Search in sources :

Example 1 with BootstrapProperties

use of com.adaptris.core.management.BootstrapProperties in project interlok by adaptris.

the class CachingConfigLoaderTest method testLoad_NoKey.

@Test
public void testLoad_NoKey() throws Exception {
    BootstrapProperties mockBootProperties = new MockBootProperties("some-data");
    assertEquals("some-data", CachingConfigLoader.loadInterlokConfig(mockBootProperties));
}
Also used : BootstrapProperties(com.adaptris.core.management.BootstrapProperties) Test(org.junit.Test)

Example 2 with BootstrapProperties

use of com.adaptris.core.management.BootstrapProperties in project interlok by adaptris.

the class CachingConfigLoaderTest method testLoad_WithKey.

@Test
public void testLoad_WithKey() throws Exception {
    BootstrapProperties mockBootProperties = new MockBootProperties("some-data", Arrays.asList("adapterResourceName"));
    assertEquals("some-data", CachingConfigLoader.loadInterlokConfig(mockBootProperties));
    assertEquals(1, CachingConfigLoader.cacheSize());
    assertEquals("some-data", CachingConfigLoader.loadInterlokConfig(mockBootProperties));
}
Also used : BootstrapProperties(com.adaptris.core.management.BootstrapProperties) Test(org.junit.Test)

Example 3 with BootstrapProperties

use of com.adaptris.core.management.BootstrapProperties in project interlok by adaptris.

the class ConfigurationCheckRunnerTest method testSuccessRunner.

@Test
@SuppressWarnings("deprecation")
public void testSuccessRunner() throws Exception {
    String xml = this.createAdapterConfig(new NullConnection("SharedNullConnection"), new SharedConnection("SharedNullConnection"), new SharedConnection("SharedNullConnection"));
    BootstrapProperties mockProp = new MockBootProperties(xml);
    List<ConfigurationCheckReport> reports = checkRunner.runChecks(mockProp, mockUnifiedBootstrap);
    assertEquals(configurationCheckersCount(), reports.size());
    for (ConfigurationCheckReport report : reports) {
        if (report.getCheckName().equals(SHARED_CONN_TEST_FRIENDLY_NAME)) {
            assertTrue(report.isCheckPassed());
            assertEquals(0, report.getFailureExceptions().size());
        }
    }
}
Also used : SharedConnection(com.adaptris.core.SharedConnection) BootstrapProperties(com.adaptris.core.management.BootstrapProperties) NullConnection(com.adaptris.core.NullConnection) Test(org.junit.Test)

Example 4 with BootstrapProperties

use of com.adaptris.core.management.BootstrapProperties in project interlok by adaptris.

the class ConfigurationCheckRunnerTest method testFailureRunner.

@Test
@SuppressWarnings("deprecation")
public void testFailureRunner() throws Exception {
    String xml = this.createAdapterConfig(new NullConnection("SharedNullConnection"), null, null);
    BootstrapProperties mockProp = new MockBootProperties(xml);
    List<ConfigurationCheckReport> reports = checkRunner.runChecks(mockProp, mockUnifiedBootstrap);
    assertEquals(configurationCheckersCount(), reports.size());
    for (ConfigurationCheckReport report : reports) {
        if (report.getCheckName().equals(SHARED_CONN_TEST_FRIENDLY_NAME)) {
            assertFalse(report.isCheckPassed());
            assertTrue(report.getWarnings().size() > 0);
            assertNotNull(report.toString());
        }
    }
}
Also used : BootstrapProperties(com.adaptris.core.management.BootstrapProperties) NullConnection(com.adaptris.core.NullConnection) Test(org.junit.Test)

Example 5 with BootstrapProperties

use of com.adaptris.core.management.BootstrapProperties in project interlok by adaptris.

the class SharedConnectionConfigurationCheckerTest method testProduceAndConsumeConnectionsExist.

@Test
public void testProduceAndConsumeConnectionsExist() throws Exception {
    BootstrapProperties mockBootProperties = new MockBootProperties(createAdapterConfig(new NullConnection("SharedNullConnection"), new SharedConnection("SharedNullConnection"), new SharedConnection("SharedNullConnection"), null));
    ConfigurationCheckReport report = checker.performConfigCheck(mockBootProperties);
    assertTrue(report.isCheckPassed());
    assertNotNull(report.toString());
}
Also used : SharedConnection(com.adaptris.core.SharedConnection) BootstrapProperties(com.adaptris.core.management.BootstrapProperties) NullConnection(com.adaptris.core.NullConnection) Test(org.junit.Test)

Aggregations

BootstrapProperties (com.adaptris.core.management.BootstrapProperties)26 Test (org.junit.Test)25 NullConnection (com.adaptris.core.NullConnection)5 SharedConnection (com.adaptris.core.SharedConnection)5 SharedService (com.adaptris.core.SharedService)5 NullService (com.adaptris.core.NullService)4 Properties (java.util.Properties)3 ServiceList (com.adaptris.core.ServiceList)2 JunitBootstrapProperties (com.adaptris.core.stubs.JunitBootstrapProperties)2