aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/vid/automation/test/StartTest.java
diff options
context:
space:
mode:
authorOfir Sonsino <os0695@att.com>2018-01-31 17:19:00 +0200
committerOfir Sonsino <os0695@att.com>2018-01-31 17:19:00 +0200
commit1cfb08779ea0e00be69e072a940b3063e049fe6b (patch)
tree6602a900387c8393ed0dcd81c0539381632903c6 /vid-automation/src/main/java/vid/automation/test/StartTest.java
parent2f20b001b9243e0f8b44aecc768ec265fd538732 (diff)
org.onap migration
Change-Id: I52f0b2851f2c765752b6d21f49b32136d7d72a3d Issue-ID: VID-86 Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-automation/src/main/java/vid/automation/test/StartTest.java')
-rw-r--r--vid-automation/src/main/java/vid/automation/test/StartTest.java66
1 files changed, 66 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/StartTest.java b/vid-automation/src/main/java/vid/automation/test/StartTest.java
new file mode 100644
index 000000000..742cb6f1e
--- /dev/null
+++ b/vid-automation/src/main/java/vid/automation/test/StartTest.java
@@ -0,0 +1,66 @@
+package vid.automation.test;
+
+import org.testng.TestNG;
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * Created by itzikliderman on 21/06/2017.
+ */
+public class StartTest {
+ public static boolean debug = false;
+
+ public static AtomicBoolean loggerInitialized = new AtomicBoolean(false);
+
+ protected static Logger logger = null;
+
+ public static void main (String[] args) throws IOException {
+ String debugEnabled = System.getProperty("debug");
+ if (debugEnabled != null && debugEnabled.equalsIgnoreCase("true")) {
+ debug = true;
+ }
+ System.out.println("Debug mode is " + (debug ? "enabled" : "disabled"));
+
+ enableLogger();
+
+ TestNG testng = new TestNG();
+
+ List<String> suites = new ArrayList<String>();
+ suites.add(args[0]);
+ testng.setTestSuites(suites);
+ testng.setUseDefaultListeners(true);
+ testng.setOutputDirectory("target/");
+
+ testng.run();
+ }
+
+ public StartTest() {
+ logger = Logger.getLogger(StartTest.class.getName());
+ }
+
+ public static void enableLogger() {
+
+ if (false == loggerInitialized.get()) {
+
+ loggerInitialized.set(true);
+
+ String log4jPropsFile = System.getProperty("log4j.configuration");
+// if (System.getProperty("os.name").contains("Windows")) {
+ String logProps = "src/main/resources/ci/conf/log4j.properties";
+ if (log4jPropsFile == null) {
+ System.setProperty("targetlog", "target/");
+ log4jPropsFile = logProps;
+ }
+
+// }
+ PropertyConfigurator.configureAndWatch(log4jPropsFile);
+
+ }
+ }
+
+}