Search in sources :

Example 11 with JUnitProbe

use of org.mule.tck.probe.JUnitProbe in project mule by mulesoft.

the class AbstractDeploymentTestCase method assertConditionOnRegistry.

protected void assertConditionOnRegistry(TestDeploymentListener listener, Function<DefaultRegistry, Boolean> verifier) {
    Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
    prober.check(new JUnitProbe() {

        @Override
        public boolean test() {
            DefaultRegistry registry = (DefaultRegistry) listener.getRegistry();
            if (registry == null) {
                return false;
            }
            return verifier.apply(registry);
        }

        @Override
        public String describeFailure() {
            return "Properties were not overriden by the deployment properties";
        }
    });
}
Also used : JUnitProbe(org.mule.tck.probe.JUnitProbe) PollingProber(org.mule.tck.probe.PollingProber) DefaultRegistry(org.mule.runtime.core.internal.registry.DefaultRegistry) PollingProber(org.mule.tck.probe.PollingProber) Prober(org.mule.tck.probe.Prober)

Example 12 with JUnitProbe

use of org.mule.tck.probe.JUnitProbe in project mule by mulesoft.

the class AbstractDeploymentTestCase method assertAtLeastOneUndeploymentSuccess.

protected void assertAtLeastOneUndeploymentSuccess(final DeploymentListener listener, final String appName) {
    Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
    prober.check(new JUnitProbe() {

        @Override
        public boolean test() {
            verify(listener, atLeastOnce()).onUndeploymentSuccess(appName);
            return true;
        }

        @Override
        public String describeFailure() {
            return "Failed to undeploy artifact: " + appName + System.lineSeparator() + super.describeFailure();
        }
    });
}
Also used : JUnitProbe(org.mule.tck.probe.JUnitProbe) PollingProber(org.mule.tck.probe.PollingProber) PollingProber(org.mule.tck.probe.PollingProber) Prober(org.mule.tck.probe.Prober)

Example 13 with JUnitProbe

use of org.mule.tck.probe.JUnitProbe in project mule by mulesoft.

the class AbstractDeploymentTestCase method assertDeploymentFailure.

protected void assertDeploymentFailure(final DeploymentListener listener, final String artifactName, final VerificationMode mode) {
    Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
    prober.check(new JUnitProbe() {

        @Override
        public boolean test() {
            verify(listener, mode).onDeploymentFailure(eq(artifactName), any(Throwable.class));
            return true;
        }

        @Override
        public String describeFailure() {
            return getArtifactType(listener) + " deployment was supposed to fail for: " + artifactName + super.describeFailure();
        }
    });
}
Also used : JUnitProbe(org.mule.tck.probe.JUnitProbe) PollingProber(org.mule.tck.probe.PollingProber) PollingProber(org.mule.tck.probe.PollingProber) Prober(org.mule.tck.probe.Prober)

Example 14 with JUnitProbe

use of org.mule.tck.probe.JUnitProbe in project mule by mulesoft.

the class AbstractDeploymentTestCase method assertUndeploymentSuccess.

protected void assertUndeploymentSuccess(final DeploymentListener listener, final String appName) {
    Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
    prober.check(new JUnitProbe() {

        @Override
        public boolean test() {
            verify(listener, times(1)).onUndeploymentSuccess(appName);
            return true;
        }

        @Override
        public String describeFailure() {
            return "Failed to undeploy artifact: " + appName + System.lineSeparator() + super.describeFailure();
        }
    });
}
Also used : JUnitProbe(org.mule.tck.probe.JUnitProbe) PollingProber(org.mule.tck.probe.PollingProber) PollingProber(org.mule.tck.probe.PollingProber) Prober(org.mule.tck.probe.Prober)

Example 15 with JUnitProbe

use of org.mule.tck.probe.JUnitProbe in project mule by mulesoft.

the class AbstractDeploymentTestCase method assertRedeploymentStart.

protected void assertRedeploymentStart(final DeploymentListener listener, final String artifactName) {
    Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
    prober.check(new JUnitProbe() {

        @Override
        public boolean test() {
            verify(listener).onRedeploymentStart(eq(artifactName));
            return true;
        }

        @Override
        public String describeFailure() {
            return getArtifactType(listener) + " redeployment was supposed to start for: " + artifactName + super.describeFailure();
        }
    });
}
Also used : JUnitProbe(org.mule.tck.probe.JUnitProbe) PollingProber(org.mule.tck.probe.PollingProber) PollingProber(org.mule.tck.probe.PollingProber) Prober(org.mule.tck.probe.Prober)

Aggregations

JUnitProbe (org.mule.tck.probe.JUnitProbe)20 PollingProber (org.mule.tck.probe.PollingProber)20 Prober (org.mule.tck.probe.Prober)11 Test (org.junit.Test)6 URISyntaxException (java.net.URISyntaxException)5 IOException (java.io.IOException)4 MuleException (org.mule.runtime.api.exception.MuleException)4 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)4 ArrayList (java.util.ArrayList)2 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)2 ObjectStore (org.mule.runtime.api.store.ObjectStore)2 ObjectStoreNotAvailableException (org.mule.runtime.api.store.ObjectStoreNotAvailableException)2 Description (io.qameta.allure.Description)1 File (java.io.File)1 InputStream (java.io.InputStream)1 MalformedURLException (java.net.MalformedURLException)1 Arrays.asList (java.util.Arrays.asList)1 Collections.emptyList (java.util.Collections.emptyList)1 Collections.emptyMap (java.util.Collections.emptyMap)1 Collections.singletonList (java.util.Collections.singletonList)1