Examples of TestContextManager


Examples of org.springframework.test.context.TestContextManager

    private TestContextManager testContextManager;

    @Override
    protected void prepareContext() throws Exception {
        testContextManager = new TestContextManager(getClass());
        testContextManager.prepareTestInstance(this);
    }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

  private final TestContextManager testContextManager;


  public ParameterizedDependencyInjectionTests(final String employeeBeanName, final String employeeName)
      throws Exception {
    this.testContextManager = new TestContextManager(getClass());
    this.employeeBeanName = employeeBeanName;
    this.employeeName = employeeName;
  }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

  public void checkThatExceptionsAreNotSilentlySwallowed() throws Exception {
    SpringJUnit4ClassRunner runner = new SpringJUnit4ClassRunner(getClass()) {

      @Override
      protected TestContextManager createTestContextManager(Class<?> clazz) {
        return new TestContextManager(clazz) {

          @Override
          public void prepareTestInstance(Object testInstance) {
            throw new RuntimeException(
              "This RuntimeException should be caught and wrapped in an Exception.");
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

  /**
   * Construct a new AbstractTestNGSpringContextTests instance and initialize
   * the internal {@link TestContextManager} for the current test.
   */
  public AbstractTestNGSpringContextTests() {
    this.testContextManager = new TestContextManager(getClass());
  }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

    @Autowired
    protected ApplicationContext applicationContext;

    public SpringActivitiTestCase() {
        this.testContextManager = new TestContextManager(getClass());
    }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

  @Autowired
  protected ApplicationContext applicationContext;
 
  public SpringActivitiTestCase() {
    super();
    this.testContextManager = new TestContextManager(getClass());
  }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

    public SpringIntegration() {
    }

    @Override
    public Statement apply(Statement base, FrameworkMethod method, Object target) {
        TestContextManager contextManager = getTestContextManager(method.getMethod().getDeclaringClass());
        try {
            contextManager.prepareTestInstance(target);
        } catch (Exception e) {
            throw new IllegalStateException("Could not instantiate test instance", e);
        }
        Statement statement = super.apply(base, method, target);
        statement = withBefores(method, target, statement, contextManager);
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

        statement = withAfters(method, target, statement, contextManager);
        return statement;
    }

    protected TestContextManager getTestContextManager(Class<?> clazz) {
        return new TestContextManager(clazz);
    }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

     * Setup Spring dependencies in a step library, based on the Spring ContextConfiguration annotation.
     * @param target
     */
    public void injectDependenciesInto(Object target) {
        if (springIsOnClasspath() && annotatedWithSpringContext(target)) {
            TestContextManager contextManager = getTestContextManager(target.getClass());
            try {
                contextManager.prepareTestInstance(target);
            } catch (Exception e) {
                throw new IllegalStateException("Could not instantiate test instance", e);
            }
        }
    }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

            return false;
        }
    }

    protected TestContextManager getTestContextManager(Class<?> clazz) {
        return new TestContextManager(clazz);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.