User: ejort
Date: 02/03/29 04:14:35
Modified: src/main/test/compliance/notcompliant NCMBeanTEST.java
Log:
Merge differences between RelMX_1_0_0_13 and RelMX_1_0_0_14 to head
Revision Changes Path
1.2 +66 -23 jmx/src/main/test/compliance/notcompliant/NCMBeanTEST.java
Index: NCMBeanTEST.java
===================================================================
RCS file: /cvsroot/jboss/jmx/src/main/test/compliance/notcompliant/NCMBeanTEST.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NCMBeanTEST.java 18 Jan 2002 17:28:41 -0000 1.1
+++ NCMBeanTEST.java 29 Mar 2002 12:14:35 -0000 1.2
@@ -1,14 +1,14 @@
-/*
- * JBoss, the OpenSource J2EE webOS
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package test.compliance.notcompliant;
-
-import junit.framework.TestCase;
-
-import javax.management.MalformedObjectNameException;
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package test.compliance.notcompliant;
+
+import junit.framework.TestCase;
+
+import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.MBeanServerFactory;
import javax.management.MBeanServer;
@@ -17,16 +17,19 @@
import java.util.Hashtable;
import test.compliance.notcompliant.support.OverloadedAttribute1;
-import test.compliance.notcompliant.support.OverloadedAttribute3;
import test.compliance.notcompliant.support.OverloadedAttribute2;
-import test.compliance.notcompliant.support.DynamicAndStandard;
-
-public class NCMBeanTEST extends TestCase
-{
- public NCMBeanTEST(String s)
- {
- super(s);
- }
+import test.compliance.notcompliant.support.OverloadedAttribute3;
+import test.compliance.notcompliant.support.OverloadedAttribute4;
+import test.compliance.notcompliant.support.OverloadedAttribute5;
+import test.compliance.notcompliant.support.InterfaceProblems;
+import test.compliance.notcompliant.support.DynamicAndStandard;
+
+public class NCMBeanTEST extends TestCase
+{
+ public NCMBeanTEST(String s)
+ {
+ super(s);
+ }
public void testOverloadedAttribute1()
{
@@ -43,6 +46,16 @@
registerAndTest(new OverloadedAttribute3());
}
+ public void testOverloadedAttribute4()
+ {
+ registerAndTest(new OverloadedAttribute4());
+ }
+
+ public void testOverloadedAttribute5()
+ {
+ registerAndTest(new OverloadedAttribute5());
+ }
+
public void testMixedDynamicStandard()
{
registerAndTest(new DynamicAndStandard());
@@ -52,12 +65,17 @@
{
registerAndTest(new NoConstructor());
}
-
+
+ public void testInterfaceProblems()
+ {
+ registerAndDontTest(new InterfaceProblems());
+ }
+
private void registerAndTest(Object mbean)
{
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
try
{
- MBeanServer server = MBeanServerFactory.newMBeanServer();
server.registerMBean(mbean, new ObjectName("test:foo=bar"));
fail("expected a NotCompliantMBeanException for " +
mbean.getClass().getName());
}
@@ -69,5 +87,30 @@
{
fail("unexpected exception when registering " + mbean.getClass().getName()
+ ": " + e.getMessage());
}
+ finally
+ {
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+ }
+
+ private void registerAndDontTest(Object mbean)
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ try
+ {
+ server.registerMBean(mbean, new ObjectName("test:foo=bar"));
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ fail("FAILS IN RI: Cannot cope with overriden get/is in interfaces");
+ }
+ catch (Exception e)
+ {
+ fail("unexpected exception when registering " + mbean.getClass().getName()
+ ": " + e.getMessage());
+ }
+ finally
+ {
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
}
-}
+}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development