Search in sources :

Example 1 with TeardownFilter

use of com.hazelcast.simulator.utils.AnnotationFilter.TeardownFilter in project hazelcast-simulator by hazelcast.

the class TestContainer method registerTestPhaseTasks.

private void registerTestPhaseTasks() {
    try {
        registerSetupTask();
        registerPrepareTasks(false);
        registerPrepareTasks(true);
        taskPerPhaseMap.put(RUN, new Callable() {

            @Override
            public Object call() throws Exception {
                if (propertyBinding.recordJitter) {
                    Probe probe = propertyBinding.getOrCreateProbe("jitter", false);
                    new JitterThread(testContext, probe, propertyBinding.recordJitterThresholdNs).start();
                }
                return runStrategy.getRunCallable().call();
            }
        });
        registerTask(Verify.class, new VerifyFilter(false), LOCAL_VERIFY);
        registerTask(Verify.class, new VerifyFilter(true), GLOBAL_VERIFY);
        registerTask(Teardown.class, new TeardownFilter(false), LOCAL_TEARDOWN);
        registerTask(Teardown.class, new TeardownFilter(true), GLOBAL_TEARDOWN);
    } catch (IllegalTestException e) {
        throw rethrow(e);
    } catch (Exception e) {
        throw new IllegalTestException(format("Error during search for annotated test methods in %s: [%s] %s", testClass.getName(), e.getClass().getSimpleName(), e.getMessage()), e);
    }
}
Also used : VerifyFilter(com.hazelcast.simulator.utils.AnnotationFilter.VerifyFilter) Probe(com.hazelcast.simulator.probes.Probe) Callable(java.util.concurrent.Callable) InvocationTargetException(java.lang.reflect.InvocationTargetException) TeardownFilter(com.hazelcast.simulator.utils.AnnotationFilter.TeardownFilter)

Example 2 with TeardownFilter

use of com.hazelcast.simulator.utils.AnnotationFilter.TeardownFilter in project hazelcast-simulator by hazelcast.

the class AnnotationFilterTest method testGlobalTeardownFilter.

@Test
public void testGlobalTeardownFilter() {
    Method method = new AnnotatedMethodRetriever(AnnotationTestClass.class, Teardown.class).withVoidReturnType().withFilter(new TeardownFilter(true)).find();
    assertEquals("globalTearDown", method.getName());
}
Also used : Teardown(com.hazelcast.simulator.test.annotations.Teardown) Method(java.lang.reflect.Method) TeardownFilter(com.hazelcast.simulator.utils.AnnotationFilter.TeardownFilter) Test(org.junit.Test)

Example 3 with TeardownFilter

use of com.hazelcast.simulator.utils.AnnotationFilter.TeardownFilter in project hazelcast-simulator by hazelcast.

the class AnnotationFilterTest method testLocalTeardownFilter.

@Test
public void testLocalTeardownFilter() {
    Method method = new AnnotatedMethodRetriever(AnnotationTestClass.class, Teardown.class).withVoidReturnType().withFilter(new TeardownFilter(false)).find();
    assertEquals("localTearDown", method.getName());
}
Also used : Teardown(com.hazelcast.simulator.test.annotations.Teardown) Method(java.lang.reflect.Method) TeardownFilter(com.hazelcast.simulator.utils.AnnotationFilter.TeardownFilter) Test(org.junit.Test)

Aggregations

TeardownFilter (com.hazelcast.simulator.utils.AnnotationFilter.TeardownFilter)3 Teardown (com.hazelcast.simulator.test.annotations.Teardown)2 Method (java.lang.reflect.Method)2 Test (org.junit.Test)2 Probe (com.hazelcast.simulator.probes.Probe)1 VerifyFilter (com.hazelcast.simulator.utils.AnnotationFilter.VerifyFilter)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Callable (java.util.concurrent.Callable)1