summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorHarish Venkata Kajur <vk250x@att.com>2019-01-04 13:34:33 -0500
committerHarish Venkata Kajur <vk250x@att.com>2019-01-08 22:03:06 -0500
commit4a65c6f42c9eb705d7e3155788278674ff2b0a67 (patch)
tree874de6e711a2e80728ddc1a16d69f216e016d177 /src/main/java
parentd582cc40ecabf097f6b2f9c804eff998f922a6f5 (diff)
Update the GenTester to exit properly
Issue-ID: AAI-1958 Change-Id: Ifbffd1c15e474dce0cc7b3102f7b6961a72a864e Signed-off-by: Harish Venkata Kajur <vk250x@att.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/aai/schema/GenTester.java36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/main/java/org/onap/aai/schema/GenTester.java b/src/main/java/org/onap/aai/schema/GenTester.java
index e79256f..663aaec 100644
--- a/src/main/java/org/onap/aai/schema/GenTester.java
+++ b/src/main/java/org/onap/aai/schema/GenTester.java
@@ -135,27 +135,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);
}