Search in sources :

Example 6 with TestBox

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());
}
Also used : TestBox(com.axway.ats.harness.config.TestBox) CommonConfigurator(com.axway.ats.harness.config.CommonConfigurator) BaseTest(com.axway.ats.harness.BaseTest) Test(org.junit.Test)

Example 7 with TestBox

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);
}
Also used : TestBox(com.axway.ats.harness.config.TestBox) BaseTest(com.axway.ats.harness.BaseTest) Test(org.junit.Test)

Example 8 with TestBox

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);
}
Also used : TestBox(com.axway.ats.harness.config.TestBox) BaseTest(com.axway.ats.harness.BaseTest) Test(org.junit.Test)

Example 9 with TestBox

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);
}
Also used : TestBox(com.axway.ats.harness.config.TestBox) BaseTest(com.axway.ats.harness.BaseTest) Test(org.junit.Test)

Example 10 with TestBox

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());
}
Also used : TestBox(com.axway.ats.harness.config.TestBox) CommonConfigurator(com.axway.ats.harness.config.CommonConfigurator) BaseTest(com.axway.ats.harness.BaseTest) Test(org.junit.Test)

Aggregations

TestBox (com.axway.ats.harness.config.TestBox)24 BaseTest (com.axway.ats.harness.BaseTest)21 Test (org.junit.Test)21 CommonConfigurator (com.axway.ats.harness.config.CommonConfigurator)4 DatabaseOperations (com.axway.ats.action.dbaccess.DatabaseOperations)3 BeforeMethod (org.testng.annotations.BeforeMethod)2 DbConnPostgreSQL (com.axway.ats.core.dbaccess.postgresql.DbConnPostgreSQL)1 DbTable (com.axway.ats.environment.database.model.DbTable)1 DbVerification (com.axway.ats.rbv.clients.DbVerification)1 AssertionFailedError (junit.framework.AssertionFailedError)1