use of org.mule.runtime.core.api.config.bootstrap.BootstrapServiceDiscoverer in project mule by mulesoft.
the class SimpleRegistryBootstrapTestCase method createTestRegistryBootstrap.
private SimpleRegistryBootstrap createTestRegistryBootstrap(ArtifactType artifactType) throws InitialisationException {
final Properties properties = new Properties();
properties.put("1", format("java.lang.String,%s=%s", APPLY_TO_ARTIFACT_TYPE_PARAMETER_KEY, APP.getAsString()));
properties.put("2", format("java.util.Properties,%s=%s", APPLY_TO_ARTIFACT_TYPE_PARAMETER_KEY, DOMAIN.getAsString()));
properties.put("3", format("java.util.HashMap,%s=%s", APPLY_TO_ARTIFACT_TYPE_PARAMETER_KEY, POLICY.getAsString()));
properties.put("4", format("java.util.ArrayList,%s=%s/%s/%s", APPLY_TO_ARTIFACT_TYPE_PARAMETER_KEY, APP.getAsString(), DOMAIN.getAsString(), POLICY.getAsString()));
properties.put("jms.singletx.transaction.resource1", format("%s,optional)", TEST_TRANSACTION_FACTORY_CLASS));
properties.put("test.singletx.transaction.factory1", FakeTransactionFactory.class.getName());
properties.put("test.singletx.transaction.resource1", FakeTransactionResource.class.getName());
final BootstrapServiceDiscoverer bootstrapServiceDiscoverer = new TestBootstrapServiceDiscoverer(properties);
((DefaultMuleContext) muleContext).setBootstrapServiceDiscoverer(bootstrapServiceDiscoverer);
SimpleRegistryBootstrap simpleRegistryBootstrap = new SimpleRegistryBootstrap(artifactType, muleContext);
simpleRegistryBootstrap.initialise();
return simpleRegistryBootstrap;
}
use of org.mule.runtime.core.api.config.bootstrap.BootstrapServiceDiscoverer in project mule by mulesoft.
the class SimpleRegistryBootstrapTransformersTestCase method registeringTransformersWithCustomKey.
@Test
public void registeringTransformersWithCustomKey() throws MuleException {
Properties properties = new Properties();
properties.setProperty("core.transformer.1", ExpectedKeyTransformer.class.getName());
properties.setProperty("custom1", CustomKeyTransformer.class.getName());
TestTransformerResolver transformerResolver = new TestTransformerResolver();
((MuleContextWithRegistries) muleContext).getRegistry().registerObject("testTransformerResolver", transformerResolver);
final BootstrapServiceDiscoverer bootstrapServiceDiscoverer = new TestBootstrapServiceDiscoverer(properties);
muleContext.setBootstrapServiceDiscoverer(bootstrapServiceDiscoverer);
SimpleRegistryBootstrap registryBootstrap = new SimpleRegistryBootstrap(APP, muleContext);
registryBootstrap.initialise();
assertEquals(2, transformerResolver.getTransformersCount());
assertTrue(transformerResolver.contains(ExpectedKeyTransformer.class));
assertTrue(transformerResolver.contains(CustomKeyTransformer.class));
}
Aggregations