diff options
author | Kajur, Harish (vk250x) <vk250x@att.com> | 2018-09-18 18:57:39 -0400 |
---|---|---|
committer | Kajur, Harish (vk250x) <vk250x@att.com> | 2018-09-18 19:40:01 -0400 |
commit | 2c21dc155715070b99797243f82166b26ffb303c (patch) | |
tree | fa4109fd43db06aee4b33d85f9adceb46e06d045 /src/main/java/org | |
parent | d13dd0ed905109546950b4fdd1e3f9e0471ec8e7 (diff) |
Add unit tests for dupeTool, datasnapshot
and also for the audit oxm
Issue-ID: AAI-1633
Change-Id: If5ead46eaa9e7d012054713268009957d0103477
Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'src/main/java/org')
4 files changed, 12 insertions, 12 deletions
diff --git a/src/main/java/org/onap/aai/db/schema/AuditOXM.java b/src/main/java/org/onap/aai/db/schema/AuditOXM.java index 417824c..d7f7314 100644 --- a/src/main/java/org/onap/aai/db/schema/AuditOXM.java +++ b/src/main/java/org/onap/aai/db/schema/AuditOXM.java @@ -53,10 +53,12 @@ public class AuditOXM extends Auditor { * * @param version the version */ - public AuditOXM(LoaderFactory loaderFactory, SchemaVersion version) { + public AuditOXM(LoaderFactory loaderFactory, SchemaVersion version, EdgeIngestor ingestor) { Loader loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, version); Set<String> objectNames = getAllObjects(loader); + this.ingestor = ingestor; + allObjects = new HashSet<>(); for (String key : objectNames) { try { @@ -220,8 +222,4 @@ public class AuditOXM extends Auditor { public Set<Introspector> getAllIntrospectors() { return this.allObjects; } - - public void setEdgeIngestor(EdgeIngestor ingestor){ - this.ingestor = ingestor; - } } diff --git a/src/main/java/org/onap/aai/db/schema/AuditorFactory.java b/src/main/java/org/onap/aai/db/schema/AuditorFactory.java index 6d96f29..40dd047 100644 --- a/src/main/java/org/onap/aai/db/schema/AuditorFactory.java +++ b/src/main/java/org/onap/aai/db/schema/AuditorFactory.java @@ -20,6 +20,7 @@ package org.onap.aai.db.schema; import org.janusgraph.core.JanusGraph; +import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.introspection.LoaderFactory; import org.onap.aai.setup.SchemaVersions; import org.onap.aai.setup.SchemaVersion; @@ -37,8 +38,8 @@ public class AuditorFactory { * @param v the v * @return the OXM auditor */ - public Auditor getOXMAuditor (SchemaVersion v) { - return new AuditOXM(loaderFactory, v); + public Auditor getOXMAuditor (SchemaVersion v, EdgeIngestor ingestor) { + return new AuditOXM(loaderFactory, v, ingestor); } /** diff --git a/src/main/java/org/onap/aai/db/schema/ManageJanusGraphSchema.java b/src/main/java/org/onap/aai/db/schema/ManageJanusGraphSchema.java index dccc141..24aac9f 100644 --- a/src/main/java/org/onap/aai/db/schema/ManageJanusGraphSchema.java +++ b/src/main/java/org/onap/aai/db/schema/ManageJanusGraphSchema.java @@ -26,6 +26,7 @@ import org.janusgraph.core.schema.JanusGraphIndex; import org.janusgraph.core.schema.JanusGraphManagement; import org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder; import org.janusgraph.core.schema.SchemaStatus; +import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.setup.SchemaVersions; import org.onap.aai.setup.SchemaVersion; @@ -49,9 +50,9 @@ public class ManageJanusGraphSchema { * * @param graph the graph */ - public ManageJanusGraphSchema(final JanusGraph graph, AuditorFactory auditorFactory, SchemaVersions schemaVersions) { + public ManageJanusGraphSchema(final JanusGraph graph, AuditorFactory auditorFactory, SchemaVersions schemaVersions, EdgeIngestor edgeIngestor) { this.graph = graph; - oxmInfo = auditorFactory.getOXMAuditor(schemaVersions.getDefaultVersion()); + oxmInfo = auditorFactory.getOXMAuditor(schemaVersions.getDefaultVersion(), edgeIngestor); graphInfo = auditorFactory.getGraphAuditor(graph); } diff --git a/src/main/java/org/onap/aai/db/schema/ScriptDriver.java b/src/main/java/org/onap/aai/db/schema/ScriptDriver.java index dca8e83..ebef01d 100644 --- a/src/main/java/org/onap/aai/db/schema/ScriptDriver.java +++ b/src/main/java/org/onap/aai/db/schema/ScriptDriver.java @@ -27,9 +27,9 @@ import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration;
import org.codehaus.jackson.JsonGenerationException;
import org.onap.aai.dbmap.AAIGraphConfig;
+import org.onap.aai.edges.EdgeIngestor;
import org.onap.aai.exceptions.AAIException;
import org.onap.aai.setup.SchemaVersions;
-import org.onap.aai.setup.SchemaVersion;
import org.onap.aai.logging.LoggingContext;
import org.onap.aai.logging.LoggingContext.StatusCode;
import org.onap.aai.util.AAIConfig;
@@ -47,7 +47,6 @@ public class ScriptDriver { * @param args the arguments
* @throws AAIException the AAI exception
* @throws JsonGenerationException the json generation exception
- * @throws JsonMappingException the json mapping exception
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main (String[] args) throws AAIException, IOException, ConfigurationException {
@@ -76,6 +75,7 @@ public class ScriptDriver { AuditorFactory auditorFactory = ctx.getBean(AuditorFactory.class);
SchemaVersions schemaVersions = ctx.getBean(SchemaVersions.class);
+ EdgeIngestor edgeIngestor = ctx.getBean(EdgeIngestor.class);
String config = cArgs.config;
AAIConfig.init();
@@ -94,7 +94,7 @@ public class ScriptDriver { AuditDoc doc = null;
if ("oxm".equals(cArgs.type)) {
- doc = auditorFactory.getOXMAuditor(schemaVersions.getDefaultVersion()).getAuditDoc();
+ doc = auditorFactory.getOXMAuditor(schemaVersions.getDefaultVersion(), edgeIngestor).getAuditDoc();
} else if ("graph".equals(cArgs.type)) {
doc = auditorFactory.getGraphAuditor(graph).getAuditDoc();
}
|