X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=aai-core%2Fsrc%2Ftest%2Fjava%2Forg%2Fopenecomp%2Faai%2Fparsers%2Fquery%2FLegacyQueryTest.java;h=bab74ed056cfbdee8cc085ef89b1093b4aeb6f84;hb=96bf8c7b86bbf3350edcedcd19ad4dff97e62bb7;hp=4302de616a363338f3d2b321c7e9703db0edffee;hpb=3edff944047a20881c5d5e485e4752be456ef516;p=aai%2Faai-common.git diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/query/LegacyQueryTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/query/LegacyQueryTest.java index 4302de61..bab74ed0 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/query/LegacyQueryTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/query/LegacyQueryTest.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========================================================= */ @@ -108,10 +108,6 @@ public class LegacyQueryTest { + ".has('interface-name', 'key2')"; String parentExpected = ".has('hostname', 'key1').has('aai-node-type', 'pserver')"; - assertEquals( - "gremlin query should be for node", - expected, - query.getQueryBuilder().getQuery()); assertEquals( "parent gremlin query should be for parent", parentExpected, @@ -121,42 +117,5 @@ public class LegacyQueryTest { "lag-interface", query.getResultType()); } - - /** - * Naming exceptions. - * - * @throws JAXBException the JAXB exception - * @throws UnsupportedEncodingException the unsupported encoding exception - * @throws AAIException the AAI exception - */ - @Test - public void namingExceptions() throws JAXBException, UnsupportedEncodingException, AAIException { - URI uri = UriBuilder.fromPath("network/vces/vce/key1/port-groups/port-group/key2/cvlan-tags/cvlan-tag/655").build(); - - QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); - String expected = - ".has('vnf-id', 'key1').has('aai-node-type', 'vce')" - + ".in('org.onap.relationships.inventory.BelongsTo').has('aai-node-type', 'port-group')" - + ".has('interface-id', 'key2')" - + ".in('org.onap.relationships.inventory.BelongsTo').has('aai-node-type', 'cvlan-tag')" - + ".has('cvlan-tag', 655)"; - String expectedParent = - ".has('vnf-id', 'key1').has('aai-node-type', 'vce')" - + ".in('org.onap.relationships.inventory.BelongsTo').has('aai-node-type', 'port-group')" - + ".has('interface-id', 'key2')"; - assertEquals( - "gremlin query should be " + expected, - expected, - query.getQueryBuilder().getQuery()); - assertEquals( - "parent gremlin query should be equal the query for port group", - expectedParent, - query.getQueryBuilder().getParentQuery().getQuery()); - assertEquals( - "result type should be cvlan-tag", - "cvlan-tag", - query.getResultType()); - - } - + }