[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java
User: d_jencks Date: 02/01/29 14:00:04 Modified:src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java Log: simplified deployment calls Revision ChangesPath 1.10 +3 -3 jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java Index: ConnectionFactoryLoaderUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ConnectionFactoryLoaderUnitTestCase.java 2002/01/03 15:46:14 1.9 +++ ConnectionFactoryLoaderUnitTestCase.java 2002/01/29 22:00:04 1.10 @@ -33,7 +33,7 @@ /** * @see related * @authora href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ public class ConnectionFactoryLoaderUnitTestCase extends JBossTestCase @@ -119,7 +119,7 @@ assertTrue(State is not started, Started.equals(getServer().getAttribute(connectionFactoryLoaderName, StateString))); //deploy test session bean to look up datasource - deployJ2ee(jmxtest.jar); + deploy(jmxtest.jar); //see if the ConnectionFactory was loaded and works InitialContext ctx = getInitialContext(); @@ -128,7 +128,7 @@ tds.testDataSource(java:ConnectionFactoryLoaderTestDS); //undeploy the test ejb - undeployJ2ee(jmxtest.jar); + undeploy(jmxtest.jar); //undeploy test connection factory loader. invoke(serviceControllerName, 1.11 +52 -52 jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java Index: DeployServiceUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- DeployServiceUnitTestCase.java2002/01/03 04:01:01 1.10 +++ DeployServiceUnitTestCase.java2002/01/29 22:00:04 1.11 @@ -31,7 +31,7 @@ /** * @see related * @authora href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version $Revision: 1.10 $ + * @version $Revision: 1.11 $ */ public class DeployServiceUnitTestCase extends JBossTestCase @@ -103,20 +103,20 @@ assertTrue(test mbean already registered before deploy, !getServer().isRegistered(testObjectName)); //deploy the test xml doc. - deployService(testUrl); + deploy(testUrl); //check deployment registered expected mbeans assertTrue(test mbean not registered after deploy, getServer().isRegistered(testObjectName)); //deploy the test xml doc again, should undeploy and redeploy. - undeployService(testUrl); - deployService(testUrl); + undeploy(testUrl); + deploy(testUrl); //check deployment registered expected mbeans assertTrue(test mbean not registered after redeploy, getServer().isRegistered(testObjectName)); //undeploy test xml doc. - undeployService(testUrl); + undeploy(testUrl); //check they aren't there any more assertTrue(test mbean still registered after undeploy, !getServer().isRegistered(testObjectName)); @@ -146,7 +146,7 @@ assertTrue(test mbean already registered before deploy, !getServer().isRegistered(testObjectName)); //deploy the test xml doc. - deployService(testUrl); + deploy(testUrl); //check deployment registered expected mbeans assertTrue(test mbean not registered after deploy, getServer().isRegistered(testObjectName)); @@ -170,14 +170,14 @@ fail(could not remove mbean after class loaded in jsr + e); } //deploy the test xml doc again, should undeploy and redeploy. - undeployService(testUrl); - deployService(testUrl); + undeploy(testUrl); + deploy(testUrl); //check deployment registered expected mbeans assertTrue(test mbean not registered after redeploy, getServer().isRegistered(testObjectName)); //undeploy test xml doc. - undeployService(testUrl); + undeploy(testUrl); //check they aren't there any more assertTrue(test mbean still registered after undeploy, !getServer().isRegistered(testObjectName)); @@ -198,13 +198,13 @@ } //deploy the test xml doc a second time. - deployService(testUrl); + deploy(testUrl); //check deployment registered expected mbeans assertTrue(test mbean not
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java
User: user57 Date: 02/01/02 20:01:01 Modified:src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java Log: o migrated all components to a new JMX domain name model. jboss.system is now where to core/spine components live. moved all components that were in JBOSS-SYSTEM that did not move into a jboss.* domain into jboss (where the server is now registered). The point was to limit the members of jboss.system to core bits only. o Created org.jboss.system.Server, which does the work of initialization that org.jboss.Main used to do. Main now only parses the command line, sets up basic legecy properties and creates a Server instance. o Moved functionality of Shutdown (component not cl tool) into Server ( which is bound as jboss.system:service=Server) o Moved more Runtime access from Info into Server. Exposed memory info as attributes. o Logging a WARN everywhere that uses System.getProperty(jboss.system.home) as that should go away soon/eventually. o Initialized the invokerMap in the harmi impl to avoid NPE o Made getopt.jar a member of the lib/* dir instead of adding it to the run.jar and shutdown.jars each time. o Minor cosmetic changes along the way. Revision ChangesPath 1.8 +2 -2 jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java Index: ConnectionFactoryLoaderUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ConnectionFactoryLoaderUnitTestCase.java 2001/12/20 06:13:27 1.7 +++ ConnectionFactoryLoaderUnitTestCase.java 2002/01/03 04:01:01 1.8 @@ -33,7 +33,7 @@ /** * @see related * @authora href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ */ public class ConnectionFactoryLoaderUnitTestCase extends JBossTestCase @@ -105,7 +105,7 @@ //try to set the attributes on the bean assertTrue(setAttributes returned null, getServer().setAttributes(connectionFactoryLoaderName, al) != null); - ObjectName serviceControllerName = new ObjectName(JBOSS-SYSTEM:spine=ServiceController); + ObjectName serviceControllerName = new ObjectName(jboss.system:service=ServiceController); //invoke(connectionFactoryLoaderName, start, args, sig); invoke(serviceControllerName, create, 1.10 +5 -6 jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java Index: DeployServiceUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- DeployServiceUnitTestCase.java2001/12/20 06:13:27 1.9 +++ DeployServiceUnitTestCase.java2002/01/03 04:01:01 1.10 @@ -4,9 +4,8 @@ * Distributable under LGPL license. * See terms of license at gnu.org. */ -package org.jboss.test.jmx.test; - +package org.jboss.test.jmx.test; import java.io.File; import java.net.InetAddress; @@ -32,7 +31,7 @@ /** * @see related * @authora href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ public class DeployServiceUnitTestCase extends JBossTestCase @@ -61,7 +60,7 @@ super(name); try { - serviceControllerName = new ObjectName(JBOSS-SYSTEM:spine=ServiceController); + serviceControllerName = new ObjectName(jboss.system:service=ServiceController); } catch (Exception e) { @@ -142,7 +141,7 @@ ObjectName testObjectName2 = new ObjectName(test:name=TestDeployer2); ObjectName testObjectName3 = new ObjectName(test:name=TestDeployer3); //the classloader mbean - ObjectName classLoaderObjectName = new ObjectName(JBOSS-SYSTEM:spine=ServiceClassLoader); + ObjectName classLoaderObjectName = new ObjectName(jboss.system:service=ServiceClassLoader); //check they aren't there already assertTrue(test mbean already registered before deploy, !getServer().isRegistered(testObjectName)); @@ -235,7 +234,7 @@ ObjectName testObjectName2 = new ObjectName(test:name=TestDeployer2); ObjectName testObjectName3 = new ObjectName(test:name=TestDeployer3); //the classloader mbean - ObjectName classLoaderObjectName = new ObjectName(JBOSS-SYSTEM:spine=ServiceClassLoader); +
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java
User: d_jencks Date: 01/12/19 22:13:27 Modified:src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java Log: Fixed up dependency tests to work with depends elements Revision ChangesPath 1.7 +17 -5 jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java Index: ConnectionFactoryLoaderUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ConnectionFactoryLoaderUnitTestCase.java 2001/11/19 06:59:13 1.6 +++ ConnectionFactoryLoaderUnitTestCase.java 2001/12/20 06:13:27 1.7 @@ -33,7 +33,7 @@ /** * @see related * @authora href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ */ public class ConnectionFactoryLoaderUnitTestCase extends JBossTestCase @@ -108,9 +108,13 @@ ObjectName serviceControllerName = new ObjectName(JBOSS-SYSTEM:spine=ServiceController); //invoke(connectionFactoryLoaderName, start, args, sig); invoke(serviceControllerName, - registerAndStartService, - new Object[] {connectionFactoryLoaderName, null}, - new String[] {javax.management.ObjectName, java.lang.String}); + create, + new Object[] {connectionFactoryLoaderName}, + new String[] {javax.management.ObjectName}); + invoke(serviceControllerName, + start, + new Object[] {connectionFactoryLoaderName}, + new String[] {javax.management.ObjectName}); assertTrue(State is not started, Started.equals(getServer().getAttribute(connectionFactoryLoaderName, StateString))); @@ -127,8 +131,16 @@ undeployJ2ee(jmxtest.jar); //undeploy test connection factory loader. + invoke(serviceControllerName, + stop, + new Object[] {connectionFactoryLoaderName}, + new String[] {javax.management.ObjectName}); + invoke(serviceControllerName, + destroy, + new Object[] {connectionFactoryLoaderName}, + new String[] {javax.management.ObjectName}); invoke(serviceControllerName, - undeploy, + remove, new Object[] {connectionFactoryLoaderName}, new String[] {javax.management.ObjectName}); 1.9 +45 -239 jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java Index: DeployServiceUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- DeployServiceUnitTestCase.java2001/12/05 21:22:21 1.8 +++ DeployServiceUnitTestCase.java2001/12/20 06:13:27 1.9 @@ -32,13 +32,20 @@ /** * @see related * @authora href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ */ public class DeployServiceUnitTestCase extends JBossTestCase { // Constants - - + protected final static int INSTALLED = 0; + protected final static int CONFIGURED = 1; + protected final static int CREATED = 2; + protected final static int RUNNING = 3; + protected final static int FAILED = 4; + protected final static int STOPPED = 5; + protected final static int DESTROYED = 6; + protected final static int NOTYETINSTALLED = 7; // Attributes ObjectName serviceControllerName; @@ -211,7 +218,7 @@ * * @exception Exception Description of Exception */ - public void testDeploySARDependencies() throws Exception + public void testDependsElement() throws Exception { //C depends on A and B //Find the testdeploy[ABC].sar files in lib directory with other jars. @@ -252,10 +259,10 @@ //undeploy test xml doc. undeployService(testUrlA); - //check they aren't there any more + //check they aren't there any more or they have stopped. assertTrue(test mbean A still registered after undeploy of A, !getServer().isRegistered(testObjectNameA)); - assertTrue(test mbean C still registered after undeploy of A, !getServer().isRegistered(testObjectNameC)); - assertTrue(test mbean B unregistered after undeploy of A,
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java
User: d_jencks Date: 01/11/18 22:59:13 Modified:src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java Log: Fixed broken jmx deployment tests and added some new ones Revision ChangesPath 1.6 +16 -21 jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java Index: ConnectionFactoryLoaderUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ConnectionFactoryLoaderUnitTestCase.java 2001/10/13 18:54:51 1.5 +++ ConnectionFactoryLoaderUnitTestCase.java 2001/11/19 06:59:13 1.6 @@ -33,7 +33,7 @@ /** * @see related * @authora href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ */ public class ConnectionFactoryLoaderUnitTestCase extends JBossTestCase @@ -89,21 +89,15 @@ AttributeList al = new AttributeList(); al.add(new Attribute(JndiName, ConnectionFactoryLoaderTestDS)); - al.add(new Attribute(RARDeployerName, JCA:service=RARDeployer)); - al.add(new Attribute(ResourceAdapterName, Minerva JDBC LocalTransaction ResourceAdapter)); + al.add(new Attribute(ResourceAdapterName, new ObjectName(JCA:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter))); al.add(new Attribute(ManagedConnectionFactoryProperties, ConnectionURL=jdbc:hsqldb:hsql://localhost:1476\n + DriverClass=org.hsqldb.jdbcDriver)); - al.add(new Attribute(ConnectionManagerFactoryName, MinervaSharedLocalCMFactory)); + al.add(new Attribute(ConnectionManagerFactoryLoaderName, new ObjectName(JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory))); al.add(new Attribute(ConnectionManagerProperties, MinSize=0\n + MaxSize=10\n - + Blocking=true\n - + CleanupEnabled=false\n - + IdleTimeoutEnabled=false\n - + InvalidateOnError=false\n - + TrackLastUsed=false\n - + CleanupIntervalMillis=12\n - + GCMinIdleMillis=120\n - + IdleTimeoutMillis=180\n + + BlockingTimeoutMillis=5000\n + + CleanupIntervalMinutes=10\n + + IdleTimeoutMinutes=30\n + MaxIdleTimeoutPercent=1.0)); al.add(new Attribute(PrincipalMappingClass, org.jboss.resource.security.ManyToOnePrincipalMapping)); al.add(new Attribute(PrincipalMappingProperties, userName=sa\n @@ -111,12 +105,13 @@ //try to set the attributes on the bean assertTrue(setAttributes returned null, getServer().setAttributes(connectionFactoryLoaderName, al) != null); - Object[] args = {}; - String[] sig = {}; + ObjectName serviceControllerName = new ObjectName(JBOSS-SYSTEM:spine=ServiceController); + //invoke(connectionFactoryLoaderName, start, args, sig); + invoke(serviceControllerName, + registerAndStartService, + new Object[] {connectionFactoryLoaderName, null}, + new String[] {javax.management.ObjectName, java.lang.String}); - invoke(connectionFactoryLoaderName, init, args, sig); - invoke(connectionFactoryLoaderName, start, args, sig); - assertTrue(State is not started, Started.equals(getServer().getAttribute(connectionFactoryLoaderName, StateString))); //deploy test session bean to look up datasource @@ -132,10 +127,10 @@ undeployJ2ee(jmxtest.jar); //undeploy test connection factory loader. - invoke(connectionFactoryLoaderName, stop, args, sig); - invoke(connectionFactoryLoaderName, destroy, args, sig); - - getServer().unregisterMBean(connectionFactoryLoaderName); + invoke(serviceControllerName, + undeploy, + new Object[] {connectionFactoryLoaderName}, + new String[] {javax.management.ObjectName}); //check that the connection factory loader is no longer registered assertTrue(connection factory loader mbean still registered, !getServer().isRegistered(connectionFactoryLoaderName)); 1.6 +132 -30 jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java Index: DeployServiceUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- DeployServiceUnitTestCase.java
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java
User: d_jencks Date: 01/09/20 11:23:41 Modified:src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java Log: fixed my mailto address Revision ChangesPath 1.4 +2 -2 jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java Index: ConnectionFactoryLoaderUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ConnectionFactoryLoaderUnitTestCase.java 2001/09/18 22:00:44 1.3 +++ ConnectionFactoryLoaderUnitTestCase.java 2001/09/20 18:23:41 1.4 @@ -32,8 +32,8 @@ /** * @see related - * @authora href=[EMAIL PROTECTED]David Jencks/a - * @version $Revision: 1.3 $ + * @authora href=mailto:[EMAIL PROTECTED];David Jencks/a + * @version $Revision: 1.4 $ */ public class ConnectionFactoryLoaderUnitTestCase extends JBossTestCase 1.4 +2 -2 jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java Index: DeployServiceUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DeployServiceUnitTestCase.java2001/09/18 22:00:44 1.3 +++ DeployServiceUnitTestCase.java2001/09/20 18:23:41 1.4 @@ -28,8 +28,8 @@ /** * @see related - * @authora href=[EMAIL PROTECTED]David Jencks/a - * @version $Revision: 1.3 $ + * @authora href=mailto:[EMAIL PROTECTED];David Jencks/a + * @version $Revision: 1.4 $ */ public class DeployServiceUnitTestCase extends JBossTestCase ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java
User: d_jencks Date: 01/09/18 15:00:44 Modified:src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java Log: Changed tests to deploy/undeploy only once per testcase file. Moved clearAuthCache to JBossTestServices Revision ChangesPath 1.3 +1 -12 jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java Index: ConnectionFactoryLoaderUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ConnectionFactoryLoaderUnitTestCase.java 2001/09/12 19:57:32 1.2 +++ ConnectionFactoryLoaderUnitTestCase.java 2001/09/18 22:00:44 1.3 @@ -33,7 +33,7 @@ /** * @see related * @authora href=[EMAIL PROTECTED]David Jencks/a - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class ConnectionFactoryLoaderUnitTestCase extends JBossTestCase @@ -55,17 +55,6 @@ } // Public - /** -* Setup the test suite. -* -* @return The test suite -*/ - public static Test suite() - { - TestSuite suite = new TestSuite(ConnectionFactoryLoaderUnitTestCase.class); - - return suite; - } /** 1.3 +1 -13 jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java Index: DeployServiceUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DeployServiceUnitTestCase.java2001/09/12 19:57:32 1.2 +++ DeployServiceUnitTestCase.java2001/09/18 22:00:44 1.3 @@ -29,7 +29,7 @@ /** * @see related * @authora href=[EMAIL PROTECTED]David Jencks/a - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class DeployServiceUnitTestCase extends JBossTestCase @@ -52,18 +52,6 @@ } // Public - /** -* Setup the test suite. -* -* @return The test suite -*/ - public static Test suite() - { - TestSuite suite = new TestSuite(DeployServiceUnitTestCase.class); - - return suite; - } - /** * Test deployment and undeployment of *-service.xml files. Make sure mbeans ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java
User: d_jencks Date: 01/09/12 12:57:32 Modified:src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java Log: Added a JBossTestCase class with logging, access to mbean server, initial context, and deploy/undeploy methods for j2ee packages and service packages. Converted ConnectionFactoryLoaderUnitTestCase and DeployServiceUnitTestCase to descend from JBossTestCase. Fixed cfl test case to work again Revision ChangesPath 1.2 +64 -70 jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java Index: ConnectionFactoryLoaderUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ConnectionFactoryLoaderUnitTestCase.java 2001/09/12 04:55:39 1.1 +++ ConnectionFactoryLoaderUnitTestCase.java 2001/09/12 19:57:32 1.2 @@ -1,161 +1,155 @@ /* - * JBoss, the OpenSource EJB server + * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ - package org.jboss.test.jmx.test; import java.net.InetAddress; import java.util.ArrayList; import java.util.Iterator; import java.util.Set; + +//test bean +import javax.ejb.*; import javax.management.Attribute; import javax.management.AttributeList; import javax.management.MBeanRegistrationException; import javax.management.ObjectInstance; import javax.management.ObjectName; -import javax.management.RuntimeMBeanException; import javax.management.ReflectionException; +import javax.management.RuntimeMBeanException; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingEnumeration; import javax.naming.NamingException; -//import org.jboss.jmx.interfaces.JMXAdaptor; -import org.jboss.jmx.connector.rmi.RMIConnector; -// import org.jboss.jmx.connector.notification.RMINotificationSender; - -import org.jboss.test.util.Deploy; - import junit.framework.*; -//test bean -import javax.ejb.*; +import org.jboss.test.JBossTestCase; import org.jboss.test.jmx.interfaces.*; /** - * - * @see related - * @author david jencks [EMAIL PROTECTED] - * @version $Revision: 1.1 $ + * @see related + * @authora href=[EMAIL PROTECTED]David Jencks/a + * @version $Revision: 1.2 $ */ public class ConnectionFactoryLoaderUnitTestCase - extends TestCase + extends JBossTestCase { // Constants - - + // Attributes - protected RMIConnector server; - + // Static // Constructors -- + /** +* Constructor for the ConnectionFactoryLoaderUnitTestCase object +* +* @param name Testcase name +*/ public ConnectionFactoryLoaderUnitTestCase(String name) { super(name); } - + // Public /** * Setup the test suite. +* +* @return The test suite */ - public static Test suite() { + public static Test suite() + { TestSuite suite = new TestSuite(ConnectionFactoryLoaderUnitTestCase.class); - - - return suite; - } - - - public void setUp() throws Exception { - String serverName = InetAddress.getLocalHost().getHostName(); - server = (RMIConnector) new InitialContext().lookup(jmx: + serverName + :rmi); - } - public void tearDown() throws Exception { - server = null; + return suite; } - public void testServerFound() throws Exception { - assertTrue(Server was not found, server != null); - } - public void xtestAddRemoveConnectionFactory() throws Exception { - + /** +* Test that a connection factory can be deployed after the rar it depends on +* is deployed. Use an ejb to make sure that the DataSource defined is +* actually bound in jndi. Undeploy and make sure the mbean is no longer +* registered. +* +* @exception Exception Description of Exception +*/ + public void testAddRemoveConnectionFactory() throws Exception + { //the mbean we are trying to deploy/undeploy ObjectName connectionFactoryLoaderName = new ObjectName(Test:service=ConnectionFactoryLoader,name=TestDS); //try to remove mbean if leftover... - if
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java TestConnectionFactoryLoader.java TestDeployService.java
User: d_jencks Date: 01/09/11 21:55:39 Added: src/main/org/jboss/test/jmx/test ConnectionFactoryLoaderUnitTestCase.java DeployServiceUnitTestCase.java Removed: src/main/org/jboss/test/jmx/test TestConnectionFactoryLoader.java TestDeployService.java Log: Changed naming scheme of tests to *UnitTestCase.java for short running tests and *StressTestCase.java for lengthy tests. Made tests-unit and tests-stress targets in build.xml Revision ChangesPath 1.1 jbosstest/src/main/org/jboss/test/jmx/test/ConnectionFactoryLoaderUnitTestCase.java Index: ConnectionFactoryLoaderUnitTestCase.java === /* * JBoss, the OpenSource EJB server * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.test.jmx.test; import java.net.InetAddress; import java.util.ArrayList; import java.util.Iterator; import java.util.Set; import javax.management.Attribute; import javax.management.AttributeList; import javax.management.MBeanRegistrationException; import javax.management.ObjectInstance; import javax.management.ObjectName; import javax.management.RuntimeMBeanException; import javax.management.ReflectionException; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingEnumeration; import javax.naming.NamingException; //import org.jboss.jmx.interfaces.JMXAdaptor; import org.jboss.jmx.connector.rmi.RMIConnector; // import org.jboss.jmx.connector.notification.RMINotificationSender; import org.jboss.test.util.Deploy; import junit.framework.*; //test bean import javax.ejb.*; import org.jboss.test.jmx.interfaces.*; /** * * @see related * @author david jencks [EMAIL PROTECTED] * @version $Revision: 1.1 $ */ public class ConnectionFactoryLoaderUnitTestCase extends TestCase { // Constants - // Attributes protected RMIConnector server; // Static // Constructors -- public ConnectionFactoryLoaderUnitTestCase(String name) { super(name); } // Public /** * Setup the test suite. */ public static Test suite() { TestSuite suite = new TestSuite(ConnectionFactoryLoaderUnitTestCase.class); return suite; } public void setUp() throws Exception { String serverName = InetAddress.getLocalHost().getHostName(); server = (RMIConnector) new InitialContext().lookup(jmx: + serverName + :rmi); } public void tearDown() throws Exception { server = null; } public void testServerFound() throws Exception { assertTrue(Server was not found, server != null); } public void xtestAddRemoveConnectionFactory() throws Exception { //the mbean we are trying to deploy/undeploy ObjectName connectionFactoryLoaderName = new ObjectName(Test:service=ConnectionFactoryLoader,name=TestDS); //try to remove mbean if leftover... if (server.isRegistered(connectionFactoryLoaderName)) { server.unregisterMBean(connectionFactoryLoaderName); } //check it isn't there already assertTrue(test mbean already registered, !server.isRegistered(connectionFactoryLoaderName)); //try to create the connection factory loader. assertTrue(server did not return an objectInstance, server.createMBean(org.jboss.resource.ConnectionFactoryLoader, connectionFactoryLoaderName) != null); //check deployment registered connection factory loader assertTrue(test mbean not registered, server.isRegistered(connectionFactoryLoaderName)); AttributeList al = new AttributeList(); al.add(new Attribute(JndiName, ConnectionFactoryLoaderTestDS)); al.add(new Attribute(RARDeployerName, JCA:service=RARDeployer)); al.add(new Attribute(ResourceAdapterName, Minerva JDBC LocalTransaction ResourceAdapter)); al.add(new Attribute(ManagedConnectionFactoryProperties, ConnectionURL=jdbc:HypersonicSQL:hsql://localhost:1476\n + DriverClass=org.hsql.jdbcDriver)); al.add(new Attribute(ConnectionManagerFactoryName, MinervaSharedLocalCMFactory)); al.add(new Attribute(ConnectionManagerProperties, MinSize=0\n + MaxSize=10\n + Blocking=true\n + CleanupEnabled=false\n +