Search in sources :

Example 1 with DefaultDslResolvingContext

use of org.mule.runtime.internal.dsl.DefaultDslResolvingContext in project mule by mulesoft.

the class ExtensionActivatorTestCase method enumsReleasedWhenStopped.

@Test
public void enumsReleasedWhenStopped() throws Exception {
    Map<String, Object> attributes = new HashMap<>();
    attributes.put(TYPE_PROPERTY_NAME, HeisenbergExtension.class.getName());
    attributes.put(VERSION, "1.0.0");
    ExtensionModel extensionModel = new DefaultJavaExtensionModelLoader().loadExtensionModel(HeisenbergExtension.class.getClassLoader(), new DefaultDslResolvingContext(Collections.emptySet()), attributes);
    ExtensionActivator extensionActivator = new ExtensionActivator(mock(ExtensionErrorsRegistrant.class, RETURNS_DEEP_STUBS), mockMuleContext());
    extensionActivator.activateExtension(extensionModel);
    assertThat(extensionActivator.getEnumTypes().size(), is(greaterThan(0)));
    extensionActivator.stop();
    assertThat(extensionActivator.getEnumTypes(), hasSize(0));
}
Also used : HashMap(java.util.HashMap) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) DefaultJavaExtensionModelLoader(org.mule.runtime.module.extension.api.loader.java.DefaultJavaExtensionModelLoader) HeisenbergExtension(org.mule.test.heisenberg.extension.HeisenbergExtension) DefaultDslResolvingContext(org.mule.runtime.internal.dsl.DefaultDslResolvingContext) Test(org.junit.Test) SmallTest(org.mule.tck.size.SmallTest)

Aggregations

HashMap (java.util.HashMap)1 Test (org.junit.Test)1 ExtensionModel (org.mule.runtime.api.meta.model.ExtensionModel)1 DefaultDslResolvingContext (org.mule.runtime.internal.dsl.DefaultDslResolvingContext)1 DefaultJavaExtensionModelLoader (org.mule.runtime.module.extension.api.loader.java.DefaultJavaExtensionModelLoader)1 SmallTest (org.mule.tck.size.SmallTest)1 HeisenbergExtension (org.mule.test.heisenberg.extension.HeisenbergExtension)1