From: Venkata Harish K Kajur Date: Thu, 28 Sep 2017 21:44:52 +0000 (-0400) Subject: Change all the packages from openecomp to onap X-Git-Tag: v1.1.0~11 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=bed3675b3616e089d8581b7cb755adb754e2f3f9;p=aai%2Ftraversal.git Change all the packages from openecomp to onap Issue-ID: AAI-61 AAI-82 Change-Id: Iba7de4bd0dea1398d8608c9c514d78ad69201d0a Signed-off-by: Venkata Harish K Kajur --- diff --git a/LICENSE.TXT b/LICENSE.TXT index 32bbcba4..72b8cfb7 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -1,23 +1,19 @@ -/*- - * ============LICENSE_START======================================================= - * org.openecomp.aai - * ================================================================================ - * Copyright © 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========================================================= - * - * ECOMP and OpenECOMP are trademarks - * and service marks of AT&T Intellectual Property. - * - */ +============LICENSE_START======================================================= +org.onap.aai +================================================================================ +Copyright © 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========================================================= + +ECOMP is a trademark and service mark of AT&T Intellectual Property. diff --git a/aai-traversal/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml b/aai-traversal/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml index 326c8cbe..047da14f 100644 --- a/aai-traversal/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml +++ b/aai-traversal/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml @@ -1,3 +1,26 @@ + diff --git a/aai-traversal/ajsc-shared-config/etc/localhost-access-logback.xml b/aai-traversal/ajsc-shared-config/etc/localhost-access-logback.xml index cf37962a..1ca6caf4 100644 --- a/aai-traversal/ajsc-shared-config/etc/localhost-access-logback.xml +++ b/aai-traversal/ajsc-shared-config/etc/localhost-access-logback.xml @@ -1,3 +1,26 @@ + @@ -6,7 +29,7 @@ ${AJSC_HOME}/logs/ajsc-jetty/localhost_access.log.%d{yyyy-MM-dd} - + %a %u %z [%t] "%m %U" %s %b %y %i{X-TransactionId} %i{X-FromAppId} %i{X-Forwarded-For} %i{X-AAI-SSL-Client-CN} %i{X-AAI-SSL-Client-OU} %i{X-AAI-SSL-Client-O} %i{X-AAI-SSL-Client-L} %i{X-AAI-SSL-Client-ST} %i{X-AAI-SSL-Client-C} %i{X-AAI-SSL-Client-NotBefore} %i{X-AAI-SSL-Client-NotAfter} %i{X-AAI-SSL-Client-DN} %D diff --git a/aai-traversal/ajsc-shared-config/etc/logback.xml b/aai-traversal/ajsc-shared-config/etc/logback.xml index ee6726dd..b855c37b 100644 --- a/aai-traversal/ajsc-shared-config/etc/logback.xml +++ b/aai-traversal/ajsc-shared-config/etc/logback.xml @@ -1,3 +1,26 @@ + ${module.ajsc.namespace.name} @@ -47,7 +70,7 @@ ${logDirectory}/rest/metrics.log.%d{yyyy-MM-dd} - + ${eelfMetricLogPattern} @@ -69,7 +92,7 @@ ${logDirectory}/rest/debug.log.%d{yyyy-MM-dd} - + ${eelfLogPattern} @@ -90,7 +113,7 @@ ${logDirectory}/rest/error.log.%d{yyyy-MM-dd} - + ${eelfLogPattern} @@ -108,7 +131,7 @@ ${logDirectory}/rest/audit.log.%d{yyyy-MM-dd} - + ${eelfAuditLogPattern} @@ -131,7 +154,7 @@ ${logDirectory}/rest/translog.log.%d{yyyy-MM-dd} - + ${eelfLogPattern} @@ -152,7 +175,7 @@ ${logDirectory}/dmaapAAIEventConsumer/error.log.%d{yyyy-MM-dd} - + ${eelfLogPattern} @@ -169,7 +192,7 @@ ${logDirectory}/dmaapAAIEventConsumer/debug.log.%d{yyyy-MM-dd} - + ${eelfLogPattern} @@ -185,7 +208,7 @@ ${logDirectory}/dmaapAAIEventConsumer/metrics.log.%d{yyyy-MM-dd} - + ${eelfLogPattern} @@ -304,20 +327,20 @@ - - + - + - + diff --git a/aai-traversal/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties b/aai-traversal/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties index 29f5f7c2..ca31a262 100644 --- a/aai-traversal/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties +++ b/aai-traversal/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties @@ -1,3 +1,3 @@ #This properties file is for defining any PostProcessorInterceptors that have been created for your AJSC service. -/**=org.openecomp.aai.interceptors.PostAaiAjscInterceptor +/**=org.onap.aai.interceptors.PostAaiAjscInterceptor diff --git a/aai-traversal/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties b/aai-traversal/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties index e803374f..1620bea2 100644 --- a/aai-traversal/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties +++ b/aai-traversal/bundleconfig-local/etc/appprops/PreProcessorInterceptors.properties @@ -1,3 +1,3 @@ #This properties file is for defining any PreProcessorInterceptors that have been created for your AJSC service. -/**=com.att.ajsc.csi.restmethodmap.RestMethodMapInterceptor,org.openecomp.aai.interceptors.PreAaiAjscInterceptor +/**=com.att.ajsc.csi.restmethodmap.RestMethodMapInterceptor,org.onap.aai.interceptors.PreAaiAjscInterceptor diff --git a/aai-traversal/bundleconfig-local/etc/appprops/aaiconfig.properties b/aai-traversal/bundleconfig-local/etc/appprops/aaiconfig.properties index e1da8ed4..217463d0 100644 --- a/aai-traversal/bundleconfig-local/etc/appprops/aaiconfig.properties +++ b/aai-traversal/bundleconfig-local/etc/appprops/aaiconfig.properties @@ -1,3 +1,25 @@ +# +# ============LICENSE_START======================================================= +# org.onap.aai +# ================================================================================ +# Copyright © 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========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# + #################################################################### # REMEMBER TO THINK ABOUT ENVIRONMENTAL DIFFERENCES AND CHANGE THE # TEMPLATE AND *ALL* DATAFILES diff --git a/aai-traversal/bundleconfig-local/etc/appprops/default-logback.xml b/aai-traversal/bundleconfig-local/etc/appprops/default-logback.xml index 0dc841df..655157b2 100644 --- a/aai-traversal/bundleconfig-local/etc/appprops/default-logback.xml +++ b/aai-traversal/bundleconfig-local/etc/appprops/default-logback.xml @@ -1,3 +1,26 @@ + diff --git a/aai-traversal/bundleconfig-local/etc/appprops/gremlin-server-config.yaml b/aai-traversal/bundleconfig-local/etc/appprops/gremlin-server-config.yaml index 19caebdb..a9de31fb 100644 --- a/aai-traversal/bundleconfig-local/etc/appprops/gremlin-server-config.yaml +++ b/aai-traversal/bundleconfig-local/etc/appprops/gremlin-server-config.yaml @@ -1,3 +1,25 @@ +# +# ============LICENSE_START======================================================= +# org.onap.aai +# ================================================================================ +# Copyright © 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========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# + hosts: [localhost] port: 8182 serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 } \ No newline at end of file diff --git a/aai-traversal/bundleconfig-local/etc/appprops/titan-cached.properties b/aai-traversal/bundleconfig-local/etc/appprops/titan-cached.properties index abaec9e1..01067885 100644 --- a/aai-traversal/bundleconfig-local/etc/appprops/titan-cached.properties +++ b/aai-traversal/bundleconfig-local/etc/appprops/titan-cached.properties @@ -1,12 +1,35 @@ +# +# ============LICENSE_START======================================================= +# org.onap.aai +# ================================================================================ +# Copyright © 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========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# + query.fast-property=true # the following parameters are not reloaded automatically and require a manual bounce +#storage.backend=inmemory storage.backend=inmemory storage.hostname=localhost #schema.default=none storage.lock.wait-time=300 storage.hbase.table=aaigraph-dev02 -storage.hbase.ext.zookeeper.znode.parent=/hbase +storage.hbase.ext.zookeeper.znode.parent=/hbase-unsecure #caching on cache.db-cache = true cache.db-cache-clean-wait = 20 diff --git a/aai-traversal/bundleconfig-local/etc/appprops/titan-realtime.properties b/aai-traversal/bundleconfig-local/etc/appprops/titan-realtime.properties index 30d8b0a1..ace08b32 100644 --- a/aai-traversal/bundleconfig-local/etc/appprops/titan-realtime.properties +++ b/aai-traversal/bundleconfig-local/etc/appprops/titan-realtime.properties @@ -1,12 +1,35 @@ +# +# ============LICENSE_START======================================================= +# org.onap.aai +# ================================================================================ +# Copyright © 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========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# + query.fast-property=true # the following parameters are not reloaded automatically and require a manual bounce +#storage.backend=inmemory storage.backend=inmemory storage.hostname=localhost #schema.default=none storage.lock.wait-time=300 storage.hbase.table=aaigraph-dev02 -storage.hbase.ext.zookeeper.znode.parent=/hbase +storage.hbase.ext.zookeeper.znode.parent=/hbase-unsecure # Setting db-cache to false ensure the fastest propagation of changes across servers cache.db-cache = false diff --git a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/FileMonitorBeans.xml b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/FileMonitorBeans.xml index 9e3e0607..37e929db 100644 --- a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/FileMonitorBeans.xml +++ b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/FileMonitorBeans.xml @@ -6,11 +6,11 @@ - + - + - + diff --git a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/jaxrsBeans.groovy b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/jaxrsBeans.groovy index fe9493a4..0749aa4b 100644 --- a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/jaxrsBeans.groovy +++ b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/jaxrsBeans.groovy @@ -3,13 +3,13 @@ beans{ xmlns jaxrs: "http://cxf.apache.org/jaxrs" xmlns util: "http://www.springframework.org/schema/util" - SearchProvider(org.openecomp.aai.rest.search.SearchProvider) - ModelAndNamedQueryRestProvider(org.openecomp.aai.rest.search.ModelAndNamedQueryRestProvider) - QueryConsumer(org.openecomp.aai.rest.QueryConsumer) + SearchProvider(org.onap.aai.rest.search.SearchProvider) + ModelAndNamedQueryRestProvider(org.onap.aai.rest.search.ModelAndNamedQueryRestProvider) + QueryConsumer(org.onap.aai.rest.QueryConsumer) - V3ThroughV7Retired(org.openecomp.aai.rest.retired.V3ThroughV7Consumer) + V3ThroughV7Retired(org.onap.aai.rest.retired.V3ThroughV7Consumer) - EchoResponse(org.openecomp.aai.rest.util.EchoResponse) + EchoResponse(org.onap.aai.rest.util.EchoResponse) util.list(id: 'jaxrsServices') { diff --git a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/serviceBeans.xml b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/serviceBeans.xml index 2b90c85a..7dda68bb 100644 --- a/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/serviceBeans.xml +++ b/aai-traversal/src/main/ajsc/ajsc-aai_v1/ajsc-aai/v1/conf/serviceBeans.xml @@ -20,11 +20,11 @@ - + class="org.onap.aai.ajsc_aai.util.ServicePropertiesMapBean" /> + - - + + @@ -33,8 +33,8 @@ - - + + - + - + - org.openecomp.aai.util.AAIAppServletContextListener + org.onap.aai.util.AAIAppServletContextListener diff --git a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/JaxrsErrorMessageLookupService.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsErrorMessageLookupService.java similarity index 93% rename from aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/JaxrsErrorMessageLookupService.java rename to aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsErrorMessageLookupService.java index 04a7a09b..6aa1f29d 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/JaxrsErrorMessageLookupService.java +++ b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsErrorMessageLookupService.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.ajsc_aai; +package org.onap.aai.ajsc_aai; //import java.util.HashMap; //import java.util.Map; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/JaxrsUserService.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsUserService.java similarity index 86% rename from aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/JaxrsUserService.java rename to aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsUserService.java index 39c78f6d..a1cc2caf 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/JaxrsUserService.java +++ b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/JaxrsUserService.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.ajsc_aai; +package org.onap.aai.ajsc_aai; import javax.ws.rs.GET; import javax.ws.rs.Path; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/filemonitor/ServicePropertiesListener.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesListener.java similarity index 79% rename from aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/filemonitor/ServicePropertiesListener.java rename to aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesListener.java index 22c1cb9f..c806045e 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/filemonitor/ServicePropertiesListener.java +++ b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesListener.java @@ -1,19 +1,21 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ diff --git a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/filemonitor/ServicePropertiesMap.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesMap.java similarity index 93% rename from aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/filemonitor/ServicePropertiesMap.java rename to aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesMap.java index 656b2903..7274c61b 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/filemonitor/ServicePropertiesMap.java +++ b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertiesMap.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.ajsc_aai.filemonitor; +package org.onap.aai.ajsc_aai.filemonitor; import java.io.File; import java.io.FileInputStream; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/filemonitor/ServicePropertyService.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertyService.java similarity index 79% rename from aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/filemonitor/ServicePropertyService.java rename to aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertyService.java index 22c1cb9f..c806045e 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/filemonitor/ServicePropertyService.java +++ b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/filemonitor/ServicePropertyService.java @@ -1,19 +1,21 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ diff --git a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/util/ServicePropertiesMapBean.java b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/util/ServicePropertiesMapBean.java similarity index 78% rename from aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/util/ServicePropertiesMapBean.java rename to aai-traversal/src/main/java/org/onap/aai/ajsc_aai/util/ServicePropertiesMapBean.java index 7577de72..71c290bd 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/ajsc_aai/util/ServicePropertiesMapBean.java +++ b/aai-traversal/src/main/java/org/onap/aai/ajsc_aai/util/ServicePropertiesMapBean.java @@ -1,26 +1,27 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ +package org.onap.aai.ajsc_aai.util; -package org.openecomp.aai.ajsc_aai.util; - -import org.openecomp.aai.ajsc_aai.filemonitor.ServicePropertiesMap; +import org.onap.aai.ajsc_aai.filemonitor.ServicePropertiesMap; public class ServicePropertiesMapBean { diff --git a/aai-traversal/src/main/java/org/openecomp/aai/config/DmaapConfig.java b/aai-traversal/src/main/java/org/onap/aai/config/DmaapConfig.java similarity index 85% rename from aai-traversal/src/main/java/org/openecomp/aai/config/DmaapConfig.java rename to aai-traversal/src/main/java/org/onap/aai/config/DmaapConfig.java index 45406ecd..247ecf72 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/config/DmaapConfig.java +++ b/aai-traversal/src/main/java/org/onap/aai/config/DmaapConfig.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.config; +package org.onap.aai.config; import org.apache.activemq.broker.BrokerService; import org.springframework.context.annotation.Bean; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessing.java b/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java similarity index 99% rename from aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessing.java rename to aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java index 9b65ca11..5e7f9d9a 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessing.java +++ b/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.dbgraphgen; +package org.onap.aai.dbgraphgen; import java.util.ArrayList; import java.util.Collection; @@ -36,20 +37,20 @@ import java.util.concurrent.TimeUnit; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; -import org.openecomp.aai.db.DbMethHelper; -import org.openecomp.aai.db.props.AAIProperties; -import org.openecomp.aai.dbgen.PropertyLimitDesc; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; -import org.openecomp.aai.query.builder.QueryBuilder; -import org.openecomp.aai.schema.enums.PropertyMetadata; -import org.openecomp.aai.serialization.db.DBSerializer; -import org.openecomp.aai.serialization.db.EdgeRules; -import org.openecomp.aai.serialization.db.EdgeType; -import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; -import org.openecomp.aai.util.AAIConfig; +import org.onap.aai.db.DbMethHelper; +import org.onap.aai.db.props.AAIProperties; +import org.onap.aai.dbgen.PropertyLimitDesc; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Introspector; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.query.builder.QueryBuilder; +import org.onap.aai.schema.enums.PropertyMetadata; +import org.onap.aai.serialization.db.DBSerializer; +import org.onap.aai.serialization.db.EdgeRules; +import org.onap.aai.serialization.db.EdgeType; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.util.AAIConfig; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ResultSet.java b/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ResultSet.java similarity index 92% rename from aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ResultSet.java rename to aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ResultSet.java index c66772d9..9759f23c 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ResultSet.java +++ b/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ResultSet.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.dbgraphgen; +package org.onap.aai.dbgraphgen; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.List; import java.util.Map; import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.openecomp.aai.dbgen.PropertyLimitDesc; +import org.onap.aai.dbgen.PropertyLimitDesc; public class ResultSet { private Vertex vert; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/dbgraphmap/SearchGraph.java b/aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java similarity index 93% rename from aai-traversal/src/main/java/org/openecomp/aai/dbgraphmap/SearchGraph.java rename to aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java index 4b0f24d3..ab986a2c 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/dbgraphmap/SearchGraph.java +++ b/aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.dbgraphmap; +package org.onap.aai.dbgraphmap; import java.io.UnsupportedEncodingException; import java.net.URI; @@ -46,33 +47,33 @@ import org.eclipse.persistence.dynamic.DynamicEntity; import org.eclipse.persistence.dynamic.DynamicType; import org.eclipse.persistence.exceptions.DynamicException; import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; -import org.openecomp.aai.db.DbMethHelper; -import org.openecomp.aai.db.props.AAIProperties; -import org.openecomp.aai.dbgen.PropertyLimitDesc; -import org.openecomp.aai.dbgraphgen.ModelBasedProcessing; -import org.openecomp.aai.dbgraphgen.ResultSet; -import org.openecomp.aai.dbmap.DBConnectionType; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.extensions.AAIExtensionMap; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.MoxyLoader; -import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; -import org.openecomp.aai.parsers.relationship.RelationshipToURI; -import org.openecomp.aai.query.builder.QueryBuilder; -import org.openecomp.aai.schema.enums.ObjectMetadata; -import org.openecomp.aai.schema.enums.PropertyMetadata; -import org.openecomp.aai.serialization.db.DBSerializer; -import org.openecomp.aai.serialization.db.EdgeRule; -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.exceptions.AAIFormatVertexException; -import org.openecomp.aai.serialization.queryformats.utils.UrlBuilder; -import org.openecomp.aai.util.StoreNotificationEvent; +import org.onap.aai.db.DbMethHelper; +import org.onap.aai.db.props.AAIProperties; +import org.onap.aai.dbgen.PropertyLimitDesc; +import org.onap.aai.dbgraphgen.ModelBasedProcessing; +import org.onap.aai.dbgraphgen.ResultSet; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.extensions.AAIExtensionMap; +import org.onap.aai.introspection.Introspector; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.MoxyLoader; +import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.parsers.relationship.RelationshipToURI; +import org.onap.aai.query.builder.QueryBuilder; +import org.onap.aai.schema.enums.ObjectMetadata; +import org.onap.aai.schema.enums.PropertyMetadata; +import org.onap.aai.serialization.db.DBSerializer; +import org.onap.aai.serialization.db.EdgeRule; +import org.onap.aai.serialization.db.EdgeRules; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TitanDBEngine; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.serialization.queryformats.exceptions.AAIFormatVertexException; +import org.onap.aai.serialization.queryformats.utils.UrlBuilder; +import org.onap.aai.util.StoreNotificationEvent; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -199,8 +200,8 @@ public class SearchGraph { Introspector searchResults = createSearchResults(loader, urlBuilder, queryResults); String outputMediaType = getMediaType(headers.getAcceptableMediaTypes()); - org.openecomp.aai.introspection.MarshallerProperties properties = new org.openecomp.aai.introspection.MarshallerProperties.Builder( - org.openecomp.aai.restcore.MediaType.getEnum(outputMediaType)).build(); + org.onap.aai.introspection.MarshallerProperties properties = new org.onap.aai.introspection.MarshallerProperties.Builder( + org.onap.aai.restcore.MediaType.getEnum(outputMediaType)).build(); result = searchResults.marshal(properties); response = Response.ok().entity(result).build(); @@ -412,8 +413,8 @@ public class SearchGraph { Introspector searchResults = createSearchResults(loader, urlBuilder, results); String outputMediaType = getMediaType(headers.getAcceptableMediaTypes()); - org.openecomp.aai.introspection.MarshallerProperties properties = new org.openecomp.aai.introspection.MarshallerProperties.Builder( - org.openecomp.aai.restcore.MediaType.getEnum(outputMediaType)).build(); + org.onap.aai.introspection.MarshallerProperties properties = new org.onap.aai.introspection.MarshallerProperties.Builder( + org.onap.aai.restcore.MediaType.getEnum(outputMediaType)).build(); result = searchResults.marshal(properties); response = Response.ok().entity(result).build(); @@ -530,10 +531,10 @@ public class SearchGraph { ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); dbEngine.startTransaction(); - org.openecomp.aai.restcore.MediaType mediaType = org.openecomp.aai.restcore.MediaType.APPLICATION_JSON_TYPE; + org.onap.aai.restcore.MediaType mediaType = org.onap.aai.restcore.MediaType.APPLICATION_JSON_TYPE; String contentType = aaiExtMap.getHttpServletRequest().getContentType(); if (contentType != null && contentType.contains("application/xml")) { - mediaType = org.openecomp.aai.restcore.MediaType.APPLICATION_XML_TYPE; + mediaType = org.onap.aai.restcore.MediaType.APPLICATION_XML_TYPE; } if (queryParameters.length() == 0) { @@ -651,10 +652,10 @@ public class SearchGraph { dbEngine.startTransaction(); - org.openecomp.aai.restcore.MediaType mediaType = org.openecomp.aai.restcore.MediaType.APPLICATION_JSON_TYPE; + org.onap.aai.restcore.MediaType mediaType = org.onap.aai.restcore.MediaType.APPLICATION_JSON_TYPE; String contentType = aaiExtMap.getHttpServletRequest().getContentType(); if (contentType != null && contentType.contains("application/xml")) { - mediaType = org.openecomp.aai.restcore.MediaType.APPLICATION_XML_TYPE; + mediaType = org.onap.aai.restcore.MediaType.APPLICATION_XML_TYPE; } if (queryParameters.length() == 0) { @@ -811,13 +812,13 @@ public class SearchGraph { break; } } - org.openecomp.aai.introspection.MarshallerProperties properties; + org.onap.aai.introspection.MarshallerProperties properties; if (isJson) { properties = - new org.openecomp.aai.introspection.MarshallerProperties.Builder(org.openecomp.aai.restcore.MediaType.APPLICATION_JSON_TYPE).build(); + new org.onap.aai.introspection.MarshallerProperties.Builder(org.onap.aai.restcore.MediaType.APPLICATION_JSON_TYPE).build(); } else { properties = - new org.openecomp.aai.introspection.MarshallerProperties.Builder(org.openecomp.aai.restcore.MediaType.APPLICATION_XML_TYPE).build(); + new org.onap.aai.introspection.MarshallerProperties.Builder(org.onap.aai.restcore.MediaType.APPLICATION_XML_TYPE).build(); } String marshalledObj = obj.marshal(properties); diff --git a/aai-traversal/src/main/java/org/openecomp/aai/interceptors/AAIHeaderProperties.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAIHeaderProperties.java similarity index 78% rename from aai-traversal/src/main/java/org/openecomp/aai/interceptors/AAIHeaderProperties.java rename to aai-traversal/src/main/java/org/onap/aai/interceptors/AAIHeaderProperties.java index 4798d904..733383a8 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/interceptors/AAIHeaderProperties.java +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAIHeaderProperties.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.interceptors; +package org.onap.aai.interceptors; public class AAIHeaderProperties { diff --git a/aai-traversal/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptor.java similarity index 94% rename from aai-traversal/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java rename to aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptor.java index 8a9362e6..155d387d 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptor.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.interceptors; +package org.onap.aai.interceptors; import java.io.InputStream; import java.util.ArrayList; @@ -36,13 +37,13 @@ import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.interceptor.LoggingMessage; import org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor; import org.apache.cxf.message.Message; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.logging.ErrorLogHelper; -import org.openecomp.aai.rest.util.EchoResponse; -import org.openecomp.aai.util.AAIConfig; -import org.openecomp.aai.util.AAIConstants; -import org.openecomp.aai.util.FormatDate; -import org.openecomp.aai.util.HbaseSaltPrefixer; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.rest.util.EchoResponse; +import org.onap.aai.util.AAIConfig; +import org.onap.aai.util.AAIConstants; +import org.onap.aai.util.FormatDate; +import org.onap.aai.util.HbaseSaltPrefixer; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSOutInterceptor.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptor.java similarity index 95% rename from aai-traversal/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSOutInterceptor.java rename to aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptor.java index a168ad9e..a280023b 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSOutInterceptor.java +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptor.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.interceptors; +package org.onap.aai.interceptors; import java.io.OutputStream; import java.util.Collections; @@ -33,11 +34,11 @@ import org.apache.cxf.io.CachedOutputStream; import org.apache.cxf.io.CachedOutputStreamCallback; import org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor; import org.apache.cxf.message.Message; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.logging.ErrorLogHelper; -import org.openecomp.aai.util.AAIConfig; -import org.openecomp.aai.util.AAIConstants; -import org.openecomp.aai.util.FormatDate; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.util.AAIConfig; +import org.onap.aai.util.AAIConstants; +import org.onap.aai.util.FormatDate; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/interceptors/PostAaiAjscInterceptor.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/PostAaiAjscInterceptor.java similarity index 85% rename from aai-traversal/src/main/java/org/openecomp/aai/interceptors/PostAaiAjscInterceptor.java rename to aai-traversal/src/main/java/org/onap/aai/interceptors/PostAaiAjscInterceptor.java index 3a4f899e..30382e4f 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/interceptors/PostAaiAjscInterceptor.java +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/PostAaiAjscInterceptor.java @@ -1,32 +1,33 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.interceptors; +package org.onap.aai.interceptors; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.openecomp.aai.logging.LoggingContext; -import org.openecomp.aai.logging.LoggingContext.StatusCode; +import org.onap.aai.logging.LoggingContext; +import org.onap.aai.logging.LoggingContext.StatusCode; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/interceptors/PreAaiAjscInterceptor.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/PreAaiAjscInterceptor.java similarity index 85% rename from aai-traversal/src/main/java/org/openecomp/aai/interceptors/PreAaiAjscInterceptor.java rename to aai-traversal/src/main/java/org/onap/aai/interceptors/PreAaiAjscInterceptor.java index a2c56d08..7d1ae734 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/interceptors/PreAaiAjscInterceptor.java +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/PreAaiAjscInterceptor.java @@ -1,31 +1,32 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.interceptors; +package org.onap.aai.interceptors; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.openecomp.aai.logging.LoggingContext; +import org.onap.aai.logging.LoggingContext; import ajsc.beans.interceptors.AjscInterceptor; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/ExceptionHandler.java b/aai-traversal/src/main/java/org/onap/aai/rest/ExceptionHandler.java similarity index 93% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/ExceptionHandler.java rename to aai-traversal/src/main/java/org/onap/aai/rest/ExceptionHandler.java index f1a6f476..c20a3708 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/ExceptionHandler.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/ExceptionHandler.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest; +package org.onap.aai.rest; import java.util.ArrayList; import java.util.List; @@ -32,8 +33,8 @@ import javax.ws.rs.core.Response; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.logging.ErrorLogHelper; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.logging.ErrorLogHelper; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.sun.istack.SAXParseException2; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/QueryConsumer.java b/aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java similarity index 84% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/QueryConsumer.java rename to aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java index 2264f245..8109f7e5 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/QueryConsumer.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest; +package org.onap.aai.rest; import java.net.URI; import java.util.ArrayList; @@ -44,24 +45,24 @@ import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriInfo; import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.openecomp.aai.dbmap.DBConnectionType; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; -import org.openecomp.aai.parsers.query.QueryParser; -import org.openecomp.aai.rest.db.HttpEntry; -import org.openecomp.aai.rest.search.GenericQueryProcessor; -import org.openecomp.aai.rest.search.QueryProcessorType; -import org.openecomp.aai.restcore.HttpMethod; -import org.openecomp.aai.restcore.RESTAPI; -import org.openecomp.aai.restcore.util.URITools; -import org.openecomp.aai.serialization.db.DBSerializer; -import org.openecomp.aai.serialization.engines.QueryStyle; -import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; -import org.openecomp.aai.serialization.queryformats.Format; -import org.openecomp.aai.serialization.queryformats.FormatFactory; -import org.openecomp.aai.serialization.queryformats.Formatter; -import org.openecomp.aai.serialization.queryformats.SubGraphStyle; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; +import org.onap.aai.parsers.query.QueryParser; +import org.onap.aai.rest.db.HttpEntry; +import org.onap.aai.rest.search.GenericQueryProcessor; +import org.onap.aai.rest.search.QueryProcessorType; +import org.onap.aai.restcore.HttpMethod; +import org.onap.aai.restcore.RESTAPI; +import org.onap.aai.restcore.util.URITools; +import org.onap.aai.serialization.db.DBSerializer; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.serialization.queryformats.Format; +import org.onap.aai.serialization.queryformats.FormatFactory; +import org.onap.aai.serialization.queryformats.Formatter; +import org.onap.aai.serialization.queryformats.SubGraphStyle; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/retired/RetiredConsumer.java b/aai-traversal/src/main/java/org/onap/aai/rest/retired/RetiredConsumer.java similarity index 91% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/retired/RetiredConsumer.java rename to aai-traversal/src/main/java/org/onap/aai/rest/retired/RetiredConsumer.java index 99974efe..01881420 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/retired/RetiredConsumer.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/retired/RetiredConsumer.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.retired; +package org.onap.aai.rest.retired; import java.util.ArrayList; @@ -36,10 +37,10 @@ import javax.ws.rs.core.UriInfo; import org.apache.cxf.jaxrs.ext.PATCH; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.logging.ErrorLogHelper; -import org.openecomp.aai.restcore.RESTAPI; -import org.openecomp.aai.util.AAIConfig; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.restcore.RESTAPI; +import org.onap.aai.util.AAIConfig; /** * The Class RetiredConsumer. diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/retired/V3ThroughV7Consumer.java b/aai-traversal/src/main/java/org/onap/aai/rest/retired/V3ThroughV7Consumer.java similarity index 78% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/retired/V3ThroughV7Consumer.java rename to aai-traversal/src/main/java/org/onap/aai/rest/retired/V3ThroughV7Consumer.java index 55d9482e..8e80a7b1 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/retired/V3ThroughV7Consumer.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/retired/V3ThroughV7Consumer.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.retired; +package org.onap.aai.rest.retired; import javax.ws.rs.Path; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/retired/V7V8NamedQueries.java b/aai-traversal/src/main/java/org/onap/aai/rest/retired/V7V8NamedQueries.java similarity index 79% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/retired/V7V8NamedQueries.java rename to aai-traversal/src/main/java/org/onap/aai/rest/retired/V7V8NamedQueries.java index 3f022a27..98be4555 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/retired/V7V8NamedQueries.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/retired/V7V8NamedQueries.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.retired; +package org.onap.aai.rest.retired; import javax.ws.rs.Path; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GenericQueryProcessor.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/GenericQueryProcessor.java similarity index 94% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/search/GenericQueryProcessor.java rename to aai-traversal/src/main/java/org/onap/aai/rest/search/GenericQueryProcessor.java index e05ec7da..9f6f3aa0 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GenericQueryProcessor.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/GenericQueryProcessor.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.io.FileNotFoundException; import java.net.URI; @@ -41,9 +42,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.javatuples.Pair; -import org.openecomp.aai.restcore.util.URITools; -import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; -import org.openecomp.aai.serialization.queryformats.SubGraphStyle; +import org.onap.aai.restcore.util.URITools; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.serialization.queryformats.SubGraphStyle; import jersey.repackaged.com.google.common.base.Joiner; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GremlinGroovyShellSingleton.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinGroovyShellSingleton.java similarity index 92% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/search/GremlinGroovyShellSingleton.java rename to aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinGroovyShellSingleton.java index 64159a4c..69e08ff9 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GremlinGroovyShellSingleton.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinGroovyShellSingleton.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.HashMap; import java.util.Map; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GremlinServerImpl.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerImpl.java similarity index 88% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/search/GremlinServerImpl.java rename to aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerImpl.java index a759b865..a05b3ae8 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GremlinServerImpl.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerImpl.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.List; import java.util.Map; @@ -30,7 +31,7 @@ import org.apache.tinkerpop.gremlin.driver.ResultSet; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; -import org.openecomp.aai.util.AAIConfig; +import org.onap.aai.util.AAIConfig; public class GremlinServerImpl extends GenericQueryProcessor { diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GremlinServerSingleton.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerSingleton.java similarity index 92% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/search/GremlinServerSingleton.java rename to aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerSingleton.java index c54b310a..e4ac8153 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GremlinServerSingleton.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerSingleton.java @@ -1,27 +1,28 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ +package org.onap.aai.rest.search; -package org.openecomp.aai.rest.search; - -import org.openecomp.aai.util.AAIConstants; -import org.openecomp.aai.util.FileWatcher; +import org.onap.aai.util.AAIConstants; +import org.onap.aai.util.FileWatcher; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import org.apache.tinkerpop.gremlin.driver.Cluster; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GroovyQueryBuilderSingleton.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/GroovyQueryBuilderSingleton.java similarity index 87% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/search/GroovyQueryBuilderSingleton.java rename to aai-traversal/src/main/java/org/onap/aai/rest/search/GroovyQueryBuilderSingleton.java index 7e5909c1..e4ddbfe1 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GroovyQueryBuilderSingleton.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/GroovyQueryBuilderSingleton.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.HashMap; import java.util.Map; @@ -31,9 +32,9 @@ import org.codehaus.groovy.ast.expr.PropertyExpression; import org.codehaus.groovy.control.CompilerConfiguration; import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer; import org.codehaus.groovy.control.customizers.ImportCustomizer; -import org.openecomp.aai.query.builder.QueryBuilder; -import org.openecomp.aai.serialization.engines.QueryStyle; -import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.query.builder.QueryBuilder; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; import groovy.lang.Binding; import groovy.lang.GroovyShell; @@ -62,7 +63,7 @@ public class GroovyQueryBuilderSingleton { "org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__", "org.apache.tinkerpop.gremlin.structure.T", "org.apache.tinkerpop.gremlin.process.traversal.P", - "org.openecomp.aai.serialization.db.EdgeType"); + "org.onap.aai.serialization.db.EdgeType"); CompilerConfiguration config = new CompilerConfiguration(); config.addCompilationCustomizers(custom, imports); diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GroovyShellImpl.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/GroovyShellImpl.java similarity index 81% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/search/GroovyShellImpl.java rename to aai-traversal/src/main/java/org/onap/aai/rest/search/GroovyShellImpl.java index 1b64d21d..272ccd0d 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/GroovyShellImpl.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/GroovyShellImpl.java @@ -1,30 +1,31 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; -import org.openecomp.aai.restcore.search.GremlinGroovyShellSingleton; +import org.onap.aai.restcore.search.GremlinGroovyShellSingleton; public class GroovyShellImpl extends GenericQueryProcessor { diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/ModelAndNamedQueryRestProvider.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProvider.java similarity index 91% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/search/ModelAndNamedQueryRestProvider.java rename to aai-traversal/src/main/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProvider.java index b8c5cf9b..49d9dc58 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/ModelAndNamedQueryRestProvider.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProvider.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.ArrayList; @@ -33,13 +34,13 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; -import org.openecomp.aai.dbgraphmap.SearchGraph; -import org.openecomp.aai.dbmap.DBConnectionType; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.extensions.AAIExtensionMap; -import org.openecomp.aai.logging.ErrorLogHelper; -import org.openecomp.aai.restcore.RESTAPI; -import org.openecomp.aai.util.AAIApiVersion; +import org.onap.aai.dbgraphmap.SearchGraph; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.extensions.AAIExtensionMap; +import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.restcore.RESTAPI; +import org.onap.aai.util.AAIApiVersion; /** * Implements the search subdomain in the REST API. All API calls must include diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/QueryProcessorType.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/QueryProcessorType.java similarity index 78% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/search/QueryProcessorType.java rename to aai-traversal/src/main/java/org/onap/aai/rest/search/QueryProcessorType.java index 33d7a902..832936a3 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/QueryProcessorType.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/QueryProcessorType.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; public enum QueryProcessorType { diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/SearchProvider.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java similarity index 88% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/search/SearchProvider.java rename to aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java index 4330db13..23bdaf0d 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/search/SearchProvider.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.ArrayList; import java.util.List; @@ -35,21 +36,21 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; -import org.openecomp.aai.db.props.AAIProperties; -import org.openecomp.aai.dbgraphmap.SearchGraph; -import org.openecomp.aai.dbmap.DBConnectionType; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; -import org.openecomp.aai.logging.ErrorLogHelper; -import org.openecomp.aai.restcore.RESTAPI; -import org.openecomp.aai.serialization.db.DBSerializer; -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.utils.UrlBuilder; +import org.onap.aai.db.props.AAIProperties; +import org.onap.aai.dbgraphmap.SearchGraph; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; +import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.restcore.RESTAPI; +import org.onap.aai.serialization.db.DBSerializer; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TitanDBEngine; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.serialization.queryformats.utils.UrlBuilder; /** * Implements the search subdomain in the REST API. All API calls must include diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/util/EchoResponse.java b/aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java similarity index 90% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/util/EchoResponse.java rename to aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java index 6d014350..55a07e48 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/util/EchoResponse.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.util; +package org.onap.aai.rest.util; import java.util.ArrayList; import java.util.HashMap; @@ -34,9 +35,9 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.logging.ErrorLogHelper; -import org.openecomp.aai.restcore.RESTAPI; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.restcore.RESTAPI; /** * The Class EchoResponse. diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/util/LogFormatTools.java b/aai-traversal/src/main/java/org/onap/aai/rest/util/LogFormatTools.java similarity index 83% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/util/LogFormatTools.java rename to aai-traversal/src/main/java/org/onap/aai/rest/util/LogFormatTools.java index d6fcd67e..cfda0c35 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/util/LogFormatTools.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/util/LogFormatTools.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.util; +package org.onap.aai.rest.util; import java.time.ZoneOffset; import java.time.ZonedDateTime; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/rest/util/ValidateEncoding.java b/aai-traversal/src/main/java/org/onap/aai/rest/util/ValidateEncoding.java similarity index 93% rename from aai-traversal/src/main/java/org/openecomp/aai/rest/util/ValidateEncoding.java rename to aai-traversal/src/main/java/org/onap/aai/rest/util/ValidateEncoding.java index a09a317a..7d4b314f 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/rest/util/ValidateEncoding.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/util/ValidateEncoding.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.util; +package org.onap.aai.rest.util; import java.io.UnsupportedEncodingException; import java.net.URI; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/transforms/Converter.java b/aai-traversal/src/main/java/org/onap/aai/transforms/Converter.java similarity index 78% rename from aai-traversal/src/main/java/org/openecomp/aai/transforms/Converter.java rename to aai-traversal/src/main/java/org/onap/aai/transforms/Converter.java index 44a0222e..cb7525f0 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/transforms/Converter.java +++ b/aai-traversal/src/main/java/org/onap/aai/transforms/Converter.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.transforms; +package org.onap.aai.transforms; public interface Converter { String convert(String input); diff --git a/aai-traversal/src/main/java/org/openecomp/aai/transforms/LowerCamelToLowerHyphenConverter.java b/aai-traversal/src/main/java/org/onap/aai/transforms/LowerCamelToLowerHyphenConverter.java similarity index 82% rename from aai-traversal/src/main/java/org/openecomp/aai/transforms/LowerCamelToLowerHyphenConverter.java rename to aai-traversal/src/main/java/org/onap/aai/transforms/LowerCamelToLowerHyphenConverter.java index a31da05e..df9ccc58 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/transforms/LowerCamelToLowerHyphenConverter.java +++ b/aai-traversal/src/main/java/org/onap/aai/transforms/LowerCamelToLowerHyphenConverter.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.transforms; +package org.onap.aai.transforms; import com.google.common.base.CaseFormat; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/transforms/LowerHyphenToLowerCamelConverter.java b/aai-traversal/src/main/java/org/onap/aai/transforms/LowerHyphenToLowerCamelConverter.java similarity index 91% rename from aai-traversal/src/main/java/org/openecomp/aai/transforms/LowerHyphenToLowerCamelConverter.java rename to aai-traversal/src/main/java/org/onap/aai/transforms/LowerHyphenToLowerCamelConverter.java index 784adbe8..e983dfb9 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/transforms/LowerHyphenToLowerCamelConverter.java +++ b/aai-traversal/src/main/java/org/onap/aai/transforms/LowerHyphenToLowerCamelConverter.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.transforms; +package org.onap.aai.transforms; /** * LowerHyphenToLowerCamelConverter is the converter to use diff --git a/aai-traversal/src/main/java/org/openecomp/aai/transforms/MapTraverser.java b/aai-traversal/src/main/java/org/onap/aai/transforms/MapTraverser.java similarity index 91% rename from aai-traversal/src/main/java/org/openecomp/aai/transforms/MapTraverser.java rename to aai-traversal/src/main/java/org/onap/aai/transforms/MapTraverser.java index 7695240d..983602e2 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/transforms/MapTraverser.java +++ b/aai-traversal/src/main/java/org/onap/aai/transforms/MapTraverser.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.transforms; +package org.onap.aai.transforms; import joptsimple.internal.Objects; diff --git a/aai-traversal/src/main/java/org/openecomp/aai/util/AAIAppServletContextListener.java b/aai-traversal/src/main/java/org/onap/aai/util/AAIAppServletContextListener.java similarity index 85% rename from aai-traversal/src/main/java/org/openecomp/aai/util/AAIAppServletContextListener.java rename to aai-traversal/src/main/java/org/onap/aai/util/AAIAppServletContextListener.java index 9edf857f..49a77d84 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/util/AAIAppServletContextListener.java +++ b/aai-traversal/src/main/java/org/onap/aai/util/AAIAppServletContextListener.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.util; +package org.onap.aai.util; import java.io.IOException; @@ -27,10 +28,10 @@ import javax.servlet.ServletContextListener; //import org.apache.activemq.broker.BrokerService; -import org.openecomp.aai.dbmap.AAIGraph; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.ModelInjestor; -import org.openecomp.aai.logging.ErrorLogHelper; +import org.onap.aai.dbmap.AAIGraph; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.ModelInjestor; +import org.onap.aai.logging.ErrorLogHelper; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -64,7 +65,7 @@ public class AAIAppServletContextListener implements ServletContextListener { * @param arg0 the ServletContextEvent */ public void contextInitialized(ServletContextEvent arg0) { - System.setProperty("org.openecomp.aai.serverStarted", "false"); + System.setProperty("org.onap.aai.serverStarted", "false"); LOGGER.info("***AAI Server initialization started..."); try { @@ -88,7 +89,7 @@ public class AAIAppServletContextListener implements ServletContextListener { //broker.start(); LOGGER.info("AAI Server initialization succcessful."); - System.setProperty("org.openecomp.aai.serverStarted", "true"); + System.setProperty("org.onap.aai.serverStarted", "true"); } catch (AAIException e) { ErrorLogHelper.logException(e); diff --git a/aai-traversal/src/main/java/org/openecomp/aai/util/MakeNamedQuery.java b/aai-traversal/src/main/java/org/onap/aai/util/MakeNamedQuery.java similarity index 93% rename from aai-traversal/src/main/java/org/openecomp/aai/util/MakeNamedQuery.java rename to aai-traversal/src/main/java/org/onap/aai/util/MakeNamedQuery.java index c6ca5991..fde25a77 100644 --- a/aai-traversal/src/main/java/org/openecomp/aai/util/MakeNamedQuery.java +++ b/aai-traversal/src/main/java/org/onap/aai/util/MakeNamedQuery.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.util; +package org.onap.aai.util; import java.io.File; import java.util.ArrayList; @@ -29,14 +30,14 @@ import java.util.UUID; import org.apache.commons.io.FileUtils; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; -import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; -import org.openecomp.aai.util.AAIConfig; -import org.openecomp.aai.util.AAIConstants; +import org.onap.aai.introspection.Introspector; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; +import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.util.AAIConfig; +import org.onap.aai.util.AAIConstants; public class MakeNamedQuery { diff --git a/aai-traversal/src/main/resources/docker/aai.sh b/aai-traversal/src/main/resources/docker/aai.sh index 741076f4..a2537753 100644 --- a/aai-traversal/src/main/resources/docker/aai.sh +++ b/aai-traversal/src/main/resources/docker/aai.sh @@ -1,22 +1,24 @@ -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# PROJECT_HOME=/opt/app/aai-traversal export PROJECT_HOME diff --git a/aai-traversal/src/main/resources/docker/docker-entrypoint.sh b/aai-traversal/src/main/resources/docker/docker-entrypoint.sh index 58231055..f69e4685 100644 --- a/aai-traversal/src/main/resources/docker/docker-entrypoint.sh +++ b/aai-traversal/src/main/resources/docker/docker-entrypoint.sh @@ -1,22 +1,24 @@ -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# # Set the current path to be the application home and common libs home export APP_HOME=$(pwd); @@ -41,7 +43,10 @@ fi; chown -R aaiadmin:aaiadmin /opt/app /var/chef /opt/aai/logroot -gosu aaiadmin ./init-chef.sh +gosu aaiadmin ./init-chef.sh || { + echo "Unable to run init chef script, please check logs"; + exit 1; +} httpPort=8086; httpsPort=8446; diff --git a/aai-traversal/src/main/resources/docker/init-chef.sh b/aai-traversal/src/main/resources/docker/init-chef.sh index 0e100556..52c35e36 100644 --- a/aai-traversal/src/main/resources/docker/init-chef.sh +++ b/aai-traversal/src/main/resources/docker/init-chef.sh @@ -1,24 +1,25 @@ #!/bin/bash - -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# ############################################################################## # Script to initialize the chef-repo branch and.chef @@ -34,10 +35,15 @@ if [ ! -d "aai-config" ]; then exit; } +fi + +if [ -d "aai-config/cookbooks/aai-traversal" ]; then + (cd aai-config/cookbooks/aai-traversal/ && \ for f in $(ls); do mv $f ../; done && \ cd ../ && rmdir aai-traversal); -fi + +fi; if [ ! -d "aai-data" ]; then @@ -46,9 +52,10 @@ if [ ! -d "aai-data" ]; then exit; } - chef-solo \ - -c /var/chef/aai-data/chef-config/dev/.knife/solo.rb \ - -j /var/chef/aai-config/cookbooks/runlist-aai-traversal.json \ - -E ${AAI_CHEF_ENV}; - fi + +chef-solo \ + -c /var/chef/aai-data/chef-config/dev/.knife/solo.rb \ + -j /var/chef/aai-config/cookbooks/runlist-aai-traversal.json \ + -E ${AAI_CHEF_ENV}; + diff --git a/aai-traversal/src/main/resources/schema/UebEventLogEntry.xsd b/aai-traversal/src/main/resources/schema/UebEventLogEntry.xsd index c679fd2a..edc89243 100644 --- a/aai-traversal/src/main/resources/schema/UebEventLogEntry.xsd +++ b/aai-traversal/src/main/resources/schema/UebEventLogEntry.xsd @@ -1,3 +1,26 @@ + diff --git a/aai-traversal/src/main/scripts/deleteNamedQuery.sh b/aai-traversal/src/main/scripts/deleteNamedQuery.sh index 70faddff..16b20a78 100644 --- a/aai-traversal/src/main/scripts/deleteNamedQuery.sh +++ b/aai-traversal/src/main/scripts/deleteNamedQuery.sh @@ -1,24 +1,25 @@ #!/bin/ksh - -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# # # This script deletes the named query in bundleconfig/etc/scriptdata/named-query-json directory diff --git a/aai-traversal/src/main/scripts/deleteTool.sh b/aai-traversal/src/main/scripts/deleteTool.sh index 02b72b06..60c3e1c0 100644 --- a/aai-traversal/src/main/scripts/deleteTool.sh +++ b/aai-traversal/src/main/scripts/deleteTool.sh @@ -1,24 +1,25 @@ #!/bin/ksh - -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# # # The script is called with a resource to be deleted. diff --git a/aai-traversal/src/main/scripts/getTool.sh b/aai-traversal/src/main/scripts/getTool.sh index 38f96c5e..39d4e878 100644 --- a/aai-traversal/src/main/scripts/getTool.sh +++ b/aai-traversal/src/main/scripts/getTool.sh @@ -1,24 +1,25 @@ #!/bin/ksh - -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# # # The script is called with a resource. diff --git a/aai-traversal/src/main/scripts/install/instutils.sh b/aai-traversal/src/main/scripts/install/instutils.sh index a5126061..ab94a9c1 100644 --- a/aai-traversal/src/main/scripts/install/instutils.sh +++ b/aai-traversal/src/main/scripts/install/instutils.sh @@ -1,24 +1,25 @@ #!/bin/ksh - -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# ECHO=${ECHO:-echo} diff --git a/aai-traversal/src/main/scripts/install/updateQueryData.sh b/aai-traversal/src/main/scripts/install/updateQueryData.sh index 798d5b8d..3c7f1bfc 100644 --- a/aai-traversal/src/main/scripts/install/updateQueryData.sh +++ b/aai-traversal/src/main/scripts/install/updateQueryData.sh @@ -1,24 +1,25 @@ #!/bin/ksh - -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# PROGNAME=$(basename $0) PROJECT_HOME=/opt/app/aai-traversal diff --git a/aai-traversal/src/main/scripts/putTool.sh b/aai-traversal/src/main/scripts/putTool.sh index bc89e86c..ea529f12 100644 --- a/aai-traversal/src/main/scripts/putTool.sh +++ b/aai-traversal/src/main/scripts/putTool.sh @@ -1,22 +1,25 @@ #!/bin/ksh - -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# # # The script is called with a resource, filepath and an optional argument to diff --git a/aai-traversal/src/test/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessingInvalidDataTest.java b/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingInvalidDataTest.java similarity index 95% rename from aai-traversal/src/test/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessingInvalidDataTest.java rename to aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingInvalidDataTest.java index b2559160..bd3705e3 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessingInvalidDataTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingInvalidDataTest.java @@ -1,983 +1,984 @@ -/*- - * ============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.dbgraphgen; - -import static org.junit.Assert.*; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyMap; -import static org.mockito.Matchers.anyMapOf; -import static org.mockito.Mockito.*; - -import com.bazaarvoice.jolt.modifier.DataType; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.LinkedListMultimap; -import com.google.common.collect.Multimap; -import com.thinkaurelius.titan.graphdb.olap.computer.VertexMapJob; -import com.thinkaurelius.titan.graphdb.types.VertexLabelVertex; -import com.thinkaurelius.titan.graphdb.types.system.BaseVertexLabel; -import com.thinkaurelius.titan.graphdb.types.system.EmptyVertex; -import com.thinkaurelius.titan.graphdb.types.vertices.EdgeLabelVertex; -import com.thinkaurelius.titan.graphdb.types.vertices.PropertyKeyVertex; -import org.apache.commons.lang.ObjectUtils; -import org.apache.openjpa.kernel.exps.Exp; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.T; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.apache.tinkerpop.gremlin.structure.VertexProperty; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.*; -import org.mockito.runners.MockitoJUnitRunner; -import org.openecomp.aai.db.DbMethHelper; -import org.openecomp.aai.db.props.AAIProperties; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; -import org.openecomp.aai.serialization.db.DBSerializer; -import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; - -import javax.inject.Inject; -import java.util.*; -@RunWith(MockitoJUnitRunner.class) -public class ModelBasedProcessingInvalidDataTest { - - @Mock - private static TransactionalGraphEngine dbEngine; - private static Loader loader; - @Mock - private static DBSerializer serializer; - ModelBasedProcessing processor; - - @Mock - private ModelBasedProcessing mockProcessor; - - - @Mock - private DbMethHelper dbMethHelper; - - @BeforeClass - public static void configure() throws Exception { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); - - - } - - @Before - public void init() { - MockitoAnnotations.initMocks(this); - processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - dbMethHelper = new DbMethHelper(loader, dbEngine); - - } - - @Test - public void getStartNodesAndModVersionIdsTest() throws AAIException { - - - List> startNodeFilterArrayOfHashes = new ArrayList>(); - Map map = new HashMap(); - map.put("test", new Object()); - startNodeFilterArrayOfHashes.add(map); - Map result=new HashMap<>(); - - Map result1 = mockProcessor.getStartNodesAndModVersionIds("test", "test", - "test", "test", "test", - "test", startNodeFilterArrayOfHashes, - "test"); - assertNotNull(result); - - } - - - @Test(expected = NullPointerException.class) - public void getStartNodesAndModVersionIdsTest2() throws AAIException { - List> startNodeFilterArrayOfHashes = new ArrayList>(); - Map map = new HashMap(); - map.put("test", new Object()); - startNodeFilterArrayOfHashes.add(map); - Map result1 = processor.getStartNodesAndModVersionIds("test", "test", - "", "test", "test", - "test", startNodeFilterArrayOfHashes, - "test"); - assertNotNull(result1); - } - - - @Test(expected = NullPointerException.class) - public void getStartNodesAndModVersionIdsTest3() throws AAIException { - List> startNodeFilterArrayOfHashes = new ArrayList>(); - Map map = new HashMap(); - map.put("test", new Object()); - startNodeFilterArrayOfHashes.add(map); - Map result1 = processor.getStartNodesAndModVersionIds("test", "test", - "", "", "test", - "test", startNodeFilterArrayOfHashes, - "test"); - assertNotNull(result1); - } - - - @Test(expected = AAIException.class) - public void getStartNodesAndModVersionIdsTest4() throws AAIException { - List> startNodeFilterArrayOfHashes = new ArrayList>(); - Map map = new HashMap(); - map.put("test", new Object()); - startNodeFilterArrayOfHashes.add(map); - Map result1 = processor.getStartNodesAndModVersionIds("test", "test", - "", "", "", - "test", startNodeFilterArrayOfHashes, - "test"); - assertNotNull(result1); - } - - - @Test(expected = AAIException.class) - public void getStartNodesAndModVersionIdsTest5() throws AAIException { - List> startNodeFilterArrayOfHashes = new ArrayList>(); - Map map = new HashMap(); - map.put("test", new Object()); - startNodeFilterArrayOfHashes.add(map); - Map result1 = processor.getStartNodesAndModVersionIds("test", "test", - "", "", "", - "", startNodeFilterArrayOfHashes, - "test"); - assertNotNull(result1); - } - - - @Test(expected = AAIException.class) - public void getStartNodesAndModVersionIdsNullTest() throws AAIException { - List> startNodeFilterArrayOfHashes = new ArrayList>(); - - Map result = null; - result = processor.getStartNodesAndModVersionIds("test", "test", - "", "", "", - "", startNodeFilterArrayOfHashes, - "test"); - - assertNotNull(result); - } - - - @Test(expected = NullPointerException.class) - public void getStartNodesAndModVersionIdsNullTest1() throws AAIException { - List> startNodeFilterArrayOfHashes = new ArrayList>(); - - Map result = null; - result = processor.getStartNodesAndModVersionIds("test", "test", - "Test", "", "", - "", startNodeFilterArrayOfHashes, - "test"); - - assertNotNull(result); - } - - @Test(expected = NullPointerException.class) - public void getStartNodesAndModVersionIdsNullTest2() throws AAIException { - List> startNodeFilterArrayOfHashes = new ArrayList>(); - - Map result = null; - result = processor.getStartNodesAndModVersionIds("test", "test", - "", "test", "", - "", startNodeFilterArrayOfHashes, - "test"); - assertNotNull(result); - } - - - @Test(expected = NullPointerException.class) - public void getStartNodesAndModVersionIdsNullTest3() throws AAIException { - List> startNodeFilterArrayOfHashes = new ArrayList>(); - - Map result = null; - result = processor.getStartNodesAndModVersionIds("test", "test", - "", "", "test", - "", startNodeFilterArrayOfHashes, - "test"); - assertNotNull(result); - } - - @Test(expected = NullPointerException.class) - public void getModelVerTopWidgetTypeTest() throws AAIException { - Vertex vertex = new EmptyVertex(); - //Mockito.when(mockProcessor.getModelVerTopWidgetType(Mockito.any(Vertex.class), Mockito.any(String.class))).thenReturn("Sucess"); - String result = processor.getModelVerTopWidgetType(vertex, "test"); - assertEquals("result has -local tacked on the end as it should", "Sucess", result - ); - - } - - @Test(expected = NullPointerException.class) - public void getModelVerTopWidgetType() throws AAIException { - /*Mockito.when(mockProcessor.getModelVerTopWidgetType(Mockito.any(String.class), - Mockito.any(String.class), Mockito.any(String.class), - Mockito.any(String.class), Mockito.any(String.class)) - ).thenReturn("Sucess");*/ - String result = processor.getModelVerTopWidgetType("test", "test", "test", "Test", "test"); - assertEquals("result has -local tacked on the end as it should", "Sucess", result - ); - - } - - @Test(expected = AAIException.class) - public void queryByModel() throws AAIException { - /*Mockito.when(mockProcessor.getModelVerTopWidgetType(Mockito.any(String.class), - Mockito.any(String.class), Mockito.any(String.class), - Mockito.any(String.class), Mockito.any(String.class)) - ).thenReturn("Sucess");*/ - List result = processor.queryByModel("test", "test", - "test", "test", "test", - "generic-vnf", null, - "test"); - assertEquals("result has -local tacked on the end as it should", 0, result.size()); - - - } - - - @Test(expected = NullPointerException.class) - public void queryByModel_Timed() throws AAIException { - List> startNodeFilterArrayOfHashes = new ArrayList>(); - Map map = new HashMap(); - map.put("test", new Object()); - startNodeFilterArrayOfHashes.add(map); - List result = processor.queryByModel_Timed("test", "test", - "test", "test", "test", - "test", startNodeFilterArrayOfHashes, - "test"); - assertEquals("result has -local tacked on the end as it should", 0, result.size()); - - - } - - @Mock - Map startNodeFilterHash; - - @Test(expected = NullPointerException.class) - public void runDeleteByModel() throws AAIException { - Map resultMock = new HashMap(); - - // when(mockProcessor.getNodeUsingUniqueId(any(String.class),any(String.class),any(String.class),any(String.class),any(String.class))).thenReturn(vertex); - when(mockProcessor.runDeleteByModel(any(String.class), - any(String.class), any(String.class), - any(String.class), anyMapOf(String.class, Object.class), any(String.class), any(String.class)) - ).thenReturn(resultMock); - Map result = processor.runDeleteByModel("test", "test", - "test", "test", startNodeFilterHash, - "test", - "test"); - assertEquals("result has -local tacked on the end as it should", result.size(), resultMock.size()); - - - } - - Optional vertext = Optional.empty(); - - @Test(expected = AAIException.class) - public void runDeleteByModelWithNullParams() throws AAIException { - Map resultMock = new HashMap(); - - - Map result = processor.runDeleteByModel("test", "test", - null, null, null, - "test", - "test"); - - assertNotNull(result); - - } - - @Test(expected = NullPointerException.class) - public void runDeleteByModelWithNullParams1() throws AAIException { - - Map result1 = processor.runDeleteByModel("test", "test", - null, "unknown", null, - "test", - "test"); - assertNotNull(result1); - - } - - - @Test(expected = NullPointerException.class) - public void runDeleteByModelWithNullParams2() throws AAIException { - - Map result1 = processor.runDeleteByModel("test", "test", - null, "unknown", null, - "test", - "test"); - assertNotNull(result1); - - } - - @Test(expected = AAIException.class) - public void queryByNamedQuery() throws AAIException{ - String transId="test"; - String fromAppId="test"; - String namedQueryUuid="test"; - ArrayList > startNodeFilterArrayOfHashes=new ArrayList>(); - String apiVer="test"; - List result=processor.queryByNamedQuery(transId,fromAppId,namedQueryUuid,startNodeFilterArrayOfHashes,apiVer); - assertNotNull(result); - } - - @Test(expected = AAIException.class) - public void queryByNamedQuery1() throws AAIException{ - String transId="teet"; - String fromAppId="test"; - String namedQueryUuid="test"; - String secondaryFilterCutPoint="test"; - List > startNodeFilterArrayOfHashes=new ArrayList>(); - String apiVer="test"; - Map secondaryFilterHash=new HashMap(); - List result=processor.queryByNamedQuery(transId,fromAppId,namedQueryUuid,startNodeFilterArrayOfHashes,apiVer,secondaryFilterCutPoint,secondaryFilterHash); - assertNotNull(result); - } - - @Test - public void deleteAsNeededFromResultSet() throws AAIException { - Vertex vert = new BaseVertexLabel("Test"); - Map resultMock = new HashMap(); - ResultSet resultSet = new ResultSet(); - resultSet.setVert(null); - - Map result = processor.deleteAsNeededFromResultSet("test", "test", - resultSet, "test", "test", - "test", - resultMock); - - assertEquals(result.size(), 0); - - resultSet.setVert(vert); - - Map result1 = processor.deleteAsNeededFromResultSet("test", "test", - resultSet, "test", "test", - "test", - resultMock); - - assertEquals(result.size(), 0); - - - } - - @Test(expected = NullPointerException.class) - public void pruneResultSetTest() throws AAIException { - ResultSet rs = new ResultSet(); - Vertex v = new BaseVertexLabel(AAIProperties.NODE_TYPE); - rs.setVert(v); - List rsList = new ArrayList(); - ResultSet rs1 = new ResultSet(); - rsList.add(rs1); - rs.setSubResultSet(rsList); - Map map = new HashMap(); - map.put("test", new Object()); - ResultSet resultSet = processor.pruneResultSet(rs, "testr", map); - assertNotNull(resultSet); - - } - - @Test(expected = NullPointerException.class) - public void satisfiesFiltersTest() throws AAIException { - ResultSet rs = new ResultSet(); - Vertex v = new BaseVertexLabel(AAIProperties.NODE_TYPE); - rs.setVert(v); - rs.getVert().property(AAIProperties.NODE_TYPE); - List rsList = new ArrayList(); - ResultSet rs1 = new ResultSet(); - rsList.add(rs1); - rs.setSubResultSet(rsList); - Map map = new HashMap(); - - map.put("modern.vertex-id", new Object()); - - boolean result = processor.satisfiesFilters(rs, map); - assertEquals(result, true); - } - - @Test - public void satisfiesFiltersTest1() throws AAIException { - ResultSet rs = new ResultSet(); - Vertex v = new BaseVertexLabel(AAIProperties.NODE_TYPE); - rs.setVert(v); - List rsList = new ArrayList(); - ResultSet rs1 = new ResultSet(); - rsList.add(rs1); - rs.setSubResultSet(rsList); - Map map = new HashMap(); - //map.put("test.filter",new Object()); - - boolean result = processor.satisfiesFilters(rs, map); - assertEquals(result, false); - } - - @Test(expected = AAIException.class) - public void satisfiesFiltersTest2() throws AAIException { - ResultSet rs = new ResultSet(); - Vertex v = new BaseVertexLabel(AAIProperties.NODE_TYPE); - rs.setVert(v); - List rsList = new ArrayList(); - ResultSet rs1 = new ResultSet(); - rsList.add(rs1); - rs.setSubResultSet(rsList); - Map map = new HashMap(); - map.put("testfilter", new Object()); - - boolean result = processor.satisfiesFilters(rs, map); - assertEquals(result, false); - } - - @Test - public void collapseForDoNotOutputTest() throws AAIException { - ResultSet rs = new ResultSet(); - rs.setDoNotOutputFlag("true"); - List rsList = new ArrayList(); - ResultSet rs1 = new ResultSet(); - rsList.add(rs1); - rs.setSubResultSet(rsList); - List result = processor.collapseForDoNotOutput(rs); - assertEquals(result.size(), 1); - } - - @Test(expected = NullPointerException.class) - public void collectInstanceDataTest() throws AAIException { - - BaseVertexLabel bs = new BaseVertexLabel("test"); - //bs.setId(80); - EmptyVertex ev = new EmptyVertex(); - //ev.setId(50l); - Vertex thisLevelElemVtx = ev; - - - Multimap thisMap = ArrayListMultimap.create(); - List vidsTraversed = new ArrayList(); - // only applies when collecting data using the default model for delete - Multimap validNextStepMap = ArrayListMultimap.create(); - Map namedQueryElementHash = new HashMap(); - namedQueryElementHash.put("test", "test"); - Map delKeyHash = new HashMap(); - - ResultSet rs = processor.collectInstanceData("test", "test", thisLevelElemVtx, "test", validNextStepMap, vidsTraversed, 1, delKeyHash, namedQueryElementHash, "test"); - } - - @Test(expected = NullPointerException.class) - public void genTopoMap4ModelVerTest() throws - AAIException { - Vertex vertext = new EmptyVertex(); - Multimap map = processor.genTopoMap4ModelVer("test", "test", vertext, "test"); - assertNotEquals(map, null); - } - - @Test(expected = AAIException.class) - public void genTopoMap4ModelVerTestNull() throws - AAIException { - Vertex vertext = null; - Multimap map = processor.genTopoMap4ModelVer("test", "test", vertext, "test"); - assertNotEquals(map, null); - } - - @Test - public void makeSureItsAnArrayListTest() { - String input = "model-versionId,modelTestID,modelTestid2;"; - List result = processor.makeSureItsAnArrayList(input); - assertTrue(result.size() > 0); - } - - @Test(expected = AAIException.class) - public void getModConstraintHashTest() throws AAIException { - Vertex modelElementVtx = new EmptyVertex(); - //modelElementVtx.property(AAIProperties.NODE_TYPE,"Model"); - Vertex modelElementVtx1 = new EmptyVertex(); - Map currentHash = new HashMap(); - currentHash.put("constraint", modelElementVtx1); - Map result = processor.getModConstraintHash(modelElementVtx, currentHash); - assertTrue(result.size() > 0); - } - - @Test(expected = AAIException.class) - public void getModConstraintHashTestNull() throws AAIException { - Vertex modelElementVtx = null; - //modelElementVtx.property(AAIProperties.NODE_TYPE,"Model"); - Vertex modelElementVtx1 =null; - Map currentHash = new HashMap(); - currentHash.put("constraint", modelElementVtx1); - Map result = processor.getModConstraintHash(modelElementVtx, currentHash); - assertTrue(result.size() > 0); - } - - @Test(expected = NullPointerException.class) - public void getTopElementForSvcOrResModelVerTest() throws AAIException { - Vertex modelElementVtx = new EmptyVertex(); - //modelElementVtx.property(AAIProperties.NODE_TYPE,"Model"); - Vertex modelElementVtx1 = new EmptyVertex(); - Map currentHash = new HashMap(); - currentHash.put("constraint", modelElementVtx1); - Vertex result = processor.getTopElementForSvcOrResModelVer(modelElementVtx, "test"); - assertNotEquals(result, null); - } - - @Test - public void getNamedQueryPropOverRideTest() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - Vertex namedQueryElementVertex = new EmptyVertex(); - Vertex instanceVertex = new EmptyVertex(); - String apiVer = "test"; - - namedQueryElementVertex.properties("property-collect-list", ""); - - Map result = processor.getNamedQueryPropOverRide(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); - assertNotEquals(result, null); - } - - @Test(expected = NullPointerException.class) - public void getNamedQueryPropOverRideTestNull() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - Vertex namedQueryElementVertex = null; - Vertex instanceVertex = new EmptyVertex(); - String apiVer = "test"; - - namedQueryElementVertex.properties("property-collect-list", ""); - - Map result = processor.getNamedQueryPropOverRide(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); - assertNotEquals(result, null); - } - - @Test(expected = NullPointerException.class) - public void namedQueryConstraintSaysStopTest() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - Vertex namedQueryElementVertex = new EmptyVertex(); - Vertex instanceVertex = new EmptyVertex(); - String apiVer = "test"; - - namedQueryElementVertex.properties("property-collect-list", ""); - - boolean result = processor.namedQueryConstraintSaysStop(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); - assertTrue(result); - } - - @Test(expected = NullPointerException.class) - public void namedQueryConstraintSaysStopTestNull() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - Vertex namedQueryElementVertex = null; - Vertex instanceVertex = new EmptyVertex(); - String apiVer = "test"; - - namedQueryElementVertex.properties("property-collect-list", ""); - - boolean result = processor.namedQueryConstraintSaysStop(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); - assertTrue(result); - } - - @Test(expected = AAIException.class) - public void namedQuerynamedQueryElementVertexNullTest() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - Vertex namedQueryElementVertex = null; - Vertex instanceVertex = null; - String apiVer = "test"; - - - boolean result = processor.namedQueryConstraintSaysStop(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); - assertTrue(result); - } - - @Test(expected = NullPointerException.class) - - public void getNamedQueryExtraDataLookupTest() throws Exception { - - String transId = "test"; - String fromAppId = "test"; - Vertex namedQueryElementVertex = new EmptyVertex(); - Vertex instanceVertex = new EmptyVertex(); - String apiVer = "test"; - - namedQueryElementVertex.properties("property-collect-list", ""); - - Map result = processor.getNamedQueryExtraDataLookup(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); - - assertTrue(result.size() > 0); - } - - @Test(expected = NullPointerException.class) - public void collectNQElementHash() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - Map currentHash = new HashMap(); - ArrayList vidsTraversed = new ArrayList(); - int levelCounter = 1; - - Map result = processor.collectNQElementHash(transId, fromAppId, - thisLevelElemVtx, incomingTrail, currentHash, - vidsTraversed, levelCounter); - - assertNotEquals(result, null); - } - - @Test(expected = NullPointerException.class) - public void collectDeleteKeyHash() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - Map currentHash = new HashMap(); - ArrayList vidsTraversed = new ArrayList(); - int levelCounter = 1; - Map modConstraintHash = new HashMap(); - String overRideModelId = "test"; - String overRideModelVersionId = "test"; - - Map result = processor.collectDeleteKeyHash(transId, fromAppId, - thisLevelElemVtx, incomingTrail, currentHash, - vidsTraversed, levelCounter, modConstraintHash, overRideModelId, overRideModelVersionId); - - assertNotEquals(result, null); - } - - @Test - public void getLinkageConnectNodeTypesTest() throws AAIException { - List linkagePtList = new ArrayList(); - linkagePtList.add("modern\\|testdata\\|"); - Set result = processor.getLinkageConnectNodeTypes(linkagePtList); - assertNotEquals(result, null); - - } - - @Test(expected = AAIException.class) - public void getLinkageConnectNodeTypesTest1() throws AAIException { - - Set result1 = processor.getLinkageConnectNodeTypes(null); - assertNotEquals(result1, null); - - List linkagePtList = new ArrayList(); - linkagePtList.add("moderntestdata"); - Set result = processor.getLinkageConnectNodeTypes(linkagePtList); - assertNotEquals(result, null); - } - - @Test(expected = NullPointerException.class) - public void collectTopology4ModelVerTest() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - Multimap thisMap = ArrayListMultimap.create(); - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - Map currentHash = new HashMap(); - List vidsTraversed = new ArrayList(); - int levelCounter = 1; - - Multimap result = processor.collectTopology4ModelVer(transId, fromAppId, - thisLevelElemVtx, incomingTrail, thisMap, vidsTraversed, levelCounter, currentHash - , "test", "test"); - - assertNotEquals(result, null); - } - - @Test(expected = AAIException.class) - public void check4EdgeRuleTest() throws AAIException { - processor.check4EdgeRule("test", "test"); - } - - @Test(expected = AAIException.class) - public void collectTopology4LinkagePointTest() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - String linkagePointStrVal = "test"; - String incomingTrail = "test"; - Multimap currentMap = ArrayListMultimap.create(); - - Multimap result = processor.collectTopology4LinkagePoint(transId, fromAppId, linkagePointStrVal, incomingTrail, currentMap); - assertNotEquals(result, null); - - } - - @Test(expected = AAIException.class) - public void getNextStepElementsFromSet() throws AAIException { - Vertex constrElemSetVtx = new EmptyVertex(); - constrElemSetVtx.property(AAIProperties.NODE_TYPE); - Map result = processor.getNextStepElementsFromSet(constrElemSetVtx); - assertNotEquals(result, null); - } - - @Test(expected = NullPointerException.class) - public void genTopoMap4NamedQTest() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - Vertex queryVertex = new EmptyVertex(); - String namedQueryUuid = "E44533334343"; - Multimap result = processor.genTopoMap4NamedQ(transId, fromAppId, queryVertex, namedQueryUuid); - assertNotEquals(result, null); - } - - @Test(expected = NullPointerException.class) - public void collectTopology4NamedQTest() throws AAIException { - String transId = "test"; - String fromAppId = "test"; - Multimap thisMap = ArrayListMultimap.create(); - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - Map currentHash = new HashMap(); - List vidsTraversed = new ArrayList(); - int levelCounter = 1; - - Multimap result = processor.collectTopology4NamedQ(transId, fromAppId, - thisLevelElemVtx, incomingTrail, thisMap, vidsTraversed, levelCounter); - assertNotEquals(result, null); - } - - @Test(expected = NullPointerException.class) - public void getModelThatNqElementRepresentsTest() throws AAIException { - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - Vertex vertex = processor.getModelThatNqElementRepresents(thisLevelElemVtx, incomingTrail); - assertNotEquals(vertex, null); - } - - @Test(expected = NullPointerException.class) - public void getModelGivenModelVer() throws AAIException { - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - Vertex vertex = processor.getModelGivenModelVer(thisLevelElemVtx, incomingTrail); - assertNotEquals(vertex, null); - } - - @Test(expected = AAIException.class) - public void getModelTypeFromModel() throws AAIException { - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - String vertex = processor.getModelTypeFromModel(thisLevelElemVtx, incomingTrail); - assertNotEquals(vertex, null); - } - - @Test(expected = NullPointerException.class) - public void getModelTypeFromModelVer() throws AAIException { - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - String vertex = processor.getModelTypeFromModelVer(thisLevelElemVtx, incomingTrail); - assertNotEquals(vertex, null); - } - - @Test(expected = NullPointerException.class) - public void getModelElementStepName() throws AAIException { - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - String vertex = processor.getModelElementStepName(thisLevelElemVtx, incomingTrail); - assertNotEquals(vertex, null); - } - - @Test(expected = AAIException.class) - public void nodeTypeSupportsPersona() throws AAIException { - String incomingTrail = ""; - boolean vertex = processor.nodeTypeSupportsPersona(incomingTrail); - assertFalse(vertex); - - - incomingTrail = "test"; - boolean vertex1 = processor.nodeTypeSupportsPersona(incomingTrail); - assertTrue(vertex1); - } - - @Test(expected = NullPointerException.class) - public void getNqElementWidgetType() throws AAIException{ - String appId="test"; - String transID="test"; - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - String vertex1 = processor.getNqElementWidgetType(appId,transID,thisLevelElemVtx,incomingTrail); - assertNotEquals(vertex1,null); - } - - - @Test(expected = NullPointerException.class) - public void getModElementWidgetType() throws AAIException{ - String appId="test"; - String transID="test"; - Vertex thisLevelElemVtx = new EmptyVertex(); - String incomingTrail = "test"; - String vertex1 = processor.getModElementWidgetType(thisLevelElemVtx,incomingTrail); - assertNotEquals(vertex1,null); - } - - @Test(expected = NullPointerException.class) - public void getNodeUsingUniqueId() throws AAIException{ - String appId="test"; - String transID="test"; - String nodeType = "generic-vnf"; - String idPropertyName = "test"; - String uniqueIdVal="test"; - Vertex vertex1 = processor.getNodeUsingUniqueId(transID,appId,nodeType,idPropertyName,uniqueIdVal); - assertNotEquals(vertex1,null); - } - - - @Test(expected = AAIException.class) - public void getNodeUsingUniqueIdNull() throws AAIException{ - String appId="test"; - String transID="test"; - String nodeType = "generic-vnf"; - String idPropertyName = "test"; - String uniqueIdVal=""; - Vertex vertex1 = null; - vertex1= processor.getNodeUsingUniqueId(transID,appId,nodeType,idPropertyName,uniqueIdVal); - assertNotEquals(vertex1,null); - - } - - - @Test(expected = AAIException.class) - public void getNodeUsingUniqueIdNull1() throws AAIException{ - String appId="test"; - String transID="test"; - String nodeType = "generic-vnf"; - String idPropertyName=""; - String uniqueIdVal="test"; - Vertex vertex1 = null; - vertex1= processor.getNodeUsingUniqueId(transID,appId,nodeType,idPropertyName,uniqueIdVal); - assertNotEquals(vertex1,null); - - - } - - - @Test(expected = AAIException.class) - public void getNodeUsingUniqueIdNull2() throws AAIException{ - String appId="test"; - String transID="test"; - String nodeType = ""; - String idPropertyName="test"; - String uniqueIdVal="test"; - Vertex vertex1 = null; - vertex1= processor.getNodeUsingUniqueId(transID,appId,nodeType,idPropertyName,uniqueIdVal); - assertNotEquals(vertex1,null); - - - } - - @Test(expected = NullPointerException.class) - public void getModelVersUsingName() throws AAIException{ - String appId="test"; - String transID="test"; - String modelName = "test"; - - List result= processor.getModelVersUsingName(transID,appId,modelName); - assertNotEquals(result,null); - } - - - @Test(expected = AAIException.class) - public void getModelVersUsingNameNull() throws AAIException{ - String appId="test"; - String transID="test"; - String modelName = ""; - - List result= processor.getModelVersUsingName(transID,appId,modelName); - assertNotEquals(result,null); - } - - - @Test(expected = NullPointerException.class) - public void getModVersUsingModelInvId() throws AAIException{ - String appId="test"; - String transID="test"; - String modelName = "test"; - - Iterator result= processor.getModVersUsingModelInvId(transID,appId,modelName); - assertNotEquals(result,null); - } - - @Test(expected = AAIException.class) - public void getModVersUsingModelInvIdNull() throws AAIException{ - String appId="test"; - String transID="test"; - String modelName = ""; - - Iterator result= processor.getModVersUsingModelInvId(transID,appId,modelName); - assertNotEquals(result,null); - } - - @Test(expected = NullPointerException.class) - public void getModVersUsingModel() throws AAIException{ - String appId="test"; - String transID="test"; - String modelName = "test"; - Vertex thisLevelElemVtx = new EmptyVertex(); - List result= processor.getModVersUsingModel(transID,appId,thisLevelElemVtx); - assertNotEquals(result,null); - } - - @Test(expected = AAIException.class) - public void getModVersUsingModel1() throws AAIException{ - String appId="test"; - String transID="test"; - - Vertex thisLevelElemVtx = null; - List result= processor.getModVersUsingModel(transID,appId,thisLevelElemVtx); - assertNotEquals(result,null); - } - - @Test(expected = NullPointerException.class) - public void getModelVerIdsUsingName() throws AAIException{ - String appId="test"; - String transID="test"; - - String modelName= "test"; - List result= processor.getModelVerIdsUsingName(transID,appId,modelName); - assertNotEquals(result,null); - } - - @Test(expected = AAIException.class) - public void getModelVerIdsUsingName1() throws AAIException{ - String appId="test"; - String transID="test"; - - String modelName= ""; - List result= processor.getModelVerIdsUsingName(transID,appId,modelName); - assertNotEquals(result,null); - } - - @Test(expected =NullPointerException.class) - public void validateModel() throws AAIException{ - String appId="test"; - String transID="test"; - - String modelVersionId= "test"; - String modelInvId= "test"; - String modelName= "test"; - processor.validateModel(transID,appId,modelName,modelVersionId); - - - } - - - -} - +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.dbgraphgen; + +import static org.junit.Assert.*; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyMap; +import static org.mockito.Matchers.anyMapOf; +import static org.mockito.Mockito.*; + +import com.bazaarvoice.jolt.modifier.DataType; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.LinkedListMultimap; +import com.google.common.collect.Multimap; +import com.thinkaurelius.titan.graphdb.olap.computer.VertexMapJob; +import com.thinkaurelius.titan.graphdb.types.VertexLabelVertex; +import com.thinkaurelius.titan.graphdb.types.system.BaseVertexLabel; +import com.thinkaurelius.titan.graphdb.types.system.EmptyVertex; +import com.thinkaurelius.titan.graphdb.types.vertices.EdgeLabelVertex; +import com.thinkaurelius.titan.graphdb.types.vertices.PropertyKeyVertex; +import org.apache.commons.lang.ObjectUtils; +import org.apache.openjpa.kernel.exps.Exp; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.T; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.VertexProperty; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.*; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aai.db.DbMethHelper; +import org.onap.aai.db.props.AAIProperties; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.serialization.db.DBSerializer; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; + +import javax.inject.Inject; +import java.util.*; +@RunWith(MockitoJUnitRunner.class) +public class ModelBasedProcessingInvalidDataTest { + + @Mock + private static TransactionalGraphEngine dbEngine; + private static Loader loader; + @Mock + private static DBSerializer serializer; + ModelBasedProcessing processor; + + @Mock + private ModelBasedProcessing mockProcessor; + + + @Mock + private DbMethHelper dbMethHelper; + + @BeforeClass + public static void configure() throws Exception { + System.setProperty("AJSC_HOME", "."); + System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); + + + } + + @Before + public void init() { + MockitoAnnotations.initMocks(this); + processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + dbMethHelper = new DbMethHelper(loader, dbEngine); + + } + + @Test + public void getStartNodesAndModVersionIdsTest() throws AAIException { + + + List> startNodeFilterArrayOfHashes = new ArrayList>(); + Map map = new HashMap(); + map.put("test", new Object()); + startNodeFilterArrayOfHashes.add(map); + Map result=new HashMap<>(); + + Map result1 = mockProcessor.getStartNodesAndModVersionIds("test", "test", + "test", "test", "test", + "test", startNodeFilterArrayOfHashes, + "test"); + assertNotNull(result); + + } + + + @Test(expected = NullPointerException.class) + public void getStartNodesAndModVersionIdsTest2() throws AAIException { + List> startNodeFilterArrayOfHashes = new ArrayList>(); + Map map = new HashMap(); + map.put("test", new Object()); + startNodeFilterArrayOfHashes.add(map); + Map result1 = processor.getStartNodesAndModVersionIds("test", "test", + "", "test", "test", + "test", startNodeFilterArrayOfHashes, + "test"); + assertNotNull(result1); + } + + + @Test(expected = NullPointerException.class) + public void getStartNodesAndModVersionIdsTest3() throws AAIException { + List> startNodeFilterArrayOfHashes = new ArrayList>(); + Map map = new HashMap(); + map.put("test", new Object()); + startNodeFilterArrayOfHashes.add(map); + Map result1 = processor.getStartNodesAndModVersionIds("test", "test", + "", "", "test", + "test", startNodeFilterArrayOfHashes, + "test"); + assertNotNull(result1); + } + + + @Test(expected = AAIException.class) + public void getStartNodesAndModVersionIdsTest4() throws AAIException { + List> startNodeFilterArrayOfHashes = new ArrayList>(); + Map map = new HashMap(); + map.put("test", new Object()); + startNodeFilterArrayOfHashes.add(map); + Map result1 = processor.getStartNodesAndModVersionIds("test", "test", + "", "", "", + "test", startNodeFilterArrayOfHashes, + "test"); + assertNotNull(result1); + } + + + @Test(expected = AAIException.class) + public void getStartNodesAndModVersionIdsTest5() throws AAIException { + List> startNodeFilterArrayOfHashes = new ArrayList>(); + Map map = new HashMap(); + map.put("test", new Object()); + startNodeFilterArrayOfHashes.add(map); + Map result1 = processor.getStartNodesAndModVersionIds("test", "test", + "", "", "", + "", startNodeFilterArrayOfHashes, + "test"); + assertNotNull(result1); + } + + + @Test(expected = AAIException.class) + public void getStartNodesAndModVersionIdsNullTest() throws AAIException { + List> startNodeFilterArrayOfHashes = new ArrayList>(); + + Map result = null; + result = processor.getStartNodesAndModVersionIds("test", "test", + "", "", "", + "", startNodeFilterArrayOfHashes, + "test"); + + assertNotNull(result); + } + + + @Test(expected = NullPointerException.class) + public void getStartNodesAndModVersionIdsNullTest1() throws AAIException { + List> startNodeFilterArrayOfHashes = new ArrayList>(); + + Map result = null; + result = processor.getStartNodesAndModVersionIds("test", "test", + "Test", "", "", + "", startNodeFilterArrayOfHashes, + "test"); + + assertNotNull(result); + } + + @Test(expected = NullPointerException.class) + public void getStartNodesAndModVersionIdsNullTest2() throws AAIException { + List> startNodeFilterArrayOfHashes = new ArrayList>(); + + Map result = null; + result = processor.getStartNodesAndModVersionIds("test", "test", + "", "test", "", + "", startNodeFilterArrayOfHashes, + "test"); + assertNotNull(result); + } + + + @Test(expected = NullPointerException.class) + public void getStartNodesAndModVersionIdsNullTest3() throws AAIException { + List> startNodeFilterArrayOfHashes = new ArrayList>(); + + Map result = null; + result = processor.getStartNodesAndModVersionIds("test", "test", + "", "", "test", + "", startNodeFilterArrayOfHashes, + "test"); + assertNotNull(result); + } + + @Test(expected = NullPointerException.class) + public void getModelVerTopWidgetTypeTest() throws AAIException { + Vertex vertex = new EmptyVertex(); + //Mockito.when(mockProcessor.getModelVerTopWidgetType(Mockito.any(Vertex.class), Mockito.any(String.class))).thenReturn("Sucess"); + String result = processor.getModelVerTopWidgetType(vertex, "test"); + assertEquals("result has -local tacked on the end as it should", "Sucess", result + ); + + } + + @Test(expected = NullPointerException.class) + public void getModelVerTopWidgetType() throws AAIException { + /*Mockito.when(mockProcessor.getModelVerTopWidgetType(Mockito.any(String.class), + Mockito.any(String.class), Mockito.any(String.class), + Mockito.any(String.class), Mockito.any(String.class)) + ).thenReturn("Sucess");*/ + String result = processor.getModelVerTopWidgetType("test", "test", "test", "Test", "test"); + assertEquals("result has -local tacked on the end as it should", "Sucess", result + ); + + } + + @Test(expected = AAIException.class) + public void queryByModel() throws AAIException { + /*Mockito.when(mockProcessor.getModelVerTopWidgetType(Mockito.any(String.class), + Mockito.any(String.class), Mockito.any(String.class), + Mockito.any(String.class), Mockito.any(String.class)) + ).thenReturn("Sucess");*/ + List result = processor.queryByModel("test", "test", + "test", "test", "test", + "generic-vnf", null, + "test"); + assertEquals("result has -local tacked on the end as it should", 0, result.size()); + + + } + + + @Test(expected = NullPointerException.class) + public void queryByModel_Timed() throws AAIException { + List> startNodeFilterArrayOfHashes = new ArrayList>(); + Map map = new HashMap(); + map.put("test", new Object()); + startNodeFilterArrayOfHashes.add(map); + List result = processor.queryByModel_Timed("test", "test", + "test", "test", "test", + "test", startNodeFilterArrayOfHashes, + "test"); + assertEquals("result has -local tacked on the end as it should", 0, result.size()); + + + } + + @Mock + Map startNodeFilterHash; + + @Test(expected = NullPointerException.class) + public void runDeleteByModel() throws AAIException { + Map resultMock = new HashMap(); + + // when(mockProcessor.getNodeUsingUniqueId(any(String.class),any(String.class),any(String.class),any(String.class),any(String.class))).thenReturn(vertex); + when(mockProcessor.runDeleteByModel(any(String.class), + any(String.class), any(String.class), + any(String.class), anyMapOf(String.class, Object.class), any(String.class), any(String.class)) + ).thenReturn(resultMock); + Map result = processor.runDeleteByModel("test", "test", + "test", "test", startNodeFilterHash, + "test", + "test"); + assertEquals("result has -local tacked on the end as it should", result.size(), resultMock.size()); + + + } + + Optional vertext = Optional.empty(); + + @Test(expected = AAIException.class) + public void runDeleteByModelWithNullParams() throws AAIException { + Map resultMock = new HashMap(); + + + Map result = processor.runDeleteByModel("test", "test", + null, null, null, + "test", + "test"); + + assertNotNull(result); + + } + + @Test(expected = NullPointerException.class) + public void runDeleteByModelWithNullParams1() throws AAIException { + + Map result1 = processor.runDeleteByModel("test", "test", + null, "unknown", null, + "test", + "test"); + assertNotNull(result1); + + } + + + @Test(expected = NullPointerException.class) + public void runDeleteByModelWithNullParams2() throws AAIException { + + Map result1 = processor.runDeleteByModel("test", "test", + null, "unknown", null, + "test", + "test"); + assertNotNull(result1); + + } + + @Test(expected = AAIException.class) + public void queryByNamedQuery() throws AAIException{ + String transId="test"; + String fromAppId="test"; + String namedQueryUuid="test"; + ArrayList > startNodeFilterArrayOfHashes=new ArrayList>(); + String apiVer="test"; + List result=processor.queryByNamedQuery(transId,fromAppId,namedQueryUuid,startNodeFilterArrayOfHashes,apiVer); + assertNotNull(result); + } + + @Test(expected = AAIException.class) + public void queryByNamedQuery1() throws AAIException{ + String transId="teet"; + String fromAppId="test"; + String namedQueryUuid="test"; + String secondaryFilterCutPoint="test"; + List > startNodeFilterArrayOfHashes=new ArrayList>(); + String apiVer="test"; + Map secondaryFilterHash=new HashMap(); + List result=processor.queryByNamedQuery(transId,fromAppId,namedQueryUuid,startNodeFilterArrayOfHashes,apiVer,secondaryFilterCutPoint,secondaryFilterHash); + assertNotNull(result); + } + + @Test + public void deleteAsNeededFromResultSet() throws AAIException { + Vertex vert = new BaseVertexLabel("Test"); + Map resultMock = new HashMap(); + ResultSet resultSet = new ResultSet(); + resultSet.setVert(null); + + Map result = processor.deleteAsNeededFromResultSet("test", "test", + resultSet, "test", "test", + "test", + resultMock); + + assertEquals(result.size(), 0); + + resultSet.setVert(vert); + + Map result1 = processor.deleteAsNeededFromResultSet("test", "test", + resultSet, "test", "test", + "test", + resultMock); + + assertEquals(result.size(), 0); + + + } + + @Test(expected = NullPointerException.class) + public void pruneResultSetTest() throws AAIException { + ResultSet rs = new ResultSet(); + Vertex v = new BaseVertexLabel(AAIProperties.NODE_TYPE); + rs.setVert(v); + List rsList = new ArrayList(); + ResultSet rs1 = new ResultSet(); + rsList.add(rs1); + rs.setSubResultSet(rsList); + Map map = new HashMap(); + map.put("test", new Object()); + ResultSet resultSet = processor.pruneResultSet(rs, "testr", map); + assertNotNull(resultSet); + + } + + @Test(expected = NullPointerException.class) + public void satisfiesFiltersTest() throws AAIException { + ResultSet rs = new ResultSet(); + Vertex v = new BaseVertexLabel(AAIProperties.NODE_TYPE); + rs.setVert(v); + rs.getVert().property(AAIProperties.NODE_TYPE); + List rsList = new ArrayList(); + ResultSet rs1 = new ResultSet(); + rsList.add(rs1); + rs.setSubResultSet(rsList); + Map map = new HashMap(); + + map.put("modern.vertex-id", new Object()); + + boolean result = processor.satisfiesFilters(rs, map); + assertEquals(result, true); + } + + @Test + public void satisfiesFiltersTest1() throws AAIException { + ResultSet rs = new ResultSet(); + Vertex v = new BaseVertexLabel(AAIProperties.NODE_TYPE); + rs.setVert(v); + List rsList = new ArrayList(); + ResultSet rs1 = new ResultSet(); + rsList.add(rs1); + rs.setSubResultSet(rsList); + Map map = new HashMap(); + //map.put("test.filter",new Object()); + + boolean result = processor.satisfiesFilters(rs, map); + assertEquals(result, false); + } + + @Test(expected = AAIException.class) + public void satisfiesFiltersTest2() throws AAIException { + ResultSet rs = new ResultSet(); + Vertex v = new BaseVertexLabel(AAIProperties.NODE_TYPE); + rs.setVert(v); + List rsList = new ArrayList(); + ResultSet rs1 = new ResultSet(); + rsList.add(rs1); + rs.setSubResultSet(rsList); + Map map = new HashMap(); + map.put("testfilter", new Object()); + + boolean result = processor.satisfiesFilters(rs, map); + assertEquals(result, false); + } + + @Test + public void collapseForDoNotOutputTest() throws AAIException { + ResultSet rs = new ResultSet(); + rs.setDoNotOutputFlag("true"); + List rsList = new ArrayList(); + ResultSet rs1 = new ResultSet(); + rsList.add(rs1); + rs.setSubResultSet(rsList); + List result = processor.collapseForDoNotOutput(rs); + assertEquals(result.size(), 1); + } + + @Test(expected = NullPointerException.class) + public void collectInstanceDataTest() throws AAIException { + + BaseVertexLabel bs = new BaseVertexLabel("test"); + //bs.setId(80); + EmptyVertex ev = new EmptyVertex(); + //ev.setId(50l); + Vertex thisLevelElemVtx = ev; + + + Multimap thisMap = ArrayListMultimap.create(); + List vidsTraversed = new ArrayList(); + // only applies when collecting data using the default model for delete + Multimap validNextStepMap = ArrayListMultimap.create(); + Map namedQueryElementHash = new HashMap(); + namedQueryElementHash.put("test", "test"); + Map delKeyHash = new HashMap(); + + ResultSet rs = processor.collectInstanceData("test", "test", thisLevelElemVtx, "test", validNextStepMap, vidsTraversed, 1, delKeyHash, namedQueryElementHash, "test"); + } + + @Test(expected = NullPointerException.class) + public void genTopoMap4ModelVerTest() throws + AAIException { + Vertex vertext = new EmptyVertex(); + Multimap map = processor.genTopoMap4ModelVer("test", "test", vertext, "test"); + assertNotEquals(map, null); + } + + @Test(expected = AAIException.class) + public void genTopoMap4ModelVerTestNull() throws + AAIException { + Vertex vertext = null; + Multimap map = processor.genTopoMap4ModelVer("test", "test", vertext, "test"); + assertNotEquals(map, null); + } + + @Test + public void makeSureItsAnArrayListTest() { + String input = "model-versionId,modelTestID,modelTestid2;"; + List result = processor.makeSureItsAnArrayList(input); + assertTrue(result.size() > 0); + } + + @Test(expected = AAIException.class) + public void getModConstraintHashTest() throws AAIException { + Vertex modelElementVtx = new EmptyVertex(); + //modelElementVtx.property(AAIProperties.NODE_TYPE,"Model"); + Vertex modelElementVtx1 = new EmptyVertex(); + Map currentHash = new HashMap(); + currentHash.put("constraint", modelElementVtx1); + Map result = processor.getModConstraintHash(modelElementVtx, currentHash); + assertTrue(result.size() > 0); + } + + @Test(expected = AAIException.class) + public void getModConstraintHashTestNull() throws AAIException { + Vertex modelElementVtx = null; + //modelElementVtx.property(AAIProperties.NODE_TYPE,"Model"); + Vertex modelElementVtx1 =null; + Map currentHash = new HashMap(); + currentHash.put("constraint", modelElementVtx1); + Map result = processor.getModConstraintHash(modelElementVtx, currentHash); + assertTrue(result.size() > 0); + } + + @Test(expected = NullPointerException.class) + public void getTopElementForSvcOrResModelVerTest() throws AAIException { + Vertex modelElementVtx = new EmptyVertex(); + //modelElementVtx.property(AAIProperties.NODE_TYPE,"Model"); + Vertex modelElementVtx1 = new EmptyVertex(); + Map currentHash = new HashMap(); + currentHash.put("constraint", modelElementVtx1); + Vertex result = processor.getTopElementForSvcOrResModelVer(modelElementVtx, "test"); + assertNotEquals(result, null); + } + + @Test + public void getNamedQueryPropOverRideTest() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + Vertex namedQueryElementVertex = new EmptyVertex(); + Vertex instanceVertex = new EmptyVertex(); + String apiVer = "test"; + + namedQueryElementVertex.properties("property-collect-list", ""); + + Map result = processor.getNamedQueryPropOverRide(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); + assertNotEquals(result, null); + } + + @Test(expected = NullPointerException.class) + public void getNamedQueryPropOverRideTestNull() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + Vertex namedQueryElementVertex = null; + Vertex instanceVertex = new EmptyVertex(); + String apiVer = "test"; + + namedQueryElementVertex.properties("property-collect-list", ""); + + Map result = processor.getNamedQueryPropOverRide(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); + assertNotEquals(result, null); + } + + @Test(expected = NullPointerException.class) + public void namedQueryConstraintSaysStopTest() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + Vertex namedQueryElementVertex = new EmptyVertex(); + Vertex instanceVertex = new EmptyVertex(); + String apiVer = "test"; + + namedQueryElementVertex.properties("property-collect-list", ""); + + boolean result = processor.namedQueryConstraintSaysStop(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); + assertTrue(result); + } + + @Test(expected = NullPointerException.class) + public void namedQueryConstraintSaysStopTestNull() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + Vertex namedQueryElementVertex = null; + Vertex instanceVertex = new EmptyVertex(); + String apiVer = "test"; + + namedQueryElementVertex.properties("property-collect-list", ""); + + boolean result = processor.namedQueryConstraintSaysStop(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); + assertTrue(result); + } + + @Test(expected = AAIException.class) + public void namedQuerynamedQueryElementVertexNullTest() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + Vertex namedQueryElementVertex = null; + Vertex instanceVertex = null; + String apiVer = "test"; + + + boolean result = processor.namedQueryConstraintSaysStop(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); + assertTrue(result); + } + + @Test(expected = NullPointerException.class) + + public void getNamedQueryExtraDataLookupTest() throws Exception { + + String transId = "test"; + String fromAppId = "test"; + Vertex namedQueryElementVertex = new EmptyVertex(); + Vertex instanceVertex = new EmptyVertex(); + String apiVer = "test"; + + namedQueryElementVertex.properties("property-collect-list", ""); + + Map result = processor.getNamedQueryExtraDataLookup(transId, fromAppId, namedQueryElementVertex, instanceVertex, apiVer); + + assertTrue(result.size() > 0); + } + + @Test(expected = NullPointerException.class) + public void collectNQElementHash() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + Map currentHash = new HashMap(); + ArrayList vidsTraversed = new ArrayList(); + int levelCounter = 1; + + Map result = processor.collectNQElementHash(transId, fromAppId, + thisLevelElemVtx, incomingTrail, currentHash, + vidsTraversed, levelCounter); + + assertNotEquals(result, null); + } + + @Test(expected = NullPointerException.class) + public void collectDeleteKeyHash() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + Map currentHash = new HashMap(); + ArrayList vidsTraversed = new ArrayList(); + int levelCounter = 1; + Map modConstraintHash = new HashMap(); + String overRideModelId = "test"; + String overRideModelVersionId = "test"; + + Map result = processor.collectDeleteKeyHash(transId, fromAppId, + thisLevelElemVtx, incomingTrail, currentHash, + vidsTraversed, levelCounter, modConstraintHash, overRideModelId, overRideModelVersionId); + + assertNotEquals(result, null); + } + + @Test + public void getLinkageConnectNodeTypesTest() throws AAIException { + List linkagePtList = new ArrayList(); + linkagePtList.add("modern\\|testdata\\|"); + Set result = processor.getLinkageConnectNodeTypes(linkagePtList); + assertNotEquals(result, null); + + } + + @Test(expected = AAIException.class) + public void getLinkageConnectNodeTypesTest1() throws AAIException { + + Set result1 = processor.getLinkageConnectNodeTypes(null); + assertNotEquals(result1, null); + + List linkagePtList = new ArrayList(); + linkagePtList.add("moderntestdata"); + Set result = processor.getLinkageConnectNodeTypes(linkagePtList); + assertNotEquals(result, null); + } + + @Test(expected = NullPointerException.class) + public void collectTopology4ModelVerTest() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + Multimap thisMap = ArrayListMultimap.create(); + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + Map currentHash = new HashMap(); + List vidsTraversed = new ArrayList(); + int levelCounter = 1; + + Multimap result = processor.collectTopology4ModelVer(transId, fromAppId, + thisLevelElemVtx, incomingTrail, thisMap, vidsTraversed, levelCounter, currentHash + , "test", "test"); + + assertNotEquals(result, null); + } + + @Test(expected = AAIException.class) + public void check4EdgeRuleTest() throws AAIException { + processor.check4EdgeRule("test", "test"); + } + + @Test(expected = AAIException.class) + public void collectTopology4LinkagePointTest() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + String linkagePointStrVal = "test"; + String incomingTrail = "test"; + Multimap currentMap = ArrayListMultimap.create(); + + Multimap result = processor.collectTopology4LinkagePoint(transId, fromAppId, linkagePointStrVal, incomingTrail, currentMap); + assertNotEquals(result, null); + + } + + @Test(expected = AAIException.class) + public void getNextStepElementsFromSet() throws AAIException { + Vertex constrElemSetVtx = new EmptyVertex(); + constrElemSetVtx.property(AAIProperties.NODE_TYPE); + Map result = processor.getNextStepElementsFromSet(constrElemSetVtx); + assertNotEquals(result, null); + } + + @Test(expected = NullPointerException.class) + public void genTopoMap4NamedQTest() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + Vertex queryVertex = new EmptyVertex(); + String namedQueryUuid = "E44533334343"; + Multimap result = processor.genTopoMap4NamedQ(transId, fromAppId, queryVertex, namedQueryUuid); + assertNotEquals(result, null); + } + + @Test(expected = NullPointerException.class) + public void collectTopology4NamedQTest() throws AAIException { + String transId = "test"; + String fromAppId = "test"; + Multimap thisMap = ArrayListMultimap.create(); + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + Map currentHash = new HashMap(); + List vidsTraversed = new ArrayList(); + int levelCounter = 1; + + Multimap result = processor.collectTopology4NamedQ(transId, fromAppId, + thisLevelElemVtx, incomingTrail, thisMap, vidsTraversed, levelCounter); + assertNotEquals(result, null); + } + + @Test(expected = NullPointerException.class) + public void getModelThatNqElementRepresentsTest() throws AAIException { + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + Vertex vertex = processor.getModelThatNqElementRepresents(thisLevelElemVtx, incomingTrail); + assertNotEquals(vertex, null); + } + + @Test(expected = NullPointerException.class) + public void getModelGivenModelVer() throws AAIException { + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + Vertex vertex = processor.getModelGivenModelVer(thisLevelElemVtx, incomingTrail); + assertNotEquals(vertex, null); + } + + @Test(expected = AAIException.class) + public void getModelTypeFromModel() throws AAIException { + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + String vertex = processor.getModelTypeFromModel(thisLevelElemVtx, incomingTrail); + assertNotEquals(vertex, null); + } + + @Test(expected = NullPointerException.class) + public void getModelTypeFromModelVer() throws AAIException { + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + String vertex = processor.getModelTypeFromModelVer(thisLevelElemVtx, incomingTrail); + assertNotEquals(vertex, null); + } + + @Test(expected = NullPointerException.class) + public void getModelElementStepName() throws AAIException { + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + String vertex = processor.getModelElementStepName(thisLevelElemVtx, incomingTrail); + assertNotEquals(vertex, null); + } + + @Test(expected = AAIException.class) + public void nodeTypeSupportsPersona() throws AAIException { + String incomingTrail = ""; + boolean vertex = processor.nodeTypeSupportsPersona(incomingTrail); + assertFalse(vertex); + + + incomingTrail = "test"; + boolean vertex1 = processor.nodeTypeSupportsPersona(incomingTrail); + assertTrue(vertex1); + } + + @Test(expected = NullPointerException.class) + public void getNqElementWidgetType() throws AAIException{ + String appId="test"; + String transID="test"; + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + String vertex1 = processor.getNqElementWidgetType(appId,transID,thisLevelElemVtx,incomingTrail); + assertNotEquals(vertex1,null); + } + + + @Test(expected = NullPointerException.class) + public void getModElementWidgetType() throws AAIException{ + String appId="test"; + String transID="test"; + Vertex thisLevelElemVtx = new EmptyVertex(); + String incomingTrail = "test"; + String vertex1 = processor.getModElementWidgetType(thisLevelElemVtx,incomingTrail); + assertNotEquals(vertex1,null); + } + + @Test(expected = NullPointerException.class) + public void getNodeUsingUniqueId() throws AAIException{ + String appId="test"; + String transID="test"; + String nodeType = "generic-vnf"; + String idPropertyName = "test"; + String uniqueIdVal="test"; + Vertex vertex1 = processor.getNodeUsingUniqueId(transID,appId,nodeType,idPropertyName,uniqueIdVal); + assertNotEquals(vertex1,null); + } + + + @Test(expected = AAIException.class) + public void getNodeUsingUniqueIdNull() throws AAIException{ + String appId="test"; + String transID="test"; + String nodeType = "generic-vnf"; + String idPropertyName = "test"; + String uniqueIdVal=""; + Vertex vertex1 = null; + vertex1= processor.getNodeUsingUniqueId(transID,appId,nodeType,idPropertyName,uniqueIdVal); + assertNotEquals(vertex1,null); + + } + + + @Test(expected = AAIException.class) + public void getNodeUsingUniqueIdNull1() throws AAIException{ + String appId="test"; + String transID="test"; + String nodeType = "generic-vnf"; + String idPropertyName=""; + String uniqueIdVal="test"; + Vertex vertex1 = null; + vertex1= processor.getNodeUsingUniqueId(transID,appId,nodeType,idPropertyName,uniqueIdVal); + assertNotEquals(vertex1,null); + + + } + + + @Test(expected = AAIException.class) + public void getNodeUsingUniqueIdNull2() throws AAIException{ + String appId="test"; + String transID="test"; + String nodeType = ""; + String idPropertyName="test"; + String uniqueIdVal="test"; + Vertex vertex1 = null; + vertex1= processor.getNodeUsingUniqueId(transID,appId,nodeType,idPropertyName,uniqueIdVal); + assertNotEquals(vertex1,null); + + + } + + @Test(expected = NullPointerException.class) + public void getModelVersUsingName() throws AAIException{ + String appId="test"; + String transID="test"; + String modelName = "test"; + + List result= processor.getModelVersUsingName(transID,appId,modelName); + assertNotEquals(result,null); + } + + + @Test(expected = AAIException.class) + public void getModelVersUsingNameNull() throws AAIException{ + String appId="test"; + String transID="test"; + String modelName = ""; + + List result= processor.getModelVersUsingName(transID,appId,modelName); + assertNotEquals(result,null); + } + + + @Test(expected = NullPointerException.class) + public void getModVersUsingModelInvId() throws AAIException{ + String appId="test"; + String transID="test"; + String modelName = "test"; + + Iterator result= processor.getModVersUsingModelInvId(transID,appId,modelName); + assertNotEquals(result,null); + } + + @Test(expected = AAIException.class) + public void getModVersUsingModelInvIdNull() throws AAIException{ + String appId="test"; + String transID="test"; + String modelName = ""; + + Iterator result= processor.getModVersUsingModelInvId(transID,appId,modelName); + assertNotEquals(result,null); + } + + @Test(expected = NullPointerException.class) + public void getModVersUsingModel() throws AAIException{ + String appId="test"; + String transID="test"; + String modelName = "test"; + Vertex thisLevelElemVtx = new EmptyVertex(); + List result= processor.getModVersUsingModel(transID,appId,thisLevelElemVtx); + assertNotEquals(result,null); + } + + @Test(expected = AAIException.class) + public void getModVersUsingModel1() throws AAIException{ + String appId="test"; + String transID="test"; + + Vertex thisLevelElemVtx = null; + List result= processor.getModVersUsingModel(transID,appId,thisLevelElemVtx); + assertNotEquals(result,null); + } + + @Test(expected = NullPointerException.class) + public void getModelVerIdsUsingName() throws AAIException{ + String appId="test"; + String transID="test"; + + String modelName= "test"; + List result= processor.getModelVerIdsUsingName(transID,appId,modelName); + assertNotEquals(result,null); + } + + @Test(expected = AAIException.class) + public void getModelVerIdsUsingName1() throws AAIException{ + String appId="test"; + String transID="test"; + + String modelName= ""; + List result= processor.getModelVerIdsUsingName(transID,appId,modelName); + assertNotEquals(result,null); + } + + @Test(expected =NullPointerException.class) + public void validateModel() throws AAIException{ + String appId="test"; + String transID="test"; + + String modelVersionId= "test"; + String modelInvId= "test"; + String modelName= "test"; + processor.validateModel(transID,appId,modelName,modelVersionId); + + + } + + + +} + diff --git a/aai-traversal/src/test/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessingTest.java b/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingTest.java similarity index 93% rename from aai-traversal/src/test/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessingTest.java rename to aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingTest.java index 64e723b0..406d1229 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessingTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/dbgraphgen/ModelBasedProcessingTest.java @@ -1,541 +1,542 @@ -/*- - * ============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.dbgraphgen; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import com.bazaarvoice.jolt.modifier.DataType; -import com.google.common.collect.Multimap; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.apache.tinkerpop.gremlin.structure.VertexProperty; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.*; -import org.mockito.internal.exceptions.MockitoLimitations; -import org.mockito.runners.MockitoJUnitRunner; -import org.openecomp.aai.db.DbMethHelper; -import org.openecomp.aai.db.props.AAIProperties; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; -import org.openecomp.aai.parsers.exceptions.AAIIdentityMapParseException; -import org.openecomp.aai.query.builder.GraphTraversalBuilder; -import org.openecomp.aai.query.builder.QueryBuilder; -import org.openecomp.aai.query.builder.TraversalQuery; -import org.openecomp.aai.schema.enums.PropertyMetadata; -import org.openecomp.aai.serialization.db.DBSerializer; -import org.openecomp.aai.serialization.db.EdgeType; -import org.openecomp.aai.serialization.engines.QueryStyle; -import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; -import org.powermock.modules.junit4.PowerMockRunner; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import java.util.*; - -@RunWith(MockitoJUnitRunner.class) -public class ModelBasedProcessingTest { - - @Mock private static TransactionalGraphEngine dbEngine; - private static Loader loader; - @Mock private static DBSerializer serializer; - @Mock private static TransactionalGraphEngine.Admin admin; - ModelBasedProcessing mockProcessor; - @Mock - private DbMethHelper dbMethHelper; - - @BeforeClass - public static void configure() throws Exception { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); - - - } - - @Before - public void init() { - mockProcessor = new ModelBasedProcessing(loader, dbEngine, serializer); - - MockitoAnnotations.initMocks(this); - } - - @Test - public void testPropNameChange1() throws AAIUnknownObjectException { - String result; - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - result = processor.getPropNameWithAliasIfNeeded("generic-vnf", "model-invariant-id"); - assertEquals("result has -local tacked on the end as it should", "model-invariant-id" + AAIProperties.DB_ALIAS_SUFFIX, result); - result = processor.getPropNameWithAliasIfNeeded("generic-vnf", "vnf-id"); - assertEquals("result does NOT have -local tacked on the end as it should", "vnf-id", result); - result = processor.getPropNameWithAliasIfNeeded("generic-vnf", "model-invariant-id" + AAIProperties.DB_ALIAS_SUFFIX); - assertEquals("property not modified because it already includes the right suffix", "model-invariant-id" + AAIProperties.DB_ALIAS_SUFFIX, result); - } - - @Mock - GraphTraversal v; - @Mock - GraphTraversal graphTraversal; - @Mock - GraphTraversalSource graphTraversalSource; - @Mock Iterable uniqVerts; - List vertexList=new ArrayList<>(); - @Mock Vertex vertex; - @Mock Vertex vertex1; - @Mock - QueryBuilder queryBuilder; - - EdgeType treeType; - @Test(expected = NullPointerException.class) - public void getStartNodesAndModVersionIds() throws AAIException{ - - vertex.property("model-ver","model-version-id"); - vertex1.property(AAIProperties.NODE_TYPE,"model-ver"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - //vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"model-ver")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("model-ver","model-version-id")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(vertexList); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - //this.engine.getQueryBuilder(startV).createEdgeTraversal(treeType, startV, loader.introspectorFromName(connectedNodeType)); - - queryBuilder.toList().add(vertex); - Mockito.when(dbEngine.getQueryBuilder(vertex)).thenReturn(queryBuilder); - - Introspector obj=loader.introspectorFromName("model-ver"); - - Mockito.when(queryBuilder.createEdgeTraversal(EdgeType.TREE,vertex,obj)).thenReturn(queryBuilder); - //Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","model-ver","model-version-id","vnf-id-1"); - - - List> startNodeFilterArrayOfHashes=new ArrayList<>(); - - Map result1=processor.getStartNodesAndModVersionIds("9999","postmen","vnf-id-1","vnf-id-1", - "vnf-id","generic-vnf",startNodeFilterArrayOfHashes,""); - } - - - @Test(expected = AAIException.class) - public void getStartNodesAndModVersionIds1() throws AAIException{ - - vertex.property("model-version-id","vnf-id-1"); - vertex1.property(AAIProperties.NODE_TYPE,"model-ver"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - //vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"model-ver")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("model-version-id","vnf-id-1")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(vertexList); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - //this.engine.getQueryBuilder(startV).createEdgeTraversal(treeType, startV, loader.introspectorFromName(connectedNodeType)); - - queryBuilder.toList().add(vertex); - Mockito.when(dbEngine.getQueryBuilder(vertex)).thenReturn(queryBuilder); - - Introspector obj=loader.introspectorFromName("generic-vnf"); - Mockito.when(queryBuilder.createEdgeTraversal(EdgeType.TREE,vertex,obj)).thenReturn(queryBuilder); - //Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","model-ver","model-version-id","vnf-id-1"); - - - List> startNodeFilterArrayOfHashes=new ArrayList<>(); - - Map result1=processor.getStartNodesAndModVersionIds("9999","postmen","vnf-id-1","vnf-id-1", - "vnf-id","generic-vnf",startNodeFilterArrayOfHashes,""); - } - - @Test - public void getNodeUsingUniqueIdTest() throws AAIException{ - vertex.property("vnf-id","vnf-id-1"); - vertex1.property(AAIProperties.NODE_TYPE,"generic-vnf"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - //vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"generic-vnf")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("vnf-id","vnf-id-1")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(vertexList); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","vnf-id","vnf-id-1"); - - assertNotNull(result); - } - - @Test - public void getNodeUsingUniqueIdTest1() throws AAIException{ - vertex.property("named-query-uui","vnf-id-1"); - vertex1.property(AAIProperties.NODE_TYPE,"named-query"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - //vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"named-query")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("named-query-uui","vnf-id-1")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(vertexList); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","named-query","named-query-uui","vnf-id-1"); - - assertNotNull(result); - } - - @Test(expected = AAIException.class) - public void getModelVersUsingNameTest() throws AAIException{ - - vertex.property(AAIProperties.NODE_TYPE,"generic-vnf"); - vertex1.property("generic-vnf","generic-vnf"); - graphTraversal.addV(vertex1); - v.addV(vertex1); - vertexList.add(vertex); - vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"model-ver")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("model-name","generic-vnf")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(vertexList); - //Mockito.when(vertexList.listIterator().hasNext()).thenReturn(true); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - List result=processor.getModelVersUsingName("9999","postment","generic-vnf"); - - assertTrue(result.size()>0); - } - - //uniqueIdVal Null Expecting AAI Excpetion - @Test(expected = AAIException.class) - public void getNodeUsingUniqueIdTestNull() throws AAIException{ - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","vnf-id",""); - - - } - - //idPropertyName Null Expecting AAI Excpetion - @Test(expected = AAIException.class) - public void getNodeUsingUniqueIdTestNull1() throws AAIException{ - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","","vnf-id-1"); - - - } - - //idPropertyName Null Expecting AAI Excpetion - @Test(expected = AAIException.class) - public void getNodeUsingUniqueIdTestNull2() throws AAIException{ - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","","vnf-id","vnf-id-1"); - - - } - - @Test(expected = AAIException.class) - public void getNodeUsingUniqueIdTestTwoVertex() throws AAIException{ - vertex.property("vnf-id","vnf-id-1"); - vertex1.property(AAIProperties.NODE_TYPE,"generic-vnf"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"generic-vnf")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("vnf-id","vnf-id-1")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(vertexList); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","vnf-id","vnf-id-1"); - - assertNotNull(result); - } - - //uniqVerts Null Expection AAI Exception - @Test(expected = AAIException.class) - public void getNodeUsingUniqueIdTestVertexNull() throws AAIException{ - vertex.property("vnf-id","vnf-id-1"); - vertex1.property(AAIProperties.NODE_TYPE,"generic-vnf"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - //vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"generic-vnf")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("vnf-id","vnf-id-1")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(null); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","vnf-id","vnf-id-1"); - - assertNotNull(result); - } - - //uniqVerts Null Expection AAI Exception - @Test(expected = AAIException.class) - public void getNodeUsingUniqueIdTestVertexHasNot() throws AAIException{ - vertex.property("vnf-id","vnf-id-1"); - vertex1.property(AAIProperties.NODE_TYPE,"generic-vnf"); - graphTraversal.addV(vertex); - v.addV(vertex1); - //vertexList.add(vertex); - //vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"generic-vnf")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("vnf-id","vnf-id-1")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(vertexList); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","vnf-id","vnf-id-1"); - - assertNotNull(result); - } - - @Test(expected = AAIIdentityMapParseException.class) - public void runDeleteByModelTest() throws AAIException{ - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - Optional vertex=Optional.empty(); - Map startNodeFilterHash=new HashMap<>(); - startNodeFilterHash.put("related-link.data","relationshipdata"); - startNodeFilterHash.put("generic-vnf.d","relationshipdata"); - Mockito.when(dbMethHelper.searchVertexByIdentityMap("relationship-data",startNodeFilterHash)).thenReturn(vertex); - Map re =processor.runDeleteByModel("9999","postmen","","relationship-data",startNodeFilterHash,"vnf-id","vnf-id"); - assertNotNull(re); - - - } - - @Test(expected = AAIException.class) - public void getModelGivenModelVerTest() throws AAIException{ - vertex.property("named-query-uuid","vnf-id-1"); - vertex1.property(AAIProperties.NODE_TYPE,"named-query"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - //vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"named-query")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("named-query-uuid","vnf-id-1")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(vertexList); - - QueryBuilder qub=Mockito.mock(QueryBuilder.class); - qub.toList().addAll(vertexList); - Mockito.when(dbEngine.getQueryBuilder(Mockito.any(Vertex.class))).thenReturn(queryBuilder); - - Mockito.when(queryBuilder.createEdgeTraversal(Mockito.any(EdgeType.class),Mockito.any(Vertex.class),Mockito.any(Introspector.class))).thenReturn(qub); - - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - Vertex result=processor.getModelGivenModelVer(vertex,""); - assertNotNull(result); - - } - - @Test(expected = AAIException.class) - public void queryByNamedQuery_TimedTest() throws AAIException{ - vertex.property("named-query-uuid","named-query-element"); - vertex1.property(AAIProperties.NODE_TYPE,"named-query"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - //vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"named-query")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("named-query-uuid","named-query-element")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(vertexList); - - QueryBuilder qub=Mockito.mock(QueryBuilder.class); - qub.toList().addAll(vertexList); - Mockito.when(dbEngine.getQueryBuilder(Mockito.any(Vertex.class))).thenReturn(queryBuilder); - - Mockito.when(queryBuilder.createEdgeTraversal(Mockito.any(EdgeType.class),Mockito.any(Vertex.class),Mockito.any(Introspector.class))).thenReturn(qub); - - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - List> startNodeFilterArrayOfHashes=new ArrayList<>(); - Map secondaryFilterHash=new HashMap<>(); - - List res=processor.queryByNamedQuery_Timed("99999","postmen","named-query-element",startNodeFilterArrayOfHashes,"vnf","vnf", - secondaryFilterHash); - - - } - - @Test(expected = AAIException.class) - public void genTopoMap4NamedQTest() throws AAIException{ - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - vertex.property("named-query-uuid","named-query-element"); - vertex1.property(AAIProperties.NODE_TYPE,"named-query-element"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - QueryBuilder qub=Mockito.mock(QueryBuilder.class); - qub.toList().addAll(vertexList); - Mockito.when(dbEngine.getQueryBuilder(Mockito.any(Vertex.class))).thenReturn(queryBuilder); - - Mockito.when(queryBuilder.createEdgeTraversal(Mockito.any(EdgeType.class),Mockito.any(Vertex.class),Mockito.any(Introspector.class))).thenReturn(qub); - - Multimap map =processor.genTopoMap4NamedQ("9999","postmen",vertex,"named-query-element"); - } - - @Test(expected = AAIException.class) - public void genTopoMap4NamedQTest1() throws AAIException{ - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - vertex.property("named-query-uuid","named-query-element"); - vertex1.property(AAIProperties.NODE_TYPE,"named-query-element"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - QueryBuilder qub=Mockito.mock(QueryBuilder.class); - qub.toList().addAll(vertexList); - Mockito.when(dbEngine.getQueryBuilder(Mockito.any(Vertex.class))).thenReturn(queryBuilder); - - Mockito.when(queryBuilder.createEdgeTraversal(Mockito.any(EdgeType.class),Mockito.any(Vertex.class),Mockito.any(Introspector.class))).thenReturn(qub); - - Multimap map =processor.genTopoMap4NamedQ("9999","postmen",null,"named-query-element"); - } - - @Test(expected = AAIException.class) - public void getModelThatNqElementRepresentsTest() throws AAIException{ - vertex.property("model-ver","named-query-element"); - vertex1.property(AAIProperties.NODE_TYPE,"named-query-element"); - graphTraversal.addV(vertex); - v.addV(vertex1); - vertexList.add(vertex); - QueryBuilder qub=Mockito.mock(QueryBuilder.class); - qub.toList().addAll(vertexList); - Mockito.when(dbEngine.getQueryBuilder(Mockito.any(Vertex.class))).thenReturn(queryBuilder); - - Mockito.when(queryBuilder.createEdgeTraversal(Mockito.any(EdgeType.class),Mockito.any(Vertex.class),Mockito.any(Introspector.class))).thenReturn(qub); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - Vertex v=processor.getModelThatNqElementRepresents(vertex,"g"); - } - - @Test(expected = NullPointerException.class) - public void getModelTypeFromModel() throws AAIException{ - Vertex vt=Mockito.mock(Vertex.class); - vt.property("model-type","named-query-element"); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - String v=processor.getModelTypeFromModel(vt,"g"); - } - - @Test(expected = AAIException.class) - public void getModelTypeFromModel1() throws AAIException{ - Vertex vt=Mockito.mock(Vertex.class); - vt.property("model-type","named-query-element"); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - String v=processor.getModelTypeFromModel(null,"g"); - } - - @Test(expected = NullPointerException.class) - public void getModVersUsingModelInvId() throws AAIException{ - - vertex.property(AAIProperties.NODE_TYPE,"model-invariant-id"); - vertex1.property("model","model-invariant-id"); - graphTraversal.addV(vertex1); - v.addV(vertex1); - vertexList.add(vertex); - vertexList.add(vertex1); - Mockito.when(dbEngine.asAdmin()).thenReturn(admin); - Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); - Mockito.when(graphTraversalSource.V()).thenReturn(v); - Mockito.when(v.has(AAIProperties.NODE_TYPE,"model-invariant-id")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.has("model","model-invariant-id")).thenReturn(graphTraversal); - Mockito.when(graphTraversal.toList()).thenReturn(vertexList); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - Iterator result=processor.getModVersUsingModelInvId("9999","postment","model"); - } - - @Test(expected = AAIException.class) - public void getNamedQueryExtraDataLookupTest() throws AAIException{ - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - Map re=processor.getNamedQueryExtraDataLookup("","",null,vertex, - ""); - } - - @Test(expected = AAIException.class) - public void getNamedQueryExtraDataLookupTest1() throws AAIException{ - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - - Map re=processor.getNamedQueryExtraDataLookup("","",vertex,null, - ""); - } - - @Test(expected = NullPointerException.class) - public void showResultSet() throws AAIException{ - vertex.property("model-ver","model-versionId"); - vertex.property("aai","model-versionId"); - - - ResultSet rs= Mockito.mock(ResultSet.class); - Mockito.when(rs.getVert()).thenReturn(vertex); - - List> vb=new ArrayList<>(); - VertexProperty v=Mockito.mock(VertexProperty.class); - v.property("model-ver","1"); - vb.add(v); - v.property("aai","5"); - vb.add(v); - v.property("source-of-truth","6"); - vb.add(v); - - vertex.properties("model-ver","aai"); - Mockito.when(vertex.property(AAIProperties.NODE_TYPE)).thenReturn(v); - //Mockito.when(vertex.properties()).thenReturn(Mockito.any()); - ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - processor.showResultSet(rs,8); - - } -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.dbgraphgen; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import com.bazaarvoice.jolt.modifier.DataType; +import com.google.common.collect.Multimap; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.VertexProperty; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.*; +import org.mockito.internal.exceptions.MockitoLimitations; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aai.db.DbMethHelper; +import org.onap.aai.db.props.AAIProperties; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Introspector; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.parsers.exceptions.AAIIdentityMapParseException; +import org.onap.aai.query.builder.GraphTraversalBuilder; +import org.onap.aai.query.builder.QueryBuilder; +import org.onap.aai.query.builder.TraversalQuery; +import org.onap.aai.schema.enums.PropertyMetadata; +import org.onap.aai.serialization.db.DBSerializer; +import org.onap.aai.serialization.db.EdgeType; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.powermock.modules.junit4.PowerMockRunner; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.*; + +@RunWith(MockitoJUnitRunner.class) +public class ModelBasedProcessingTest { + + @Mock private static TransactionalGraphEngine dbEngine; + private static Loader loader; + @Mock private static DBSerializer serializer; + @Mock private static TransactionalGraphEngine.Admin admin; + ModelBasedProcessing mockProcessor; + @Mock + private DbMethHelper dbMethHelper; + + @BeforeClass + public static void configure() throws Exception { + System.setProperty("AJSC_HOME", "."); + System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); + + + } + + @Before + public void init() { + mockProcessor = new ModelBasedProcessing(loader, dbEngine, serializer); + + MockitoAnnotations.initMocks(this); + } + + @Test + public void testPropNameChange1() throws AAIUnknownObjectException { + String result; + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + result = processor.getPropNameWithAliasIfNeeded("generic-vnf", "model-invariant-id"); + assertEquals("result has -local tacked on the end as it should", "model-invariant-id" + AAIProperties.DB_ALIAS_SUFFIX, result); + result = processor.getPropNameWithAliasIfNeeded("generic-vnf", "vnf-id"); + assertEquals("result does NOT have -local tacked on the end as it should", "vnf-id", result); + result = processor.getPropNameWithAliasIfNeeded("generic-vnf", "model-invariant-id" + AAIProperties.DB_ALIAS_SUFFIX); + assertEquals("property not modified because it already includes the right suffix", "model-invariant-id" + AAIProperties.DB_ALIAS_SUFFIX, result); + } + + @Mock + GraphTraversal v; + @Mock + GraphTraversal graphTraversal; + @Mock + GraphTraversalSource graphTraversalSource; + @Mock Iterable uniqVerts; + List vertexList=new ArrayList<>(); + @Mock Vertex vertex; + @Mock Vertex vertex1; + @Mock + QueryBuilder queryBuilder; + + EdgeType treeType; + @Test(expected = NullPointerException.class) + public void getStartNodesAndModVersionIds() throws AAIException{ + + vertex.property("model-ver","model-version-id"); + vertex1.property(AAIProperties.NODE_TYPE,"model-ver"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + //vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"model-ver")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("model-ver","model-version-id")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(vertexList); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + //this.engine.getQueryBuilder(startV).createEdgeTraversal(treeType, startV, loader.introspectorFromName(connectedNodeType)); + + queryBuilder.toList().add(vertex); + Mockito.when(dbEngine.getQueryBuilder(vertex)).thenReturn(queryBuilder); + + Introspector obj=loader.introspectorFromName("model-ver"); + + Mockito.when(queryBuilder.createEdgeTraversal(EdgeType.TREE,vertex,obj)).thenReturn(queryBuilder); + //Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","model-ver","model-version-id","vnf-id-1"); + + + List> startNodeFilterArrayOfHashes=new ArrayList<>(); + + Map result1=processor.getStartNodesAndModVersionIds("9999","postmen","vnf-id-1","vnf-id-1", + "vnf-id","generic-vnf",startNodeFilterArrayOfHashes,""); + } + + + @Test(expected = AAIException.class) + public void getStartNodesAndModVersionIds1() throws AAIException{ + + vertex.property("model-version-id","vnf-id-1"); + vertex1.property(AAIProperties.NODE_TYPE,"model-ver"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + //vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"model-ver")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("model-version-id","vnf-id-1")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(vertexList); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + //this.engine.getQueryBuilder(startV).createEdgeTraversal(treeType, startV, loader.introspectorFromName(connectedNodeType)); + + queryBuilder.toList().add(vertex); + Mockito.when(dbEngine.getQueryBuilder(vertex)).thenReturn(queryBuilder); + + Introspector obj=loader.introspectorFromName("generic-vnf"); + Mockito.when(queryBuilder.createEdgeTraversal(EdgeType.TREE,vertex,obj)).thenReturn(queryBuilder); + //Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","model-ver","model-version-id","vnf-id-1"); + + + List> startNodeFilterArrayOfHashes=new ArrayList<>(); + + Map result1=processor.getStartNodesAndModVersionIds("9999","postmen","vnf-id-1","vnf-id-1", + "vnf-id","generic-vnf",startNodeFilterArrayOfHashes,""); + } + + @Test + public void getNodeUsingUniqueIdTest() throws AAIException{ + vertex.property("vnf-id","vnf-id-1"); + vertex1.property(AAIProperties.NODE_TYPE,"generic-vnf"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + //vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"generic-vnf")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("vnf-id","vnf-id-1")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(vertexList); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","vnf-id","vnf-id-1"); + + assertNotNull(result); + } + + @Test + public void getNodeUsingUniqueIdTest1() throws AAIException{ + vertex.property("named-query-uui","vnf-id-1"); + vertex1.property(AAIProperties.NODE_TYPE,"named-query"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + //vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"named-query")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("named-query-uui","vnf-id-1")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(vertexList); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","named-query","named-query-uui","vnf-id-1"); + + assertNotNull(result); + } + + @Test(expected = AAIException.class) + public void getModelVersUsingNameTest() throws AAIException{ + + vertex.property(AAIProperties.NODE_TYPE,"generic-vnf"); + vertex1.property("generic-vnf","generic-vnf"); + graphTraversal.addV(vertex1); + v.addV(vertex1); + vertexList.add(vertex); + vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"model-ver")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("model-name","generic-vnf")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(vertexList); + //Mockito.when(vertexList.listIterator().hasNext()).thenReturn(true); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + List result=processor.getModelVersUsingName("9999","postment","generic-vnf"); + + assertTrue(result.size()>0); + } + + //uniqueIdVal Null Expecting AAI Excpetion + @Test(expected = AAIException.class) + public void getNodeUsingUniqueIdTestNull() throws AAIException{ + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","vnf-id",""); + + + } + + //idPropertyName Null Expecting AAI Excpetion + @Test(expected = AAIException.class) + public void getNodeUsingUniqueIdTestNull1() throws AAIException{ + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","","vnf-id-1"); + + + } + + //idPropertyName Null Expecting AAI Excpetion + @Test(expected = AAIException.class) + public void getNodeUsingUniqueIdTestNull2() throws AAIException{ + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","","vnf-id","vnf-id-1"); + + + } + + @Test(expected = AAIException.class) + public void getNodeUsingUniqueIdTestTwoVertex() throws AAIException{ + vertex.property("vnf-id","vnf-id-1"); + vertex1.property(AAIProperties.NODE_TYPE,"generic-vnf"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"generic-vnf")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("vnf-id","vnf-id-1")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(vertexList); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","vnf-id","vnf-id-1"); + + assertNotNull(result); + } + + //uniqVerts Null Expection AAI Exception + @Test(expected = AAIException.class) + public void getNodeUsingUniqueIdTestVertexNull() throws AAIException{ + vertex.property("vnf-id","vnf-id-1"); + vertex1.property(AAIProperties.NODE_TYPE,"generic-vnf"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + //vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"generic-vnf")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("vnf-id","vnf-id-1")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(null); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","vnf-id","vnf-id-1"); + + assertNotNull(result); + } + + //uniqVerts Null Expection AAI Exception + @Test(expected = AAIException.class) + public void getNodeUsingUniqueIdTestVertexHasNot() throws AAIException{ + vertex.property("vnf-id","vnf-id-1"); + vertex1.property(AAIProperties.NODE_TYPE,"generic-vnf"); + graphTraversal.addV(vertex); + v.addV(vertex1); + //vertexList.add(vertex); + //vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"generic-vnf")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("vnf-id","vnf-id-1")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(vertexList); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + Vertex result=processor.getNodeUsingUniqueId("9999", "postmen","generic-vnf","vnf-id","vnf-id-1"); + + assertNotNull(result); + } + + @Test(expected = AAIIdentityMapParseException.class) + public void runDeleteByModelTest() throws AAIException{ + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + Optional vertex=Optional.empty(); + Map startNodeFilterHash=new HashMap<>(); + startNodeFilterHash.put("related-link.data","relationshipdata"); + startNodeFilterHash.put("generic-vnf.d","relationshipdata"); + Mockito.when(dbMethHelper.searchVertexByIdentityMap("relationship-data",startNodeFilterHash)).thenReturn(vertex); + Map re =processor.runDeleteByModel("9999","postmen","","relationship-data",startNodeFilterHash,"vnf-id","vnf-id"); + assertNotNull(re); + + + } + + @Test(expected = AAIException.class) + public void getModelGivenModelVerTest() throws AAIException{ + vertex.property("named-query-uuid","vnf-id-1"); + vertex1.property(AAIProperties.NODE_TYPE,"named-query"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + //vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"named-query")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("named-query-uuid","vnf-id-1")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(vertexList); + + QueryBuilder qub=Mockito.mock(QueryBuilder.class); + qub.toList().addAll(vertexList); + Mockito.when(dbEngine.getQueryBuilder(Mockito.any(Vertex.class))).thenReturn(queryBuilder); + + Mockito.when(queryBuilder.createEdgeTraversal(Mockito.any(EdgeType.class),Mockito.any(Vertex.class),Mockito.any(Introspector.class))).thenReturn(qub); + + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + Vertex result=processor.getModelGivenModelVer(vertex,""); + assertNotNull(result); + + } + + @Test(expected = AAIException.class) + public void queryByNamedQuery_TimedTest() throws AAIException{ + vertex.property("named-query-uuid","named-query-element"); + vertex1.property(AAIProperties.NODE_TYPE,"named-query"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + //vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"named-query")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("named-query-uuid","named-query-element")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(vertexList); + + QueryBuilder qub=Mockito.mock(QueryBuilder.class); + qub.toList().addAll(vertexList); + Mockito.when(dbEngine.getQueryBuilder(Mockito.any(Vertex.class))).thenReturn(queryBuilder); + + Mockito.when(queryBuilder.createEdgeTraversal(Mockito.any(EdgeType.class),Mockito.any(Vertex.class),Mockito.any(Introspector.class))).thenReturn(qub); + + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + List> startNodeFilterArrayOfHashes=new ArrayList<>(); + Map secondaryFilterHash=new HashMap<>(); + + List res=processor.queryByNamedQuery_Timed("99999","postmen","named-query-element",startNodeFilterArrayOfHashes,"vnf","vnf", + secondaryFilterHash); + + + } + + @Test(expected = AAIException.class) + public void genTopoMap4NamedQTest() throws AAIException{ + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + vertex.property("named-query-uuid","named-query-element"); + vertex1.property(AAIProperties.NODE_TYPE,"named-query-element"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + QueryBuilder qub=Mockito.mock(QueryBuilder.class); + qub.toList().addAll(vertexList); + Mockito.when(dbEngine.getQueryBuilder(Mockito.any(Vertex.class))).thenReturn(queryBuilder); + + Mockito.when(queryBuilder.createEdgeTraversal(Mockito.any(EdgeType.class),Mockito.any(Vertex.class),Mockito.any(Introspector.class))).thenReturn(qub); + + Multimap map =processor.genTopoMap4NamedQ("9999","postmen",vertex,"named-query-element"); + } + + @Test(expected = AAIException.class) + public void genTopoMap4NamedQTest1() throws AAIException{ + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + vertex.property("named-query-uuid","named-query-element"); + vertex1.property(AAIProperties.NODE_TYPE,"named-query-element"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + QueryBuilder qub=Mockito.mock(QueryBuilder.class); + qub.toList().addAll(vertexList); + Mockito.when(dbEngine.getQueryBuilder(Mockito.any(Vertex.class))).thenReturn(queryBuilder); + + Mockito.when(queryBuilder.createEdgeTraversal(Mockito.any(EdgeType.class),Mockito.any(Vertex.class),Mockito.any(Introspector.class))).thenReturn(qub); + + Multimap map =processor.genTopoMap4NamedQ("9999","postmen",null,"named-query-element"); + } + + @Test(expected = AAIException.class) + public void getModelThatNqElementRepresentsTest() throws AAIException{ + vertex.property("model-ver","named-query-element"); + vertex1.property(AAIProperties.NODE_TYPE,"named-query-element"); + graphTraversal.addV(vertex); + v.addV(vertex1); + vertexList.add(vertex); + QueryBuilder qub=Mockito.mock(QueryBuilder.class); + qub.toList().addAll(vertexList); + Mockito.when(dbEngine.getQueryBuilder(Mockito.any(Vertex.class))).thenReturn(queryBuilder); + + Mockito.when(queryBuilder.createEdgeTraversal(Mockito.any(EdgeType.class),Mockito.any(Vertex.class),Mockito.any(Introspector.class))).thenReturn(qub); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + Vertex v=processor.getModelThatNqElementRepresents(vertex,"g"); + } + + @Test(expected = NullPointerException.class) + public void getModelTypeFromModel() throws AAIException{ + Vertex vt=Mockito.mock(Vertex.class); + vt.property("model-type","named-query-element"); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + String v=processor.getModelTypeFromModel(vt,"g"); + } + + @Test(expected = AAIException.class) + public void getModelTypeFromModel1() throws AAIException{ + Vertex vt=Mockito.mock(Vertex.class); + vt.property("model-type","named-query-element"); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + String v=processor.getModelTypeFromModel(null,"g"); + } + + @Test(expected = NullPointerException.class) + public void getModVersUsingModelInvId() throws AAIException{ + + vertex.property(AAIProperties.NODE_TYPE,"model-invariant-id"); + vertex1.property("model","model-invariant-id"); + graphTraversal.addV(vertex1); + v.addV(vertex1); + vertexList.add(vertex); + vertexList.add(vertex1); + Mockito.when(dbEngine.asAdmin()).thenReturn(admin); + Mockito.when(admin.getReadOnlyTraversalSource()).thenReturn(graphTraversalSource); + Mockito.when(graphTraversalSource.V()).thenReturn(v); + Mockito.when(v.has(AAIProperties.NODE_TYPE,"model-invariant-id")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.has("model","model-invariant-id")).thenReturn(graphTraversal); + Mockito.when(graphTraversal.toList()).thenReturn(vertexList); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + Iterator result=processor.getModVersUsingModelInvId("9999","postment","model"); + } + + @Test(expected = AAIException.class) + public void getNamedQueryExtraDataLookupTest() throws AAIException{ + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + Map re=processor.getNamedQueryExtraDataLookup("","",null,vertex, + ""); + } + + @Test(expected = AAIException.class) + public void getNamedQueryExtraDataLookupTest1() throws AAIException{ + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + + Map re=processor.getNamedQueryExtraDataLookup("","",vertex,null, + ""); + } + + @Test(expected = NullPointerException.class) + public void showResultSet() throws AAIException{ + vertex.property("model-ver","model-versionId"); + vertex.property("aai","model-versionId"); + + + ResultSet rs= Mockito.mock(ResultSet.class); + Mockito.when(rs.getVert()).thenReturn(vertex); + + List> vb=new ArrayList<>(); + VertexProperty v=Mockito.mock(VertexProperty.class); + v.property("model-ver","1"); + vb.add(v); + v.property("aai","5"); + vb.add(v); + v.property("source-of-truth","6"); + vb.add(v); + + vertex.properties("model-ver","aai"); + Mockito.when(vertex.property(AAIProperties.NODE_TYPE)).thenReturn(v); + //Mockito.when(vertex.properties()).thenReturn(Mockito.any()); + ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + processor.showResultSet(rs,8); + + } +} diff --git a/aai-traversal/src/test/java/org/openecomp/aai/dbgraphmap/SearchGraphTest.java b/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphTest.java similarity index 91% rename from aai-traversal/src/test/java/org/openecomp/aai/dbgraphmap/SearchGraphTest.java rename to aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphTest.java index 49ad810b..f624828d 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/dbgraphmap/SearchGraphTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphTest.java @@ -1,378 +1,379 @@ -/*- - * ============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.dbgraphmap; - -import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.graphdb.types.system.EmptyVertex; -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.apache.tinkerpop.gremlin.structure.VertexProperty; -import org.apache.velocity.util.ArrayListWrapper; -import org.eclipse.persistence.dynamic.DynamicEntity; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.openecomp.aai.dbgraphgen.ModelBasedProcessing; -import org.openecomp.aai.dbmap.DBConnectionType; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.extensions.AAIExtensionMap; -import org.openecomp.aai.introspection.*; -import org.openecomp.aai.parsers.relationship.RelationshipToURI; -import org.openecomp.aai.serialization.db.DBSerializer; -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.utils.UrlBuilder; - - -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.*; -import java.net.URI; -import java.sql.ResultSet; -import java.util.*; -import java.util.stream.Stream; - -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.*; - -public class SearchGraphTest { - - private SearchGraph searchGraph; - - protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); - - private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); - - private final static Version version = Version.getLatest(); - private final static ModelType introspectorFactoryType = ModelType.MOXY; - private final static QueryStyle queryStyle = QueryStyle.TRAVERSAL; - private final static DBConnectionType type = DBConnectionType.REALTIME; - - static { - VALID_HTTP_STATUS_CODES.add(200); - VALID_HTTP_STATUS_CODES.add(201); - VALID_HTTP_STATUS_CODES.add(204); - } - - private HttpHeaders httpHeaders; - - private UriInfo uriInfo; - - private MultivaluedMap headersMultiMap; - private MultivaluedMap queryParameters; - - private List aaiRequestContextList; - - private List outputMediaTypes; - - private Loader loader; - private TitanGraph graph; - - private Graph tx; - - private GraphTraversalSource g; - private TransactionalGraphEngine dbEngine; - - @Before - public void setup(){ - - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - - searchGraph = new SearchGraph(); - - httpHeaders = mock(HttpHeaders.class); - uriInfo = mock(UriInfo.class); - - headersMultiMap = new MultivaluedHashMap<>(); - queryParameters = Mockito.spy(new MultivaluedHashMap<>()); - - headersMultiMap.add("X-FromAppId", "JUNIT"); - headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); - headersMultiMap.add("Real-Time", "true"); - headersMultiMap.add("Accept", "application/json"); - headersMultiMap.add("aai-request-context", ""); - - outputMediaTypes = new ArrayList<>(); - outputMediaTypes.add(APPLICATION_JSON); - - aaiRequestContextList = new ArrayList<>(); - aaiRequestContextList.add(""); - - when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); - when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); - when(httpHeaders.getRequestHeader("X-FromAppId")).thenReturn(Arrays.asList("JUNIT")); - when(httpHeaders.getRequestHeader("X-TransactionId")).thenReturn(Arrays.asList("JUNIT")); - - when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); - - - when(uriInfo.getQueryParameters()).thenReturn(queryParameters); - when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); - - // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable - Mockito.doReturn(null).when(queryParameters).remove(anyObject()); - - when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); - loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); - dbEngine = new TitanDBEngine( - queryStyle, - type, - loader); - } - -@Test(expected = AAIException.class) - public void runNodesQuery() throws AAIException{ - DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); - UrlBuilder urlBuilder = new UrlBuilder(version, serializer); - searchGraph.runNodesQuery(httpHeaders,"",null, - null,dbEngine,loader,urlBuilder); - } - @Test(expected = AAIException.class) - public void runNodesQueryNull() throws AAIException{ - DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); - UrlBuilder urlBuilder = new UrlBuilder(version, serializer); - searchGraph.runNodesQuery(httpHeaders,"nnn",null, - null,dbEngine,loader,urlBuilder); - } - @Test(expected = AAIException.class) - public void testRunGenericQueryFailWhenInvalidRelationshipList() throws AAIException { - - List keys = new ArrayList<>(); - keys.add("cloud-region.cloud-owner:test-aic"); - - List includeStrings = new ArrayList<>(); - includeStrings.add("cloud-region"); - - DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); - UrlBuilder urlBuilder = new UrlBuilder(version, serializer); - Response response = searchGraph.runGenericQuery(httpHeaders, "service-instance", keys, includeStrings, 1, dbEngine, loader, urlBuilder); - System.out.println(response); - } - - - @Test(expected = AAIException.class) - public void testRunGenericQueryFailWhenInvalidRelationshipList1() throws AAIException { - - List keys = new ArrayList<>(); - keys.add("cloud-region.cloud-owner:test-aic"); - - List includeStrings = new ArrayList<>(); - includeStrings.add("cloud-region"); - - DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); - UrlBuilder urlBuilder = new UrlBuilder(version, serializer); - Response response = searchGraph.runGenericQuery(httpHeaders, null, keys, includeStrings, 1, dbEngine, loader, urlBuilder); - System.out.println(response); - } - - @Test(expected = AAIException.class) - public void testRunGenericQueryFailWhenInvalidRelationshipList2() throws AAIException { - - List keys = new ArrayList<>(); - keys.add("cloud-region.cloud-owner:test-aic"); - - List includeStrings = new ArrayList<>(); - includeStrings.add("cloud-region"); - - DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); - UrlBuilder urlBuilder = new UrlBuilder(version, serializer); - Response response = searchGraph.runGenericQuery(httpHeaders, "", null, includeStrings, 1, dbEngine, loader, urlBuilder); - System.out.println(response); - } - - @Test(expected = AAIException.class) - public void testRunGenericQueryFailWhenInvalidRelationshipList3() throws AAIException { - - List keys = new ArrayList<>(); - keys.add("cloud-region.cloud-owner:test-aic"); - - List includeStrings = new ArrayList<>(); - includeStrings.add("cloud-region"); - - DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); - UrlBuilder urlBuilder = new UrlBuilder(version, serializer); - Response response = searchGraph.runGenericQuery(httpHeaders, "", keys, null, 1, dbEngine, loader, urlBuilder); - System.out.println(response); - } - - - /*@Test(expected = NullPointerException.class) - public void createSearchResults() throws AAIException { - - List keys = new ArrayList<>(); - Vertex vertex=new EmptyVertex(); - keys.add(vertex); - - - - List includeStrings = new ArrayList<>(); - includeStrings.add("cloud-region"); - - DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); - UrlBuilder urlBuilder = new UrlBuilder(version, serializer); - Introspector response = searchGraph.createSearchResults(loader, urlBuilder, keys); - System.out.println(response); - }*/ - @Test - public void createSearchResults1() throws Exception { - - List keys = new ArrayList<>(); - Vertex vertex=new EmptyVertex(); - keys.add(vertex); - DBSerializer ds=mock(DBSerializer.class); - UrlBuilder urlBuilder=mock(UrlBuilder.class); - when(urlBuilder.pathed(vertex)).thenReturn("cloud-region"); - Stream stream=mock(Stream.class); - when(stream.isParallel()).thenReturn(true); - List includeStrings = new ArrayList<>(); - includeStrings.add("cloud-region"); - RelationshipToURI relationshipToURI=mock(RelationshipToURI.class); - URI uri =new URI(""); - when(relationshipToURI.getUri()).thenReturn(uri); - - DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); - // UrlBuilder urlBuilder = new UrlBuilder(version, serializer); - Introspector response = searchGraph.createSearchResults(loader, urlBuilder, keys); - System.out.println(response); - } - @Test(expected = AAIException.class) - public void executeModelOperationTest() throws Exception{ - Vertex vertex=new EmptyVertex(); - vertex.property("model-name"); - Map mapObj=new HashMap(); - mapObj.put("modle-version",vertex); - List> startNodeFilterArrayOfHashes=new ArrayList<>(); - startNodeFilterArrayOfHashes.add(mapObj); - List resultSet=new ArrayList(); - DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); - // ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - AAIExtensionMap map=mock(AAIExtensionMap.class); - HttpServletRequest servletRequest=mock(HttpServletRequest.class); - - when(map.getHttpServletRequest()).thenReturn(servletRequest); - when(servletRequest.getContentType()).thenReturn("application/json"); - DynamicEntity modelAndNamedQuerySearch=mock(DynamicEntity.class); - when(modelAndNamedQuerySearch.isSet("topNodeType")).thenReturn(true); - - -/* when(processor.queryByModel("9999","model-ver","model-version-id", - "model-inv-id","modelname","aai", - startNodeFilterArrayOfHashes,"aai-ver")).thenReturn(resultSet);*/ - - searchGraph.executeModelOperation("","","",type,true, - map); - } - - @Test(expected = AAIException.class) - public void executeModelOperationXMLTest() throws Exception{ - Vertex vertex=new EmptyVertex(); - vertex.property("model-name"); - Map mapObj=new HashMap(); - mapObj.put("modle-version",vertex); - List> startNodeFilterArrayOfHashes=new ArrayList<>(); - startNodeFilterArrayOfHashes.add(mapObj); - List resultSet=new ArrayList(); - DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); - // ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); - AAIExtensionMap map=mock(AAIExtensionMap.class); - HttpServletRequest servletRequest=mock(HttpServletRequest.class); - - when(map.getHttpServletRequest()).thenReturn(servletRequest); - when(servletRequest.getContentType()).thenReturn("application/xml"); - - DynamicEntity modelAndNamedQuerySearch=mock(DynamicEntity.class); - when(modelAndNamedQuerySearch.isSet("queryParameters")).thenReturn(true); -/* when(processor.queryByModel("9999","model-ver","model-version-id", - "model-inv-id","modelname","aai", - startNodeFilterArrayOfHashes,"aai-ver")).thenReturn(resultSet);*/ - - searchGraph.executeModelOperation("","","",type,true, - map); - } - @Test - public void runNodesQueryTest() throws AAIException{ - UrlBuilder urlBuilder=mock(UrlBuilder.class); - List filter=new ArrayList(); - filter.add("model:EQUALS:DOES-NOT-EXIST:AAI"); - List edgeFilter=new ArrayList(); - edgeFilter.add("model:DOES-NOT-EXIST:DOES-NOT-EXIST:AAI"); - Response response= searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, - filter,dbEngine,loader,urlBuilder); - Assert.assertNotNull(response); - } - - @Test - public void runNodesQueryExistsTest() throws AAIException{ - UrlBuilder urlBuilder=mock(UrlBuilder.class); - List filter=new ArrayList(); - filter.add("model:EQUALS:DOES-NOT-EXIST:AAI"); - List edgeFilter=new ArrayList(); - edgeFilter.add("model:EXISTS:DOES-NOT-EXIST:AAI"); - Response response= searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, - filter,dbEngine,loader,urlBuilder); - Assert.assertNotNull(response); - } - - @Test - public void runNodesQueryTestDOESNOTEQUAL() throws AAIException{ - UrlBuilder urlBuilder=mock(UrlBuilder.class); - List filter=new ArrayList(); - filter.add("model:DOES-NOT-EQUAL:DOES-NOT-EXIST"); - List edgeFilter=new ArrayList(); - searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, - filter,dbEngine,loader,urlBuilder); - } - - @Test - public void runNodesQueryTestGreaterThan3() throws AAIException{ - UrlBuilder urlBuilder=mock(UrlBuilder.class); - List filter=new ArrayList(); - filter.add("model:DOES-NOT-EQUAL:DOES-NOT-EXIST:AAI"); - List edgeFilter=new ArrayList(); - searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, - filter,dbEngine,loader,urlBuilder); - } - - @Test - public void runNodesQueryTestGreaterThanExists() throws AAIException{ - UrlBuilder urlBuilder=mock(UrlBuilder.class); - List filter=new ArrayList(); - filter.add("model:EXISTS:DOES-NOT-EXIST:AAI"); - List edgeFilter=new ArrayList(); - searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, - filter,dbEngine,loader,urlBuilder); - } - - @Test(expected = AAIException.class) - public void runNodesQueryTestGreaterThanDoesNotExists() throws AAIException{ - UrlBuilder urlBuilder=mock(UrlBuilder.class); - List filter=new ArrayList(); - filter.add("model:DOES_NOT_EXIST:DOES-NOT-EXIST:AAI"); - List edgeFilter=new ArrayList(); - searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, - filter,dbEngine,loader,urlBuilder); - } +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.dbgraphmap; + +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.graphdb.types.system.EmptyVertex; +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.apache.tinkerpop.gremlin.structure.VertexProperty; +import org.apache.velocity.util.ArrayListWrapper; +import org.eclipse.persistence.dynamic.DynamicEntity; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.onap.aai.dbgraphgen.ModelBasedProcessing; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.extensions.AAIExtensionMap; +import org.onap.aai.introspection.*; +import org.onap.aai.parsers.relationship.RelationshipToURI; +import org.onap.aai.serialization.db.DBSerializer; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TitanDBEngine; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.serialization.queryformats.utils.UrlBuilder; + + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.*; +import java.net.URI; +import java.sql.ResultSet; +import java.util.*; +import java.util.stream.Stream; + +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.*; + +public class SearchGraphTest { + + private SearchGraph searchGraph; + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + private final static Version version = Version.getLatest(); + private final static ModelType introspectorFactoryType = ModelType.MOXY; + private final static QueryStyle queryStyle = QueryStyle.TRAVERSAL; + private final static DBConnectionType type = DBConnectionType.REALTIME; + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + private HttpHeaders httpHeaders; + + private UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private Loader loader; + private TitanGraph graph; + + private Graph tx; + + private GraphTraversalSource g; + private TransactionalGraphEngine dbEngine; + + @Before + public void setup(){ + + System.setProperty("AJSC_HOME", "."); + System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); + + searchGraph = new SearchGraph(); + + httpHeaders = mock(HttpHeaders.class); + uriInfo = mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + when(httpHeaders.getRequestHeader("X-FromAppId")).thenReturn(Arrays.asList("JUNIT")); + when(httpHeaders.getRequestHeader("X-TransactionId")).thenReturn(Arrays.asList("JUNIT")); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); + dbEngine = new TitanDBEngine( + queryStyle, + type, + loader); + } + +@Test(expected = AAIException.class) + public void runNodesQuery() throws AAIException{ + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); + UrlBuilder urlBuilder = new UrlBuilder(version, serializer); + searchGraph.runNodesQuery(httpHeaders,"",null, + null,dbEngine,loader,urlBuilder); + } + @Test(expected = AAIException.class) + public void runNodesQueryNull() throws AAIException{ + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); + UrlBuilder urlBuilder = new UrlBuilder(version, serializer); + searchGraph.runNodesQuery(httpHeaders,"nnn",null, + null,dbEngine,loader,urlBuilder); + } + @Test(expected = AAIException.class) + public void testRunGenericQueryFailWhenInvalidRelationshipList() throws AAIException { + + List keys = new ArrayList<>(); + keys.add("cloud-region.cloud-owner:test-aic"); + + List includeStrings = new ArrayList<>(); + includeStrings.add("cloud-region"); + + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); + UrlBuilder urlBuilder = new UrlBuilder(version, serializer); + Response response = searchGraph.runGenericQuery(httpHeaders, "service-instance", keys, includeStrings, 1, dbEngine, loader, urlBuilder); + System.out.println(response); + } + + + @Test(expected = AAIException.class) + public void testRunGenericQueryFailWhenInvalidRelationshipList1() throws AAIException { + + List keys = new ArrayList<>(); + keys.add("cloud-region.cloud-owner:test-aic"); + + List includeStrings = new ArrayList<>(); + includeStrings.add("cloud-region"); + + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); + UrlBuilder urlBuilder = new UrlBuilder(version, serializer); + Response response = searchGraph.runGenericQuery(httpHeaders, null, keys, includeStrings, 1, dbEngine, loader, urlBuilder); + System.out.println(response); + } + + @Test(expected = AAIException.class) + public void testRunGenericQueryFailWhenInvalidRelationshipList2() throws AAIException { + + List keys = new ArrayList<>(); + keys.add("cloud-region.cloud-owner:test-aic"); + + List includeStrings = new ArrayList<>(); + includeStrings.add("cloud-region"); + + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); + UrlBuilder urlBuilder = new UrlBuilder(version, serializer); + Response response = searchGraph.runGenericQuery(httpHeaders, "", null, includeStrings, 1, dbEngine, loader, urlBuilder); + System.out.println(response); + } + + @Test(expected = AAIException.class) + public void testRunGenericQueryFailWhenInvalidRelationshipList3() throws AAIException { + + List keys = new ArrayList<>(); + keys.add("cloud-region.cloud-owner:test-aic"); + + List includeStrings = new ArrayList<>(); + includeStrings.add("cloud-region"); + + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); + UrlBuilder urlBuilder = new UrlBuilder(version, serializer); + Response response = searchGraph.runGenericQuery(httpHeaders, "", keys, null, 1, dbEngine, loader, urlBuilder); + System.out.println(response); + } + + + /*@Test(expected = NullPointerException.class) + public void createSearchResults() throws AAIException { + + List keys = new ArrayList<>(); + Vertex vertex=new EmptyVertex(); + keys.add(vertex); + + + + List includeStrings = new ArrayList<>(); + includeStrings.add("cloud-region"); + + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); + UrlBuilder urlBuilder = new UrlBuilder(version, serializer); + Introspector response = searchGraph.createSearchResults(loader, urlBuilder, keys); + System.out.println(response); + }*/ + @Test + public void createSearchResults1() throws Exception { + + List keys = new ArrayList<>(); + Vertex vertex=new EmptyVertex(); + keys.add(vertex); + DBSerializer ds=mock(DBSerializer.class); + UrlBuilder urlBuilder=mock(UrlBuilder.class); + when(urlBuilder.pathed(vertex)).thenReturn("cloud-region"); + Stream stream=mock(Stream.class); + when(stream.isParallel()).thenReturn(true); + List includeStrings = new ArrayList<>(); + includeStrings.add("cloud-region"); + RelationshipToURI relationshipToURI=mock(RelationshipToURI.class); + URI uri =new URI(""); + when(relationshipToURI.getUri()).thenReturn(uri); + + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); + // UrlBuilder urlBuilder = new UrlBuilder(version, serializer); + Introspector response = searchGraph.createSearchResults(loader, urlBuilder, keys); + System.out.println(response); + } + @Test(expected = AAIException.class) + public void executeModelOperationTest() throws Exception{ + Vertex vertex=new EmptyVertex(); + vertex.property("model-name"); + Map mapObj=new HashMap(); + mapObj.put("modle-version",vertex); + List> startNodeFilterArrayOfHashes=new ArrayList<>(); + startNodeFilterArrayOfHashes.add(mapObj); + List resultSet=new ArrayList(); + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); + // ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + AAIExtensionMap map=mock(AAIExtensionMap.class); + HttpServletRequest servletRequest=mock(HttpServletRequest.class); + + when(map.getHttpServletRequest()).thenReturn(servletRequest); + when(servletRequest.getContentType()).thenReturn("application/json"); + DynamicEntity modelAndNamedQuerySearch=mock(DynamicEntity.class); + when(modelAndNamedQuerySearch.isSet("topNodeType")).thenReturn(true); + + +/* when(processor.queryByModel("9999","model-ver","model-version-id", + "model-inv-id","modelname","aai", + startNodeFilterArrayOfHashes,"aai-ver")).thenReturn(resultSet);*/ + + searchGraph.executeModelOperation("","","",type,true, + map); + } + + @Test(expected = AAIException.class) + public void executeModelOperationXMLTest() throws Exception{ + Vertex vertex=new EmptyVertex(); + vertex.property("model-name"); + Map mapObj=new HashMap(); + mapObj.put("modle-version",vertex); + List> startNodeFilterArrayOfHashes=new ArrayList<>(); + startNodeFilterArrayOfHashes.add(mapObj); + List resultSet=new ArrayList(); + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "JUNIT"); + // ModelBasedProcessing processor = new ModelBasedProcessing(loader, dbEngine, serializer); + AAIExtensionMap map=mock(AAIExtensionMap.class); + HttpServletRequest servletRequest=mock(HttpServletRequest.class); + + when(map.getHttpServletRequest()).thenReturn(servletRequest); + when(servletRequest.getContentType()).thenReturn("application/xml"); + + DynamicEntity modelAndNamedQuerySearch=mock(DynamicEntity.class); + when(modelAndNamedQuerySearch.isSet("queryParameters")).thenReturn(true); +/* when(processor.queryByModel("9999","model-ver","model-version-id", + "model-inv-id","modelname","aai", + startNodeFilterArrayOfHashes,"aai-ver")).thenReturn(resultSet);*/ + + searchGraph.executeModelOperation("","","",type,true, + map); + } + @Test + public void runNodesQueryTest() throws AAIException{ + UrlBuilder urlBuilder=mock(UrlBuilder.class); + List filter=new ArrayList(); + filter.add("model:EQUALS:DOES-NOT-EXIST:AAI"); + List edgeFilter=new ArrayList(); + edgeFilter.add("model:DOES-NOT-EXIST:DOES-NOT-EXIST:AAI"); + Response response= searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, + filter,dbEngine,loader,urlBuilder); + Assert.assertNotNull(response); + } + + @Test + public void runNodesQueryExistsTest() throws AAIException{ + UrlBuilder urlBuilder=mock(UrlBuilder.class); + List filter=new ArrayList(); + filter.add("model:EQUALS:DOES-NOT-EXIST:AAI"); + List edgeFilter=new ArrayList(); + edgeFilter.add("model:EXISTS:DOES-NOT-EXIST:AAI"); + Response response= searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, + filter,dbEngine,loader,urlBuilder); + Assert.assertNotNull(response); + } + + @Test + public void runNodesQueryTestDOESNOTEQUAL() throws AAIException{ + UrlBuilder urlBuilder=mock(UrlBuilder.class); + List filter=new ArrayList(); + filter.add("model:DOES-NOT-EQUAL:DOES-NOT-EXIST"); + List edgeFilter=new ArrayList(); + searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, + filter,dbEngine,loader,urlBuilder); + } + + @Test + public void runNodesQueryTestGreaterThan3() throws AAIException{ + UrlBuilder urlBuilder=mock(UrlBuilder.class); + List filter=new ArrayList(); + filter.add("model:DOES-NOT-EQUAL:DOES-NOT-EXIST:AAI"); + List edgeFilter=new ArrayList(); + searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, + filter,dbEngine,loader,urlBuilder); + } + + @Test + public void runNodesQueryTestGreaterThanExists() throws AAIException{ + UrlBuilder urlBuilder=mock(UrlBuilder.class); + List filter=new ArrayList(); + filter.add("model:EXISTS:DOES-NOT-EXIST:AAI"); + List edgeFilter=new ArrayList(); + searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, + filter,dbEngine,loader,urlBuilder); + } + + @Test(expected = AAIException.class) + public void runNodesQueryTestGreaterThanDoesNotExists() throws AAIException{ + UrlBuilder urlBuilder=mock(UrlBuilder.class); + List filter=new ArrayList(); + filter.add("model:DOES_NOT_EXIST:DOES-NOT-EXIST:AAI"); + List edgeFilter=new ArrayList(); + searchGraph.runNodesQuery(httpHeaders,"model-ver",edgeFilter, + filter,dbEngine,loader,urlBuilder); + } } \ No newline at end of file diff --git a/aai-traversal/src/test/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptorTest.java b/aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptorTest.java similarity index 97% rename from aai-traversal/src/test/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptorTest.java rename to aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptorTest.java index d265299c..40de5a9b 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptorTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSInInterceptorTest.java @@ -1,14 +1,14 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 + * 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, @@ -16,9 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.interceptors; +package org.onap.aai.interceptors; import org.apache.cxf.message.Exchange; import org.apache.cxf.message.ExchangeImpl; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/interceptors/AAILogJAXRSOutInterceptorTest.java b/aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptorTest.java similarity index 94% rename from aai-traversal/src/test/java/org/openecomp/aai/interceptors/AAILogJAXRSOutInterceptorTest.java rename to aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptorTest.java index df2feeca..52c6a426 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/interceptors/AAILogJAXRSOutInterceptorTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/interceptors/AAILogJAXRSOutInterceptorTest.java @@ -1,14 +1,14 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 + * 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, @@ -16,9 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.interceptors; +package org.onap.aai.interceptors; import org.apache.cxf.io.CacheAndWriteOutputStream; import org.apache.cxf.message.Exchange; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/interceptors/PostAaiAjscInterceptorTest.java b/aai-traversal/src/test/java/org/onap/aai/interceptors/PostAaiAjscInterceptorTest.java similarity index 89% rename from aai-traversal/src/test/java/org/openecomp/aai/interceptors/PostAaiAjscInterceptorTest.java rename to aai-traversal/src/test/java/org/onap/aai/interceptors/PostAaiAjscInterceptorTest.java index 3aa2aa95..6efb0d17 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/interceptors/PostAaiAjscInterceptorTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/interceptors/PostAaiAjscInterceptorTest.java @@ -1,14 +1,14 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 + * 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, @@ -16,14 +16,15 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.interceptors; +package org.onap.aai.interceptors; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import org.openecomp.aai.logging.LoggingContext; +import org.onap.aai.logging.LoggingContext; import javax.servlet.http.HttpServletRequest; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/interceptors/PreAaiAjscInterceptorTest.java b/aai-traversal/src/test/java/org/onap/aai/interceptors/PreAaiAjscInterceptorTest.java similarity index 89% rename from aai-traversal/src/test/java/org/openecomp/aai/interceptors/PreAaiAjscInterceptorTest.java rename to aai-traversal/src/test/java/org/onap/aai/interceptors/PreAaiAjscInterceptorTest.java index 91620192..35651c30 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/interceptors/PreAaiAjscInterceptorTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/interceptors/PreAaiAjscInterceptorTest.java @@ -1,14 +1,14 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 + * 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, @@ -16,9 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.interceptors; +package org.onap.aai.interceptors; import org.junit.Before; import org.junit.Test; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/ExceptionHandlerTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/ExceptionHandlerTest.java similarity index 95% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/ExceptionHandlerTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/ExceptionHandlerTest.java index 8e2bb949..eaf9e551 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/ExceptionHandlerTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/ExceptionHandlerTest.java @@ -1,14 +1,14 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 + * 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, @@ -16,9 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest; +package org.onap.aai.rest; import com.fasterxml.jackson.core.JsonLocation; import com.fasterxml.jackson.core.JsonParseException; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromNfTypeQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromNfTypeQueryTest.java similarity index 90% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromNfTypeQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromNfTypeQueryTest.java index f2a1a3e3..1c932307 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromNfTypeQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromNfTypeQueryTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class CloudRegionFromNfTypeQueryTest extends QueryTest { public CloudRegionFromNfTypeQueryTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromNfTypeVendorVersionTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromNfTypeVendorVersionTest.java similarity index 92% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromNfTypeVendorVersionTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromNfTypeVendorVersionTest.java index 5a39f12d..ae04734e 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromNfTypeVendorVersionTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromNfTypeVendorVersionTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class CloudRegionFromNfTypeVendorVersionTest extends QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromNfTypeVendorVersion_withOptionalTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromNfTypeVendorVersion_withOptionalTest.java similarity index 93% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromNfTypeVendorVersion_withOptionalTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromNfTypeVendorVersion_withOptionalTest.java index 08a24a90..59b0d0a3 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromNfTypeVendorVersion_withOptionalTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromNfTypeVendorVersion_withOptionalTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class CloudRegionFromNfTypeVendorVersion_withOptionalTest extends QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromVnfTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromVnfTest.java similarity index 62% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromVnfTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromVnfTest.java index 5e0ecd55..f828558f 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionFromVnfTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionFromVnfTest.java @@ -1,4 +1,25 @@ -package org.openecomp.aai.rest.search; +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest.search; import static org.junit.Assert.*; @@ -9,8 +30,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class CloudRegionFromVnfTest extends QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionfromCountryCloudRegionVersionQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionfromCountryCloudRegionVersionQueryTest.java similarity index 88% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionfromCountryCloudRegionVersionQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionfromCountryCloudRegionVersionQueryTest.java index 0bf58fbe..08c62af1 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionfromCountryCloudRegionVersionQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionfromCountryCloudRegionVersionQueryTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class CloudRegionfromCountryCloudRegionVersionQueryTest extends QueryTest { public CloudRegionfromCountryCloudRegionVersionQueryTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionfromCountryQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionfromCountryQueryTest.java similarity index 87% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionfromCountryQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionfromCountryQueryTest.java index 4a5991dd..4106939c 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/CloudRegionfromCountryQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/CloudRegionfromCountryQueryTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class CloudRegionfromCountryQueryTest extends QueryTest { public CloudRegionfromCountryQueryTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/FirstNetTopology_LineOfBusinessTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/FirstNetTopology_LineOfBusinessTest.java similarity index 91% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/FirstNetTopology_LineOfBusinessTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/FirstNetTopology_LineOfBusinessTest.java index ce739c8e..88831bd9 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/FirstNetTopology_LineOfBusinessTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/FirstNetTopology_LineOfBusinessTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class FirstNetTopology_LineOfBusinessTest extends QueryTest { public FirstNetTopology_LineOfBusinessTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/FirstNetTopology_ServiceInstanceTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/FirstNetTopology_ServiceInstanceTest.java similarity index 93% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/FirstNetTopology_ServiceInstanceTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/FirstNetTopology_ServiceInstanceTest.java index a6352ecc..a53ca0c3 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/FirstNetTopology_ServiceInstanceTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/FirstNetTopology_ServiceInstanceTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class FirstNetTopology_ServiceInstanceTest extends QueryTest { public FirstNetTopology_ServiceInstanceTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/GremlinServerImplTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/GremlinServerImplTest.java similarity index 86% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/GremlinServerImplTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/GremlinServerImplTest.java index deea9037..5c6a45f2 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/GremlinServerImplTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/GremlinServerImplTest.java @@ -1,163 +1,164 @@ -/*- - * ============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.rest.search; - -import com.thinkaurelius.titan.core.TitanGraph; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.T; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.openecomp.aai.dbmap.DBConnectionType; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; -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.SubGraphStyle; - -import javax.ws.rs.core.*; -import java.net.URI; -import java.util.*; - -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class GremlinServerImplTest { - - GremlinServerImpl gremlinServerImpl; - - protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); - - private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); - - private final static Version version = Version.getLatest(); - private final static ModelType introspectorFactoryType = ModelType.MOXY; - private final static QueryStyle queryStyle = QueryStyle.TRAVERSAL; - private final static DBConnectionType type = DBConnectionType.REALTIME; - - static { - VALID_HTTP_STATUS_CODES.add(200); - VALID_HTTP_STATUS_CODES.add(201); - VALID_HTTP_STATUS_CODES.add(204); - } - - private GenericQueryProcessor genericQueryProcessor; - private HttpHeaders httpHeaders; - - private UriInfo uriInfo; - - private MultivaluedMap headersMultiMap; - private MultivaluedMap queryParameters; - - private List aaiRequestContextList; - - private List outputMediaTypes; - - private Loader loader; - private TitanGraph graph; - - private Graph tx; - - private GraphTraversalSource g; - private TransactionalGraphEngine dbEngine; - - - -@Before - public void setup()throws AAIException{ - - httpHeaders = mock(HttpHeaders.class); - uriInfo = mock(UriInfo.class); - - headersMultiMap = new MultivaluedHashMap<>(); - queryParameters = Mockito.spy(new MultivaluedHashMap<>()); - - headersMultiMap.add("X-FromAppId", "JUNIT"); - headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); - headersMultiMap.add("Real-Time", "true"); - headersMultiMap.add("Accept", "application/json"); - headersMultiMap.add("aai-request-context", ""); - - outputMediaTypes = new ArrayList<>(); - outputMediaTypes.add(APPLICATION_JSON); - - aaiRequestContextList = new ArrayList<>(); - aaiRequestContextList.add(""); - - when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); - when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); - when(httpHeaders.getRequestHeader("X-FromAppId")).thenReturn(Arrays.asList("JUNIT")); - when(httpHeaders.getRequestHeader("X-TransactionId")).thenReturn(Arrays.asList("JUNIT")); - - when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); - - - when(uriInfo.getQueryParameters()).thenReturn(queryParameters); - when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); - - // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable - Mockito.doReturn(null).when(queryParameters).remove(anyObject()); - - when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); - loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); - dbEngine = new TitanDBEngine( - queryStyle, - type, - loader); - GenericQueryProcessor.Builder builder=new GenericQueryProcessor.Builder(dbEngine); -builder.queryFrom(URI.create("te")); -builder.queryFrom("te"); -builder.create(); -builder.processWith(QueryProcessorType.GREMLIN_SERVER); - builder.processWith(QueryProcessorType.LOCAL_GROOVY); - - gremlinServerImpl= new GremlinServerImpl(builder); - } - - @Test(expected = NullPointerException.class) - public void processSubGraphTest() throws Exception{ - GraphTraversal g=Mockito.mock(GraphTraversal.class); - g.has("cloud-region-id", "cloud-region-id-1"); - gremlinServerImpl.processSubGraph(SubGraphStyle.prune,g); -} - - @Test(expected = RuntimeException.class) - public void executeTest() throws Exception{ - GraphTraversal g=Mockito.mock(GraphTraversal.class); - g.has("cloud-region-id", "cloud-region-id-1"); - //Mockito.when(etPath()).thenReturn("testpath"); - List re= gremlinServerImpl.execute(SubGraphStyle.prune); - Assert.assertNotNull(re); - } - - - -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.rest.search; + +import com.thinkaurelius.titan.core.TitanGraph; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.T; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TitanDBEngine; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.serialization.queryformats.SubGraphStyle; + +import javax.ws.rs.core.*; +import java.net.URI; +import java.util.*; + +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class GremlinServerImplTest { + + GremlinServerImpl gremlinServerImpl; + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + private final static Version version = Version.getLatest(); + private final static ModelType introspectorFactoryType = ModelType.MOXY; + private final static QueryStyle queryStyle = QueryStyle.TRAVERSAL; + private final static DBConnectionType type = DBConnectionType.REALTIME; + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + private GenericQueryProcessor genericQueryProcessor; + private HttpHeaders httpHeaders; + + private UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private Loader loader; + private TitanGraph graph; + + private Graph tx; + + private GraphTraversalSource g; + private TransactionalGraphEngine dbEngine; + + + +@Before + public void setup()throws AAIException{ + + httpHeaders = mock(HttpHeaders.class); + uriInfo = mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + when(httpHeaders.getRequestHeader("X-FromAppId")).thenReturn(Arrays.asList("JUNIT")); + when(httpHeaders.getRequestHeader("X-TransactionId")).thenReturn(Arrays.asList("JUNIT")); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); + dbEngine = new TitanDBEngine( + queryStyle, + type, + loader); + GenericQueryProcessor.Builder builder=new GenericQueryProcessor.Builder(dbEngine); +builder.queryFrom(URI.create("te")); +builder.queryFrom("te"); +builder.create(); +builder.processWith(QueryProcessorType.GREMLIN_SERVER); + builder.processWith(QueryProcessorType.LOCAL_GROOVY); + + gremlinServerImpl= new GremlinServerImpl(builder); + } + + @Test(expected = NullPointerException.class) + public void processSubGraphTest() throws Exception{ + GraphTraversal g=Mockito.mock(GraphTraversal.class); + g.has("cloud-region-id", "cloud-region-id-1"); + gremlinServerImpl.processSubGraph(SubGraphStyle.prune,g); +} + + @Test(expected = RuntimeException.class) + public void executeTest() throws Exception{ + GraphTraversal g=Mockito.mock(GraphTraversal.class); + g.has("cloud-region-id", "cloud-region-id-1"); + //Mockito.when(etPath()).thenReturn("testpath"); + List re= gremlinServerImpl.execute(SubGraphStyle.prune); + Assert.assertNotNull(re); + } + + + +} diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/GroovyShellImplTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/GroovyShellImplTest.java similarity index 85% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/GroovyShellImplTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/GroovyShellImplTest.java index 723e30d0..3735e978 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/GroovyShellImplTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/GroovyShellImplTest.java @@ -1,157 +1,158 @@ -/*- - * ============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.rest.search; - -import com.thinkaurelius.titan.core.TitanGraph; -import groovy.lang.MissingPropertyException; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; -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.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.openecomp.aai.dbmap.DBConnectionType; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; -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.SubGraphStyle; - -import javax.ws.rs.core.*; -import java.net.URI; -import java.util.*; - -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class GroovyShellImplTest { - - GroovyShellImpl groovyShellImpl ; - - protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); - - private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); - - private final static Version version = Version.getLatest(); - private final static ModelType introspectorFactoryType = ModelType.MOXY; - private final static QueryStyle queryStyle = QueryStyle.TRAVERSAL; - private final static DBConnectionType type = DBConnectionType.REALTIME; - - static { - VALID_HTTP_STATUS_CODES.add(200); - VALID_HTTP_STATUS_CODES.add(201); - VALID_HTTP_STATUS_CODES.add(204); - } - - private GenericQueryProcessor genericQueryProcessor; - private HttpHeaders httpHeaders; - - private UriInfo uriInfo; - - private MultivaluedMap headersMultiMap; - private MultivaluedMap queryParameters; - - private List aaiRequestContextList; - - private List outputMediaTypes; - - private Loader loader; - private TitanGraph graph; - - private Graph tx; - - private GraphTraversalSource g; - private TransactionalGraphEngine dbEngine; - - - -@Before - public void setup()throws AAIException{ - - httpHeaders = mock(HttpHeaders.class); - uriInfo = mock(UriInfo.class); - - headersMultiMap = new MultivaluedHashMap<>(); - queryParameters = Mockito.spy(new MultivaluedHashMap<>()); - - headersMultiMap.add("X-FromAppId", "JUNIT"); - headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); - headersMultiMap.add("Real-Time", "true"); - headersMultiMap.add("Accept", "application/json"); - headersMultiMap.add("aai-request-context", ""); - - outputMediaTypes = new ArrayList<>(); - outputMediaTypes.add(APPLICATION_JSON); - - aaiRequestContextList = new ArrayList<>(); - aaiRequestContextList.add(""); - - when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); - when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); - when(httpHeaders.getRequestHeader("X-FromAppId")).thenReturn(Arrays.asList("JUNIT")); - when(httpHeaders.getRequestHeader("X-TransactionId")).thenReturn(Arrays.asList("JUNIT")); - - when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); - - - when(uriInfo.getQueryParameters()).thenReturn(queryParameters); - when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); - - // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable - Mockito.doReturn(null).when(queryParameters).remove(anyObject()); - - when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); - loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); - dbEngine = new TitanDBEngine( - queryStyle, - type, - loader); - GenericQueryProcessor.Builder builder=new GenericQueryProcessor.Builder(dbEngine); -builder.queryFrom(URI.create("te")); -builder.queryFrom("te"); -builder.create(); -builder.processWith(QueryProcessorType.GREMLIN_SERVER); - builder.processWith(QueryProcessorType.LOCAL_GROOVY); - - groovyShellImpl= new GroovyShellImpl(builder); - } - - @Test(expected = MissingPropertyException.class) - public void processSubGraphTest() throws Exception{ - GraphTraversal g=Mockito.mock(GraphTraversal.class); - g.has("cloud-region-id", "cloud-region-id-1"); - Map params = new HashMap<>(); - groovyShellImpl.runQuery("vnfs-fromServiceInstance",params); -} - - - - - -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.rest.search; + +import com.thinkaurelius.titan.core.TitanGraph; +import groovy.lang.MissingPropertyException; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; +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.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TitanDBEngine; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.serialization.queryformats.SubGraphStyle; + +import javax.ws.rs.core.*; +import java.net.URI; +import java.util.*; + +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class GroovyShellImplTest { + + GroovyShellImpl groovyShellImpl ; + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + private final static Version version = Version.getLatest(); + private final static ModelType introspectorFactoryType = ModelType.MOXY; + private final static QueryStyle queryStyle = QueryStyle.TRAVERSAL; + private final static DBConnectionType type = DBConnectionType.REALTIME; + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + private GenericQueryProcessor genericQueryProcessor; + private HttpHeaders httpHeaders; + + private UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private Loader loader; + private TitanGraph graph; + + private Graph tx; + + private GraphTraversalSource g; + private TransactionalGraphEngine dbEngine; + + + +@Before + public void setup()throws AAIException{ + + httpHeaders = mock(HttpHeaders.class); + uriInfo = mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + when(httpHeaders.getRequestHeader("X-FromAppId")).thenReturn(Arrays.asList("JUNIT")); + when(httpHeaders.getRequestHeader("X-TransactionId")).thenReturn(Arrays.asList("JUNIT")); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); + dbEngine = new TitanDBEngine( + queryStyle, + type, + loader); + GenericQueryProcessor.Builder builder=new GenericQueryProcessor.Builder(dbEngine); +builder.queryFrom(URI.create("te")); +builder.queryFrom("te"); +builder.create(); +builder.processWith(QueryProcessorType.GREMLIN_SERVER); + builder.processWith(QueryProcessorType.LOCAL_GROOVY); + + groovyShellImpl= new GroovyShellImpl(builder); + } + + @Test(expected = MissingPropertyException.class) + public void processSubGraphTest() throws Exception{ + GraphTraversal g=Mockito.mock(GraphTraversal.class); + g.has("cloud-region-id", "cloud-region-id-1"); + Map params = new HashMap<>(); + groovyShellImpl.runQuery("vnfs-fromServiceInstance",params); +} + + + + + +} diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/ImageFromCloudRegionNfTypeTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/ImageFromCloudRegionNfTypeTest.java similarity index 93% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/ImageFromCloudRegionNfTypeTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/ImageFromCloudRegionNfTypeTest.java index d93f1835..02f7162e 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/ImageFromCloudRegionNfTypeTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/ImageFromCloudRegionNfTypeTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class ImageFromCloudRegionNfTypeTest extends QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/LinkedDevices_ComplicatedGVtoGV.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/LinkedDevices_ComplicatedGVtoGV.java similarity index 69% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/LinkedDevices_ComplicatedGVtoGV.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/LinkedDevices_ComplicatedGVtoGV.java index 656cd441..c4b90bfc 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/LinkedDevices_ComplicatedGVtoGV.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/LinkedDevices_ComplicatedGVtoGV.java @@ -1,4 +1,25 @@ -package org.openecomp.aai.rest.search; +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest.search; import java.util.Map; @@ -7,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class LinkedDevices_ComplicatedGVtoGV extends QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/LinkedDevices_NewvceVserverTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/LinkedDevices_NewvceVserverTest.java similarity index 75% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/LinkedDevices_NewvceVserverTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/LinkedDevices_NewvceVserverTest.java index e37bb5a2..dcc3d327 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/LinkedDevices_NewvceVserverTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/LinkedDevices_NewvceVserverTest.java @@ -1,4 +1,25 @@ -package org.openecomp.aai.rest.search; +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest.search; import static org.junit.Assert.*; @@ -11,8 +32,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class LinkedDevices_NewvceVserverTest extends QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/LinkedDevices_SimpleGVtoGVQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/LinkedDevices_SimpleGVtoGVQueryTest.java similarity index 64% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/LinkedDevices_SimpleGVtoGVQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/LinkedDevices_SimpleGVtoGVQueryTest.java index 435878eb..399b60aa 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/LinkedDevices_SimpleGVtoGVQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/LinkedDevices_SimpleGVtoGVQueryTest.java @@ -1,4 +1,25 @@ -package org.openecomp.aai.rest.search; +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest.search; import java.util.Map; @@ -7,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class LinkedDevices_SimpleGVtoGVQueryTest extends QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/LocationNetTypeNetRolefromCloudRegionQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/LocationNetTypeNetRolefromCloudRegionQueryTest.java similarity index 89% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/LocationNetTypeNetRolefromCloudRegionQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/LocationNetTypeNetRolefromCloudRegionQueryTest.java index e8aec8bf..6dcb0717 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/LocationNetTypeNetRolefromCloudRegionQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/LocationNetTypeNetRolefromCloudRegionQueryTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class LocationNetTypeNetRolefromCloudRegionQueryTest extends QueryTest { public LocationNetTypeNetRolefromCloudRegionQueryTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/ModelAndNamedQueryRestProviderTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProviderTest.java similarity index 89% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/ModelAndNamedQueryRestProviderTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProviderTest.java index 5813ef11..ea5bc853 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/ModelAndNamedQueryRestProviderTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProviderTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -26,16 +27,16 @@ import org.apache.commons.io.IOUtils; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import org.openecomp.aai.dbmap.DBConnectionType; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; -import org.openecomp.aai.serialization.db.DBSerializer; -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.utils.UrlBuilder; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; +import org.onap.aai.serialization.db.DBSerializer; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TitanDBEngine; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.serialization.queryformats.utils.UrlBuilder; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.*; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/MsoRequestVfModuleTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/MsoRequestVfModuleTest.java similarity index 93% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/MsoRequestVfModuleTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/MsoRequestVfModuleTest.java index 1038eb35..225d45f4 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/MsoRequestVfModuleTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/MsoRequestVfModuleTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class MsoRequestVfModuleTest extends QueryTest { public MsoRequestVfModuleTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/NetworkNameFromNetworkRoleQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/NetworkNameFromNetworkRoleQueryTest.java similarity index 66% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/NetworkNameFromNetworkRoleQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/NetworkNameFromNetworkRoleQueryTest.java index ce88b012..83b6d2f1 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/NetworkNameFromNetworkRoleQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/NetworkNameFromNetworkRoleQueryTest.java @@ -1,4 +1,25 @@ -package org.openecomp.aai.rest.search; +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest.search; import static org.junit.Assert.*; @@ -9,8 +30,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class NetworkNameFromNetworkRoleQueryTest extends QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/NfTypefromCloudRegionQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/NfTypefromCloudRegionQueryTest.java similarity index 89% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/NfTypefromCloudRegionQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/NfTypefromCloudRegionQueryTest.java index 9451a865..4b667d02 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/NfTypefromCloudRegionQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/NfTypefromCloudRegionQueryTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class NfTypefromCloudRegionQueryTest extends QueryTest { public NfTypefromCloudRegionQueryTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/OwningEntityfromServiceInstance.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/OwningEntityfromServiceInstance.java similarity index 88% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/OwningEntityfromServiceInstance.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/OwningEntityfromServiceInstance.java index d6704faa..d0fd1b12 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/OwningEntityfromServiceInstance.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/OwningEntityfromServiceInstance.java @@ -1,32 +1,33 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; import java.util.Map; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/PendingTopologyDetailTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/PendingTopologyDetailTest.java similarity index 96% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/PendingTopologyDetailTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/PendingTopologyDetailTest.java index 22a60cee..d282164e 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/PendingTopologyDetailTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/PendingTopologyDetailTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class PendingTopologyDetailTest extends QueryTest { public PendingTopologyDetailTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/PserverfromConfigurationFilterInterfaceIdTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/PserverfromConfigurationFilterInterfaceIdTest.java similarity index 91% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/PserverfromConfigurationFilterInterfaceIdTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/PserverfromConfigurationFilterInterfaceIdTest.java index 2dc023b7..9a427caf 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/PserverfromConfigurationFilterInterfaceIdTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/PserverfromConfigurationFilterInterfaceIdTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class PserverfromConfigurationFilterInterfaceIdTest extends QueryTest { public PserverfromConfigurationFilterInterfaceIdTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/PserverfromConfigurationTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/PserverfromConfigurationTest.java similarity index 92% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/PserverfromConfigurationTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/PserverfromConfigurationTest.java index fd23bc40..9638cfdd 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/PserverfromConfigurationTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/PserverfromConfigurationTest.java @@ -1,14 +1,14 @@ -/*- +/** * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 + * 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, @@ -16,9 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class PserverfromConfigurationTest extends QueryTest { public PserverfromConfigurationTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/PserversFromVnfQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/PserversFromVnfQueryTest.java similarity index 90% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/PserversFromVnfQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/PserversFromVnfQueryTest.java index f8bcb7d4..e6abee67 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/PserversFromVnfQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/PserversFromVnfQueryTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class PserversFromVnfQueryTest extends QueryTest { public PserversFromVnfQueryTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/QueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/QueryTest.java similarity index 81% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/QueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/QueryTest.java index 2d40484a..54579371 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/QueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/QueryTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.any; @@ -35,16 +36,16 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; -import org.openecomp.aai.query.builder.GremlinTraversal; -import org.openecomp.aai.serialization.db.EdgeRules; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; -import org.openecomp.aai.serialization.engines.QueryStyle; -import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; +import org.onap.aai.query.builder.GremlinTraversal; +import org.onap.aai.serialization.db.EdgeRules; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; public abstract class QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/QueryVnfFromModelByRegionTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/QueryVnfFromModelByRegionTest.java similarity index 75% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/QueryVnfFromModelByRegionTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/QueryVnfFromModelByRegionTest.java index 6fe78720..67f7d11a 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/QueryVnfFromModelByRegionTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/QueryVnfFromModelByRegionTest.java @@ -1,12 +1,33 @@ -package org.openecomp.aai.rest.search; +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest.search; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; import java.util.Map; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/SearchProviderTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/SearchProviderTest.java similarity index 92% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/SearchProviderTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/SearchProviderTest.java index 6b922bff..8633cb4a 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/SearchProviderTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/SearchProviderTest.java @@ -1,40 +1,41 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import org.openecomp.aai.dbmap.DBConnectionType; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; -import org.openecomp.aai.serialization.db.DBSerializer; -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.utils.UrlBuilder; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; +import org.onap.aai.serialization.db.DBSerializer; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TitanDBEngine; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.serialization.queryformats.utils.UrlBuilder; import javax.ws.rs.core.*; import java.util.*; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/ServiceFromPserverAndSubsNameTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/ServiceFromPserverAndSubsNameTest.java similarity index 93% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/ServiceFromPserverAndSubsNameTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/ServiceFromPserverAndSubsNameTest.java index 264e4622..3be5b347 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/ServiceFromPserverAndSubsNameTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/ServiceFromPserverAndSubsNameTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class ServiceFromPserverAndSubsNameTest extends QueryTest { public ServiceFromPserverAndSubsNameTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/SimpleFormatTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/SimpleFormatTest.java similarity index 79% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/SimpleFormatTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/SimpleFormatTest.java index eedcd693..17ddfc51 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/SimpleFormatTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/SimpleFormatTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -35,21 +36,21 @@ import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.openecomp.aai.dbmap.DBConnectionType; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; -import org.openecomp.aai.serialization.db.DBSerializer; -import org.openecomp.aai.serialization.db.EdgeRules; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; -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.RawFormat; -import org.openecomp.aai.serialization.queryformats.exceptions.AAIFormatVertexException; -import org.openecomp.aai.serialization.queryformats.utils.UrlBuilder; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; +import org.onap.aai.serialization.db.DBSerializer; +import org.onap.aai.serialization.db.EdgeRules; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.engines.TitanDBEngine; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; +import org.onap.aai.serialization.queryformats.RawFormat; +import org.onap.aai.serialization.queryformats.exceptions.AAIFormatVertexException; +import org.onap.aai.serialization.queryformats.utils.UrlBuilder; import com.google.gson.JsonObject; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyDetailFromVserverQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyDetailFromVserverQueryTest.java similarity index 94% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyDetailFromVserverQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyDetailFromVserverQueryTest.java index 758b113a..a99fa8fa 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyDetailFromVserverQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyDetailFromVserverQueryTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class TopologyDetailFromVserverQueryTest extends QueryTest { public TopologyDetailFromVserverQueryTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyDetailsQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyDetailsQueryTest.java similarity index 96% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyDetailsQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyDetailsQueryTest.java index 1dd4db27..18919149 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyDetailsQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyDetailsQueryTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class TopologyDetailsQueryTest extends QueryTest { public TopologyDetailsQueryTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyFromCloudRegionIdAndServiceIdTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyFromCloudRegionIdAndServiceIdTest.java similarity index 96% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyFromCloudRegionIdAndServiceIdTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyFromCloudRegionIdAndServiceIdTest.java index d53f51d9..8068c314 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyFromCloudRegionIdAndServiceIdTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyFromCloudRegionIdAndServiceIdTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class TopologyFromCloudRegionIdAndServiceIdTest extends QueryTest { public TopologyFromCloudRegionIdAndServiceIdTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyFromSubscriberNameAndServiceTypeTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyFromSubscriberNameAndServiceTypeTest.java similarity index 97% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyFromSubscriberNameAndServiceTypeTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyFromSubscriberNameAndServiceTypeTest.java index b200e9bf..b10abf31 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/TopologyFromSubscriberNameAndServiceTypeTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/TopologyFromSubscriberNameAndServiceTypeTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -32,8 +33,8 @@ import com.att.eelf.configuration.EELFManager; import com.google.common.base.CaseFormat; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class TopologyFromSubscriberNameAndServiceTypeTest extends QueryTest { private static final EELFLogger LOGGER = EELFManager.getInstance() diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfInstancesFromServiceInstancebyModelVersionTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfInstancesFromServiceInstancebyModelVersionTest.java similarity index 91% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfInstancesFromServiceInstancebyModelVersionTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/VnfInstancesFromServiceInstancebyModelVersionTest.java index 56ddaaf2..ecf30b31 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfInstancesFromServiceInstancebyModelVersionTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfInstancesFromServiceInstancebyModelVersionTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class VnfInstancesFromServiceInstancebyModelVersionTest extends QueryTest { public VnfInstancesFromServiceInstancebyModelVersionTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfTopologyFromServiceInstanceTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfTopologyFromServiceInstanceTest.java similarity index 95% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfTopologyFromServiceInstanceTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/VnfTopologyFromServiceInstanceTest.java index 2963c2f4..b426ee15 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfTopologyFromServiceInstanceTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfTopologyFromServiceInstanceTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class VnfTopologyFromServiceInstanceTest extends QueryTest { public VnfTopologyFromServiceInstanceTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfTopologyFromVfModuleTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfTopologyFromVfModuleTest.java similarity index 95% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfTopologyFromVfModuleTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/VnfTopologyFromVfModuleTest.java index 07e38942..7fbc175d 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfTopologyFromVfModuleTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfTopologyFromVfModuleTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class VnfTopologyFromVfModuleTest extends QueryTest { public VnfTopologyFromVfModuleTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfTopologyFromVnfTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfTopologyFromVnfTest.java similarity index 95% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfTopologyFromVnfTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/VnfTopologyFromVnfTest.java index c678be56..af935f75 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfTopologyFromVnfTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfTopologyFromVnfTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class VnfTopologyFromVnfTest extends QueryTest { public VnfTopologyFromVnfTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfsFromPserverQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfsFromPserverQueryTest.java similarity index 90% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfsFromPserverQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/VnfsFromPserverQueryTest.java index fde3729e..a3f9c976 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfsFromPserverQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfsFromPserverQueryTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -28,8 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class VnfsFromPserverQueryTest extends QueryTest { public VnfsFromPserverQueryTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfsFromServiceInstanceTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfsFromServiceInstanceTest.java similarity index 90% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfsFromServiceInstanceTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/VnfsFromServiceInstanceTest.java index 2a33d7dc..6e4f9231 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VnfsFromServiceInstanceTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/VnfsFromServiceInstanceTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import java.util.Map; @@ -27,8 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class VnfsFromServiceInstanceTest extends QueryTest { public VnfsFromServiceInstanceTest() throws AAIException, NoEdgeRuleFoundException { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VserverFromVnfQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/VserverFromVnfQueryTest.java similarity index 64% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/VserverFromVnfQueryTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/VserverFromVnfQueryTest.java index 9d6ad2e5..acec2e7d 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VserverFromVnfQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/VserverFromVnfQueryTest.java @@ -1,4 +1,25 @@ -package org.openecomp.aai.rest.search; +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest.search; import static org.junit.Assert.*; @@ -9,8 +30,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class VserverFromVnfQueryTest extends QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VserverLogicallinkFromPServerTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/search/VserverLogicallinkFromPServerTest.java similarity index 89% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/search/VserverLogicallinkFromPServerTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/search/VserverLogicallinkFromPServerTest.java index 5d022ff7..8901de23 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/search/VserverLogicallinkFromPServerTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/search/VserverLogicallinkFromPServerTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.search; +package org.onap.aai.rest.search; import static org.junit.Assert.*; @@ -29,8 +30,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public class VserverLogicallinkFromPServerTest extends QueryTest { diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/util/EchoResponseTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/util/EchoResponseTest.java similarity index 95% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/util/EchoResponseTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/util/EchoResponseTest.java index 44d38be9..d06c8b73 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/util/EchoResponseTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/util/EchoResponseTest.java @@ -1,14 +1,14 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 + * 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, @@ -16,9 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.util; +package org.onap.aai.rest.util; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/util/LogFormatToolsTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/util/LogFormatToolsTest.java similarity index 81% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/util/LogFormatToolsTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/util/LogFormatToolsTest.java index 3a1ddc1b..c4cc211e 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/util/LogFormatToolsTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/util/LogFormatToolsTest.java @@ -1,35 +1,36 @@ -/*- - * ============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.rest.util; - -import org.junit.Test; - -import static org.junit.Assert.assertNotNull; - -public class LogFormatToolsTest { - - @Test - public void testLogFormatTools(){ - - String dateTime = new LogFormatTools().getCurrentDateTime(); - assertNotNull(dateTime); - } -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest.util; + +import org.junit.Test; + +import static org.junit.Assert.assertNotNull; + +public class LogFormatToolsTest { + + @Test + public void testLogFormatTools(){ + + String dateTime = new LogFormatTools().getCurrentDateTime(); + assertNotNull(dateTime); + } +} diff --git a/aai-traversal/src/test/java/org/openecomp/aai/rest/util/ValidateEncodingTest.java b/aai-traversal/src/test/java/org/onap/aai/rest/util/ValidateEncodingTest.java similarity index 93% rename from aai-traversal/src/test/java/org/openecomp/aai/rest/util/ValidateEncodingTest.java rename to aai-traversal/src/test/java/org/onap/aai/rest/util/ValidateEncodingTest.java index 8c6450de..fa6480f7 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/rest/util/ValidateEncodingTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/rest/util/ValidateEncodingTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.rest.util; +package org.onap.aai.rest.util; import static org.junit.Assert.*; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/JaxrsUserServiceTest.java b/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/JaxrsUserServiceTest.java similarity index 89% rename from aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/JaxrsUserServiceTest.java rename to aai-traversal/src/test/java/org/onap/aai/retiredcustomer/JaxrsUserServiceTest.java index 9a9ae8d4..3e323dd0 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/JaxrsUserServiceTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/JaxrsUserServiceTest.java @@ -1,110 +1,111 @@ -/*- - * ============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.retiredcustomer; - -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.openecomp.aai.ajsc_aai.JaxrsUserService; -import org.openecomp.aai.introspection.Version; -import org.openecomp.aai.rest.retired.RetiredConsumer; - -import javax.ws.rs.core.*; -import java.util.*; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.when; - -public class JaxrsUserServiceTest { - - - protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); - - private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); - - static { - VALID_HTTP_STATUS_CODES.add(200); - VALID_HTTP_STATUS_CODES.add(201); - VALID_HTTP_STATUS_CODES.add(204); - } - - protected JaxrsUserService jaxrsUserService; - protected HttpHeaders httpHeaders; - protected UriInfo uriInfo; - - private MultivaluedMap headersMultiMap; - private MultivaluedMap queryParameters; - - private List aaiRequestContextList; - - private List outputMediaTypes; - - private static final EELFLogger logger = EELFManager.getInstance().getLogger(RetiredConsumer.class.getName()); - - @Before - public void setup(){ - logger.info("Starting the setup for the integration tests of Rest Endpoints"); - - jaxrsUserService = new JaxrsUserService(); - httpHeaders = Mockito.mock(HttpHeaders.class); - uriInfo = Mockito.mock(UriInfo.class); - - headersMultiMap = new MultivaluedHashMap<>(); - queryParameters = Mockito.spy(new MultivaluedHashMap<>()); - - headersMultiMap.add("X-FromAppId", "JUNIT"); - headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); - headersMultiMap.add("Real-Time", "true"); - headersMultiMap.add("Accept", "application/json"); - headersMultiMap.add("aai-request-context", ""); - - outputMediaTypes = new ArrayList<>(); - outputMediaTypes.add(APPLICATION_JSON); - - aaiRequestContextList = new ArrayList<>(); - aaiRequestContextList.add(""); - - when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); - when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); - - when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); - - - when(uriInfo.getQueryParameters()).thenReturn(queryParameters); - when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); - - // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable - Mockito.doReturn(null).when(queryParameters).remove(anyObject()); - - when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); - } - @Test - public void lookUpUserTest(){ - when(uriInfo.getPath()).thenReturn("/user?userID1"); - String response = jaxrsUserService.lookupUser("userID1"); - assertNotNull(response); - - - } -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.retiredcustomer; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; +import org.onap.aai.ajsc_aai.JaxrsUserService; +import org.onap.aai.introspection.Version; +import org.onap.aai.rest.retired.RetiredConsumer; + +import javax.ws.rs.core.*; +import java.util.*; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.when; + +public class JaxrsUserServiceTest { + + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + protected JaxrsUserService jaxrsUserService; + protected HttpHeaders httpHeaders; + protected UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(RetiredConsumer.class.getName()); + + @Before + public void setup(){ + logger.info("Starting the setup for the integration tests of Rest Endpoints"); + + jaxrsUserService = new JaxrsUserService(); + httpHeaders = Mockito.mock(HttpHeaders.class); + uriInfo = Mockito.mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + } + @Test + public void lookUpUserTest(){ + when(uriInfo.getPath()).thenReturn("/user?userID1"); + String response = jaxrsUserService.lookupUser("userID1"); + assertNotNull(response); + + + } +} diff --git a/aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/RetiredConsumerTest.java b/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/RetiredConsumerTest.java similarity index 92% rename from aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/RetiredConsumerTest.java rename to aai-traversal/src/test/java/org/onap/aai/retiredcustomer/RetiredConsumerTest.java index 4a8a051e..3810d441 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/RetiredConsumerTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/RetiredConsumerTest.java @@ -1,128 +1,129 @@ -/*- - * ============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.retiredcustomer; - -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.openecomp.aai.introspection.Version; -import org.openecomp.aai.rest.retired.RetiredConsumer; - -import javax.ws.rs.core.*; -import java.util.*; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.when; - -public abstract class RetiredConsumerTest { - - protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); - - private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); - - static { - VALID_HTTP_STATUS_CODES.add(200); - VALID_HTTP_STATUS_CODES.add(201); - VALID_HTTP_STATUS_CODES.add(204); - } - - protected RetiredConsumer retiredConsumer; - protected HttpHeaders httpHeaders; - protected UriInfo uriInfo; - - private MultivaluedMap headersMultiMap; - private MultivaluedMap queryParameters; - - private List aaiRequestContextList; - - private List outputMediaTypes; - - private static final EELFLogger logger = EELFManager.getInstance().getLogger(RetiredConsumer.class.getName()); - - @Before - public void setup(){ - logger.info("Starting the setup for the integration tests of Rest Endpoints"); - - retiredConsumer = getRetiredConsumer(); - httpHeaders = Mockito.mock(HttpHeaders.class); - uriInfo = Mockito.mock(UriInfo.class); - - headersMultiMap = new MultivaluedHashMap<>(); - queryParameters = Mockito.spy(new MultivaluedHashMap<>()); - - headersMultiMap.add("X-FromAppId", "JUNIT"); - headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); - headersMultiMap.add("Real-Time", "true"); - headersMultiMap.add("Accept", "application/json"); - headersMultiMap.add("aai-request-context", ""); - - outputMediaTypes = new ArrayList<>(); - outputMediaTypes.add(APPLICATION_JSON); - - aaiRequestContextList = new ArrayList<>(); - aaiRequestContextList.add(""); - - when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); - when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); - - when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); - - - when(uriInfo.getQueryParameters()).thenReturn(queryParameters); - when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); - - // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable - Mockito.doReturn(null).when(queryParameters).remove(anyObject()); - - when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); - } - - @Test - public void testRetiredForAllEndPoints(){ - when(uriInfo.getPath()).thenReturn("/aai/v3/cloud-infrastructure/pservers/pserver/test-pserver1"); - - Response response = retiredConsumer.createMessageGet(Version.getLatest().toString(), httpHeaders, uriInfo, null); - assertNotNull(response); - assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); - - response = retiredConsumer.createMessagePost(Version.getLatest().toString(), httpHeaders, uriInfo, null); - assertNotNull(response); - assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); - - response = retiredConsumer.createMessagePatch(Version.getLatest().toString(), httpHeaders, uriInfo, null); - assertNotNull(response); - assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); - - response = retiredConsumer.createMessagePut(Version.getLatest().toString(), httpHeaders, uriInfo, null); - assertNotNull(response); - assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); - - response = retiredConsumer.createMessageDelete(Version.getLatest().toString(), httpHeaders, uriInfo, null); - assertNotNull(response); - assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); - } - - public abstract RetiredConsumer getRetiredConsumer(); -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.retiredcustomer; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; +import org.onap.aai.introspection.Version; +import org.onap.aai.rest.retired.RetiredConsumer; + +import javax.ws.rs.core.*; +import java.util.*; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.when; + +public abstract class RetiredConsumerTest { + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + protected RetiredConsumer retiredConsumer; + protected HttpHeaders httpHeaders; + protected UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(RetiredConsumer.class.getName()); + + @Before + public void setup(){ + logger.info("Starting the setup for the integration tests of Rest Endpoints"); + + retiredConsumer = getRetiredConsumer(); + httpHeaders = Mockito.mock(HttpHeaders.class); + uriInfo = Mockito.mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + } + + @Test + public void testRetiredForAllEndPoints(){ + when(uriInfo.getPath()).thenReturn("/aai/v3/cloud-infrastructure/pservers/pserver/test-pserver1"); + + Response response = retiredConsumer.createMessageGet(Version.getLatest().toString(), httpHeaders, uriInfo, null); + assertNotNull(response); + assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); + + response = retiredConsumer.createMessagePost(Version.getLatest().toString(), httpHeaders, uriInfo, null); + assertNotNull(response); + assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); + + response = retiredConsumer.createMessagePatch(Version.getLatest().toString(), httpHeaders, uriInfo, null); + assertNotNull(response); + assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); + + response = retiredConsumer.createMessagePut(Version.getLatest().toString(), httpHeaders, uriInfo, null); + assertNotNull(response); + assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); + + response = retiredConsumer.createMessageDelete(Version.getLatest().toString(), httpHeaders, uriInfo, null); + assertNotNull(response); + assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); + } + + public abstract RetiredConsumer getRetiredConsumer(); +} diff --git a/aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/V3ThroughV7ConsumerTest.java b/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/V3ThroughV7ConsumerTest.java similarity index 74% rename from aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/V3ThroughV7ConsumerTest.java rename to aai-traversal/src/test/java/org/onap/aai/retiredcustomer/V3ThroughV7ConsumerTest.java index ea8ea9cb..e02cf383 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/V3ThroughV7ConsumerTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/V3ThroughV7ConsumerTest.java @@ -1,33 +1,34 @@ -/*- - * ============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.retiredcustomer; - -import org.openecomp.aai.rest.retired.RetiredConsumer; -import org.openecomp.aai.rest.retired.V3ThroughV7Consumer; - - -public class V3ThroughV7ConsumerTest extends RetiredConsumerTest { - - @Override - public RetiredConsumer getRetiredConsumer() { - return new V3ThroughV7Consumer(); - } -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.retiredcustomer; + +import org.onap.aai.rest.retired.RetiredConsumer; +import org.onap.aai.rest.retired.V3ThroughV7Consumer; + + +public class V3ThroughV7ConsumerTest extends RetiredConsumerTest { + + @Override + public RetiredConsumer getRetiredConsumer() { + return new V3ThroughV7Consumer(); + } +} diff --git a/aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/V7V8NamedQueriesTest.java b/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/V7V8NamedQueriesTest.java similarity index 74% rename from aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/V7V8NamedQueriesTest.java rename to aai-traversal/src/test/java/org/onap/aai/retiredcustomer/V7V8NamedQueriesTest.java index 9968ee8c..7c75e606 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/retiredcustomer/V7V8NamedQueriesTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/retiredcustomer/V7V8NamedQueriesTest.java @@ -1,33 +1,34 @@ -/*- - * ============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.retiredcustomer; - -import org.openecomp.aai.rest.retired.RetiredConsumer; -import org.openecomp.aai.rest.retired.V7V8NamedQueries; - -public class V7V8NamedQueriesTest extends RetiredConsumerTest { - - @Override - public RetiredConsumer getRetiredConsumer() { - return new V7V8NamedQueries(); - } -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.retiredcustomer; + +import org.onap.aai.rest.retired.RetiredConsumer; +import org.onap.aai.rest.retired.V7V8NamedQueries; + +public class V7V8NamedQueriesTest extends RetiredConsumerTest { + + @Override + public RetiredConsumer getRetiredConsumer() { + return new V7V8NamedQueries(); + } +} diff --git a/aai-traversal/src/test/java/org/openecomp/aai/transforms/JoltTestUtil.java b/aai-traversal/src/test/java/org/onap/aai/transforms/JoltTestUtil.java similarity index 90% rename from aai-traversal/src/test/java/org/openecomp/aai/transforms/JoltTestUtil.java rename to aai-traversal/src/test/java/org/onap/aai/transforms/JoltTestUtil.java index 7df27905..6a1966cf 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/transforms/JoltTestUtil.java +++ b/aai-traversal/src/test/java/org/onap/aai/transforms/JoltTestUtil.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.transforms; +package org.onap.aai.transforms; import java.io.IOException; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/transforms/LowerHyphenToLowerCamelConverterTest.java b/aai-traversal/src/test/java/org/onap/aai/transforms/LowerHyphenToLowerCamelConverterTest.java similarity index 90% rename from aai-traversal/src/test/java/org/openecomp/aai/transforms/LowerHyphenToLowerCamelConverterTest.java rename to aai-traversal/src/test/java/org/onap/aai/transforms/LowerHyphenToLowerCamelConverterTest.java index 3dc5299c..8c8837c8 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/transforms/LowerHyphenToLowerCamelConverterTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/transforms/LowerHyphenToLowerCamelConverterTest.java @@ -1,24 +1,25 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - -package org.openecomp.aai.transforms; +package org.onap.aai.transforms; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/transforms/MapTraverserTest.java b/aai-traversal/src/test/java/org/onap/aai/transforms/MapTraverserTest.java similarity index 84% rename from aai-traversal/src/test/java/org/openecomp/aai/transforms/MapTraverserTest.java rename to aai-traversal/src/test/java/org/onap/aai/transforms/MapTraverserTest.java index e3b77604..f26f7195 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/transforms/MapTraverserTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/transforms/MapTraverserTest.java @@ -1,27 +1,28 @@ -/*- +/** * ============LICENSE_START======================================================= - * org.openecomp.aai + * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 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 - * + * + * 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ +package org.onap.aai.transforms; -package org.openecomp.aai.transforms; - -import org.openecomp.aai.transforms.LowerCamelToLowerHyphenConverter; -import org.openecomp.aai.transforms.MapTraverser; +import org.onap.aai.transforms.LowerCamelToLowerHyphenConverter; +import org.onap.aai.transforms.MapTraverser; import com.bazaarvoice.jolt.JsonUtils; import org.junit.Test; diff --git a/aai-traversal/src/test/java/org/openecomp/aai/util/AAIAppServletContextListenerTest.java b/aai-traversal/src/test/java/org/onap/aai/util/AAIAppServletContextListenerTest.java similarity index 91% rename from aai-traversal/src/test/java/org/openecomp/aai/util/AAIAppServletContextListenerTest.java rename to aai-traversal/src/test/java/org/onap/aai/util/AAIAppServletContextListenerTest.java index d8e49284..003c4e0c 100644 --- a/aai-traversal/src/test/java/org/openecomp/aai/util/AAIAppServletContextListenerTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/util/AAIAppServletContextListenerTest.java @@ -1,177 +1,178 @@ -/*- - * ============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.util; - -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.Logger; -import ch.qos.logback.classic.PatternLayout; -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.AppenderBase; -import org.apache.commons.lang.ObjectUtils; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.openecomp.aai.dbmap.AAIGraph; -import org.openecomp.aai.logging.ErrorLogHelper; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.agent.PowerMockAgent; -import org.powermock.modules.junit4.rule.PowerMockRule; -import org.slf4j.LoggerFactory; - -import javax.servlet.ServletContextEvent; -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -@PrepareForTest({AAIGraph.class, AAIConfig.class, ErrorLogHelper.class}) -public class AAIAppServletContextListenerTest { - - @Rule - public PowerMockRule rule = new PowerMockRule(); - - static { - PowerMockAgent.initializeIfNeeded(); - } - - private ServletContextEvent arg; - private AAIAppServletContextListener listener; - - /** - * Initialize. - */ - @Before - @PrepareForTest({AAIGraph.class, AAIConfig.class, ErrorLogHelper.class}) - public void initialize(){ - arg = PowerMockito.mock(ServletContextEvent.class); - PowerMockito.mockStatic(AAIGraph.class); - PowerMockito.mockStatic(AAIConfig.class); - PowerMockito.mockStatic(ErrorLogHelper.class); - - listener = new AAIAppServletContextListener(); - configureLog(); - } - - /** - * Test contextDestroyed. - */ - @Test(expected = NullPointerException.class) - //@Ignore - public void testContextDestroyed(){ - listener.contextDestroyed(arg); - assertTrue(logContains(Level.DEBUG, "AAI Server shutdown")); - assertTrue(logContains(Level.INFO, "AAI graph shutdown")); - } - - /** - * Test contextInitialized. - */ - @Test - //@Ignore - public void testContextInitialized(){ - listener.contextInitialized(arg); - assertFalse(logContains(Level.DEBUG, "Loading aaiconfig.properties")); - assertFalse(logContains(Level.DEBUG, "Loading error.properties")); - assertFalse(logContains(Level.DEBUG, "Loading graph database")); - assertFalse(logContains(Level.INFO, "AAI Server initialization")); - } - - - /** - * Helper method to check if a String appears in the desired log level. - * - * @param level Log level to use - * @param expected String to search for - * @return True if search String is found, false otherwise - */ - private boolean logContains(Level level, String expected) { - String actual[] = RecordingAppender.messages(); - for (String log : actual) { - if (log.contains(level.toString()) && log.contains(expected)) - return true; - } - return false; - } - - /** - * Set logging level, and initialize log-appender. - */ - private void configureLog() { - org.slf4j.Logger rootLogger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); - rootLogger.debug("debug"); - // rootLogger.(); - // rootLogger.addAppender(RecordingAppender.appender(new PatternLayout())); - } - -} - - -/** - * Appender class that appends log messages to a String List when some logging event occurs - */ -class RecordingAppender extends AppenderBase { - private static List messages = new ArrayList(); - private static RecordingAppender appender = new RecordingAppender(); - private PatternLayout patternLayout; - - private RecordingAppender() { - super(); - } - - /** - * @param patternLayout Pattern to format log message - * @return Current appender - */ - public static RecordingAppender appender(PatternLayout patternLayout) { - appender.patternLayout = patternLayout; - appender.clear(); - return appender; - } - - @Override - protected void append(ILoggingEvent event) { - messages.add(patternLayout.doLayout(event)); - } - - public void close() {} - - public boolean requiresLayout() { - return false; - } - - /** - * @return Return logs as a String array - */ - public static String[] messages() { - return (String[]) messages.toArray(new String[messages.size()]); - } - - /** - * Clear the message container - */ - private void clear() { - messages.clear(); - } - -} +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.Logger; +import ch.qos.logback.classic.PatternLayout; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; +import org.apache.commons.lang.ObjectUtils; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.onap.aai.dbmap.AAIGraph; +import org.onap.aai.logging.ErrorLogHelper; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.agent.PowerMockAgent; +import org.powermock.modules.junit4.rule.PowerMockRule; +import org.slf4j.LoggerFactory; + +import javax.servlet.ServletContextEvent; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +@PrepareForTest({AAIGraph.class, AAIConfig.class, ErrorLogHelper.class}) +public class AAIAppServletContextListenerTest { + + @Rule + public PowerMockRule rule = new PowerMockRule(); + + static { + PowerMockAgent.initializeIfNeeded(); + } + + private ServletContextEvent arg; + private AAIAppServletContextListener listener; + + /** + * Initialize. + */ + @Before + @PrepareForTest({AAIGraph.class, AAIConfig.class, ErrorLogHelper.class}) + public void initialize(){ + arg = PowerMockito.mock(ServletContextEvent.class); + PowerMockito.mockStatic(AAIGraph.class); + PowerMockito.mockStatic(AAIConfig.class); + PowerMockito.mockStatic(ErrorLogHelper.class); + + listener = new AAIAppServletContextListener(); + configureLog(); + } + + /** + * Test contextDestroyed. + */ + @Test(expected = NullPointerException.class) + //@Ignore + public void testContextDestroyed(){ + listener.contextDestroyed(arg); + assertTrue(logContains(Level.DEBUG, "AAI Server shutdown")); + assertTrue(logContains(Level.INFO, "AAI graph shutdown")); + } + + /** + * Test contextInitialized. + */ + @Test + //@Ignore + public void testContextInitialized(){ + listener.contextInitialized(arg); + assertFalse(logContains(Level.DEBUG, "Loading aaiconfig.properties")); + assertFalse(logContains(Level.DEBUG, "Loading error.properties")); + assertFalse(logContains(Level.DEBUG, "Loading graph database")); + assertFalse(logContains(Level.INFO, "AAI Server initialization")); + } + + + /** + * Helper method to check if a String appears in the desired log level. + * + * @param level Log level to use + * @param expected String to search for + * @return True if search String is found, false otherwise + */ + private boolean logContains(Level level, String expected) { + String actual[] = RecordingAppender.messages(); + for (String log : actual) { + if (log.contains(level.toString()) && log.contains(expected)) + return true; + } + return false; + } + + /** + * Set logging level, and initialize log-appender. + */ + private void configureLog() { + org.slf4j.Logger rootLogger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); + rootLogger.debug("debug"); + // rootLogger.(); + // rootLogger.addAppender(RecordingAppender.appender(new PatternLayout())); + } + +} + + +/** + * Appender class that appends log messages to a String List when some logging event occurs + */ +class RecordingAppender extends AppenderBase { + private static List messages = new ArrayList(); + private static RecordingAppender appender = new RecordingAppender(); + private PatternLayout patternLayout; + + private RecordingAppender() { + super(); + } + + /** + * @param patternLayout Pattern to format log message + * @return Current appender + */ + public static RecordingAppender appender(PatternLayout patternLayout) { + appender.patternLayout = patternLayout; + appender.clear(); + return appender; + } + + @Override + protected void append(ILoggingEvent event) { + messages.add(patternLayout.doLayout(event)); + } + + public void close() {} + + public boolean requiresLayout() { + return false; + } + + /** + * @return Return logs as a String array + */ + public static String[] messages() { + return (String[]) messages.toArray(new String[messages.size()]); + } + + /** + * Clear the message container + */ + private void clear() { + messages.clear(); + } + +} diff --git a/aai-traversal/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties b/aai-traversal/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties index e1386538..218d9acd 100644 --- a/aai-traversal/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties +++ b/aai-traversal/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties @@ -1,22 +1,24 @@ -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# #################################################################### # REMEMBER TO THINK ABOUT ENVIRONMENTAL DIFFERENCES AND CHANGE THE diff --git a/aai-traversal/src/test/resources/config/etc/titan-cached.properties b/aai-traversal/src/test/resources/config/etc/titan-cached.properties index 64089093..2333d2a1 100644 --- a/aai-traversal/src/test/resources/config/etc/titan-cached.properties +++ b/aai-traversal/src/test/resources/config/etc/titan-cached.properties @@ -1,22 +1,24 @@ -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# query.fast-property=true # the following parameters are not reloaded automatically and require a manual bounce diff --git a/aai-traversal/src/test/resources/config/etc/titan-realtime.properties b/aai-traversal/src/test/resources/config/etc/titan-realtime.properties index c50b1411..2d1d21dd 100644 --- a/aai-traversal/src/test/resources/config/etc/titan-realtime.properties +++ b/aai-traversal/src/test/resources/config/etc/titan-realtime.properties @@ -1,22 +1,24 @@ -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# query.fast-property=true # the following parameters are not reloaded automatically and require a manual bounce diff --git a/aai-traversal/src/test/resources/inmemory_titan.properties b/aai-traversal/src/test/resources/inmemory_titan.properties index 46695d68..cf4bbfd3 100644 --- a/aai-traversal/src/test/resources/inmemory_titan.properties +++ b/aai-traversal/src/test/resources/inmemory_titan.properties @@ -1,21 +1,23 @@ -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# storage.backend=inmemory diff --git a/aai-traversal/src/test/resources/logback.xml b/aai-traversal/src/test/resources/logback.xml index 042f0527..cc640175 100644 --- a/aai-traversal/src/test/resources/logback.xml +++ b/aai-traversal/src/test/resources/logback.xml @@ -1,21 +1,26 @@ + ============LICENSE_START======================================================= + org.onap.aai + ================================================================================ + Copyright © 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========================================================= + + ECOMP is a trademark and service mark of AT&T Intellectual Property. + +--> ${module.ajsc.namespace.name} @@ -231,12 +236,12 @@ --> - + diff --git a/aai-traversal/src/test/resources/test_aaiconfig.properties b/aai-traversal/src/test/resources/test_aaiconfig.properties index 926d3f8b..f9847618 100644 --- a/aai-traversal/src/test/resources/test_aaiconfig.properties +++ b/aai-traversal/src/test/resources/test_aaiconfig.properties @@ -1,22 +1,24 @@ -### +# # ============LICENSE_START======================================================= -# org.openecomp.aai +# org.onap.aai # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright © 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 -# +# +# 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========================================================= -### +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# #################################################################### # REMEMBER TO THINK ABOUT ENVIRONMENTAL DIFFERENCES AND CHANGE THE diff --git a/pom.xml b/pom.xml index b179c3d0..55559c1a 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ aaiadmin aaiadmin - org.openecomp.aai.dev + org.onap.aai.dev