use of org.mule.tck.probe.JUnitLambdaProbe in project mule by mulesoft.
the class ExpiryMonitorTestCase method testNotExpiry.
@Test
public void testNotExpiry() throws InterruptedException {
Expirable e = () -> expire();
long startTime = currentTimeMillis();
monitor.addExpirable(EXPIRE_TIME, MILLISECONDS, e);
monitor.run();
assertThat(expired, is(false));
new PollingProber(EXPIRE_TIMEOUT, 50).check(new JUnitLambdaProbe(() -> {
assertThat(monitor.isRegistered(e), is(false));
assertThat(expired, is(true));
return true;
}, ae -> {
ae.printStackTrace();
return "" + currentTimeMillis() + " - " + monitor.toString();
}));
assertThat(expiredTime - startTime, greaterThanOrEqualTo(EXPIRE_TIME - DELTA_TIME));
}
use of org.mule.tck.probe.JUnitLambdaProbe in project mule by mulesoft.
the class ExpiryMonitorTestCase method testExpiry.
@Test
public void testExpiry() throws InterruptedException {
Expirable e = () -> expire();
monitor.addExpirable(EXPIRE_TIME, MILLISECONDS, e);
new PollingProber(EXPIRE_TIMEOUT, 50).check(new JUnitLambdaProbe(() -> {
assertThat(monitor.isRegistered(e), is(false));
assertThat(expired, is(true));
return true;
}, ae -> {
ae.printStackTrace();
return "" + currentTimeMillis() + " - " + monitor.toString();
}));
}
use of org.mule.tck.probe.JUnitLambdaProbe in project mule by mulesoft.
the class LifecycleAwareConfigurationInstanceTestCase method disposeMetadataCacheWhenConfigIsDisposed.
@Test
public void disposeMetadataCacheWhenConfigIsDisposed() throws Exception {
MuleMetadataService muleMetadataManager = ((MuleContextWithRegistries) muleContext).getRegistry().lookupObject(MuleMetadataService.class);
muleMetadataManager.getMetadataCache(NAME);
interceptable.initialise();
interceptable.start();
interceptable.stop();
new PollingProber(1000, 100).check(new JUnitLambdaProbe(() -> muleMetadataManager.getMetadataCaches().entrySet().isEmpty()));
}
use of org.mule.tck.probe.JUnitLambdaProbe in project mule by mulesoft.
the class TypedValueParameterOperationExecutionTestCase method typedValueForStringOnSourceOnSuccess.
@Test
public void typedValueForStringOnSourceOnSuccess() throws Exception {
Flow flow = (Flow) getFlowConstruct("typedValueForStringOnSourceOnSuccess");
flow.start();
new PollingProber(100000, 100).check(new JUnitLambdaProbe(() -> TypedValueSource.onSuccessValue != null));
assertTypedValue(TypedValueSource.onSuccessValue, STRING_VALUE, WILDCARD, null);
}
use of org.mule.tck.probe.JUnitLambdaProbe in project mule by mulesoft.
the class PetStoreDefaultEncodingTestCase method listen.
private Message listen() {
PollingProber prober = new PollingProber(TIMEOUT_MILLIS, POLL_DELAY_MILLIS);
prober.check(new JUnitLambdaProbe(() -> messageHolder.get() != null));
return messageHolder.get();
}
Aggregations