public ContainerTestContextSetter() { ContainerTestContext.startContext(getContext() != null ? getContext().getUuid() : null); }
@Override public void evaluate() throws Throwable { try { this.doEvaluation(TestRunnerUtils.getTestRunnerFacade(), this.context); } catch (Throwable t) { throw RemoteUtils.getActualThrowable(t); } }
UUID getUuid() { return this.getContext() != null ? this.getContext().getUuid() : null; }
private void initTestClass(Object instance, TxHandler txHandler) { // Try to set the context (if the class is ContextAware) if (ContextAware.class.isAssignableFrom(instance.getClass())) { ((ContextAware) instance).setContext(this.getContext()); } if (TransactionAware.class.isAssignableFrom(instance.getClass())) { ((TransactionAware) instance).setTxHandler(txHandler); } // Try to call the init method (if the class implements Initializable) if (Initializable.class.isAssignableFrom(instance.getClass())) { ((Initializable) instance).init(); } }
@Override public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) { T t = this.get(contextual); if (t == null) { Bean<T> b = (Bean<T>) contextual; return storeObject(b.getBeanClass(), new CustomScopeInstance<T>(b, creationalContext)); } else { return t; } }
@Override protected void doEvaluation(TestRunnerFacade facade, TestRunnerContext context) throws Throwable { facade.runTestMethodInEjbContext(new TestRunnerAnnotationHandler(method, description, context)); // facade.runTestMethodInEjbContext(method.getDeclaringClass().getName(), method.getName(), context); } }
@Override protected String getLocalRoot() { return this.getContext().getLocalRoot(); }
@Override public void close() { ContainerTestContext.endContext(this.disposeContext); }
@Override public boolean isActive() { return isContextActive(); }
/** * Gets a Path instance relative to the 'local' test (rather than the JBoss server context). * * @param relativePath * Relative path like <code>target/file.xml</code> * @param createParentDirectories * If true, the parent directories of the path are created if necessary * @return Path relative to the unit test VM */ protected final Path getLocalPath(String relativePath, boolean createParentDirectories) { return this.getLocalPath(Paths.get(relativePath), createParentDirectories); }
/** * Looks up a TestRunnerFacade using a remote JNDI service locator, configured by JU property files. * @return TestRunnerFacade instance */ public static synchronized TestRunnerFacade getTestRunnerFacade() { if (testRunnerFacade == null) { testRunnerFacade = getRemoteServiceLocator().lookup(TestRunnerFacade.class); } return testRunnerFacade; } }
private void initTestClass(Object instance, TxHandler txHandler) { // Try to set the context (if the class is ContextAware) if (ContextAware.class.isAssignableFrom(instance.getClass())) { ((ContextAware) instance).setContext(this.getContext()); } if (TransactionAware.class.isAssignableFrom(instance.getClass())) { ((TransactionAware) instance).setTxHandler(txHandler); } // Try to call the init method (if the class implements Initializable) if (Initializable.class.isAssignableFrom(instance.getClass())) { ((Initializable) instance).init(); } }
public ContainerTestContextSetter() { ContainerTestContext.startContext(getContext() != null ? getContext().getUuid() : null); }
@Override public void evaluate() throws Throwable { try { this.doEvaluation(TestRunnerUtils.getTestRunnerFacade(), this.context); } catch (Throwable t) { throw RemoteUtils.getActualThrowable(t); } }
@Override public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) { T t = this.get(contextual); if (t == null) { Bean<T> b = (Bean<T>) contextual; return storeObject(b.getBeanClass(), new CustomScopeInstance<T>(b, creationalContext)); } else { return t; } }
UUID getUuid() { return this.getContext() != null ? this.getContext().getUuid() : null; }
@Override protected void doEvaluation(TestRunnerFacade facade, TestRunnerContext context) throws Throwable { facade.runTestMethodInEjbContext(new TestRunnerAnnotationHandler(method, description, context)); // facade.runTestMethodInEjbContext(method.getDeclaringClass().getName(), method.getName(), context); } }
@Override protected String getLocalRoot() { return this.getContext().getLocalRoot(); }
@Override public void close() { ContainerTestContext.endContext(this.disposeContext); }
@Override public boolean isActive() { return isContextActive(); }