use of org.mule.runtime.container.api.MuleCoreExtension in project mule by mulesoft.
the class ReflectionMuleCoreExtensionDependencyResolverTestCase method resolvesDisorderedCoreExtensionAwareExtensions.
@Test
public void resolvesDisorderedCoreExtensionAwareExtensions() throws Exception {
MuleCoreExtension coreExtensionsAwareExtension1 = mockCoreExtension(EXTENSION1);
MuleCoreExtension coreExtensionsAwareExtension2 = mockCoreExtension(EXTENSION2);
List<MuleCoreExtension> coreExtensions = new LinkedList<>();
coreExtensions.add(coreExtensionsAwareExtension2);
coreExtensions.add(coreExtensionsAwareExtension1);
final List<MuleCoreExtension> resolvedCoreExtensions = dependencyResolver.resolveDependencies(coreExtensions);
assertThat(resolvedCoreExtensions.size(), equalTo(2));
assertThat(resolvedCoreExtensions.get(0), sameInstance(coreExtensionsAwareExtension1));
assertThat(resolvedCoreExtensions.get(1), sameInstance(coreExtensionsAwareExtension2));
}
use of org.mule.runtime.container.api.MuleCoreExtension in project mule by mulesoft.
the class ReflectionMuleCoreExtensionDependencyResolverTestCase method resolvesStandardAndCoreExtensionAwareExtensions.
@Test
public void resolvesStandardAndCoreExtensionAwareExtensions() throws Exception {
MuleCoreExtension coreExtensionsAwareExtension = mockCoreExtension("coreExtensionsAwareExtension");
MuleCoreExtension testCoreExtension = new TestCoreExtension();
List<MuleCoreExtension> coreExtensions = new LinkedList<>();
coreExtensions.add(coreExtensionsAwareExtension);
coreExtensions.add(testCoreExtension);
final List<MuleCoreExtension> resolvedCoreExtensions = dependencyResolver.resolveDependencies(coreExtensions);
assertThat(resolvedCoreExtensions.size(), equalTo(2));
assertThat(resolvedCoreExtensions.get(0), sameInstance(testCoreExtension));
assertThat(resolvedCoreExtensions.get(1), sameInstance(coreExtensionsAwareExtension));
}
use of org.mule.runtime.container.api.MuleCoreExtension in project mule by mulesoft.
the class ReflectionMuleCoreExtensionDependencyResolverTestCase method resolvesCoreExtensionAwareAndStandardExtensions.
@Test
public void resolvesCoreExtensionAwareAndStandardExtensions() throws Exception {
MuleCoreExtension coreExtensionsAwareExtension = mockCoreExtension(EXTENSION1);
MuleCoreExtension testCoreExtension = new TestCoreExtension();
List<MuleCoreExtension> coreExtensions = new LinkedList<>();
coreExtensions.add(testCoreExtension);
coreExtensions.add(coreExtensionsAwareExtension);
final List<MuleCoreExtension> resolvedCoreExtensions = dependencyResolver.resolveDependencies(coreExtensions);
assertThat(resolvedCoreExtensions.size(), equalTo(2));
assertThat(resolvedCoreExtensions.get(0), sameInstance(testCoreExtension));
assertThat(resolvedCoreExtensions.get(1), sameInstance(coreExtensionsAwareExtension));
}
use of org.mule.runtime.container.api.MuleCoreExtension in project mule by mulesoft.
the class ReflectionMuleCoreExtensionDependencyResolverTestCase method mockCoreExtension.
private MuleCoreExtension mockCoreExtension(String extension11) {
MuleCoreExtension extension1 = mock(CoreExtensionsAwareExtension.class);
when(extension1.getName()).thenReturn(extension11);
return extension1;
}
use of org.mule.runtime.container.api.MuleCoreExtension in project mule by mulesoft.
the class DefaultMuleCoreExtensionManagerServer method start.
@Override
public void start() throws MuleException {
LOGGER.info("Starting core extensions");
for (MuleCoreExtension extension : orderedCoreExtensions) {
extension.start();
startedCoreExtensions.add(extension);
LOGGER.info("Core extension '{}' started", extension.toString());
}
}
Aggregations