/** * Determine whether or not to rollback transactions by default for the * supplied {@linkplain TestContext test context}. * <p>Supports {@link Rollback @Rollback} or {@link Commit @Commit} at the * class-level. * @param testContext the test context for which the default rollback flag * should be retrieved * @return the <em>default rollback</em> flag for the supplied test context * @throws Exception if an error occurs while determining the default rollback flag */ protected final boolean isDefaultRollback(TestContext testContext) throws Exception { Class<?> testClass = testContext.getTestClass(); Rollback rollback = AnnotatedElementUtils.findMergedAnnotation(testClass, Rollback.class); boolean rollbackPresent = (rollback != null); if (rollbackPresent) { boolean defaultRollback = rollback.value(); if (logger.isDebugEnabled()) { logger.debug(String.format("Retrieved default @Rollback(%s) for test class [%s].", defaultRollback, testClass.getName())); } return defaultRollback; } // else return true; }
AnnotatedElementUtils.findMergedAnnotation(testContext.getTestMethod(), Rollback.class); if (rollbackAnnotation != null) { boolean rollbackOverride = rollbackAnnotation.value(); if (logger.isDebugEnabled()) { logger.debug(String.format(
/** * Determine whether or not to rollback transactions by default for the * supplied {@linkplain TestContext test context}. * <p>Supports {@link Rollback @Rollback} or {@link Commit @Commit} at the * class-level. * @param testContext the test context for which the default rollback flag * should be retrieved * @return the <em>default rollback</em> flag for the supplied test context * @throws Exception if an error occurs while determining the default rollback flag */ protected final boolean isDefaultRollback(TestContext testContext) throws Exception { Class<?> testClass = testContext.getTestClass(); Rollback rollback = AnnotatedElementUtils.findMergedAnnotation(testClass, Rollback.class); boolean rollbackPresent = (rollback != null); if (rollbackPresent) { boolean defaultRollback = rollback.value(); if (logger.isDebugEnabled()) { logger.debug(String.format("Retrieved default @Rollback(%s) for test class [%s].", defaultRollback, testClass.getName())); } return defaultRollback; } // else return true; }
AnnotatedElementUtils.findMergedAnnotation(testContext.getTestMethod(), Rollback.class); if (rollbackAnnotation != null) { boolean rollbackOverride = rollbackAnnotation.value(); if (logger.isDebugEnabled()) { logger.debug(String.format(
AnnotatedElementUtils.findMergedAnnotation(testContext.getTestMethod(), Rollback.class); if (rollbackAnnotation != null) { boolean rollbackOverride = rollbackAnnotation.value(); if (logger.isDebugEnabled()) { logger.debug(String.format(
boolean defaultRollback = rollback.value(); if (logger.isDebugEnabled()) { logger.debug(String.format("Retrieved default @Rollback(%s) for test class [%s].",