X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=aai-core%2Fsrc%2Ftest%2Fjava%2Forg%2Fopenecomp%2Faai%2Fparsers%2Fquery%2FGraphTraversalTest.java;h=79f75ab940d97df23398759bebb8171b9dd278de;hb=96bf8c7b86bbf3350edcedcd19ad4dff97e62bb7;hp=2f0d67df96952206b491fa2aaf30931a2dd45781;hpb=3edff944047a20881c5d5e485e4752be456ef516;p=aai%2Faai-common.git diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/query/GraphTraversalTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/query/GraphTraversalTest.java index 2f0d67df..79f75ab9 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/query/GraphTraversalTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/query/GraphTraversalTest.java @@ -5,16 +5,16 @@ * 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. + * 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========================================================= */ @@ -486,10 +486,8 @@ public class GraphTraversalTest { QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); GraphTraversal expected = __.start() - .has("vnf-id", "key1").or( - __.has(AAIProperties.NODE_TYPE, "vce"), - __.has(AAIProperties.NODE_TYPE, "vpe"), - __.has(AAIProperties.NODE_TYPE, "generic-vnf")); + .has("vnf-id", "key1").has( + AAIProperties.NODE_TYPE, P.within("vce" , "vpe" , "generic-vnf")); GraphTraversal expectedParent = expected; assertEquals( @@ -535,17 +533,12 @@ public class GraphTraversalTest { QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); GraphTraversal expected = __.start() - .has("vnf-id", "key1").or( - __.has(AAIProperties.NODE_TYPE, "vce"), - __.has(AAIProperties.NODE_TYPE, "vpe"), - __.has(AAIProperties.NODE_TYPE, "generic-vnf")) - .filter(x -> true).outE().has("isParent", true).inV().has("vf-module-id", "key2"); + .has("vnf-id", "key1").has(AAIProperties.NODE_TYPE, P.within("vce", "vpe", "generic-vnf")) + .union(__.out("has").has("aai-node-type", "vf-module")) + .has("vf-module-id", "key2"); GraphTraversal expectedParent = __.start() - .has("vnf-id", "key1").or( - __.has(AAIProperties.NODE_TYPE, "vce"), - __.has(AAIProperties.NODE_TYPE, "vpe"), - __.has(AAIProperties.NODE_TYPE, "generic-vnf")); + .has("vnf-id", "key1").has(AAIProperties.NODE_TYPE, P.within("vce", "vpe", "generic-vnf")); assertEquals( "gremlin query should be " + expected.toString(), expected.toString(),