use of com.axway.ats.harness.config.TestBox in project ats-framework by Axway.
the class Test_CommonConfigurator method testBoxProperties.
@Test
public void testBoxProperties() throws ConfigurationException {
CommonConfigurator testDataConfigurator = CommonConfigurator.getInstance();
testDataConfigurator.registerConfigFile(configFile1.getAbsolutePath());
TestBox textbox1 = testDataConfigurator.getTestBox("testbox1");
TestBox textbox2 = testDataConfigurator.getTestBox("testbox2");
assertEquals(TEXTBOX1_HOST, textbox1.getHost());
assertEquals(TEXTBOX1_DBPORT, textbox1.getDbPort());
assertEquals(TEXTBOX1_ADMINPASS, textbox1.getAdminPass());
assertEquals(TEXTBOX1_DBNAME, textbox1.getDbName());
assertEquals(TEXTBOX1_DBUSER, textbox1.getDbUser());
assertEquals(TEXTBOX1_DBPASS, textbox1.getDbPass());
assertEquals(TEXTBOX1_DBTYPE.toLowerCase(), textbox1.getDbType().toString().toLowerCase());
assertEquals(TEXTBOX2_HOST, textbox2.getHost());
assertEquals(TEXTBOX2_ADMINUSER, textbox2.getAdminUser());
}
use of com.axway.ats.harness.config.TestBox in project ats-framework by Axway.
the class Test_TestBox method testDbPortEmpty.
@Test(expected = NullOrEmptyConfigurationPropertyException.class)
public void testDbPortEmpty() throws NullOrEmptyConfigurationPropertyException {
TestBox testBox = new TestBox();
testBox.setDbPort(ONLY_SPACE_STR);
}
use of com.axway.ats.harness.config.TestBox in project ats-framework by Axway.
the class Test_TestBox method testDbTypeEmpty.
@Test(expected = NullOrEmptyConfigurationPropertyException.class)
public void testDbTypeEmpty() throws NullOrEmptyConfigurationPropertyException {
TestBox testBox = new TestBox();
testBox.setDbType(ONLY_SPACE_STR);
}
use of com.axway.ats.harness.config.TestBox in project ats-framework by Axway.
the class Test_TestBox method testAdminUserEmpty.
@Test(expected = NullOrEmptyConfigurationPropertyException.class)
public void testAdminUserEmpty() throws NullOrEmptyConfigurationPropertyException {
TestBox testBox = new TestBox();
testBox.setAdminUser(ONLY_SPACE_STR);
}
use of com.axway.ats.harness.config.TestBox in project ats-framework by Axway.
the class Test_CommonConfigurator method testBoxProperties2.
@Test
public void testBoxProperties2() throws ConfigurationException {
CommonConfigurator testDataConfigurator = CommonConfigurator.getInstance();
testDataConfigurator.registerConfigFile(configFile1.getAbsolutePath());
TestBox textbox1 = testDataConfigurator.getTestBox("testbox1");
assertEquals(TEXTBOX1_HOST, textbox1.getHost());
testDataConfigurator.registerConfigFile(configFile2.getAbsolutePath());
textbox1 = testDataConfigurator.getTestBox("testbox1");
assertEquals(TEXTBOX1_HOST2, textbox1.getHost());
testDataConfigurator.setTempProperty("common.testboxes.testbox1.host", "host1");
textbox1 = testDataConfigurator.getTestBox("testbox1");
assertEquals("host1", textbox1.getHost());
testDataConfigurator.clearTempProperties();
textbox1 = testDataConfigurator.getTestBox("testbox1");
assertEquals(TEXTBOX1_HOST2, textbox1.getHost());
}
Aggregations