Search in sources :

Example 1 with DomainBundleFileBuilder

use of org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder in project mule by mulesoft.

the class DomainBundleDeploymentTestCase method redeploysDomainBundleCausesUndeployOfRemovedApps.

@Test
public void redeploysDomainBundleCausesUndeployOfRemovedApps() throws Exception {
    ApplicationFileBuilder applicationFileBuilder1 = new ApplicationFileBuilder(dummyAppDescriptorFileBuilder).dependingOn(dummyDomainFileBuilder);
    ApplicationFileBuilder applicationFileBuilder2 = new ApplicationFileBuilder(emptyAppFileBuilder).dependingOn(dummyDomainFileBuilder);
    DomainBundleFileBuilder domainBundleFileBuilder = new DomainBundleFileBuilder(dummyDomainFileBuilder).containing(applicationFileBuilder1).containing(applicationFileBuilder2);
    addDomainBundleFromBuilder(domainBundleFileBuilder);
    startDeployment();
    assertDeploymentSuccess(domainBundleDeploymentListener, domainBundleFileBuilder.getId());
    assertDeploymentSuccess(domainDeploymentListener, dummyDomainFileBuilder.getId());
    assertApplicationDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder1.getId());
    assertApplicationDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder2.getId());
    reset(domainDeploymentListener);
    reset(domainBundleDeploymentListener);
    reset(applicationDeploymentListener);
    domainBundleFileBuilder = new DomainBundleFileBuilder(dummyDomainFileBuilder).containing(applicationFileBuilder1);
    addDomainBundleFromBuilder(domainBundleFileBuilder);
    assertDeploymentSuccess(domainBundleDeploymentListener, domainBundleFileBuilder.getId());
    assertDomainRedeploymentSuccess(dummyDomainFileBuilder.getId());
    assertApplicationRedeploymentSuccess(applicationFileBuilder1.getId());
    assertApplicationMissingOnBundleRedeployment(applicationFileBuilder2.getId());
}
Also used : ApplicationFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder) DomainBundleFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder) Test(org.junit.Test)

Example 2 with DomainBundleFileBuilder

use of org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder in project mule by mulesoft.

the class DomainBundleDeploymentTestCase method redeploysDomainBundleWithBrokenDomain.

@Test
public void redeploysDomainBundleWithBrokenDomain() throws Exception {
    ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder(dummyAppDescriptorFileBuilder).dependingOn(dummyDomainFileBuilder);
    DomainBundleFileBuilder domainBundleFileBuilder = new DomainBundleFileBuilder(dummyDomainFileBuilder).containing(applicationFileBuilder);
    addDomainBundleFromBuilder(domainBundleFileBuilder);
    startDeployment();
    assertDeploymentSuccess(domainBundleDeploymentListener, domainBundleFileBuilder.getId());
    assertDeploymentSuccess(domainDeploymentListener, dummyDomainFileBuilder.getId());
    assertApplicationDeploymentSuccess(applicationDeploymentListener, dummyAppDescriptorFileBuilder.getId());
    reset(domainDeploymentListener);
    reset(domainBundleDeploymentListener);
    reset(applicationDeploymentListener);
    dummyDomainFileBuilder = new DomainFileBuilder(dummyDomainFileBuilder).corrupted();
    domainBundleFileBuilder = new DomainBundleFileBuilder(dummyDomainFileBuilder).containing(applicationFileBuilder);
    addDomainBundleFromBuilder(domainBundleFileBuilder);
    assertDeploymentFailure(domainBundleDeploymentListener, domainBundleFileBuilder.getId());
    assertDomainRedeploymentFailure(dummyDomainFileBuilder.getId());
    assertRedeploymentFailure(applicationDeploymentListener, dummyAppDescriptorFileBuilder.getId());
    assertThat(deploymentService.findApplication(dummyAppDescriptorFileBuilder.getId()), is(nullValue()));
}
Also used : ApplicationFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder) DomainFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.DomainFileBuilder) DomainBundleFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder) Test(org.junit.Test)

Example 3 with DomainBundleFileBuilder

