Update the GenTester to exit properly 12/75312/1 1.0.3
authorHarish Venkata Kajur <vk250x@att.com>
Fri, 4 Jan 2019 18:34:33 +0000 (13:34 -0500)
committerHarish Venkata Kajur <vk250x@att.com>
Fri, 4 Jan 2019 18:34:38 +0000 (13:34 -0500)
Issue-ID: AAI-1958
Change-Id: Ifbffd1c15e474dce0cc7b3102f7b6961a72a864e
Signed-off-by: Harish Venkata Kajur <vk250x@att.com>
pom.xml
src/main/java/org/onap/aai/schema/GenTester.java
src/main/scripts/common_functions.sh

diff --git a/pom.xml b/pom.xml
index 20ad889..59cfc07 100755 (executable)
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
     </parent>
     <groupId>org.onap.aai.graphadmin</groupId>
     <artifactId>aai-graphadmin</artifactId>
-    <version>1.0.2-SNAPSHOT</version>
+    <version>1.0.3-SNAPSHOT</version>
 
     <properties>
 
@@ -99,8 +99,8 @@
         <gson.version>2.7</gson.version>
         <json.version>20090211</json.version>
 
-        <aai.core.version>1.3.4</aai.core.version>
-        <aai.schema.version>1.3.4</aai.schema.version>
+        <aai.core.version>1.3.5</aai.core.version>
+        <aai.schema.version>1.3.5</aai.schema.version>
 
         <netty.handler.version>4.1.9.Final</netty.handler.version>
         <netty.version>4.0.56.Final</netty.version>
index 812c7b0..87d0a97 100644 (file)
@@ -133,27 +133,27 @@ public class GenTester {
                        // Load the propertyKeys, indexes and edge-Labels into the DB
                        JanusGraphManagement graphMgt = graph.openManagement();
 
-               imsg = "-- Loading new schema elements into JanusGraph --";
-                       System.out.println(imsg);
-                       LOGGER.info(imsg);
-                       SchemaGenerator.loadSchemaIntoJanusGraph(graph, graphMgt, null);
+            imsg = "-- Loading new schema elements into JanusGraph --";
+            System.out.println(imsg);
+            LOGGER.info(imsg);
+            SchemaGenerator.loadSchemaIntoJanusGraph(graph, graphMgt, null);
+                       if( graph != null ){
+                               imsg = "-- graph commit";
+                               System.out.println(imsg);
+                               LOGGER.info(imsg);
+                               graph.tx().commit();
+
+                               imsg = "-- graph shutdown ";
+                               System.out.println(imsg);
+                               LOGGER.info(imsg);
+                               graph.close();
+                               throw new RuntimeException();
+                       }
            } catch(Exception ex) {
-               ErrorLogHelper.logError("AAI_4000", ex.getMessage());
+            ErrorLogHelper.logError("AAI_4000", ex.getMessage());
+            System.exit(1);
            }
-           
-
-           if( graph != null ){
-                   String imsg = "-- graph commit";
-               System.out.println(imsg);
-               LOGGER.info(imsg);
-               graph.tx().commit();
 
-                       imsg = "-- graph shutdown ";
-               System.out.println(imsg);
-               LOGGER.info(imsg);
-               graph.close();
-           }
-           
            LOGGER.auditEvent("-- all done, if program does not exit, please kill.");
            System.exit(0);
     }
index ed795fe..55fb516 100644 (file)
@@ -49,7 +49,10 @@ execute_spring_jar(){
 
     JAVA_OPTS="${JAVA_OPTS} ${JAVA_POST_OPTS}";
 
-    ${JAVA_HOME}/bin/java ${JVM_OPTS} ${JAVA_OPTS} -jar ${EXECUTABLE_JAR} "$@"
+    ${JAVA_HOME}/bin/java ${JVM_OPTS} ${JAVA_OPTS} -jar ${EXECUTABLE_JAR} "$@" || {
+        echo "Failed to run the tool $0 successfully";
+        exit 1;
+    }
 }
 
 # Prints the start date and the script that the user called