public boolean hasPersistenceTestAnnotation() { return testClass.getAnnotation(PersistenceTest.class) != null; }
private GitHub getGitHubValue(Method method, TestClass testClass) { GitHub gitHub = method.getAnnotation(GitHub.class); if (gitHub == null) { gitHub = testClass.getAnnotation(GitHub.class); } return gitHub; } }
private Redmine getRedmineValue(Method method, TestClass testClass) { Redmine redmine = method.getAnnotation(Redmine.class); if (redmine == null) { redmine = testClass.getAnnotation(Redmine.class); } return redmine; } }
public static String extract(ExecContext context, TestClass testClass) { BMRule rule = testClass.getAnnotation(BMRule.class); BMRules rules = testClass.getAnnotation(BMRules.class); String script = createRules(context, rule, rules); return script; }
private IstioResource[] findAnnotations(TestClass testClass) { if (testClass.isAnnotationPresent(IstioResource.class)) { return new IstioResource[] {testClass.getAnnotation(IstioResource.class)}; } else { if (testClass.isAnnotationPresent(IstioResource.List.class)) { return testClass.getAnnotation(IstioResource.List.class).value(); } } return new IstioResource[0]; }
private RestoreIstioResource[] findRestoreAnnotations(TestClass testClass) { if (testClass.isAnnotationPresent(RestoreIstioResource.class)) { return new RestoreIstioResource[] {testClass.getAnnotation(RestoreIstioResource.class)}; } else { if (testClass.isAnnotationPresent(RestoreIstioResource.List.class)) { return testClass.getAnnotation(RestoreIstioResource.List.class).value(); } } return new RestoreIstioResource[0]; }
private JpaCacheEviction obtainAnnotation(TestEvent event) { final JpaCacheEviction classLevel = event.getTestClass().getAnnotation(JpaCacheEviction.class); final JpaCacheEviction methodLevel = event.getTestMethod().getAnnotation(JpaCacheEviction.class); if (methodLevel != null) { return methodLevel; } return classLevel; }
private JpaCacheEviction obtainAnnotation(TestEvent event) { final JpaCacheEviction classLevel = event.getTestClass().getAnnotation(JpaCacheEviction.class); final JpaCacheEviction methodLevel = event.getTestMethod().getAnnotation(JpaCacheEviction.class); if (methodLevel != null) { return methodLevel; } return classLevel; }
public File getBndFile(TestClass testClass) { if (testClass.isAnnotationPresent(BndFile.class)) { BndFile annotation = testClass.getAnnotation(BndFile.class); return new File(annotation.value()); } return bndFile; }
private JpaCacheEviction obtainAnnotation(TestEvent event) { final JpaCacheEviction classLevel = event.getTestClass().getAnnotation(JpaCacheEviction.class); final JpaCacheEviction methodLevel = event.getTestMethod().getAnnotation(JpaCacheEviction.class); if (methodLevel != null) { return methodLevel; } return classLevel; }
/** * Returns all resources defined for this test class * including those defined on the test method level. */ public Collection<T> getDescriptors(TestClass testClass) { final List<T> descriptors = new ArrayList<T>(); for (Method testMethod : testClass.getMethods(resourceAnnotation)) { descriptors.addAll(getDescriptorsDefinedFor(testMethod)); } descriptors.addAll(obtainClassLevelDescriptor(testClass.getAnnotation(resourceAnnotation))); return descriptors; }
private static DeploymentParameters resolveDeployment(TestClass testClass) { if (testClass.isAnnotationPresent(DeploymentParameters.class)) { return testClass.getAnnotation(DeploymentParameters.class); } else { return new DeploymentParametersAnnotationClass(); } }
private static DeploymentParameters resolveDeployment(TestClass testClass) { if (testClass.isAnnotationPresent(DeploymentParameters.class)) { return testClass.getAnnotation(DeploymentParameters.class); } else { return new DeploymentParametersAnnotationClass(); } }
@Override protected Archive<?> build(TestClass testClass) { if (testClass.isAnnotationPresent(MavenBuild.class)) { final MavenBuild mavenBuildDeployment = testClass.getAnnotation(MavenBuild.class); return runBuild(mavenBuildDeployment); } return null; }
@Override protected Archive<?> build(TestClass testClass) { if (testClass.isAnnotationPresent(GradleBuild.class)) { final GradleBuild gradleBuildDeployment = testClass.getAnnotation(GradleBuild.class); return runBuild(gradleBuildDeployment); } return null; }
@Override public TransactionMode getTransactionModeFromClassLevel(TestEvent testEvent) { return testEvent.getTestClass().getAnnotation(Transactional.class).value(); }
public void executeSleep(@Observes BeforeClass beforeClass) { final TestClass testClass = beforeClass.getTestClass(); if (ReflectionUtil.isClassWithAnnotation(testClass.getJavaClass(), Sleep.class)) { final Sleep sleep = testClass.getAnnotation(Sleep.class); executeSleep(sleep); } }
public void executeHealthCheck(@Observes BeforeClass beforeClass) { final TestClass testClass = beforeClass.getTestClass(); if (ReflectionUtil.isClassWithAnnotation(testClass.getJavaClass(), HealthCheck.class)) { final HealthCheck healthCheck = testClass.getAnnotation(HealthCheck.class); executeHealthCheck(healthCheck); } }
public void executeSleep(@Observes BeforeClass beforeClass) { final TestClass testClass = beforeClass.getTestClass(); if (ReflectionUtil.isClassWithAnnotation(testClass.getJavaClass(), Sleep.class)) { final Sleep sleep = testClass.getAnnotation(Sleep.class); executeSleep(sleep); } }
public void executeHealthCheck(@Observes BeforeClass beforeClass) { final TestClass testClass = beforeClass.getTestClass(); if (ReflectionUtil.isClassWithAnnotation(testClass.getJavaClass(), HealthCheck.class)) { final HealthCheck healthCheck = testClass.getAnnotation(HealthCheck.class); executeHealthCheck(healthCheck); } }