Merge "fix xsd generation when obj crosses oxm files"
authorJames Forsyth <jf2512@att.com>
Mon, 22 Oct 2018 23:13:20 +0000 (23:13 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 22 Oct 2018 23:13:20 +0000 (23:13 +0000)
13 files changed:
aai-annotations/pom.xml
aai-auth/pom.xml
aai-core/pom.xml
aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java
aai-core/src/test/java/org/onap/aai/rest/RestHandlerTest.java [new file with mode: 0644]
aai-core/src/test/java/org/onap/aai/util/JettyObfuscationConversionCommandLineUtilTest.java
aai-schema-ingest/pom.xml
aai-schema/pom.xml
aai-schema/src/main/resources/onap/dbedgerules/v14/DbEdgeRules_ccvpn_v14.json
aai-schema/src/main/xjb/bindings-onap.xjb
aai-utils/pom.xml
pom.xml
version.properties

index 4297c1a..4dab523 100644 (file)
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-common</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.4.0-SNAPSHOT</version>
     </parent>
     <artifactId>aai-annotations</artifactId>
     <name>aai-annotations</name>
     <packaging>jar</packaging>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.4.0-SNAPSHOT</version>
     <properties>
         <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
     </properties>
index 03a32b9..ecae486 100644 (file)
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-common</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.4.0-SNAPSHOT</version>
     </parent>
     <artifactId>aai-auth</artifactId>
     <name>aai-auth</name>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.4.0-SNAPSHOT</version>
 
     <properties>
         <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
index 9788e11..57b67e6 100644 (file)
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-common</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.4.0-SNAPSHOT</version>
     </parent>
     <artifactId>aai-core</artifactId>
     <name>aai-core</name>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.4.0-SNAPSHOT</version>
     <packaging>jar</packaging>
     <properties>
         <sonar.language>java</sonar.language>
index 5231970..5915ce6 100644 (file)
@@ -31,6 +31,8 @@ import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.Matchers.matchesPattern;
 import static org.junit.Assert.*;
 
+import java.io.FileNotFoundException;
+
 public class AAIGraphTest extends AAISetup{
        @Before
        public void setup() {
@@ -68,5 +70,15 @@ public class AAIGraphTest extends AAISetup{
                graphMgt.rollback();
                graph.close();
        }
+       
+       @Test (expected=FileNotFoundException.class)
+       public void JanusGraphOpenNameWithInvalidFilePathTest() throws Exception{
+               JanusGraph graph = JanusGraphFactory.open(new AAIGraphConfig.Builder("invalid").forService(SERVICE_NAME).withGraphType("graphType").buildConfiguration());
+               JanusGraphManagement graphMgt = graph.openManagement();
+               String connectionInstanceName = graphMgt.getOpenInstances().stream().filter(c -> c.contains("current")).findFirst().get();
+               assertThat(connectionInstanceName,matchesPattern("^\\d+_[\\w\\-\\d]+_" + SERVICE_NAME + "_graphType_\\d+\\(current\\)$"));
+               graphMgt.rollback();
+               graph.close();
+       }
 
 }
diff --git a/aai-core/src/test/java/org/onap/aai/rest/RestHandlerTest.java b/aai-core/src/test/java/org/onap/aai/rest/RestHandlerTest.java
new file mode 100644 (file)
index 0000000..c25e292
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * 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.onap.aai.rest;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class RestHandlerTest {
+
+    @Test
+    public void testGetInstance() {
+
+       RestHandlerService firstInstance = RestHandlerService.getInstance();
+       RestHandlerService secondInstance = RestHandlerService.getInstance();
+       assertNotNull(firstInstance);
+       assertNotNull(secondInstance);
+       assertTrue(firstInstance == secondInstance);
+
+    }
+}
index 97349ec..071b630 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ *  Modifications Copyright © 2018 IBM.
+ * ================================================================================
  * 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
@@ -30,42 +32,65 @@ import org.junit.Test;
 
 public class JettyObfuscationConversionCommandLineUtilTest {
 
-       private final ByteArrayOutputStream testOut = new ByteArrayOutputStream();
+    private final ByteArrayOutputStream testOut = new ByteArrayOutputStream();
+
+    /**
+     * Test.
+     */
+    @Test
+    public void test() {
+        //setup, this will catch main's print statements for evaluation
+        PrintStream oldOutputStream = System.out;
+        System.setOut(new PrintStream(testOut));
+
+        /* ------ TEST OBFUSCATION ----*/
+        JettyObfuscationConversionCommandLineUtil.main(new String[]{"-e", "hello world"});
+        /*
+         * testOut was also catching any logging statements which interfered with result checking.
+         * This regex business was the workaround - it tries to find the expected value in
+         * the results and asserts against that.
+         */
+        String obfResult = testOut.toString();
+        String obfExpected = "OBF:1thf1ugo1x151wfw1ylz11tr1ymf1wg21x1h1uh21th7";
+        Pattern obfExpectPat = Pattern.compile(obfExpected);
+        Matcher obfMatch = obfExpectPat.matcher(obfResult);
+        assertTrue(obfMatch.find());
+
+        testOut.reset(); //clear out previous result
+
+        /* ------ TEST DEOBFUSCATION ----- */
+        JettyObfuscationConversionCommandLineUtil.main(new String[]{"-d", obfExpected});
+        String deobfResult = testOut.toString();
+        String deobfExpected = "hello world";
+        Pattern deobfExpectPat = Pattern.compile(deobfExpected);
+        Matcher deobfMatch = deobfExpectPat.matcher(deobfResult);
+        assertTrue(deobfMatch.find());
 
-       /**
-        * Test.
-        */
-       @Test
-       public void test() {
-               //setup, this will catch main's print statements for evaluation
-               PrintStream oldOutputStream = System.out;
-               System.setOut(new PrintStream(testOut));
+        //clean up, resets to stdout
+        System.setOut(oldOutputStream);
+    }
 
-               /* ------ TEST OBFUSCATION ----*/
-               JettyObfuscationConversionCommandLineUtil.main(new String[]{"-e", "hello world"});
-               /*
-                * testOut was also catching any logging statements which interfered with result checking.
-                * This regex business was the workaround - it tries to find the expected value in
-                * the results and asserts against that.
-                */
-               String obfResult = testOut.toString();
-               String obfExpected = "OBF:1thf1ugo1x151wfw1ylz11tr1ymf1wg21x1h1uh21th7";
-               Pattern obfExpectPat = Pattern.compile(obfExpected);
-               Matcher obfMatch = obfExpectPat.matcher(obfResult);
-               assertTrue(obfMatch.find());
+    
+    /**
+     * Test.
+     */
+    @Test
+    public void testUsage() {
+        System.setOut(new PrintStream(testOut));
 
-               testOut.reset(); //clear out previous result
+        /* ------ TEST OBFUSCATION ----*/
+        JettyObfuscationConversionCommandLineUtil.main(new String[]{"-f", "hello world"});
+        /*
+         * testOut was also catching any logging statements which interfered with result checking.
+         * This regex business was the workaround - it tries to find the expected value in
+         * the results and asserts against that.
+         */
+        String obfResult = testOut.toString();
+        assertTrue(obfResult.startsWith("failed to parse input"));
+        
+        testOut.reset(); //clear out previous result
 
-               /* ------ TEST DEOBFUSCATION ----- */
-               JettyObfuscationConversionCommandLineUtil.main(new String[]{"-d", obfExpected});
-               String deobfResult = testOut.toString();
-               String deobfExpected = "hello world";
-               Pattern deobfExpectPat = Pattern.compile(deobfExpected);
-               Matcher deobfMatch = deobfExpectPat.matcher(deobfResult);
-               assertTrue(deobfMatch.find());
 
-               //clean up, resets to stdout
-               System.setOut(oldOutputStream);
-       }
+    }
 
 }
index 9ac9695..d2f9369 100644 (file)
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-common</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.4.0-SNAPSHOT</version>
     </parent>
     <artifactId>aai-schema-ingest</artifactId>
     <name>aai-schema-ingest</name>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.4.0-SNAPSHOT</version>
     <packaging>jar</packaging>
 
     <build>
index 7facd99..e949d23 100644 (file)
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-common</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.4.0-SNAPSHOT</version>
     </parent>
     <artifactId>aai-schema</artifactId>
     <name>aai-schema</name>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.4.0-SNAPSHOT</version>
     <properties>
         <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
         <!-- Start of Default ONAP Schema Properties -->
index 1b6d940..62b6c52 100644 (file)
                "to": "service-instance",
                "label": "org.onap.relationships.inventory.PartOf",
                "direction": "OUT",
-               "multiplicity": "ONE2MANY",
+               "multiplicity": "MANY2MANY",
                "contains-other-v": "NONE",
                "delete-other-v": "NONE",
                "prevent-delete": "NONE",
index 85713f2..f5579b8 100644 (file)
@@ -2,7 +2,11 @@
 <jaxb:bindings
     version="2.1"
     xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
+    <jaxb:globalBindings>
+           <xjc:serializable uid="14"/>
+    </jaxb:globalBindings>
     <jaxb:bindings scd="x-schema::a" xmlns:a="http://org.openecomp.aai.inventory/v8">
         <jaxb:schemaBindings>
             <jaxb:package name="org.onap.aai.domain.yang.v8"/>
@@ -16,7 +20,7 @@
     <jaxb:bindings scd="x-schema::a" xmlns:a="http://org.openecomp.aai.inventory/v10">
         <jaxb:schemaBindings>
             <jaxb:package name="org.onap.aai.domain.yang.v10"/>
-        </jaxb:schemaBindings>      
+        </jaxb:schemaBindings>
     </jaxb:bindings>
     <jaxb:bindings scd="x-schema::a" xmlns:a="http://org.openecomp.aai.inventory/v11">
         <jaxb:schemaBindings>
@@ -26,7 +30,7 @@
     <jaxb:bindings scd="x-schema::a" xmlns:a="http://org.onap.aai.inventory/v12">
         <jaxb:schemaBindings>
             <jaxb:package name="org.onap.aai.domain.yang.v12"/>
-        </jaxb:schemaBindings>      
+        </jaxb:schemaBindings>
     </jaxb:bindings>
     <jaxb:bindings scd="x-schema::a" xmlns:a="http://org.onap.aai.inventory/v13">
         <jaxb:schemaBindings>
@@ -35,7 +39,7 @@
     </jaxb:bindings>
     <jaxb:bindings scd="x-schema::a" xmlns:a="http://org.onap.aai.inventory/v14">
         <jaxb:schemaBindings>
-            <jaxb:package name="org.onap.aai.domain.yang"/>
-        </jaxb:schemaBindings>      
+               <jaxb:package name="org.onap.aai.domain.yang"/>
+        </jaxb:schemaBindings>
     </jaxb:bindings>
 </jaxb:bindings>
index 4eadb51..0f02b99 100644 (file)
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-common</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.4.0-SNAPSHOT</version>
     </parent>
     <artifactId>aai-utils</artifactId>
     <name>aai-utils</name>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.4.0-SNAPSHOT</version>
 
     <properties>
         <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
diff --git a/pom.xml b/pom.xml
index 2e15647..d7b47a6 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
 
     <groupId>org.onap.aai.aai-common</groupId>
     <artifactId>aai-common</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.4.0-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>aai-aai-common</name>
     <description>Contains all of the common code for resources and traversal repos</description>
index 51e1781..66827fd 100644 (file)
@@ -4,7 +4,7 @@
 # because they are used in Jenkins, whose plug-in doesn't support
 
 major_version=1
-minor_version=3
+minor_version=4
 patch_version=0
 
 base_version=${major_version}.${minor_version}.${patch_version}