/** * Delegates to the configured {@link TestContextManager} to * {@linkplain TestContextManager#prepareTestInstance(Object) prepare} this test * instance prior to execution of any individual tests, for example for * injecting dependencies, etc. * @throws Exception if a registered TestExecutionListener throws an exception */ @BeforeClass(alwaysRun = true, dependsOnMethods = "springTestContextBeforeTestClass") protected void springTestContextPrepareTestInstance() throws Exception { this.testContextManager.prepareTestInstance(this); }
public void prepareTestInstance(Object testInstance) throws Exception { delegate.prepareTestInstance(testInstance); }
/** * Delegates to {@link TestContextManager#prepareTestInstance}. */ @Override public void postProcessTestInstance(Object testInstance, ExtensionContext context) throws Exception { getTestContextManager(context).prepareTestInstance(testInstance); }
/** * Invoke {@link TestContextManager#prepareTestInstance(Object)} and * then evaluate the next {@link Statement} in the execution chain * (typically an instance of {@link RunAfterTestMethodCallbacks}). */ @Override public void evaluate() throws Throwable { this.testContextManager.prepareTestInstance(this.testInstance); this.next.evaluate(); }
@Override public void runBare() throws Throwable { testContextManager.prepareTestInstance(this); // this will initialize // all dependencies super.runBare(); }
/** * Delegate to the parent implementation for creating the test instance and * then allow the {@link #getTestContextManager() TestContextManager} to * prepare the test instance before returning it. * @see TestContextManager#prepareTestInstance */ @Override protected Object createTest() throws Exception { Object testInstance = super.createTest(); getTestContextManager().prepareTestInstance(testInstance); return testInstance; }
@Before public void injectDependencies() throws Exception { testContextManager.prepareTestInstance(this); }
@Override public void runBare() throws Throwable { testContextManager.prepareTestInstance(this); // this will initialize all dependencies try { super.runBare(); } finally { testContextManager.afterTestClass(); applicationContext.close(); clearTestContextCache(testContextManager); applicationContext = null; processEngine = null; testContextManager = null; CachedIntrospectionResults.clearClassLoader(getClass().getClassLoader()); } }
public void setUpStringContext() throws Exception { testContextManager = new TestContextManager(getClass()); testContextManager.prepareTestInstance(this);
/** * Delegates to the configured {@link TestContextManager} to * {@linkplain TestContextManager#prepareTestInstance(Object) prepare} this test * instance prior to execution of any individual tests, for example for * injecting dependencies, etc. * @throws Exception if a registered TestExecutionListener throws an exception */ @BeforeClass(alwaysRun = true, dependsOnMethods = "springTestContextBeforeTestClass") protected void springTestContextPrepareTestInstance() throws Exception { this.testContextManager.prepareTestInstance(this); }
/** * Invoke {@link TestContextManager#prepareTestInstance(Object)} and * then evaluate the next {@link Statement} in the execution chain * (typically an instance of {@link RunAfterTestMethodCallbacks}). */ @Override public void evaluate() throws Throwable { this.testContextManager.prepareTestInstance(this.testInstance); this.next.evaluate(); }
@Override public void runBare() throws Throwable { testContextManager.prepareTestInstance(this); // this will initialize all dependencies super.runBare(); }
/** * Invoke {@link TestContextManager#prepareTestInstance(Object)} and * then evaluate the next {@link Statement} in the execution chain * (typically an instance of {@link RunAfterTestMethodCallbacks}). */ @Override public void evaluate() throws Throwable { this.testContextManager.prepareTestInstance(testInstance); this.next.evaluate(); }
/** * Delegates to {@link TestContextManager#prepareTestInstance}. */ @Override public void postProcessTestInstance(Object testInstance, ExtensionContext context) throws Exception { getTestContextManager(context).prepareTestInstance(testInstance); }
@Override public void runBare() throws Throwable { testContextManager.prepareTestInstance(this); // this will initialize all dependencies super.runBare(); }
@Override public void runBare() throws Throwable { testContextManager.prepareTestInstance(this); // this will initialize all dependencies super.runBare(); }
/** * Delegates to {@link TestContextManager#prepareTestInstance}. */ @Override public void postProcessTestInstance(Object testInstance, ExtensionContext context) throws Exception { getTestContextManager(context).prepareTestInstance(testInstance); }
/** * Delegate to the parent implementation for creating the test instance and * then allow the {@link #getTestContextManager() TestContextManager} to * prepare the test instance before returning it. * @see TestContextManager#prepareTestInstance */ @Override protected Object createTest() throws Exception { Object testInstance = super.createTest(); getTestContextManager().prepareTestInstance(testInstance); return testInstance; }
@Override protected Object createTest() throws Exception { Object testInstance = csvTestsProvider.newTestClassInstance(); getTestContextManager().prepareTestInstance(testInstance); return testInstance; }
/** * Delegate to the parent implementation for creating the test instance and * then allow the {@link #getTestContextManager() TestContextManager} to * prepare the test instance before returning it. * @see TestContextManager#prepareTestInstance */ @Override protected Object createTest() throws Exception { Object testInstance = super.createTest(); getTestContextManager().prepareTestInstance(testInstance); return testInstance; }