<parent>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-parent</artifactId>
- <version>1.15.2</version>
+ <version>1.15.3-SNAPSHOT</version>
</parent>
<groupId>org.onap.aai.graphadmin</groupId>
<artifactId>aai-graphadmin</artifactId>
- <version>1.15.2-SNAPSHOT</version>
+ <version>1.15.3-SNAPSHOT</version>
<properties>
<!-- This value should be overwritten at runtime to wherever need to be pushed to -->
<docker.push.registry>localhost:5000</docker.push.registry>
<aai.docker.version>1.0.0</aai.docker.version>
- <aai.schema.service.version>1.12.5</aai.schema.service.version>
- <aai.common.version>1.15.2</aai.common.version>
+ <aai.schema.service.version>1.12.6</aai.schema.service.version>
+ <aai.common.version>1.15.3-SNAPSHOT</aai.common.version>
<aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/
</aai.build.directory>
<aai.docker.namespace>onap</aai.docker.namespace>
<schema.uri.base.path>/aai</schema.uri.base.path>
<!-- End of Default ONAP Schema Properties -->
- <micrometer.version>1.8.1</micrometer.version>
+ <!-- <micrometer.version>1.8.1</micrometer.version> -->
<antlr.version>4.9.3</antlr.version>
<jcommander.version>1.78</jcommander.version>
<gremlin.version>3.7.1</gremlin.version>
<version>1.18.30</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>io.micrometer</groupId>
- <artifactId>micrometer-core</artifactId>
- <version>${micrometer.version}</version>
- </dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
- <version>${micrometer.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-jersey2</artifactId>
- <version>${micrometer.version}</version>
+ <version>1.8.13</version>
</dependency>
<!-- End of graphadmin metric collection dependencies -->
</dependency>
<!-- Start of Logback Dependencies -->
- <dependency>
- <groupId>com.att.eelf</groupId>
- <artifactId>eelf-core</artifactId>
- </dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
- <version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
- <version>${netty.handler.version}</version>
</dependency>
<!-- End of Netty Dependencies -->
<!-- Only used for the WebTestClient -->
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
static {
System.setProperty("aai.service.name", DataExportTasks.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
LOGGER = LoggerFactory.getLogger(DataExportTasks.class);
}
*/
package org.onap.aai.datagrooming;
-import com.att.eelf.configuration.Configuration;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import java.io.BufferedReader;
// Set the logging file properties to be used by EELFManager
System.setProperty("aai.service.name", DataGrooming.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
PropertyPasswordConfiguration initializer = new PropertyPasswordConfiguration();
initializer.initialize(ctx);
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.att.eelf.configuration.Configuration;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
// Set the logging file properties to be used by EELFManager
System.setProperty("aai.service.name", DataSnapshot.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
LOGGER = LoggerFactory.getLogger(DataSnapshot.class);
cArgs = new CommandLineArgs();
import org.onap.aai.util.GraphAdminDBUtils;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.beust.jcommander.JCommander;
// Set the logging file properties to be used by EELFManager
System.setProperty("aai.service.name", DataSnapshot4HistInit.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
PropertyPasswordConfiguration initializer = new PropertyPasswordConfiguration();
*/
package org.onap.aai.dbgen;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
public static void main(String[] args) throws AAIException {
System.setProperty("aai.service.name", DupeTool.class.getSimpleName());
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, "dupeTool-logback.xml");
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
MDC.put("logFilenameAppender", DupeTool.class.getSimpleName());
import org.onap.aai.util.AAIConstants;
import org.slf4j.MDC;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.janusgraph.core.JanusGraphFactory;
// the Terminal.
System.setProperty("aai.service.name", ForceDelete.class.getSimpleName());
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_FORCE_DELETE_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
Logger logger = LoggerFactory.getLogger(ForceDeleteTool.class.getSimpleName());
MDC.put("logFilenameAppender", ForceDeleteTool.class.getSimpleName());
import org.janusgraph.core.JanusGraph;
import org.onap.aai.util.AAIConstants;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.MDC;
import java.util.Properties;
public static void main(String[] args)
{
System.setProperty("aai.service.name", UpdatePropertyTool.class.getSimpleName());
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, PROPERTY_LOGGING_FILE_NAME);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
MDC.put("logFilenameAppender", UpdatePropertyTool.class.getSimpleName());
exit(EXIT_VM_STATUS_CODE);
}
-}
\ No newline at end of file
+}
*/
package org.onap.aai.dbgen.schemamod;
-import com.att.eelf.configuration.Configuration;
import org.onap.aai.restclient.PropertyPasswordConfiguration;
import org.onap.aai.exceptions.AAIException;
import org.onap.aai.introspection.Loader;
public static void main(String[] args) throws AAIException {
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_SCHEMA_MOD_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
MDC.put("logFilenameAppender", SchemaMod.class.getSimpleName());
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
*/
package org.onap.aai.dbgen.schemamod;
-import com.att.eelf.configuration.Configuration;
import org.onap.aai.restclient.PropertyPasswordConfiguration;
import org.onap.aai.exceptions.AAIException;
import org.onap.aai.introspection.Loader;
public void execute(String[] args) {
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_SCHEMA_MOD_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
Logger logger = LoggerFactory.getLogger(SchemaMod4Hist.class.getSimpleName());
MDC.put("logFilenameAppender", SchemaMod4Hist.class.getSimpleName());
import org.onap.aai.util.AAISystemExitUtil;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.janusgraph.core.JanusGraph;
*/
public static void main(String[] args) {
- // Set the logging file properties to be used by EELFManager
- System.setProperty("aai.service.name", HistoryTruncate.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
try (AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext()) {
try {
ctx.refresh();
package org.onap.aai.migration;
-import com.att.eelf.configuration.Configuration;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import org.apache.commons.configuration2.ex.ConfigurationException;
public void run(String[] args) {
// Set the logging file properties to be used by EELFManager
System.setProperty("aai.service.name", MigrationController.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, "migration-logback.xml");
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES);
-
MDC.put("logFilenameAppender", MigrationController.class.getSimpleName());
logger = LoggerFactory.getLogger(MigrationControllerInternal.class.getSimpleName());
package org.onap.aai.rest.client;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
import org.onap.aai.restclient.NoAuthRestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
public class ApertureServiceNoAuthClient extends NoAuthRestClient {
- private static EELFLogger logger = EELFManager.getInstance().getLogger(ApertureServiceNoAuthClient.class);
+ private static Logger logger = LoggerFactory.getLogger(ApertureServiceNoAuthClient.class);
@Value("${aperture.service.base.url}")
private String baseUrl;
*/
package org.onap.aai.schema;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.janusgraph.core.EdgeLabel;
JanusGraph graph = null;
System.setProperty("aai.service.name", GenTester.class.getSimpleName());
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
+
LOGGER = LoggerFactory.getLogger(GenTester.class);
boolean addDefaultCR = true;
*/
package org.onap.aai.schema;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.janusgraph.core.JanusGraph;
JanusGraph graph = null;
System.setProperty("aai.service.name", GenTester4Hist.class.getSimpleName());
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
+
LOGGER = LoggerFactory.getLogger(GenTester4Hist.class);
boolean addDefaultCR = false; // For History, we do not add the default CloudRegion
*/
package org.onap.aai.util;
-import com.att.eelf.configuration.Configuration;
import org.onap.aai.config.SpringContextAware;
import org.onap.aai.dbmap.AAIGraph;
public SendDeleteMigrationNotifications(LoaderFactory loaderFactory, SchemaVersions schemaVersions, String config, String path, int sleepInMilliSecs, int numToBatch, String requestId, EventAction eventAction, String eventSource) {
System.setProperty("aai.service.name", SendDeleteMigrationNotifications.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, "migration-logback.xml");
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES);
MDC.put("logFilenameAppender", SendDeleteMigrationNotifications.class.getSimpleName());
*/
package org.onap.aai.util;
-import com.att.eelf.configuration.Configuration;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.onap.aai.config.SpringContextAware;
public SendMigrationNotifications(LoaderFactory loaderFactory, SchemaVersions schemaVersions, String config, String path, Set<String> notifyOn, int sleepInMilliSecs, int numToBatch, String requestId, EventAction eventAction, String eventSource) {
System.setProperty("aai.service.name", SendMigrationNotifications.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, "migration-logback.xml");
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES);
MDC.put("logFilenameAppender", SendMigrationNotifications.class.getSimpleName());
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
-import com.att.eelf.configuration.Configuration;
-
public class UniquePropertyCheck {
private static final String FROMAPPID = "AAI-UTILS";
private static final String TRANSID = UUID.randomUUID().toString();
private static final String COMPONENT = "UniquePropertyCheck";
-
+
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
-
-
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
+
Logger logger = LoggerFactory.getLogger(UniquePropertyCheck.class);
MDC.put("logFilenameAppender", UniquePropertyCheck.class.getSimpleName());
AaiScheduledTaskAuditLog auditLog = new AaiScheduledTaskAuditLog();
}
String propertyName = args[0];
Graph graph = null;
-
+
try(JanusGraph tGraph = JanusGraphFactory.open(new AAIGraphConfig.Builder(AAIConstants.REALTIME_DB_CONFIG).forService(UniquePropertyCheck.class.getSimpleName()).withGraphType("realtime").buildConfiguration())) {
AAIConfig.init();
System.out.println(" ---- NOTE --- about to open graph (takes a little while)--------\n");
logAndPrint(logger, " Error: Could not get JanusGraph ");
System.exit(1);
}
-
+
graph = tGraph.newTransaction();
if( graph == null ){
logAndPrint(logger, "could not get graph object in UniquePropertyCheck() \n");
logAndPrint(logger, msg);
System.exit(0);
}
-
+
runTheCheckForUniqueness( TRANSID, FROMAPPID, graph, propertyName, logger );
auditLog.logAfter();
System.exit(0);
-
+
}// End main()
-
-
+
+
/**
* Run the check for uniqueness.
*
* @param logger the logger
* @return the boolean
*/
- public static Boolean runTheCheckForUniqueness( String transId, String fromAppId, Graph graph,
+ public static Boolean runTheCheckForUniqueness( String transId, String fromAppId, Graph graph,
String propertyName, Logger logger ){
-
- // Note - property can be found in more than one nodetype
- // our uniqueness constraints are always across the entire db - so this
+
+ // Note - property can be found in more than one nodetype
+ // our uniqueness constraints are always across the entire db - so this
// tool looks across all nodeTypes that the property is found in.
Boolean foundDupesFlag = false;
-
+
HashMap <String,String> valuesAndVidHash = new HashMap <> ();
HashMap <String,String> dupeHash = new HashMap <> ();
-
+
int propCount = 0;
int dupeCount = 0;
Iterator<Vertex> vertItor = graph.traversal().V().has(propertyName);
}
else {
valuesAndVidHash.put(val.toString(), thisVid);
- }
+ }
}
-
-
+
+
String info = "\n Found this property [" + propertyName + "] " + propCount + " times in our db.";
logAndPrint(logger, info);
info = " Found " + dupeCount + " cases of duplicate values for this property.\n\n";
String dupeValue = pair.getKey().toString();
String vidsStr = pair.getValue().toString();
String[] vidArr = vidsStr.split("\\|");
- logAndPrint(logger, "\n\n -------------- Found " + vidArr.length
+ logAndPrint(logger, "\n\n -------------- Found " + vidArr.length
+ " nodes with " + propertyName + " of this value: [" + dupeValue + "]. Node details: ");
-
+
for( int i = 0; i < vidArr.length; i++ ){
String vidString = vidArr[i];
Long idLong = Long.valueOf(vidString);
}
catch( Exception e2 ){
logAndPrint(logger, "Threw Exception: [" + e2.toString() + "]");
- }
-
-
+ }
+
+
return foundDupesFlag;
-
+
}// end of runTheCheckForUniqueness()
-
-
+
+
/**
* Show properties and edges.
*
* @param logger the logger
*/
private static void showPropertiesAndEdges( String transId, String fromAppId, Vertex tVert,
- Logger logger ){
+ Logger logger ){
if( tVert == null ){
logAndPrint(logger, "Null node passed to showPropertiesAndEdges.");
else{
nodeType = ob.toString();
}
-
+
logAndPrint(logger, " AAINodeType/VtxID for this Node = [" + nodeType + "/" + tVert.id() + "]");
logAndPrint(logger, " Property Detail: ");
Iterator<VertexProperty<Object>> pI = tVert.properties();
while( pI.hasNext() ){
VertexProperty<Object> tp = pI.next();
Object val = tp.value();
- logAndPrint(logger, "Prop: [" + tp.key() + "], val = [" + val + "] ");
+ logAndPrint(logger, "Prop: [" + tp.key() + "], val = [" + val + "] ");
}
-
+
Iterator <Edge> eI = tVert.edges(Direction.BOTH);
if( ! eI.hasNext() ){
logAndPrint(logger, "No edges were found for this vertex. ");
}
} // End of showPropertiesAndEdges()
-
+
/**
* Log and print.
*
System.out.println(msg);
logger.info(msg);
}
-
-}
\ No newline at end of file
+
+}
BOOTSTRAP_SERVERS=localhost:9092
JAAS_CONFIG=
+aai.graph.properties.path=${server.local.startpath}/etc/appprops/janusgraph-realtime.properties
import org.onap.aai.serialization.db.EdgeSerializer;\r
import org.onap.aai.serialization.engines.TransactionalGraphEngine;\r
\r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
-\r
import org.janusgraph.core.JanusGraph;\r
import org.janusgraph.core.JanusGraphFactory;\r
import org.janusgraph.core.JanusGraphTransaction;\r
import org.janusgraph.core.schema.JanusGraphManagement;\r
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;\r
+import org.junit.jupiter.api.BeforeEach;\r
+import org.junit.jupiter.api.Test;\r
+\r
import org.onap.aai.AAISetup;\r
import org.onap.aai.dbmap.DBConnectionType;\r
import org.onap.aai.introspection.Loader;\r
import org.onap.aai.migration.v13.MigrateInMaintDefaultToFalseTest.InMaintDefaultMigrator;\r
import org.onap.aai.serialization.engines.QueryStyle;\r
import org.onap.aai.serialization.engines.JanusGraphDBEngine;\r
-import org.onap.aai.serialization.engines.TransactionalGraphEngine;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import org.onap.aai.serialization.engines.TransactionalGraphEngine;\r
+\r
+import static org.junit.jupiter.api.Assertions.assertTrue;\r
import static org.mockito.Mockito.spy;\r
import static org.mockito.Mockito.when;\r
\r
import java.util.HashMap;\r
import java.util.Map;\r
-import java.util.Optional;
-
+import java.util.Optional;\r
+\r
public class MigrateInMaintDefaultToFalseTest extends\r
AAISetup {\r
protected static final String VNF_NODE_TYPE = "generic-vnf";\r
g.addV().property("aai-node-type", "generic-vnf")\r
.property("vnf-id", "generic-vnf3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//l-interface\r
g.addV().property("aai-node-type", "l-interface")\r
.property("interface-name", "l-interface0")\r
g.addV().property("aai-node-type", "l-interface")\r
.property("interface-name", "l-interface3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//lag-interface\r
g.addV().property("aai-node-type", "lag-interface")\r
.property("interface-name", "lag-interface0")\r
g.addV().property("aai-node-type", "lag-interface")\r
.property("interface-name", "lag-interface3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//logical-link\r
g.addV().property("aai-node-type", "logical-link")\r
.property("link-name", "logical-link0")\r
g.addV().property("aai-node-type", "logical-link")\r
.property("link-name", "logical-link3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//p-interface\r
g.addV().property("aai-node-type", "p-interface")\r
.property("interface-name", "p-interface0")\r
g.addV().property("aai-node-type", "p-interface")\r
.property("interface-name", "p-interface3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//pnf\r
g.addV().property("aai-node-type", "pnf")\r
.property("pnf-name", "pnf0")\r
g.addV().property("aai-node-type", "pnf")\r
.property("pnf-name", "pnf3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//pserver\r
g.addV().property("aai-node-type", "pserver")\r
.property("pserver-id", "pserver0")\r
g.addV().property("aai-node-type", "pserver")\r
.property("pserver-id", "pserver3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//vlan\r
g.addV().property("aai-node-type", "vlan")\r
.property("vlan-interface", "vlan0")\r
.property("nos-server-id", "nos-server1")\r
.property("nos-server-name", "nos-server-name1")\r
.property("vendor", "vendor1")\r
- .property("nos-server-selflink", "nos-server-selflink1") \r
+ .property("nos-server-selflink", "nos-server-selflink1")\r
.property("in-maint", "")\r
.next();\r
g.addV().property("aai-node-type", "nos-server")\r
.property("nos-server-selflink", "nos-server-selflink3")\r
.property("in-maint", false)\r
.next();\r
- \r
+\r
TransactionalGraphEngine spy = spy(dbEngine);\r
TransactionalGraphEngine.Admin adminSpy = spy(dbEngine.asAdmin());\r
GraphTraversalSource traversal = g;\r
assertTrue(g.V().has("aai-node-type", "vnfc").has("vnfc-name", "vnfc0").has("in-maint", false).hasNext(),\r
"Value of vnfc should be updated since the property in-maint doesn't exist");\r
assertTrue(g.V().has("aai-node-type", "vserver").has("vserver-id", "vserver0").has("in-maint", false).hasNext(),\r
- "Value of vserver should be updated since the property in-maint doesn't exist"); \r
+ "Value of vserver should be updated since the property in-maint doesn't exist");\r
assertTrue(g.V().has("aai-node-type", "nos-server").has("nos-server-id", "nos-server0").has("in-maint", false).hasNext(),\r
- "Value of nos-server should be updated since the property in-maint doesn't exist"); \r
+ "Value of nos-server should be updated since the property in-maint doesn't exist");\r
}\r
\r
@Test\r
- public void testEmptyValue() { \r
+ public void testEmptyValue() {\r
assertTrue(g.V().has("aai-node-type", "generic-vnf").has("vnf-id", "generic-vnf1").has("in-maint", false).hasNext(),\r
"Value of generic-vnf should be updated since the value for in-maint is an empty string");\r
assertTrue(g.V().has("aai-node-type", "l-interface").has("interface-name", "l-interface1").has("in-maint", false).hasNext(),\r
assertTrue(g.V().has("aai-node-type", "nos-server").has("nos-server-id", "nos-server1").has("in-maint", false).hasNext(),\r
"Value of nos-server should be updated since the value for in-maint is an empty string");\r
}\r
- \r
+\r
@Test\r
public void testExistingTrueValues() {\r
assertTrue(g.V().has("aai-node-type", "generic-vnf").has("vnf-id", "generic-vnf2").has("in-maint", true).hasNext(),\r
assertTrue(g.V().has("aai-node-type", "nos-server").has("nos-server-id", "nos-server2").has("in-maint", true).hasNext(),\r
"Value of nos-server shouldn't be updated since in-maint already exists");\r
}\r
- \r
+\r
@Test\r
public void testExistingFalseValues() {\r
assertTrue(g.V().has("aai-node-type", "generic-vnf").has("vnf-id", "generic-vnf3").has("in-maint", false).hasNext(),\r
assertTrue(g.V().has("aai-node-type", "nos-server").has("nos-server-id", "nos-server3").has("in-maint", false).hasNext(),\r
"Value of nos-server shouldn't be updated since in-maint already exists");\r
}\r
-}
\ No newline at end of file
+}\r
import org.onap.aai.serialization.db.EdgeSerializer;\r
import org.onap.aai.serialization.engines.TransactionalGraphEngine;\r
\r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
-\r
import org.janusgraph.core.JanusGraph;\r
import org.janusgraph.core.JanusGraphFactory;\r
import org.janusgraph.core.JanusGraphTransaction;\r
import org.janusgraph.core.schema.JanusGraphManagement;\r
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;\r
+import org.junit.jupiter.api.BeforeEach;\r
+import org.junit.jupiter.api.Test;\r
+\r
import org.onap.aai.AAISetup;\r
import org.onap.aai.dbmap.DBConnectionType;\r
import org.onap.aai.introspection.Loader;\r
import org.onap.aai.migration.v15.MigrateInMaintDefaultToFalseTest.InMaintDefaultMigrator;\r
import org.onap.aai.serialization.engines.QueryStyle;\r
import org.onap.aai.serialization.engines.JanusGraphDBEngine;\r
-import org.onap.aai.serialization.engines.TransactionalGraphEngine;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import org.onap.aai.serialization.engines.TransactionalGraphEngine;\r
+\r
+import static org.junit.jupiter.api.Assertions.assertTrue;\r
import static org.mockito.Mockito.spy;\r
import static org.mockito.Mockito.when;\r
\r
import java.util.HashMap;\r
import java.util.Map;\r
-import java.util.Optional;
-
+import java.util.Optional;\r
+\r
public class MigrateInMaintDefaultToFalseTest extends\r
AAISetup {\r
protected static final String VNF_NODE_TYPE = "generic-vnf";\r
g.addV().property("aai-node-type", "generic-vnf")\r
.property("vnf-id", "generic-vnf3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//l-interface\r
g.addV().property("aai-node-type", "l-interface")\r
.property("interface-name", "l-interface0")\r
g.addV().property("aai-node-type", "l-interface")\r
.property("interface-name", "l-interface3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//lag-interface\r
g.addV().property("aai-node-type", "lag-interface")\r
.property("interface-name", "lag-interface0")\r
g.addV().property("aai-node-type", "lag-interface")\r
.property("interface-name", "lag-interface3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//logical-link\r
g.addV().property("aai-node-type", "logical-link")\r
.property("link-name", "logical-link0")\r
g.addV().property("aai-node-type", "logical-link")\r
.property("link-name", "logical-link3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//p-interface\r
g.addV().property("aai-node-type", "p-interface")\r
.property("interface-name", "p-interface0")\r
g.addV().property("aai-node-type", "p-interface")\r
.property("interface-name", "p-interface3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//pnf\r
g.addV().property("aai-node-type", "pnf")\r
.property("pnf-name", "pnf0")\r
g.addV().property("aai-node-type", "pnf")\r
.property("pnf-name", "pnf3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//pserver\r
g.addV().property("aai-node-type", "pserver")\r
.property("pserver-id", "pserver0")\r
g.addV().property("aai-node-type", "pserver")\r
.property("pserver-id", "pserver3")\r
.property("in-maint", false)\r
- .next(); \r
+ .next();\r
//vlan\r
g.addV().property("aai-node-type", "vlan")\r
.property("vlan-interface", "vlan0")\r
.property("nos-server-id", "nos-server1")\r
.property("nos-server-name", "nos-server-name1")\r
.property("vendor", "vendor1")\r
- .property("nos-server-selflink", "nos-server-selflink1") \r
+ .property("nos-server-selflink", "nos-server-selflink1")\r
.property("in-maint", "")\r
.next();\r
g.addV().property("aai-node-type", "nos-server")\r
.property("nos-server-selflink", "nos-server-selflink3")\r
.property("in-maint", false)\r
.next();\r
- \r
+\r
TransactionalGraphEngine spy = spy(dbEngine);\r
TransactionalGraphEngine.Admin adminSpy = spy(dbEngine.asAdmin());\r
GraphTraversalSource traversal = g;\r
assertTrue(g.V().has("aai-node-type", "vnfc").has("vnfc-name", "vnfc0").has("in-maint", false).hasNext(),\r
"Value of vnfc should be updated since the property in-maint doesn't exist");\r
assertTrue(g.V().has("aai-node-type", "vserver").has("vserver-id", "vserver0").has("in-maint", false).hasNext(),\r
- "Value of vserver should be updated since the property in-maint doesn't exist"); \r
+ "Value of vserver should be updated since the property in-maint doesn't exist");\r
assertTrue(g.V().has("aai-node-type", "nos-server").has("nos-server-id", "nos-server0").has("in-maint", false).hasNext(),\r
- "Value of nos-server should be updated since the property in-maint doesn't exist"); \r
+ "Value of nos-server should be updated since the property in-maint doesn't exist");\r
}\r
\r
@Test\r
- public void testEmptyValue() { \r
+ public void testEmptyValue() {\r
assertTrue(g.V().has("aai-node-type", "generic-vnf").has("vnf-id", "generic-vnf1").has("in-maint", false).hasNext(),\r
"Value of generic-vnf should be updated since the value for in-maint is an empty string");\r
assertTrue(g.V().has("aai-node-type", "l-interface").has("interface-name", "l-interface1").has("in-maint", false).hasNext(),\r
assertTrue(g.V().has("aai-node-type", "nos-server").has("nos-server-id", "nos-server1").has("in-maint", false).hasNext(),\r
"Value of nos-server should be updated since the value for in-maint is an empty string");\r
}\r
- \r
+\r
@Test\r
public void testExistingTrueValues() {\r
assertTrue(g.V().has("aai-node-type", "generic-vnf").has("vnf-id", "generic-vnf2").has("in-maint", true).hasNext(),\r
assertTrue(g.V().has("aai-node-type", "nos-server").has("nos-server-id", "nos-server2").has("in-maint", true).hasNext(),\r
"Value of nos-server shouldn't be updated since in-maint already exists");\r
}\r
- \r
+\r
@Test\r
public void testExistingFalseValues() {\r
assertTrue(g.V().has("aai-node-type", "generic-vnf").has("vnf-id", "generic-vnf3").has("in-maint", false).hasNext(),\r
assertTrue(g.V().has("aai-node-type", "nos-server").has("nos-server-id", "nos-server3").has("in-maint", false).hasNext(),\r
"Value of nos-server shouldn't be updated since in-maint already exists");\r
}\r
-}
\ No newline at end of file
+}\r