Examples of TestContextManager


Examples of org.springframework.test.context.TestContextManager

   * initializes the internal {@link TestContextManager} for the current test;
   * and retrieves the configured (or default) {@link ProfileValueSource}.
   */
  public AbstractJUnit38SpringContextTests() {
    super();
    this.testContextManager = new TestContextManager(getClass());
    this.profileValueSource = ProfileValueUtils.retrieveProfileValueSource(getClass());
  }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

   * configured (or default) {@link ProfileValueSource}.
   * @param name the name of the current test to execute
   */
  public AbstractJUnit38SpringContextTests(String name) {
    super(name);
    this.testContextManager = new TestContextManager(getClass());
    this.profileValueSource = ProfileValueUtils.retrieveProfileValueSource(getClass());
  }
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

     */
    @Before
    public void setUpContext() throws Exception {
        //this is where the magic happens, we actually do "by hand" what the spring runner would do for us,
        // read the JavaDoc for the class bellow to know exactly what it does, the method names are quite accurate though
        TestContextManager testContextManager = new TestContextManager(getClass());
        testContextManager.prepareTestInstance(this);
    }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

   * Creates a new {@link TestContextManager} for the supplied test class.
   * <p>Can be overridden by subclasses.
   * @param clazz the test class to be managed
   */
  protected TestContextManager createTestContextManager(Class<?> clazz) {
    return new TestContextManager(clazz);
  }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

  /**
   * Creates a new {@link TestContextManager}. Can be overridden by subclasses.
   * @param clazz the Class object corresponding to the test class to be managed
   */
  protected TestContextManager createTestContextManager(Class<?> clazz) {
    return new TestContextManager(clazz);
  }
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

    /**
     * Loads the basic Citrus application context with all necessary parent context files.
     */
    public ApplicationContext loadApplicationContext() {
        if (applicationContext == null) {
            TestContextManager testContextManager = new TestContextManager(AbstractTestNGCitrusTest.class) {
                @Override
                public void prepareTestInstance(Object testInstance) throws Exception {
                    applicationContext = getTestContext().getApplicationContext();

                    // add special admin webapp test listeners
                    applicationContext.getBean(TestListeners.class).addTestListener(webSocketTestEventListener);
                    applicationContext.getBean(TestActionListeners.class).addTestActionListener(webSocketTestEventListener);
                    applicationContext.getBean(MessageListeners.class).addMessageListener(webSocketTestEventListener);
                }
            };

            try {
                testContextManager.prepareTestInstance(null);
            } catch (Exception e) {
                log.error("Failed to load application context", e);
            }
        }
       
View Full Code Here

Examples of org.springframework.test.context.TestContextManager

    /**
     * Stops and destroy this application context.
     */
    public void destroyApplicationContext() {
        TestContextManager testContextManager = new TestContextManager(AbstractTestNGCitrusTest.class) {
            @Override
            public void prepareTestInstance(Object testInstance) throws Exception {
                getTestContext().markApplicationContextDirty(DirtiesContext.HierarchyMode.CURRENT_LEVEL);
            }
        };
       
        try {
            testContextManager.prepareTestInstance(null);
        } catch (Exception e) {
            log.error("Failed to stop application context", e);
        }
       
        applicationContext = null;
View Full Code Here

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
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.