use of org.mule.tck.probe.PollingProber 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();
}
});
}
use of org.mule.tck.probe.PollingProber 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();
}
});
}
use of org.mule.tck.probe.PollingProber 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();
}
});
}
use of org.mule.tck.probe.PollingProber in project mule by mulesoft.
the class AbstractDeploymentTestCase method assertMuleContextCreated.
protected void assertMuleContextCreated(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)).onArtifactCreated(eq(appName), any(CustomizationService.class));
return true;
}
@Override
public String describeFailure() {
return String.format("Did not received notification '%s' for app '%s'", "onArtifactCreated", appName) + System.lineSeparator() + super.describeFailure();
}
});
}
use of org.mule.tck.probe.PollingProber in project mule by mulesoft.
the class AbstractDeploymentTestCase method assertNoDeploymentInvoked.
protected void assertNoDeploymentInvoked(final DeploymentListener deploymentListener) {
// TODO(pablo.kraan): look for a better way to test this
boolean invoked;
Prober prober = new PollingProber(DeploymentDirectoryWatcher.DEFAULT_CHANGES_CHECK_INTERVAL_MS * 2, 100);
try {
prober.check(new Probe() {
@Override
public boolean isSatisfied() {
try {
verify(deploymentListener, times(1)).onDeploymentStart(any(String.class));
return true;
} catch (AssertionError e) {
return false;
}
}
@Override
public String describeFailure() {
return "No deployment has started";
}
});
invoked = true;
} catch (AssertionError e) {
invoked = false;
}
assertFalse("A deployment was started", invoked);
}
Aggregations