use of org.mule.runtime.deployment.model.internal.nativelib.DefaultNativeLibraryFinderFactory in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysWithExtensionXmlPlugin.
@Test
public void deploysWithExtensionXmlPlugin() throws Exception {
ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder("appWithExtensionXmlPlugin").definedBy("app-with-extension-xml-plugin-module-bye.xml").dependingOn(byeXmlExtensionPlugin);
addPackedAppFromBuilder(applicationFileBuilder);
final DefaultDomainManager domainManager = new DefaultDomainManager();
domainManager.addDomain(createDefaultDomain());
TestApplicationFactory appFactory = createTestApplicationFactory(new MuleApplicationClassLoaderFactory(new DefaultNativeLibraryFinderFactory()), domainManager, serviceManager, extensionModelLoaderManager, moduleRepository, createDescriptorLoaderRepository());
deploymentService.setAppFactory(appFactory);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder.getId());
}
use of org.mule.runtime.deployment.model.internal.nativelib.DefaultNativeLibraryFinderFactory in project mule by mulesoft.
the class ApplicationDeploymentTestCase method undeploysAppCompletelyEvenOnDisposingException.
@Test
public void undeploysAppCompletelyEvenOnDisposingException() throws Exception {
addPackedAppFromBuilder(emptyAppFileBuilder);
final DefaultDomainManager domainManager = new DefaultDomainManager();
domainManager.addDomain(createDefaultDomain());
TestApplicationFactory appFactory = createTestApplicationFactory(new MuleApplicationClassLoaderFactory(new DefaultNativeLibraryFinderFactory()), domainManager, serviceManager, extensionModelLoaderManager, moduleRepository, createDescriptorLoaderRepository());
appFactory.setFailOnDisposeApplication(true);
deploymentService.setAppFactory(appFactory);
startDeployment();
assertApplicationDeploymentSuccess(applicationDeploymentListener, emptyAppFileBuilder.getId());
Application app = findApp(emptyAppFileBuilder.getId(), 1);
assertTrue("Unable to remove anchor file", removeAppAnchorFile(emptyAppFileBuilder.getId()));
assertUndeploymentSuccess(applicationDeploymentListener, emptyAppFileBuilder.getId());
assertStatus(app, STOPPED);
assertAppFolderIsDeleted(emptyAppFileBuilder.getId());
}
use of org.mule.runtime.deployment.model.internal.nativelib.DefaultNativeLibraryFinderFactory in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysWithExtensionXmlPluginWithDependencies.
@Test
public void deploysWithExtensionXmlPluginWithDependencies() throws Exception {
String moduleFileName = "module-using-java.xml";
String extensionName = "using-java-extension";
String moduleDestination = "org/mule/module/" + moduleFileName;
MulePluginModel.MulePluginModelBuilder builder = new MulePluginModel.MulePluginModelBuilder().setName(extensionName).setMinMuleVersion(MIN_MULE_VERSION).setRequiredProduct(MULE);
builder.withExtensionModelDescriber().setId(XmlExtensionModelLoader.DESCRIBER_ID).addProperty(RESOURCE_XML, moduleDestination);
builder.withClassLoaderModelDescriptorLoader(new MuleArtifactLoaderDescriptorBuilder().addProperty(EXPORTED_PACKAGES, asList("org.foo")).setId(MULE_LOADER_ID).build());
builder.withBundleDescriptorLoader(createBundleDescriptorLoader(extensionName, MULE_EXTENSION_CLASSIFIER, MULE_LOADER_ID));
builder.setRequiredProduct(MULE).setMinMuleVersion(MIN_MULE_VERSION);
final ArtifactPluginFileBuilder byeXmlExtensionPlugin = new ArtifactPluginFileBuilder(extensionName).describedBy(builder.build()).containingResource("module-using-javaSource.xml", moduleDestination).dependingOn(new JarFileBuilder("echoTestJar", echoTestJarFile)).describedBy(builder.build());
ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder("appWithExtensionXmlPluginWithDependencies").definedBy("app-with-extension-xml-plugin-module-using-java.xml").dependingOn(byeXmlExtensionPlugin);
addPackedAppFromBuilder(applicationFileBuilder);
final DefaultDomainManager domainManager = new DefaultDomainManager();
domainManager.addDomain(createDefaultDomain());
TestApplicationFactory appFactory = createTestApplicationFactory(new MuleApplicationClassLoaderFactory(new DefaultNativeLibraryFinderFactory()), domainManager, serviceManager, extensionModelLoaderManager, moduleRepository, createDescriptorLoaderRepository());
deploymentService.setAppFactory(appFactory);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder.getId());
}
use of org.mule.runtime.deployment.model.internal.nativelib.DefaultNativeLibraryFinderFactory in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysWithExtensionXmlPluginWithXmlDependencies.
@Test
public void deploysWithExtensionXmlPluginWithXmlDependencies() throws Exception {
ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder("appWithExtensionXmlPluginWithXmlDependencies").definedBy("app-with-extension-xml-plugin-module-using-bye.xml").dependingOn(moduleUsingByeXmlExtensionPlugin);
addPackedAppFromBuilder(applicationFileBuilder);
final DefaultDomainManager domainManager = new DefaultDomainManager();
domainManager.addDomain(createDefaultDomain());
TestApplicationFactory appFactory = createTestApplicationFactory(new MuleApplicationClassLoaderFactory(new DefaultNativeLibraryFinderFactory()), domainManager, serviceManager, extensionModelLoaderManager, moduleRepository, createDescriptorLoaderRepository());
deploymentService.setAppFactory(appFactory);
startDeployment();
assertDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder.getId());
}
use of org.mule.runtime.deployment.model.internal.nativelib.DefaultNativeLibraryFinderFactory in project mule by mulesoft.
the class ApplicationDeploymentTestCase method undeploysAppCompletelyEvenOnStoppingException.
@Test
public void undeploysAppCompletelyEvenOnStoppingException() throws Exception {
addPackedAppFromBuilder(emptyAppFileBuilder);
final DefaultDomainManager domainManager = new DefaultDomainManager();
domainManager.addDomain(createDefaultDomain());
TestApplicationFactory appFactory = createTestApplicationFactory(new MuleApplicationClassLoaderFactory(new DefaultNativeLibraryFinderFactory()), domainManager, serviceManager, extensionModelLoaderManager, moduleRepository, createDescriptorLoaderRepository());
appFactory.setFailOnStopApplication(true);
deploymentService.setAppFactory(appFactory);
startDeployment();
assertApplicationDeploymentSuccess(applicationDeploymentListener, emptyAppFileBuilder.getId());
Application app = findApp(emptyAppFileBuilder.getId(), 1);
assertTrue("Unable to remove anchor file", removeAppAnchorFile(emptyAppFileBuilder.getId()));
assertUndeploymentSuccess(applicationDeploymentListener, emptyAppFileBuilder.getId());
assertAppFolderIsDeleted(emptyAppFileBuilder.getId());
assertStatus(app, DESTROYED);
}
Aggregations