diff --git a/src/test/java/TestNGRunner.java b/src/test/java/TestNGRunner.java index 022954a..4e3317d 100644 --- a/src/test/java/TestNGRunner.java +++ b/src/test/java/TestNGRunner.java @@ -13,7 +13,8 @@ public class TestNGRunner { public static void main(String[] args) throws Exception { - List testsForExecution = ParametersParser.getListOfTests(args); + TestSource source = SourceFactory.getSource(args); + List testsForExecution = source.getSteps(); XmlSuite suite = new XmlSuite(); suite.setName("TmpSuite"); @@ -21,7 +22,8 @@ public static void main(String[] args) throws Exception { try { addXmlTestToSuite(suite, testModel); } catch (Exception e) { - e.printStackTrace(); + log.error(cannot parse) + throw new RuntimeException(e); } }); List suites = new ArrayList(); @@ -31,7 +33,7 @@ public static void main(String[] args) throws Exception { tng.run(); } - private static XmlTest addXmlTestToSuite(XmlSuite suite, TestModel testToAdd) throws Exception { + private static XmlTest addXmlTestToSuite(XmlSuite suite, TestModel testToAdd) { XmlTest test = new XmlTest(suite); test.setName(testToAdd.testClassName); List classes = new ArrayList(); @@ -46,4 +48,4 @@ private static XmlTest addXmlTestToSuite(XmlSuite suite, TestModel testToAdd) th test.setXmlClasses(classes); return test; } -} \ No newline at end of file +}