/** * Overriden to return JBossTestServices as the test delegate. * * @param clazz the test class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new JBossTestServices(clazz); return delegate; }
/** * Deploy a package with the main deployer. The supplied name is * interpreted as a url, or as a filename in jbosstest.deploy.lib or ../lib. * * @param name filename/url of package to deploy. * @exception Exception Description of Exception */ protected void deploy(String name) throws Exception { delegate.deploy(name); }
protected void flushAuthCache(String domain) throws Exception { delegate.flushAuthCache(domain); }
public void redeploy(String name) throws Exception { if (Boolean.getBoolean("jbosstest.nodeploy") == true) { log.debug("Skipping redeployment of: " + name); return; } URL deployURL = getDeployURL(name); log.debug("Deploying " + name + ", url=" + deployURL); invoke(getDeployerName(), "redeploy", new Object[]{deployURL}, new String[]{"java.net.URL"}); }
/** Do a JAAS login with the current username, password and login config. * @throws Exception */ public void login() throws Exception { flushAuthCache("other"); String username = getUsername(); String pass = getPassword(); String config = getLoginConfig(); char[] password = null; if (pass != null) password = pass.toCharArray(); AppCallbackHandler handler = new AppCallbackHandler(username, password); getLog().debug("Creating LoginContext(" + config + ")"); lc = new LoginContext(config, handler); lc.login(); getLog().debug("Created LoginContext, subject=" + lc.getSubject()); }
/** * 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()); }
/** * Gets the DeployerName attribute of the JBossTestCase object * * @return The DeployerName value * @exception MalformedObjectNameException Description of Exception */ protected ObjectName getDeployerName() throws MalformedObjectNameException { return delegate.getDeployerName(); }
/** * Gets the InitialContext attribute of the JBossTestCase object * * @return The InitialContext value * @throws Exception for any error */ protected InitialContext getInitialContext() throws Exception { return delegate.getInitialContext(); }
protected String getJndiInitFactory() { return delegate.getJndiInitFactory(); }
protected int getIterationCount() { return delegate.getIterationCount(); }
protected int getBeanCount() { return delegate.getBeanCount(); }
/** * Returns the deployment directory to use. This does it's best to figure out * where you are looking. If you supply a complete url, it returns it. * Otherwise, it looks for jbosstest.deploy.dir or if missing ../lib. Then it * tries to construct a file url or a url. * * @param filename name of the file/url you want * @return A more or less canonical string for the url. * @exception MalformedURLException Description of Exception */ protected URL getDeployURL(final String filename) throws MalformedURLException { return delegate.getDeployURL(filename); }
/** * Constructor for the JBossTestCase object * * @param className Test case name */ public JBossTestServices(String className) { super(getClass(className)); } public JBossTestServices(Class clazz)
/** * Undeploy a package with the main deployer. The supplied name is * interpreted as a url, or as a filename in jbosstest.deploy.lib or output/lib. * * @param name filename/url of package to undeploy. * @exception Exception Description of Exception */ public void undeploy(String name) throws Exception { if (Boolean.getBoolean("jbosstest.nodeploy") == true) return; URL deployURL = getDeployURL(name); log.debug("Undeploying " + name + ", url=" + deployURL); Object[] args = {deployURL}; String[] sig = {"java.net.URL"}; invoke(getDeployerName(), "undeploy", args, sig); }
/** Do a JAAS login with the current username, password and login config. * @throws Exception */ public void login() throws Exception { try { flushAuthCache("other"); } catch(Exception e) { // JBTEST-13, this should not fail this login attempt getLog().debug("Failed to flushAuthCache; "+e); } String username = getUsername(); String pass = getPassword(); String config = getLoginConfig(); char[] password = null; if (pass != null) password = pass.toCharArray(); AppCallbackHandler handler = new AppCallbackHandler(username, password); getLog().debug("Creating LoginContext(" + config + ")"); lc = new LoginContext(config, handler); lc.login(); getLog().debug("Created LoginContext, subject=" + lc.getSubject()); }
/** * 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()); }
/** * Gets the DeployerName attribute of the JBossTestCase object * * @return The DeployerName value * @exception MalformedObjectNameException Description of Exception */ protected ObjectName getDeployerName() throws MalformedObjectNameException { return delegate.getDeployerName(); }
/** * Gets the InitialContext attribute of the JBossTestCase object * * @return The InitialContext value * @throws Exception for any error */ protected InitialContext getInitialContext() throws Exception { return delegate.getInitialContext(); }
protected String getJndiInitFactory() { return delegate.getJndiInitFactory(); }
protected int getIterationCount() { return delegate.getIterationCount(); }