Refine search
/** * This test will fail unless a time out transformer is applied to it. * * @author cbeust */ @Test(timeOut = 1000) @Listeners(MySuiteListener.class) public class AnnotationTransformerClassSampleTest { public void one() { try { Thread.sleep(2000); } catch (InterruptedException handled) { Thread.currentThread().interrupt(); } } }
boolean shouldIntercept(Class testClass) { Listeners listenersAnnotation = getListenersAnnotation(testClass); return listenersAnnotation != null && asList(listenersAnnotation.value()).contains(SoftAsserts.class); }
/** * @author Radovan Semancik */ @ContextConfiguration(locations = {"classpath:ctx-model-intest-test-main.xml"}) @DirtiesContext(classMode = ClassMode.AFTER_CLASS) @Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class }) public class TestManualCapabilities extends TestManual { @Override protected File getResourceFile() { return RESOURCE_MANUAL_CAPABILITIES_FILE; } @Override protected boolean nativeCapabilitiesEntered() { return true; } @Override protected int getNumberOfAccountAttributeDefinitions() { return 5; } }
@ContextConfiguration(classes = CitrusSpringConfig.class) @Listeners( { PrepareTestNGMethodInterceptor.class } ) public abstract class AbstractTestNGCitrusTest extends AbstractTestNGSpringContextTests {
@Listeners(ResultContextListener.class) public class ResultContextListenerSample { @Test public void f() { } }
@ContextConfiguration(locations = {"classpath:ctx-model-intest-test-main.xml"}) @DirtiesContext(classMode = ClassMode.AFTER_CLASS) @Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class }) public class TestPersona extends AbstractPersonaTest {
@ContextConfiguration(locations = { "classpath:META-INF/spring/stevia-boot-context.xml" }) @Listeners({ControllerMaskingListener.class, ConditionsListener.class,TestListener.class}) public class SteviaTestBase extends AbstractTestNGSpringContextTests implements Constants {
@Listeners(SimpleListener.class) public class FailingSampleTest { @AfterMethod public void am() { SimpleListener.m_list.add(6); } @Test public void a1() { SimpleListener.m_list.add(4); throw new RuntimeException(); } }
@ContextConfiguration(locations = {"classpath:ctx-model-intest-test-main.xml"}) @DirtiesContext(classMode = ClassMode.AFTER_CLASS) @Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class }) public class TestManual extends AbstractDirectManualResourceTest {
@Listeners(MyClassListener.class) public class ClassListenerSample { @Test public void test() {} @Test public void test2() {} }
@SuppressWarnings({"deprecation"}) private IAnnotation createListenersTag(Class<?> cls, Annotation a, IAnnotationTransformer transformer) { ListenersAnnotation result = new ListenersAnnotation(); Listeners l = (Listeners) a; result.setValue(l.value()); return result; }
@ContextConfiguration(locations = {"classpath:ctx-model-intest-test-main.xml"}) @DirtiesContext(classMode = ClassMode.AFTER_CLASS) @Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class }) public class TestManualGrouping extends AbstractGroupingManualResourceTest {
@Listeners(LocalDataProviderListener.class) public class SimpleDataProviderWithListenerAnnotationSample { @Test(dataProvider = "getData") public void testMethod(int i) { Assert.assertTrue(i > 0); } @DataProvider public Object[][] getData() { return new Object[][] {{1}, {2}}; } }
private IAnnotation createListenersTag(Annotation a) { ListenersAnnotation result = new ListenersAnnotation(); Listeners l = (Listeners) a; result.setValue(l.value()); return result; }
@ContextConfiguration(locations = "classpath:ctx-provisioning-test-main.xml") @DirtiesContext @Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class }) public class TestDummyPrioritiesAndReadReplaceLegacyUpdate extends TestDummyPrioritiesAndReadReplace {
@Listeners(DataProviderInfoProvider.class) public class InstanceBasedDataProviderWithListenerAnnotationSample { @Test(dataProvider = "getData") public void testMethod(int i) { Assert.assertTrue(i > 0); } @DataProvider public Object[][] getData() { return new Object[][] {{1}, {2}}; } }
private boolean checkBMNGListener(Class<?> clazz) { Listeners listeners = clazz.getAnnotation(Listeners.class); if (listeners == null) { return false; } Class<? extends ITestNGListener>[] clazzarray = listeners.value(); for (int i = 0; i < clazzarray.length; i++) { if (clazzarray[i] == BMNGListener.class) { return true; } } return false; }