Java Code Examples for org.springframework.test.context.junit4.statements.ProfileValueChecker

Following code examples demonstrate how to use org.springframework.test.context.junit4.statements.ProfileValueChecker from spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.test.context.junit4.statements.ProfileValueChecker and various code implementation of this class.
Example 1
Project : spring-framework Source File : SpringMethodRule.java View Source Code on GitHub

    @Override
    public Statement apply(
            final Statement base,
            final FrameworkMethod frameworkMethod,
            final Object testInstance) {
        LOGGER.debug("Applying SpringMethodRule to test method [{}]", frameworkMethod.getMethod());
        final Class<?> testClass = testInstance.getClass();
        final TestContextManager testContextManager = SpringClassRule.getTestContextManager(testClass);

        Statement statement = base;
        statement = new RunBeforeTestMethodCallbacks(statement, testInstance, frameworkMethod.getMethod(),
                testContextManager);
        statement = new RunAfterTestMethodCallbacks(statement, testInstance, frameworkMethod.getMethod(),
                testContextManager);
        statement = new RunPrepareTestInstanceCallbacks(statement, testInstance, testContextManager);
        statement = new SpringRepeat(statement, frameworkMethod.getMethod());
        statement = new SpringFailOnTimeout(statement, frameworkMethod.getMethod());
        statement = new ProfileValueChecker(statement, testInstance.getClass(), frameworkMethod.getMethod());
        return statement;
    }
			
Example 2
Project : spring-framework Source File : SpringClassRule.java View Source Code on GitHub

    public Statement apply(final Statement base, final Description description) {
        final Class<?> testClass = description.getTestClass();
        LOGGER.debug("Applying SpringClassRule to test class [{}]", testClass.getName());

        final TestContextManager testContextManager = getTestContextManager(testClass);
        Statement statement = base;
        statement = new RunBeforeTestClassCallbacks(statement, testContextManager);
        statement = new RunAfterTestClassCallbacks(statement, testContextManager);
        statement = new ProfileValueChecker(statement, testClass, null);
        statement = new TestContextManagerCacheEvictor(statement, testClass);
        return statement;
    }