/** * @param testium * @param tgFile * @return * @throws Error */ private static TestGroup readTestGroup(Testium testium, RunTimeData anRtData) throws Error { Trace.println(Trace.UTIL, "readTestGroup( Testium, runTimeData )", true); File tgFile = anRtData.getValueAsFile(Testium.TESTFILE); TestGroup testGroup; try { testGroup = testium.readTestGroup(tgFile); } catch (IOError e) { Trace.print(Trace.UTIL, e); throw new Error("TestGroup could not be read: " + tgFile.getPath(), e); } return testGroup; }
/** * @param testium * @param rtData * @throws Error */ private static void doExecution(Testium aTestium, RunTimeData anRtData) throws Error { Trace.println(Trace.EXEC, "doExecution( Testium, runTimeData )", true); TestGroup testGroup = readTestGroup(aTestium, anRtData); File testSuiteDir = anRtData.getValueAsFile(Testium.PROJECTDIR); if (testSuiteDir == null) { throw new Error("Test Suite Directory is not defined"); } if (!testSuiteDir.isDirectory()) { throw new Error("Test Suite Directory is not found: " + testSuiteDir.getPath()); } try { aTestium.execute(testGroup, testSuiteDir, anRtData); } catch (TestExecutionException e) { Trace.print(Trace.EXEC, e); throw new Error("Execution failed.", e); } }
/** * @param rtData * @param testium * @param tgFile * @param testGroup * @throws Error */ private static void doPreparations(Testium aTestium, RunTimeData anRtData) throws Error { Trace.println(Trace.EXEC, "doPreparations( Testium, runTimeData )", true); TestGroup testGroup = readTestGroup(aTestium, anRtData); File testSuiteDir = anRtData.getValueAs(File.class, Testium.PROJECTDIR); String groupId = anRtData.getValueAs(String.class, Testium.TESTGROUP); String caseId = anRtData.getValueAs(String.class, Testium.TESTCASE); if (groupId == null && caseId == null) { throw new Error("Preparation failed: Must specify a testgroup or testcase to prepare for."); } try { aTestium.prepare(testGroup, testSuiteDir, anRtData); } catch (TestExecutionException e) { Trace.print(Trace.EXEC, e); throw new Error("Preparation failed.", e); } }