[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java
User: schaefera Date: 01/12/08 21:01:44 Added: src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java Log: Added Notification Transport to JSR-77 which works similar to EJB-Connector but with the tweak of JSR-77 interface. Added the adjusted JDBC JSR-77 shadow objects. Added JSR-77 to the Connector Factory enabling JSR-77 to start and stop Datasources. Added a testsuite for JSR-77 which tests the basic stuff inclusive the notification delivery. Revision ChangesPath 1.1 jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java Index: JSR77SpecUnitTestCase.java === /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.test.management.test; import java.io.IOException; import java.net.InetAddress; import java.rmi.RemoteException; import java.util.Set; import javax.ejb.CreateException; import javax.ejb.Handle; import javax.management.Notification; import javax.management.NotificationListener; import javax.management.ObjectName; import javax.management.j2ee.ListenerRegistration; import javax.management.j2ee.Management; import javax.management.j2ee.ManagementHome; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.rmi.PortableRemoteObject; import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.jboss.test.JBossTestCase; import org.jboss.test.JBossTestSetup; /** * Test of JSR-77 specification conformance using the ??ToDo * These test the basic JSR-77 handling and access. * * @author mailto:[EMAIL PROTECTED]";>Andreas Schaefer. * @version $Revision: 1.1 $ * * Revisions: * * 20011206 Andreas Schaefer: * * Creation * **/ public class JSR77SpecUnitTestCase extends JBossTestCase { // Constants - // Attributes // Static /** * Setup the test suite. */ public static Test suite() { TestSuite lSuite = new TestSuite(); lSuite.addTest( new TestSuite( JSR77SpecUnitTestCase.class ) ); // Create an initializer for the test suite TestSetup lWrapper = new JBossTestSetup( lSuite ) { protected void setUp() throws Exception { super.setUp(); //deployJ2ee( "jsr77-spec.jar" ); //flushAuthCache(); } protected void tearDown() throws Exception { //undeployJ2ee( "jsr77-spec.jar" ); //super.tearDown(); } }; return lWrapper; } // Constructors -- public JSR77SpecUnitTestCase( String pName ) { super( pName ); } // Public /** * Test if a connection could be made to the Management MBean **/ public void testConnect() throws Exception { getLog().debug("+++ testConnect"); Management lManagement = getManagementEJB(); String lDomain = lManagement.getDefaultDomain(); getLog().debug( "+++ testConnect, domain: " + lDomain ); lManagement.remove(); } /** * Test if the management domain could be retrieved **/ public void testGetManagementDomain() throws Exception { getLog().debug("+++ testGetManagementDomain"); Management lManagement = getManagementEJB(); Set lNames = lManagement.queryNames( new ObjectName( lManagement.getDefaultDomain() + ":type=J2EEManagement,*" ) ); if( lNames.isEmpty() ) { fail( "Could not found JSR-77 root object of type 'J2EEManagement'" ); } if( lNames.size() > 1 ) { fail( "Found more than one JSR-77 root objects of type 'J2EEManagement'" ); } ObjectName lManagementDomain = (ObjectName) lNames.iterator().next(); getLog().debug( "+++ testGetManagementDomain, root: " + lManagementDomain ); lManagement.remove(); } /** * Test if the deployed EJB could be found directly * and through navigation **/ public void testGetDataSource() throws Exception { getLog().debug("+++ testGetDataSource"); Management lManagement = getManagementEJB(); Set lNames = lManagement.queryNames(
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java
User: schaefera Date: 01/12/09 22:27:49 Modified:src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java Log: Adjusted the jsr77.jar to the newest release of the JSR-77 spec. (2001/12/06) and also made the necessary changes to our implementation. All necessary add ons are in but not all unnecessary methods are out. Therefore is also a problem with method conflicts from JSR-77 and ServiceMBeanSupport which must be fixed later (by converting to DynamicMBeans). Revision ChangesPath 1.2 +5 -5 jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java Index: JSR77SpecUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JSR77SpecUnitTestCase.java2001/12/09 05:01:43 1.1 +++ JSR77SpecUnitTestCase.java2001/12/10 06:27:49 1.2 @@ -35,7 +35,7 @@ * These test the basic JSR-77 handling and access. * * @author mailto:[EMAIL PROTECTED]";>Andreas Schaefer. - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * * Revisions: * @@ -114,14 +114,14 @@ Management lManagement = getManagementEJB(); Set lNames = lManagement.queryNames( new ObjectName( -lManagement.getDefaultDomain() + ":type=J2EEManagement,*" +lManagement.getDefaultDomain() + ":type=J2EEDomain,*" ) ); if( lNames.isEmpty() ) { - fail( "Could not found JSR-77 root object of type 'J2EEManagement'" ); + fail( "Could not found JSR-77 root object of type 'J2EEDomain'" ); } if( lNames.size() > 1 ) { - fail( "Found more than one JSR-77 root objects of type 'J2EEManagement'" ); + fail( "Found more than one JSR-77 root objects of type 'J2EEDomain'" ); } ObjectName lManagementDomain = (ObjectName) lNames.iterator().next(); getLog().debug( "+++ testGetManagementDomain, root: " + lManagementDomain ); @@ -255,7 +255,7 @@ Exception { getLog().debug("+++ getManagementEJB()"); - Object lObject = getInitialContext().lookup( "ejb/mgmt/J2EEManagement" ); + Object lObject = getInitialContext().lookup( "ejb/mgmt/J2EEDomain" ); ManagementHome lHome = (ManagementHome) PortableRemoteObject.narrow( lObject, ManagementHome.class ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java
User: schaefera Date: 02/03/07 21:30:48 Modified:src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java Log: Adjusted the JSR-77 implementation to the current specification. Also the StateManageable methods are renamed to avoid conflicts with the JBoss MBean lifecycle. Also XDoclet is used to generated the StandardMBean interfaces. Revision ChangesPath 1.4 +7 -7 jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java Index: JSR77SpecUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JSR77SpecUnitTestCase.java16 Feb 2002 11:27:02 - 1.3 +++ JSR77SpecUnitTestCase.java8 Mar 2002 05:30:48 - 1.4 @@ -35,7 +35,7 @@ * These test the basic JSR-77 handling and access. * * @author mailto:[EMAIL PROTECTED]";>Andreas Schaefer. - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * * Revisions: * @@ -114,14 +114,14 @@ Management lManagement = getManagementEJB(); Set lNames = lManagement.queryNames( new ObjectName( -lManagement.getDefaultDomain() + ":type=J2EEDomain,*" +lManagement.getDefaultDomain() + ":j2eeType=J2EEDomain,*" ) ); if( lNames.isEmpty() ) { - fail( "Could not found JSR-77 root object of type 'J2EEDomain'" ); + fail( "Could not found JSR-77 root object of j2eeType 'J2EEDomain'" ); } if( lNames.size() > 1 ) { - fail( "Found more than one JSR-77 root objects of type 'J2EEDomain'" ); + fail( "Found more than one JSR-77 root objects of j2eeType 'J2EEDomain'" ); } ObjectName lManagementDomain = (ObjectName) lNames.iterator().next(); getLog().debug( "+++ testGetManagementDomain, root: " + lManagementDomain ); @@ -140,7 +140,7 @@ Management lManagement = getManagementEJB(); Set lNames = lManagement.queryNames( new ObjectName( -lManagement.getDefaultDomain() + ":type=JDBCDataSource,name=DefaultDS,*" +lManagement.getDefaultDomain() + ":j2eeType=JDBCDataSource,name=DefaultDS,*" ) ); if( lNames.isEmpty() ) { @@ -169,7 +169,7 @@ Management lManagement = getManagementEJB(); Set lNames = lManagement.queryNames( new ObjectName( -lManagement.getDefaultDomain() + ":type=JDBCDataSource,name=DefaultDS,*" +lManagement.getDefaultDomain() + ":j2eeType=JDBCDataSource,name=DefaultDS,*" ) ); if( lNames.isEmpty() ) { @@ -199,7 +199,7 @@ Management lManagement = getManagementEJB(); Set lNames = lManagement.queryNames( new ObjectName( -lManagement.getDefaultDomain() + ":type=JDBCDataSource,name=DefaultDS,*" +lManagement.getDefaultDomain() + ":j2eeType=JDBCDataSource,name=DefaultDS,*" ) ); if( lNames.isEmpty() ) { ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java
User: schaefera Date: 02/03/10 20:31:35 Modified:src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java Log: Moved the JSR-77 code to the new "management" module. It contains the specification implementation for MEJB and the JBoss implementation. It does not contain references to JBoss server. The only workaround there is that MEJB needs to use the JMX RemoteMBean- Server which is not available in JBossMX right now. Therefore I added this to a JAR achive under tools/lib. Revision ChangesPath 1.5 +5 -2 jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java Index: JSR77SpecUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- JSR77SpecUnitTestCase.java8 Mar 2002 05:30:48 - 1.4 +++ JSR77SpecUnitTestCase.java11 Mar 2002 04:31:35 - 1.5 @@ -35,7 +35,7 @@ * These test the basic JSR-77 handling and access. * * @author mailto:[EMAIL PROTECTED]";>Andreas Schaefer. - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * * Revisions: * @@ -190,7 +190,9 @@ /** * Test the notification delivery by restarting Default DataSource **/ - public void testNotificationDeliver() +/* AS: Take this test out because it causes and endless loop and I want to + commit the changes. Will bring it back in soon. +public void testNotificationDeliver() throws Exception { @@ -239,6 +241,7 @@ throw e; } } +*/ // Z implementation -- ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java
User: schaefera Date: 02/03/14 23:04:41 Modified:src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java Log: Adjusted the JBoss Management Testsuite to the MEJB Session Bean JNDI name change. Revision ChangesPath 1.6 +2 -2 jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java Index: JSR77SpecUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- JSR77SpecUnitTestCase.java11 Mar 2002 04:31:35 - 1.5 +++ JSR77SpecUnitTestCase.java15 Mar 2002 07:04:41 - 1.6 @@ -35,7 +35,7 @@ * These test the basic JSR-77 handling and access. * * @author mailto:[EMAIL PROTECTED]";>Andreas Schaefer. - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * * Revisions: * @@ -258,7 +258,7 @@ Exception { getLog().debug("+++ getManagementEJB()"); - Object lObject = getInitialContext().lookup( "ejb/mgmt/J2EEDomain" ); + Object lObject = getInitialContext().lookup( "ejb/mgmt/MEJB" ); ManagementHome lHome = (ManagementHome) PortableRemoteObject.narrow( lObject, ManagementHome.class ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java
User: schaefera Date: 02/03/23 18:27:49 Modified:src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java Log: getLog() in inner class listener fails at runtime therefore removed but brought the Notification Listener test back in after the fixes. Revision ChangesPath 1.7 +49 -30 jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java Index: JSR77SpecUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- JSR77SpecUnitTestCase.java15 Mar 2002 07:04:41 - 1.6 +++ JSR77SpecUnitTestCase.java24 Mar 2002 02:27:49 - 1.7 @@ -30,12 +30,17 @@ import org.jboss.test.JBossTestCase; import org.jboss.test.JBossTestSetup; +import org.jboss.management.j2ee.J2EEDomain; +import org.jboss.management.j2ee.J2EEManagedObject; +import org.jboss.management.j2ee.J2EEServer; +import org.jboss.management.j2ee.JDBCDataSource; + /** * Test of JSR-77 specification conformance using the ??ToDo * These test the basic JSR-77 handling and access. * * @author mailto:[EMAIL PROTECTED]";>Andreas Schaefer. - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ * * Revisions: * @@ -49,6 +54,8 @@ { // Constants - + public static final String TEST_DATASOURCE = "DefaultDS"; + // Attributes // Static @@ -114,14 +121,17 @@ Management lManagement = getManagementEJB(); Set lNames = lManagement.queryNames( new ObjectName( -lManagement.getDefaultDomain() + ":j2eeType=J2EEDomain,*" - ) +lManagement.getDefaultDomain() + ":" + +J2EEManagedObject.TYPE + "=" + J2EEDomain.J2EE_TYPE + "," + +"*" + ), + null ); if( lNames.isEmpty() ) { - fail( "Could not found JSR-77 root object of j2eeType 'J2EEDomain'" ); + fail( "Could not found JSR-77 root object of type '" + J2EEDomain.J2EE_TYPE + "'" ); } if( lNames.size() > 1 ) { - fail( "Found more than one JSR-77 root objects of j2eeType 'J2EEDomain'" ); + fail( "Found more than one JSR-77 root objects of type '" + J2EEDomain.J2EE_TYPE + "'" ); } ObjectName lManagementDomain = (ObjectName) lNames.iterator().next(); getLog().debug( "+++ testGetManagementDomain, root: " + lManagementDomain ); @@ -140,19 +150,23 @@ Management lManagement = getManagementEJB(); Set lNames = lManagement.queryNames( new ObjectName( -lManagement.getDefaultDomain() + ":j2eeType=JDBCDataSource,name=DefaultDS,*" - ) +lManagement.getDefaultDomain() + ":" + +J2EEManagedObject.TYPE + "=" + JDBCDataSource.J2EE_TYPE + "," + +"name=" + TEST_DATASOURCE + "," + +"*" + ), + null ); if( lNames.isEmpty() ) { - fail( "Could not found JSR-77 JDBC DataSource named 'DefaultDS'" ); + fail( "Could not found JSR-77 JDBC DataSource named '" + TEST_DATASOURCE + "'" ); } if( lNames.size() > 1 ) { - fail( "Found more than one JSR-77 JDBC DataSource named 'DefaultDS'" ); + fail( "Found more than one JSR-77 JDBC DataSource named '" + TEST_DATASOURCE + "'" ); } ObjectName lDataSource = (ObjectName) lNames.iterator().next(); - getLog().debug( "+++ testGetDataSource, DefaultDS: " + lDataSource ); + getLog().debug( "+++ testGetDataSource, " + TEST_DATASOURCE + ": " + lDataSource ); getLog().debug( - "+++ testGetDataSource, DefaultDS status: " + + "+++ testGetDataSource, " + TEST_DATASOURCE + " status: " + lManagement.getAttribute( lDataSource, "State" ) ); lManagement.remove(); @@ -169,20 +183,24 @@ Management lManagement = getManagementEJB(); Set lNames = lManagement.queryNames( new ObjectName( -lManagement.getDefaultDomain() + ":j2eeType=JDBCDataSource,name=DefaultDS,*" - ) +lManagement.getDefaultDomain() + ":" + +J2EEManagedObject.TYPE + "=" + JDBCDataSource.J2EE_TYPE + "," + +"name=" + TEST_DATASOURCE + "," + +"*" + ), + null ); if( lNames.isEmpty() ) { - fail( "Could not found JSR-77 JDBC DataSource named 'DefaultDS'" ); + fail( "Could not found JSR-77 JDBC DataSource na
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java
User: user57 Date: 02/02/16 03:27:02 Modified:src/main/org/jboss/test/management/test JSR77SpecUnitTestCase.java Log: o System.err, System.out & printStackTrace() 99.9% gone. Revision ChangesPath 1.3 +2 -2 jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java Index: JSR77SpecUnitTestCase.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/management/test/JSR77SpecUnitTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JSR77SpecUnitTestCase.java10 Dec 2001 06:27:49 - 1.2 +++ JSR77SpecUnitTestCase.java16 Feb 2002 11:27:02 - 1.3 @@ -35,7 +35,7 @@ * These test the basic JSR-77 handling and access. * * @author mailto:[EMAIL PROTECTED]";>Andreas Schaefer. - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * * Revisions: * @@ -235,7 +235,7 @@ lManagement.remove(); } catch( Exception e ) { - e.printStackTrace(); + log.debug("failed", e); throw e; } } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development