/** * Create a delegate by calling AbstractTestDelegate.getDelegate(clazz) * to allow for a test specific delegate. * This method then delegates to the AbstractTestDelegate.setUp method. * @throws Exception */ protected void setUp() throws Exception { super.setUp(); delegate = AbstractTestDelegate.getDelegate(clazz); delegate.setUp(); }
/** * This method then delegates to the AbstractTestDelegate.tearDown method. * @throws Exception */ protected void tearDown() throws Exception { if (delegate != null) delegate.tearDown(); delegate = null; } }
/** * Get the delegate * * @param clazz the test class * @return the delegate */ public static AbstractTestDelegate getDelegate(Class<?> clazz) { return new AbstractTestDelegate(clazz); }
/** * Setup callback. This calls setUpLogging and if enableSecurity is true, * setUpSecurity. * * @throws Exception for any error */ public void setUp() throws Exception { setUpLogging(); log("setUp"); if (enableSecurity) setUpSecurity(); }
/** * Teardown. If enableSecurity is true, this calls tearDownSecurity. The * tearDownLogging is then called regardless. * * @throws Exception for any error */ public void tearDown() throws Exception { try { if (enableSecurity) tearDownSecurity(); } finally { tearDownLogging(); } log("tornDown"); }
public void setUp() throws Exception { super.setUp(); Class adminClass = Thread.currentThread().getContextClassLoader().loadClass(adminName); Constructor constructor = adminClass.getConstructor(new Class[] { Class.class }); Admin admin = (Admin) constructor.newInstance(new Object[] { clazz } ); GenericAdmin.delegate = admin; } }
/** * Log an event with the given context * * @param context the context */ protected void log(String context) { getLog().debug("==== " + context + " " + clazz.getName() + " ===="); } }
/** * Enable trace logging for the given category name. * * @param name - the logging category to enable trace level logging for. */ protected void enableTrace(String name) { getDelegate().enableTrace(name); }
@Override public void setUp() throws Exception { super.setUp(); String aopXmlName = clazz.getName().replace(".", "/") + "-aop.xml"; URL url = clazz.getClassLoader().getResource(aopXmlName); if(url == null) throw new IllegalStateException("Can't find resource " + aopXmlName); AspectXmlLoader.deployXML(url); urls.add(url); }
/** * Setup callback. This calls setUpLogging and if enableSecurity is true, * setUpSecurity. * * @throws Exception for any error */ public void setUp() throws Exception { setUpLogging(); log("setUp"); if (enableSecurity) setUpSecurity(); }
/** * Teardown. If enableSecurity is true, this calls tearDownSecurity. The * tearDownLogging is then called regardless. * * @throws Exception for any error */ public void tearDown() throws Exception { try { if (enableSecurity) tearDownSecurity(); } finally { tearDownLogging(); } log("tornDown"); }
/** * Log an event with the given context * * @param context the context */ protected void log(String context) { getLog().debug("==== " + context + " " + clazz.getName() + " ===="); } }
/** * Enable trace logging for the given category name. * * @param name - the logging category to enable trace level logging for. */ protected void enableTrace(String name) { getDelegate().enableTrace(name); }
public void setUp() throws Exception { super.setUp(); try { deploy(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable e) { throw new RuntimeException(e); } }
/** * Create a delegate by calling AbstractTestDelegate.getDelegate(clazz) * to allow for a test specific delegate. * This method then delegates to the AbstractTestDelegate.setUp method. * @throws Exception */ protected void setUp() throws Exception { super.setUp(); delegate = AbstractTestDelegate.getDelegate(clazz); delegate.setUp(); }
/** * This method then delegates to the AbstractTestDelegate.tearDown method. * @throws Exception */ protected void tearDown() throws Exception { if (delegate != null) delegate.tearDown(); delegate = null; } }
/** * Get the jboss logger. */ public Logger getLog() { return getDelegate().getLog(); }
/** * Get the delegate * * @param clazz the test class * @return the delegate */ public static AbstractTestDelegate getDelegate(Class<?> clazz) { return new AbstractTestDelegate(clazz); }
/** * The JUnit setup method * * @throws Exception for any error */ public void setUp() throws Exception { super.setUp(); log = getLog(); log.debug("JBossTestServices.setUp()"); init(); log.info("jbosstest.beancount: " + System.getProperty("jbosstest.beancount")); log.info("jbosstest.iterationcount: " + System.getProperty("jbosstest.iterationcount")); log.info("jbosstest.threadcount: " + System.getProperty("jbosstest.threadcount")); log.info("jbosstest.nodeploy: " + System.getProperty("jbosstest.nodeploy")); log.info("jbosstest.jndiurl: " + this.getJndiURL()); log.info("jbosstest.jndifactory: " + this.getJndiInitFactory()); }