use of org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder in project mule by mulesoft.

the class DomainBundleDeploymentTestCase method redeploysDomainBundle.

@Test
public void redeploysDomainBundle() throws Exception {
    ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder(dummyAppDescriptorFileBuilder).dependingOn(dummyDomainFileBuilder);
    DomainBundleFileBuilder domainBundleFileBuilder = new DomainBundleFileBuilder(dummyDomainFileBuilder).containing(applicationFileBuilder);
    addDomainBundleFromBuilder(domainBundleFileBuilder);
    startDeployment();
    assertDeploymentSuccess(domainBundleDeploymentListener, domainBundleFileBuilder.getId());
    assertDeploymentSuccess(domainDeploymentListener, dummyDomainFileBuilder.getId());
    assertApplicationDeploymentSuccess(applicationDeploymentListener, dummyAppDescriptorFileBuilder.getId());
    reset(domainDeploymentListener);
    reset(domainBundleDeploymentListener);
    reset(applicationDeploymentListener);
    addDomainBundleFromBuilder(domainBundleFileBuilder);
    assertDeploymentSuccess(domainBundleDeploymentListener, domainBundleFileBuilder.getId());
    assertDomainRedeploymentSuccess(dummyDomainFileBuilder.getId());
    assertApplicationRedeploymentSuccess(dummyAppDescriptorFileBuilder.getId());
}
Also used : ApplicationFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder) DomainBundleFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder) Test(org.junit.Test)

Example 4 with DomainBundleFileBuilder

use of org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder in project mule by mulesoft.

the class DomainBundleDeploymentTestCase method deploysDomainBundle.

@Test
public void deploysDomainBundle() throws Exception {
    ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder(dummyAppDescriptorFileBuilder).dependingOn(dummyDomainFileBuilder);
    DomainBundleFileBuilder domainBundleFileBuilder = new DomainBundleFileBuilder(dummyDomainFileBuilder).containing(applicationFileBuilder);
    addDomainBundleFromBuilder(domainBundleFileBuilder);
    startDeployment();
    assertDeploymentSuccess(domainBundleDeploymentListener, domainBundleFileBuilder.getId());
    assertDeploymentSuccess(domainDeploymentListener, dummyDomainFileBuilder.getId());
    assertApplicationDeploymentSuccess(applicationDeploymentListener, dummyAppDescriptorFileBuilder.getId());
    assertDomainDir(NONE, new String[] { DEFAULT_DOMAIN_NAME, dummyDomainFileBuilder.getId() }, true);
    assertAppsDir(NONE, new String[] { dummyAppDescriptorFileBuilder.getId() }, true);
}
Also used : ApplicationFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder) DomainBundleFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder) Test(org.junit.Test)

Example 5 with DomainBundleFileBuilder

use of org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder in project mule by mulesoft.

the class DomainBundleDeploymentTestCase method deploysDomainBundleWithCorruptedApp.

@Test
public void deploysDomainBundleWithCorruptedApp() throws Exception {
    ApplicationFileBuilder applicationFileBuilder = new ApplicationFileBuilder(dummyAppDescriptorFileBuilder).corrupted();
    DomainBundleFileBuilder domainBundleFileBuilder = new DomainBundleFileBuilder(dummyDomainFileBuilder).containing(applicationFileBuilder);
    addDomainBundleFromBuilder(domainBundleFileBuilder);
    startDeployment();
    assertDeploymentFailure(domainBundleDeploymentListener, domainBundleFileBuilder.getId());
    assertDomainDir(NONE, new String[] { DEFAULT_DOMAIN_NAME, dummyDomainFileBuilder.getId() }, true);
    assertDeploymentSuccess(domainDeploymentListener, dummyDomainFileBuilder.getId());
    assertDeploymentFailure(applicationDeploymentListener, dummyAppDescriptorFileBuilder.getId());
}
Also used : ApplicationFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder) DomainBundleFileBuilder(org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 ApplicationFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder)6 DomainBundleFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.DomainBundleFileBuilder)6 DomainFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.DomainFileBuilder)2