aboutsummaryrefslogtreecommitdiffstats
path: root/aai-resources/src
diff options
context:
space:
mode:
authorMuller, Andrew (am8383) <am8383@us.att.com>2017-08-11 15:13:28 -0400
committerJames Forsyth <jf2512@att.com>2017-08-11 20:09:31 +0000
commitfd16c2550e347e5f8d7be11c12dae479e7947ed8 (patch)
tree9d18ce007cb65c714290c628da18e0999b7fdfea /aai-resources/src
parentb840faea026675dd1aa065d2cb8e025dce8d9068 (diff)
[AAI-154 Amsterdam] Check in titan refactor
Change-Id: I955ac630071680e690c523e005d289d8fc40ba6c Signed-off-by: Muller, Andrew (am8383) <am8383@us.att.com>
Diffstat (limited to 'aai-resources/src')
-rw-r--r--aai-resources/src/main/java/org/openecomp/aai/dbgen/DataSnapshot.java17
-rw-r--r--aai-resources/src/main/java/org/openecomp/aai/dbgen/ForceDeleteTool.java22
-rw-r--r--aai-resources/src/main/java/org/openecomp/aai/dbgen/UpdateEdgeTags.java28
-rw-r--r--aai-resources/src/main/java/org/openecomp/aai/migration/MigrationControllerInternal.java4
-rw-r--r--aai-resources/src/main/java/org/openecomp/aai/rest/LegacyMoxyConsumer.java6
-rw-r--r--aai-resources/src/main/java/org/openecomp/aai/rest/db/HttpEntry.java11
-rw-r--r--aai-resources/src/main/java/org/openecomp/aai/rest/tools/ModelVersionTransformer.java3
-rw-r--r--aai-resources/src/main/scripts/forceDeleteTool.sh4
-rw-r--r--aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java12
-rw-r--r--aai-resources/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java75
-rw-r--r--aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml6
-rw-r--r--aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml6
-rw-r--r--aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml4
-rw-r--r--aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml6
-rw-r--r--aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml6
-rw-r--r--aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml6
-rw-r--r--aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml6
-rw-r--r--aai-resources/src/test/resources/test_aaiconfig.properties4
18 files changed, 135 insertions, 91 deletions
diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/DataSnapshot.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/DataSnapshot.java
index 2f1ef33..faf56f3 100644
--- a/aai-resources/src/main/java/org/openecomp/aai/dbgen/DataSnapshot.java
+++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/DataSnapshot.java
@@ -25,7 +25,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Iterator;
import java.util.Properties;
import org.apache.tinkerpop.gremlin.structure.io.IoCore;
@@ -41,7 +40,6 @@ import com.att.eelf.configuration.Configuration;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.thinkaurelius.titan.core.TitanGraph;
-import com.thinkaurelius.titan.core.TitanVertex;
import com.thinkaurelius.titan.core.util.TitanCleanup;
public class DataSnapshot {
@@ -199,12 +197,7 @@ public class DataSnapshot {
graph.tx().commit();
System.out.println("Completed reloading Titan 0.5 data.");
- int vCount = 0;
- Iterator<TitanVertex> vIt = graph.query().vertices().iterator();
- while (vIt.hasNext()) {
- vCount++;
- vIt.next();
- }
+ long vCount = graph.traversal().V().count().next();
System.out.println("A little after repopulating from an old snapshot, we see: " + vCount + " vertices in the db.");
} else if (command.equals("RELOAD_DATA")) {
// -------------------------------------------------------------------
@@ -238,12 +231,8 @@ public class DataSnapshot {
graph.tx().commit();
System.out.println("Completed reloading data.");
- int vCount = 0;
- Iterator<TitanVertex> vIt = graph.query().vertices().iterator();
- while (vIt.hasNext()) {
- vCount++;
- vIt.next();
- }
+ long vCount = graph.traversal().V().count().next();
+
System.out.println("A little after repopulating from an old snapshot, we see: " + vCount + " vertices in the db.");
} else {
String emsg = "Bad command passed to DataSnapshot: [" + command + "]";
diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/ForceDeleteTool.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/ForceDeleteTool.java
index bced2bc..1cab272 100644
--- a/aai-resources/src/main/java/org/openecomp/aai/dbgen/ForceDeleteTool.java
+++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/ForceDeleteTool.java
@@ -24,6 +24,7 @@ import java.util.Iterator;
import java.util.Properties;
import java.util.Scanner;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -39,10 +40,8 @@ import org.slf4j.MDC;
import com.att.eelf.configuration.Configuration;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-import com.thinkaurelius.titan.core.TitanEdge;
import com.thinkaurelius.titan.core.TitanFactory;
import com.thinkaurelius.titan.core.TitanGraph;
-import com.thinkaurelius.titan.core.TitanGraphQuery;
@@ -220,8 +219,8 @@ public class ForceDeleteTool {
logger.error(msg);
System.exit(0);
}
- TitanGraphQuery tgQ = graph.query();
- String qStringForMsg = " graph.query()";
+ GraphTraversal<Vertex, Vertex> g = graph.traversal().V();
+ String qStringForMsg = " graph.traversal().V()";
// Note - if they're only passing on parameter, there won't be any commas
String [] paramArr = dataString.split(",");
for( int i = 0; i < paramArr.length; i++ ){
@@ -235,13 +234,12 @@ public class ForceDeleteTool {
else {
String propName = paramArr[i].substring(0,pipeLoc);
String propVal = paramArr[i].substring(pipeLoc + 1);
- tgQ = tgQ.has(propName,propVal);
+ g = g.has(propName,propVal);
qStringForMsg = qStringForMsg + ".has(" + propName + "," + propVal + ")";
}
}
- if( (tgQ != null) && (tgQ instanceof TitanGraphQuery) ){
- Iterable <Vertex> verts = (Iterable<Vertex>) tgQ.vertices();
- Iterator <Vertex> vertItor = verts.iterator();
+ if( (g != null)){
+ Iterator<Vertex> vertItor = g;
while( vertItor.hasNext() ){
resCount++;
Vertex v = vertItor.next();
@@ -300,10 +298,10 @@ public class ForceDeleteTool {
}
}
else if( actionVal.equals("DELETE_EDGE") ){
- TitanEdge thisEdge = null;
+ Edge thisEdge = null;
Iterator <Edge> edItr = graph.edges( edgeIdStr );
if( edItr != null && edItr.hasNext() ) {
- thisEdge = (TitanEdge)edItr.next();
+ thisEdge = edItr.next();
}
if( thisEdge == null ){
@@ -374,7 +372,7 @@ public class ForceDeleteTool {
}// End of showNodeInfo()
- public void showPropertiesForEdge( EELFLogger logger, TitanEdge tEd ){
+ public void showPropertiesForEdge( EELFLogger logger, Edge tEd ){
String infMsg = "";
if( tEd == null ){
infMsg = "null Edge object passed to showPropertiesForEdge()";
@@ -556,7 +554,7 @@ public class ForceDeleteTool {
}// end of countDescendants()
- public boolean getEdgeDelConfirmation( EELFLogger logger, String uid, TitanEdge ed,
+ public boolean getEdgeDelConfirmation( EELFLogger logger, String uid, Edge ed,
Boolean overRideProtection ) {
showPropertiesForEdge( logger, ed );
diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/UpdateEdgeTags.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/UpdateEdgeTags.java
index c2ebf6f..abe2a10 100644
--- a/aai-resources/src/main/java/org/openecomp/aai/dbgen/UpdateEdgeTags.java
+++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/UpdateEdgeTags.java
@@ -27,9 +27,9 @@ import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
-import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Vertex;
-
import org.openecomp.aai.dbmap.AAIGraph;
import org.openecomp.aai.dbmodel.DbEdgeRules;
import org.openecomp.aai.exceptions.AAIException;
@@ -37,10 +37,8 @@ import org.openecomp.aai.logging.ErrorLogHelper;
import org.openecomp.aai.serialization.db.EdgeRule;
import org.openecomp.aai.serialization.db.EdgeRules;
import org.openecomp.aai.util.AAIConfig;
-import com.thinkaurelius.titan.core.TitanEdge;
+
import com.thinkaurelius.titan.core.TitanGraph;
-import com.thinkaurelius.titan.core.TitanTransaction;
-import com.thinkaurelius.titan.core.TitanVertex;
@@ -152,17 +150,15 @@ public class UpdateEdgeTags {
System.exit(0);
}
- TitanTransaction g = graph.newTransaction();
try {
- Iterable <?> edges = graph.query().edges();
- Iterator <?> edgeItr = edges.iterator();
+ Iterator<Edge> edgeItr = graph.traversal().E();
// Loop through all edges and update their tags if they are a type we are interested in.
// Sorry about looping over everything, but for now, I can't find a way to just select one type of edge at a time...!?
StringBuffer sb;
boolean missingEdge = false;
while( edgeItr != null && edgeItr.hasNext() ){
- TitanEdge tmpEd = (TitanEdge) edgeItr.next();
+ Edge tmpEd = edgeItr.next();
String edLab = tmpEd.label().toString();
// Since we have edgeLabels that can be used for different pairs of node-types, we have to
@@ -170,7 +166,7 @@ public class UpdateEdgeTags {
String derivedEdgeKey = "";
if( labelMapsToMultipleKeys.contains(edLab) ){
// need to figure out which key is right for this edge
- derivedEdgeKey = deriveEdgeRuleKeyForThisEdge( TRANSID, FROMAPPID, g, tmpEd );
+ derivedEdgeKey = deriveEdgeRuleKeyForThisEdge( TRANSID, FROMAPPID, graph, tmpEd );
}
else {
// This kind of label only maps to one key -- so we can just look it up.
@@ -183,7 +179,7 @@ public class UpdateEdgeTags {
Vertex vIn = null;
Vertex vOut = null;
Object obj = null;
- vIn = tmpEd.vertex(Direction.IN);
+ vIn = tmpEd.inVertex();
if ( vIn != null ){
obj = vIn.<String>property("aai-node-type").orElse(null);
if ( obj != null ) {
@@ -197,7 +193,7 @@ public class UpdateEdgeTags {
} else {
sb.append(" missing inbound vertex ");
}
- vOut = tmpEd.vertex(Direction.OUT);
+ vOut = tmpEd.outVertex();
if ( vOut != null ) {
obj = vOut.<String>property("aai-node-type").orElse(null);
if ( obj != null ) {
@@ -257,11 +253,11 @@ public class UpdateEdgeTags {
* @return String - key to look up edgeRule (fromNodeType|toNodeType)
* @throws AAIException the AAI exception
*/
- public static String deriveEdgeRuleKeyForThisEdge( String transId, String fromAppId, TitanTransaction graph,
- TitanEdge tEdge ) throws AAIException{
+ public static String deriveEdgeRuleKeyForThisEdge( String transId, String fromAppId, Graph graph,
+ Edge tEdge ) throws AAIException{
- TitanVertex fromVtx = tEdge.outVertex();
- TitanVertex toVtx = tEdge.inVertex();
+ Vertex fromVtx = tEdge.outVertex();
+ Vertex toVtx = tEdge.inVertex();
String startNodeType = fromVtx.<String>property("aai-node-type").orElse(null);
String targetNodeType = toVtx.<String>property("aai-node-type").orElse(null);
String key = startNodeType + "|" + targetNodeType;
diff --git a/aai-resources/src/main/java/org/openecomp/aai/migration/MigrationControllerInternal.java b/aai-resources/src/main/java/org/openecomp/aai/migration/MigrationControllerInternal.java
index a296c76..875d7cb 100644
--- a/aai-resources/src/main/java/org/openecomp/aai/migration/MigrationControllerInternal.java
+++ b/aai-resources/src/main/java/org/openecomp/aai/migration/MigrationControllerInternal.java
@@ -37,6 +37,7 @@ import org.apache.activemq.broker.BrokerService;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.io.IoCore;
import org.openecomp.aai.db.props.AAIProperties;
import org.openecomp.aai.dbmap.AAIGraph;
@@ -59,7 +60,6 @@ import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
-import com.thinkaurelius.titan.core.TitanTransaction;
/**
* Runs a series of migrations from a defined directory based on the presence of
@@ -301,7 +301,7 @@ public class MigrationControllerInternal {
String dateStr= fd.getDateTime();
String fileName = snapshotLocation + File.separator + phase + "Migration." + dateStr + ".graphson";
logAndPrint("Saving snapshot of inmemory graph " + phase + " migration to " + fileName);
- TitanTransaction transaction = null;
+ Graph transaction = null;
try {
Path pathToFile = Paths.get(fileName);
diff --git a/aai-resources/src/main/java/org/openecomp/aai/rest/LegacyMoxyConsumer.java b/aai-resources/src/main/java/org/openecomp/aai/rest/LegacyMoxyConsumer.java
index 70b8c92..10a3b45 100644
--- a/aai-resources/src/main/java/org/openecomp/aai/rest/LegacyMoxyConsumer.java
+++ b/aai-resources/src/main/java/org/openecomp/aai/rest/LegacyMoxyConsumer.java
@@ -68,7 +68,6 @@ import org.openecomp.aai.workarounds.RemoveDME2QueryParams;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.google.common.base.Joiner;
-import com.thinkaurelius.titan.core.TitanTransaction;
/**
@@ -128,7 +127,6 @@ public class LegacyMoxyConsumer extends RESTAPI {
Response response = null;
Loader loader = null;
TransactionalGraphEngine dbEngine = null;
- TitanTransaction g = null;
boolean success = true;
try {
@@ -242,7 +240,6 @@ public class LegacyMoxyConsumer extends RESTAPI {
String realTime = headers.getRequestHeaders().getFirst("Real-Time");
Response response = null;
TransactionalGraphEngine dbEngine = null;
- TitanTransaction g = null;
Loader loader = null;
try {
@@ -331,7 +328,6 @@ public class LegacyMoxyConsumer extends RESTAPI {
Response response = Response.status(404)
.type(outputMediaType).build();
- TitanTransaction g = null;
boolean success = true;
try {
@@ -408,7 +404,6 @@ public class LegacyMoxyConsumer extends RESTAPI {
Response response = Response.status(404)
.type(outputMediaType).build();
- TitanTransaction g = null;
boolean success = true;
try {
@@ -523,7 +518,6 @@ public class LegacyMoxyConsumer extends RESTAPI {
String sourceOfTruth = headers.getRequestHeaders().getFirst("X-FromAppId");
String transId = headers.getRequestHeaders().getFirst("X-TransactionId");
String realTime = headers.getRequestHeaders().getFirst("Real-Time");
- TitanTransaction g = null;
Boolean success = true;
try {
diff --git a/aai-resources/src/main/java/org/openecomp/aai/rest/db/HttpEntry.java b/aai-resources/src/main/java/org/openecomp/aai/rest/db/HttpEntry.java
index 945a6f3..08cc813 100644
--- a/aai-resources/src/main/java/org/openecomp/aai/rest/db/HttpEntry.java
+++ b/aai-resources/src/main/java/org/openecomp/aai/rest/db/HttpEntry.java
@@ -39,9 +39,9 @@ import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriBuilder;
import org.apache.commons.lang.StringUtils;
+import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.javatuples.Pair;
-
import org.openecomp.aai.db.props.AAIProperties;
import org.openecomp.aai.dbmap.DBConnectionType;
import org.openecomp.aai.domain.responseMessage.AAIResponseMessage;
@@ -66,6 +66,7 @@ import org.openecomp.aai.serialization.engines.QueryStyle;
import org.openecomp.aai.serialization.engines.TitanDBEngine;
import org.openecomp.aai.serialization.engines.TransactionalGraphEngine;
import org.openecomp.aai.serialization.engines.query.QueryEngine;
+
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.fasterxml.jackson.databind.JsonNode;
@@ -73,7 +74,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.fge.jsonpatch.JsonPatchException;
import com.github.fge.jsonpatch.mergepatch.JsonMergePatch;
import com.thinkaurelius.titan.core.TitanException;
-import com.thinkaurelius.titan.core.TitanTransaction;
/**
* The Class HttpEntry.
@@ -268,7 +268,7 @@ public class HttpEntry {
}
break;
- case PUT:
+ case PUT:
if (isNewVertex) {
v = serializer.createNewVertex(obj);
}
@@ -282,7 +282,7 @@ public class HttpEntry {
relatedObjects = this.getRelatedObjects(serializer, queryEngine, v);
}
notification.createNotificationEvent(transactionId, sourceOfTruth, status, uri, obj, relatedObjects);
-
+
break;
case PUT_EDGE:
serializer.touchStandardVertexProperties(v, false);
@@ -313,7 +313,6 @@ public class HttpEntry {
//if the caller didn't touch the relationship-list, we shouldn't either
patchedObj.setValue("relationship-list", null);
}
- serializer.touchStandardVertexProperties(v, false);
serializer.serializeToDb(patchedObj, v, query, uri.getRawPath(), requestContext);
status = Status.OK;
patchedObj = serializer.getLatestVersionView(v);
@@ -471,7 +470,7 @@ public class HttpEntry {
return obj;
}
-
+
/**
* Creates the not found message.
diff --git a/aai-resources/src/main/java/org/openecomp/aai/rest/tools/ModelVersionTransformer.java b/aai-resources/src/main/java/org/openecomp/aai/rest/tools/ModelVersionTransformer.java
index 956fb41..141d71a 100644
--- a/aai-resources/src/main/java/org/openecomp/aai/rest/tools/ModelVersionTransformer.java
+++ b/aai-resources/src/main/java/org/openecomp/aai/rest/tools/ModelVersionTransformer.java
@@ -62,12 +62,10 @@ import org.openecomp.aai.serialization.db.EdgeType;
import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException;
import org.openecomp.aai.serialization.engines.QueryStyle;
import org.openecomp.aai.serialization.engines.TransactionalGraphEngine;
-import org.radeox.util.logging.Logger;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.google.common.base.Joiner;
-import com.thinkaurelius.titan.core.TitanTransaction;
/**
@@ -106,7 +104,6 @@ public class ModelVersionTransformer extends RESTAPI {
String sourceOfTruth = headers.getRequestHeaders().getFirst("X-FromAppId");
String transId = headers.getRequestHeaders().getFirst("X-TransactionId");
String realTime = headers.getRequestHeaders().getFirst("Real-Time");
- TitanTransaction g = null;
Boolean success = true;
AAIException ex;
diff --git a/aai-resources/src/main/scripts/forceDeleteTool.sh b/aai-resources/src/main/scripts/forceDeleteTool.sh
index a9dd11b..0f4ad67 100644
--- a/aai-resources/src/main/scripts/forceDeleteTool.sh
+++ b/aai-resources/src/main/scripts/forceDeleteTool.sh
@@ -41,11 +41,11 @@
# -userId (required) must be followed by a userid
# -params4Collect (followed by a string to tell what properties/values to use
# as part of a COLLECT_DATA request. Must be in the format
-# of “propertName|propValue” use commas to separate if there
+# of ?propertName|propValue? use commas to separate if there
# are more than one name/value being passed.
# -vertexId - required for a DELETE_NODE request
# -edgeId - required for a DELETE_EDGE request
-# -overRideProtection --- WARNING – This over-rides the protections we introduced!
+# -overRideProtection --- WARNING ? This over-rides the protections we introduced!
# It will let you override a protected vertex or vertex that has more
# than the allowed number of edges or descendants.
# -DISPLAY_ALL_VIDS (optional) - in the rare case when you want to see the
diff --git a/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java b/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java
index 1b5b67b..5b71cf7 100644
--- a/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java
+++ b/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java
@@ -34,12 +34,12 @@ import java.util.Map;
import java.util.Set;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
-
import org.openecomp.aai.db.props.AAIProperties;
import org.openecomp.aai.dbmap.DBConnectionType;
import org.openecomp.aai.introspection.Loader;
@@ -51,12 +51,12 @@ import org.openecomp.aai.serialization.db.EdgeRules;
import org.openecomp.aai.serialization.engines.QueryStyle;
import org.openecomp.aai.serialization.engines.TitanDBEngine;
import org.openecomp.aai.serialization.engines.TransactionalGraphEngine;
-//import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper;
+import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper;
import org.openecomp.aai.util.AAIConstants;
+
import com.thinkaurelius.titan.core.Cardinality;
import com.thinkaurelius.titan.core.TitanFactory;
import com.thinkaurelius.titan.core.TitanGraph;
-import com.thinkaurelius.titan.core.TitanTransaction;
import com.thinkaurelius.titan.core.schema.TitanManagement;
@Ignore
@@ -72,7 +72,7 @@ public class VertexMergeTest {
private static TitanGraph graph;
private static EdgeRules rules;
private static GraphTraversalSource g;
- private static TitanTransaction tx;
+ private static Graph tx;
@BeforeClass
public static void setUp() throws NoSuchFieldException, SecurityException, Exception {
graph = TitanFactory.build().set("storage.backend","inmemory").open();
@@ -80,7 +80,7 @@ public class VertexMergeTest {
g = tx.traversal();
System.setProperty("AJSC_HOME", ".");
System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local");
-// QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), "src/test/resources/org/openecomp/aai/introspection/");
+ QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), "src/test/resources/org/openecomp/aai/introspection/");
loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version);
dbEngine = new TitanDBEngine(
queryStyle,
@@ -166,7 +166,7 @@ public class VertexMergeTest {
}
@AfterClass
public static void cleanUp() {
- tx.rollback();
+ tx.tx().rollback();
graph.close();
}
diff --git a/aai-resources/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java b/aai-resources/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java
new file mode 100644
index 0000000..f9a511a
--- /dev/null
+++ b/aai-resources/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * org.openecomp.aai
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.aai.serialization.queryformats;
+
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.io.IoCore;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+import org.openecomp.aai.db.props.AAIProperties;
+import org.openecomp.aai.serialization.queryformats.exceptions.AAIFormatVertexException;
+import org.openecomp.aai.serialization.queryformats.utils.UrlBuilder;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import static org.mockito.Matchers.isA;
+import static org.mockito.Mockito.when;
+
+public class QueryFormatTestHelper {
+
+
+ public static final String testResources = "src/test/resources/org/openecomp/aai/serialization/queryformats/";
+ public static final String graphsonResources = "src/test/resources/org/openecomp/aai/serialization/queryformats/graphson/";
+
+
+ public static void mockPathed(UrlBuilder mock) throws AAIFormatVertexException {
+ Answer<String> answer = new Answer<String>() {
+ public String answer(InvocationOnMock invocation) throws Throwable {
+ Vertex v = invocation.getArgumentAt(0, Vertex.class);
+
+ return v.<String>property(AAIProperties.AAI_URI).orElse("urimissing");
+ }
+ };
+ when(mock.pathed(isA(Vertex.class))).thenAnswer(answer);
+
+ }
+
+ public static Graph loadGraphson(String fileName) throws IOException {
+ final Graph graph = TinkerGraph.open();
+ graph.io(IoCore.graphson()).readGraph(QueryFormatTestHelper.graphsonResources + fileName);
+
+ return graph;
+ }
+
+ public static void setFinalStatic(Field field, Object newValue) throws Exception {
+ field.setAccessible(true);
+ // remove final modifier from field
+ Field modifiersField = Field.class.getDeclaredField("modifiers");
+ modifiersField.setAccessible(true);
+ modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
+ field.set(null, newValue);
+ }
+
+}
diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml
index 6eebc6c..647b6f1 100644
--- a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml
+++ b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml
@@ -4411,7 +4411,7 @@
</xml-element>
<xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String">
@@ -4441,7 +4441,7 @@
</xml-element>
<xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String">
@@ -5500,7 +5500,7 @@
</xml-element>
<xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Design of zone [Medium/Large�]" />
+ <xml-property name="description" value="Design of zone [Medium/Large?]" />
</xml-properties>
</xml-element>
<xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String">
diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml
index 78c1011..fb44778 100644
--- a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml
+++ b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml
@@ -4454,7 +4454,7 @@
</xml-element>
<xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String">
@@ -4484,7 +4484,7 @@
</xml-element>
<xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String">
@@ -5543,7 +5543,7 @@
</xml-element>
<xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Design of zone [Medium/Large…]" />
+ <xml-property name="description" value="Design of zone [Medium/Large?]" />
</xml-properties>
</xml-element>
<xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String">
diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml
index b081627..1cd8119 100644
--- a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml
+++ b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml
@@ -4111,7 +4111,7 @@
</xml-element>
<xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String">
@@ -4141,7 +4141,7 @@
</xml-element>
<xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String">
diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml
index 8cba262..436fb2f 100644
--- a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml
+++ b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml
@@ -4360,7 +4360,7 @@
</xml-element>
<xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String">
@@ -4390,7 +4390,7 @@
</xml-element>
<xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String">
@@ -5435,7 +5435,7 @@
</xml-element>
<xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Design of zone [Medium/Large�]" />
+ <xml-property name="description" value="Design of zone [Medium/Large?]" />
</xml-properties>
</xml-element>
<xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String">
diff --git a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml
index d2f9823..3124e92 100644
--- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml
+++ b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml
@@ -4448,7 +4448,7 @@
</xml-element>
<xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String">
@@ -4478,7 +4478,7 @@
</xml-element>
<xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String">
@@ -5537,7 +5537,7 @@
</xml-element>
<xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Design of zone [Medium/Large�]" />
+ <xml-property name="description" value="Design of zone [Medium/Large?]" />
</xml-properties>
</xml-element>
<xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String">
diff --git a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml
index 6fa090b..903f21f 100644
--- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml
+++ b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml
@@ -4493,7 +4493,7 @@
</xml-element>
<xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String">
@@ -4523,7 +4523,7 @@
</xml-element>
<xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String">
@@ -5582,7 +5582,7 @@
</xml-element>
<xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Design of zone [Medium/Large…]" />
+ <xml-property name="description" value="Design of zone [Medium/Large?]" />
</xml-properties>
</xml-element>
<xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String">
diff --git a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml
index 03477c0..36bea63 100644
--- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml
+++ b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml
@@ -4363,7 +4363,7 @@
</xml-element>
<xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String">
@@ -4393,7 +4393,7 @@
</xml-element>
<xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" />
</xml-properties>
</xml-element>
<xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String">
@@ -5438,7 +5438,7 @@
</xml-element>
<xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String">
<xml-properties>
- <xml-property name="description" value="Design of zone [Medium/Large�]" />
+ <xml-property name="description" value="Design of zone [Medium/Large?]" />
</xml-properties>
</xml-element>
<xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String">
diff --git a/aai-resources/src/test/resources/test_aaiconfig.properties b/aai-resources/src/test/resources/test_aaiconfig.properties
index d5a7c25..33cf631 100644
--- a/aai-resources/src/test/resources/test_aaiconfig.properties
+++ b/aai-resources/src/test/resources/test_aaiconfig.properties
@@ -98,10 +98,6 @@ aai.servicedescription.hostedcomm=HOSTED COMMUNICATIONS
aai.servicedescription.mobility=MOBILITY
aai.servicedescription.vusp=VIRTUAL USP
-<<<<<<< HEAD
-aai.notification.current.package=org.openecomp.aai.dbmapGen.v6
-=======
->>>>>>> feature/AAI-8158-cleanup-at-t-specific-reference
aai.notification.current.version=v7
aai.notificationEvent.default.status=UNPROCESSED
aai.notificationEvent.default.eventType=AAI-EVENT