Search in sources :

Example 6 with CommonConfigurator

use of com.axway.ats.harness.config.CommonConfigurator in project ats-framework by Axway.

the class Test_CommonConfigurator method mailServerProperties.

@Test
public void mailServerProperties() throws ConfigurationException {
    CommonConfigurator testDataConfigurator = CommonConfigurator.getInstance();
    testDataConfigurator.registerConfigFile(configFile1.getAbsolutePath());
    MailServer mailServer = testDataConfigurator.getMailServer("exchange");
    assertEquals(MAILSERVER_HOST, mailServer.getHost());
    assertEquals(MAILSERVER_DEFAULTPASS, mailServer.getDefaultPass());
}
Also used : MailServer(com.axway.ats.harness.config.MailServer) CommonConfigurator(com.axway.ats.harness.config.CommonConfigurator) BaseTest(com.axway.ats.harness.BaseTest) Test(org.junit.Test)

Example 7 with CommonConfigurator

use of com.axway.ats.harness.config.CommonConfigurator in project ats-framework by Axway.

the class Test_CommonConfigurator method registerConfigFileFromClasspath.

@Test
public void registerConfigFileFromClasspath() throws ConfigurationException {
    CommonConfigurator testDataConfigurator = CommonConfigurator.getInstance();
    testDataConfigurator.registerConfigFileFromClasspath("/com/axway/ats/harness/config/resource2.xml");
}
Also used : CommonConfigurator(com.axway.ats.harness.config.CommonConfigurator) BaseTest(com.axway.ats.harness.BaseTest) Test(org.junit.Test)

Example 8 with CommonConfigurator

use of com.axway.ats.harness.config.CommonConfigurator 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)

Example 9 with CommonConfigurator

use of com.axway.ats.harness.config.CommonConfigurator in project ats-framework by Axway.

the class Test_CommonConfigurator method registerConfigFileFromClasspathNegative.

@Test(expected = ConfigSourceDoesNotExistException.class)
public void registerConfigFileFromClasspathNegative() throws ConfigurationException {
    CommonConfigurator testDataConfigurator = CommonConfigurator.getInstance();
    testDataConfigurator.registerConfigFileFromClasspath("/asdfasdfas");
}
Also used : CommonConfigurator(com.axway.ats.harness.config.CommonConfigurator) BaseTest(com.axway.ats.harness.BaseTest) Test(org.junit.Test)

Example 10 with CommonConfigurator

use of com.axway.ats.harness.config.CommonConfigurator in project ats-framework by Axway.

the class Test_CommonConfigurator method registerConfigFile.

@Test
public void registerConfigFile() throws ConfigurationException {
    CommonConfigurator testDataConfigurator = CommonConfigurator.getInstance();
    testDataConfigurator.registerConfigFile(configFile1.getAbsolutePath());
}
Also used : CommonConfigurator(com.axway.ats.harness.config.CommonConfigurator) BaseTest(com.axway.ats.harness.BaseTest) Test(org.junit.Test)

Aggregations

BaseTest (com.axway.ats.harness.BaseTest)14 CommonConfigurator (com.axway.ats.harness.config.CommonConfigurator)14 Test (org.junit.Test)14 TestBox (com.axway.ats.harness.config.TestBox)4 MailServer (com.axway.ats.harness.config.MailServer)1 MessagesBox (com.axway.ats.harness.config.MessagesBox)1 AssertionFailedError (junit.framework.AssertionFailedError)1