use of org.mule.tck.probe.PollingProber in project mule by mulesoft.
the class AbstractDeploymentTestCase method assertArtifactRedeploymentFailure.
private void assertArtifactRedeploymentFailure(DeploymentListener listener, String artifactName) {
Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
prober.check(new JUnitProbe() {
@Override
protected boolean test() throws Exception {
verify(listener).onRedeploymentFailure(eq(artifactName), any(Throwable.class));
return true;
}
@Override
public String describeFailure() {
return "Failed to redeploy application: " + artifactName + System.lineSeparator() + super.describeFailure();
}
});
}
use of org.mule.tck.probe.PollingProber in project mule by mulesoft.
the class AbstractDeploymentTestCase method assetArtifactFolderIsMaintained.
private void assetArtifactFolderIsMaintained(String artifactName, File artifactDir) {
Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
File appFolder = new File(artifactDir, artifactName);
prober.check(new FileExists(appFolder));
}
use of org.mule.tck.probe.PollingProber in project mule by mulesoft.
the class ApplicationPolicyDeploymentTestCase method appliesApplicationPolicyWithNotificationListener.
@Test
public void appliesApplicationPolicyWithNotificationListener() throws Exception {
policyManager.registerPolicyTemplate(fooPolicyFileBuilder.getArtifactFile());
ApplicationFileBuilder applicationFileBuilder = createExtensionApplicationWithServices(APP_WITH_EXTENSION_PLUGIN_CONFIG, helloExtensionV1Plugin);
addPackedAppFromBuilder(applicationFileBuilder);
startDeployment();
assertApplicationDeploymentSuccess(applicationDeploymentListener, applicationFileBuilder.getId());
List<Integer> notificationListenerActionIds = new ArrayList<>();
PolicyNotificationListener<PolicyNotification> notificationListener = notification -> notificationListenerActionIds.add(notification.getAction().getActionId());
policyManager.addPolicy(applicationFileBuilder.getId(), fooPolicyFileBuilder.getArtifactId(), new PolicyParametrization(FOO_POLICY_ID, pointparameters -> true, 1, singletonMap(POLICY_PROPERTY_KEY, POLICY_PROPERTY_VALUE), getResourceFile("/fooPolicy.xml"), singletonList(notificationListener)));
executeApplicationFlow("main");
assertThat(invocationCount, equalTo(1));
new PollingProber(POLICY_NOTIFICATION_TIMEOUT, 100).check(new JUnitProbe() {
@Override
protected boolean test() throws Exception {
assertThat(notificationListenerActionIds, hasSize(4));
assertThat(notificationListenerActionIds, hasItems(PROCESS_START, BEFORE_NEXT, AFTER_NEXT, PROCESS_END));
return true;
}
});
}
use of org.mule.tck.probe.PollingProber in project mule by mulesoft.
the class DomainFunctionalTestCase method disposeMuleContext.
public synchronized void disposeMuleContext(final MuleContext muleContext) {
disposedContexts.add(muleContext);
muleContext.dispose();
new PollingProber(10000, 100).check(new Probe() {
@Override
public boolean isSatisfied() {
return muleContext.isDisposed();
}
@Override
public String describeFailure() {
return "mule context timeout during dispose";
}
});
}
use of org.mule.tck.probe.PollingProber in project mule by mulesoft.
the class DeploymentTestUtils method assertFileExists.
public static void assertFileExists(File pluginsDir, String filePath) {
Prober prober = new PollingProber(5000, 100);
File marker = new File(pluginsDir, filePath);
prober.check(new FileExists(marker));
}
Aggregations