Search in sources :

Example 1 with VerifyFilter

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

the class AnnotationFilterTest method testLocalVerifyFilter.

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

Example 2 with VerifyFilter

use of com.hazelcast.simulator.utils.AnnotationFilter.VerifyFilter 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 3 with VerifyFilter

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

the class AnnotationFilterTest method testGlobalVerifyFilter.

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

Aggregations

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