Search in sources :

Example 1 with ObservableList

use of org.mule.runtime.module.deployment.internal.util.ObservableList in project mule by mulesoft.

the class DefaultArchiveDeployerTestCase method ignoresErrorsWhileRemovingArtifactDataFolder.

@Test
public void ignoresErrorsWhileRemovingArtifactDataFolder() throws Exception {
    AbstractDeployableArtifactFactory artifactFactory = mock(AbstractDeployableArtifactFactory.class);
    ArtifactDeployer artifactDeployer = mock(ArtifactDeployer.class);
    DefaultArchiveDeployer<Application> deployer = new DefaultArchiveDeployer(artifactDeployer, artifactFactory, new ObservableList(), null, null);
    deployer.setDeploymentListener(mock(DeploymentListener.class));
    deployer.deployArtifact(createMockApplication(), empty());
    mockStatic(FileUtils.class);
    PowerMockito.doThrow(new IOException()).when(FileUtils.class);
    deleteDirectory(Matchers.eq(getAppDataFolder(ARTIFACT_ID)));
    deployer.undeployArtifact(ARTIFACT_ID);
}
Also used : ObservableList(org.mule.runtime.module.deployment.internal.util.ObservableList) AbstractDeployableArtifactFactory(org.mule.runtime.module.deployment.impl.internal.artifact.AbstractDeployableArtifactFactory) IOException(java.io.IOException) DeploymentListener(org.mule.runtime.module.deployment.api.DeploymentListener) Application(org.mule.runtime.deployment.model.api.application.Application) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

IOException (java.io.IOException)1 Test (org.junit.Test)1 Application (org.mule.runtime.deployment.model.api.application.Application)1 DeploymentListener (org.mule.runtime.module.deployment.api.DeploymentListener)1 AbstractDeployableArtifactFactory (org.mule.runtime.module.deployment.impl.internal.artifact.AbstractDeployableArtifactFactory)1 ObservableList (org.mule.runtime.module.deployment.internal.util.ObservableList)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1