use of com.adaptris.core.stubs.JunitBootstrapProperties in project interlok by adaptris.
the class ConfigurationPreProcessorFactoryTest method testNoConfiguredPreProcessors.
@Test
public void testNoConfiguredPreProcessors() throws Exception {
ConfigPreProcessors loaded = preProcessorFactory.load(new JunitBootstrapProperties(new Properties()));
assertEquals(0, loaded.size());
}
use of com.adaptris.core.stubs.JunitBootstrapProperties in project interlok by adaptris.
the class ConfigurationPreProcessorFactoryTest method testBootstrapProperties_MisConfiguredPreProcessorNoClassName.
@Test
public void testBootstrapProperties_MisConfiguredPreProcessorNoClassName() throws Exception {
when(mockPropertyLoader.loadPropertyFile(anyString())).thenReturn(new Properties());
preProcessorFactory.setPropertyLoader(mockPropertyLoader);
Properties props = new Properties();
props.put("preProcessors", "testPreProcessor");
assertEquals(0, preProcessorFactory.load(new JunitBootstrapProperties(props)).size());
}
use of com.adaptris.core.stubs.JunitBootstrapProperties in project interlok by adaptris.
the class ConfigurationPreProcessorFactoryTest method testBootstrapProperties_MultipleExternalPropertyFiles2Configured.
@Test
public void testBootstrapProperties_MultipleExternalPropertyFiles2Configured() throws Exception {
Properties sampleProperties2 = new Properties();
sampleProperties2.put("name", "testPreProcessor2");
sampleProperties2.put("class", DummyConfigurationPreProcessor2.class.getCanonicalName());
when(mockPropertyLoader.loadPropertyFile("testPreProcessor")).thenReturn(sampleProperties);
when(mockPropertyLoader.loadPropertyFile("testPreProcessor2")).thenReturn(sampleProperties2);
preProcessorFactory.setPropertyLoader(mockPropertyLoader);
Properties props = new Properties();
props.put("preProcessors", "testPreProcessor:testPreProcessor2");
ConfigPreProcessors processorsList = preProcessorFactory.load(new JunitBootstrapProperties(props));
assertEquals(2, processorsList.size());
assertEquals(DummyConfigurationPreProcessor.class.getCanonicalName(), processorsList.toArray()[0].getClass().getName());
assertEquals(DummyConfigurationPreProcessor2.class.getCanonicalName(), processorsList.toArray()[1].getClass().getName());
}
use of com.adaptris.core.stubs.JunitBootstrapProperties in project interlok by adaptris.
the class ConfigurationPreProcessorFactoryTest method testBootstrapProperties_MultipleExternalPropertyFilesOnly1Configured.
@Test
public void testBootstrapProperties_MultipleExternalPropertyFilesOnly1Configured() throws Exception {
Properties sampleProperties2 = new Properties();
sampleProperties2.put("name", "testPreProcessor2");
sampleProperties2.put("class", DummyConfigurationPreProcessor2.class.getCanonicalName());
when(mockPropertyLoader.loadPropertyFile("testPreProcessor")).thenReturn(sampleProperties);
when(mockPropertyLoader.loadPropertyFile("testPreProcessor2")).thenReturn(sampleProperties2);
preProcessorFactory.setPropertyLoader(mockPropertyLoader);
Properties props = new Properties();
props.put("preProcessors", "testPreProcessor");
ConfigPreProcessors processorsList = preProcessorFactory.load(new JunitBootstrapProperties(props));
assertEquals(1, processorsList.size());
assertEquals(DummyConfigurationPreProcessor.class.getCanonicalName(), processorsList.toArray()[0].getClass().getName());
}
use of com.adaptris.core.stubs.JunitBootstrapProperties in project interlok by adaptris.
the class ConfigurationPreProcessorFactoryTest method testBootstrapProperties_EmptyConfiguredPreProcessors.
@Test
public void testBootstrapProperties_EmptyConfiguredPreProcessors() throws Exception {
Properties props = new Properties();
props.put("preProcessors", "");
ConfigPreProcessors loaded = preProcessorFactory.load(new JunitBootstrapProperties(props));
assertEquals(0, loaded.size());
}
Aggregations