use of org.sakuli.datamodel.properties.TestSuiteProperties in project sakuli by ConSol.
the class CommonInitializingServiceImplTest method testInitWithOutTestCases.
@Test
public void testInitWithOutTestCases() throws Throwable {
TestSuiteProperties props = new TestSuiteProperties();
props.setTestSuiteId("suite_id");
props.setLoadTestCasesAutomatic(false);
testSuiteProperties = spy(props);
ts = spy(new TestSuite(testSuiteProperties));
MockitoAnnotations.initMocks(this);
testling.initTestSuite();
assertEquals(ts.getState(), TestSuiteState.RUNNING);
assertNotNull(ts.getStartDate());
assertNull(ts.getAbsolutePathOfTestSuiteFile());
assertEquals(ts.getDbPrimaryKey(), -1);
assertNull(ts.getTestCases());
assertEquals(ts.getId(), "suite_id");
}
use of org.sakuli.datamodel.properties.TestSuiteProperties in project sakuli by ConSol.
the class TestSuiteHelperTest method testInitExceptionForTestCase.
@Test(expectedExceptions = FileNotFoundException.class, expectedExceptionsMessageRegExp = "test case path \".*unValidTestCase.*\" doesn't exists - check your \"testsuite.suite\" file")
public void testInitExceptionForTestCase() throws Throwable {
TestSuiteProperties testProps = TestSuitePropertiesTestUtils.getTestProps(this.getClass(), "unvalid", "unvalid_id");
TestSuiteHelper.loadTestCases(testProps);
}
use of org.sakuli.datamodel.properties.TestSuiteProperties in project sakuli by ConSol.
the class TestSuiteHelperTest method testInit.
@Test
public void testInit() throws Throwable {
TestSuiteProperties testProps = TestSuitePropertiesTestUtils.getTestProps(this.getClass(), "valid", "suite_id_001");
HashMap<String, TestCase> result = TestSuiteHelper.loadTestCases(testProps);
assertEquals(1, result.size());
//tests if onyl the valid testcase are in the suite, with there right names
TestCase tc = result.values().iterator().next();
assertEquals("http://localhost:8080", tc.getStartUrl());
assertEquals(tc.getName(), "validTestCase");
assertEquals(tc.getId(), "validTestCase");
assertEquals(tc.getId(), result.keySet().iterator().next());
}
use of org.sakuli.datamodel.properties.TestSuiteProperties in project sakuli by ConSol.
the class TestSuitePropertiesTestUtils method getTestProps.
public static TestSuiteProperties getTestProps(Class<?> classDef, String resourcePath, String suiteId) throws URISyntaxException {
Path folderPath = Paths.get(classDef.getResource(resourcePath).toURI());
assertTrue(Files.exists(folderPath));
assertTrue(Files.isDirectory(folderPath));
TestSuiteProperties props = new TestSuiteProperties();
props.setTestSuiteFolder(folderPath);
props.setTestSuiteSuiteFile(Paths.get(folderPath.toString() + TestSuiteProperties.TEST_SUITE_SUITE_FILE_APPENDER));
props.setTestSuiteId(suiteId);
props.setLoadTestCasesAutomatic(true);
return props;
}
Aggregations