[jboss-cvs] JBossAS SVN: r61853 - in trunk/system-jmx/src: tests/org/jboss/test/system/controller/integration/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 29 11:28:54 EDT 2007


Author: adrian at jboss.org
Date: 2007-03-29 11:28:54 -0400 (Thu, 29 Mar 2007)
New Revision: 61853

Added:
   trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase-mc.xml
   trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase.xml
   trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase.java
   trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCBadObjectNameTest.java
Modified:
   trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCTest.java
   trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/IntegrationTestSuite.java
Log:
[JBMICROCONT-166] - Add a test for a "bad ObjectName", i.e. non canonical name
being used by a POJO and then injected into JMX.
This test currently fails.

Added: trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase-mc.xml
===================================================================
--- trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase-mc.xml	                        (rev 0)
+++ trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase-mc.xml	2007-03-29 15:28:54 UTC (rev 61853)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="test:b=2,a=1" class="org.jboss.test.system.controller.integration.support.SimpleBean"/>
+</deployment>

Added: trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase.xml
===================================================================
--- trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase.xml	                        (rev 0)
+++ trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase.xml	2007-03-29 15:28:54 UTC (rev 61853)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="SimpleBean"><inject bean="test:b=2,a=1"/></attribute>
+   </mbean>
+</server>
\ No newline at end of file

Added: trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase.java	                        (rev 0)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCBadObjectNameUnitTestCase.java	2007-03-29 15:28:54 UTC (rev 61853)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.system.controller.integration.test;
+
+import junit.framework.Test;
+
+/**
+ * ConfigureJMXFromMCBadObjectNameUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConfigureJMXFromMCBadObjectNameUnitTestCase extends InjectJMXFromMCBadObjectNameTest
+{
+   public static Test suite()
+   {
+      return suite(ConfigureJMXFromMCBadObjectNameUnitTestCase.class);
+   }
+
+   public ConfigureJMXFromMCBadObjectNameUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testConfigureJMXFromMC() throws Throwable
+   {
+      checkInject();
+   }
+}

Added: trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCBadObjectNameTest.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCBadObjectNameTest.java	                        (rev 0)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCBadObjectNameTest.java	2007-03-29 15:28:54 UTC (rev 61853)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.system.controller.integration.test;
+
+import org.jboss.mx.util.ObjectNameFactory;
+
+/**
+ * InjectJMXFromMCTestBadObjectName.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class InjectJMXFromMCBadObjectNameTest extends InjectJMXFromMCTest
+{
+   private static final String NON_CANONICAL_OBJECT_NAME = ObjectNameFactory.create("test:b=2,a=1").getCanonicalName();
+   
+   public InjectJMXFromMCBadObjectNameTest(String name)
+   {
+      super(name);
+   }
+   
+   protected String getContextName()
+   {
+      return NON_CANONICAL_OBJECT_NAME;
+   }
+}

Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCTest.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCTest.java	2007-03-29 15:25:07 UTC (rev 61852)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCTest.java	2007-03-29 15:28:54 UTC (rev 61853)
@@ -33,16 +33,23 @@
  */
 public abstract class InjectJMXFromMCTest extends AbstractIntegrationTest
 {
+   private static final String TEST = "Test";
+   
    public InjectJMXFromMCTest(String name)
    {
       super(name);
    }
    
+   protected String getContextName()
+   {
+      return TEST;
+   }
+   
    public void checkInject() throws Throwable
    {
       Simple simple = getSimple();
 
-      ControllerContext beanContext = getControllerContext("Test");
+      ControllerContext beanContext = getControllerContext(getContextName());
       assertNotNull(beanContext);
       Object bean = beanContext.getTarget();
       assertNotNull(bean);

Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/IntegrationTestSuite.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/IntegrationTestSuite.java	2007-03-29 15:25:07 UTC (rev 61852)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/IntegrationTestSuite.java	2007-03-29 15:28:54 UTC (rev 61853)
@@ -48,6 +48,7 @@
       suite.addTest(StartMCFromJMXUnitTestCase.suite());
       suite.addTest(InstallMCFromJMXUnitTestCase.suite());
       suite.addTest(ConfigureJMXFromMCUnitTestCase.suite());
+      suite.addTest(ConfigureJMXFromMCBadObjectNameUnitTestCase.suite());
       suite.addTest(MCDependsJMXUnitTestCase.suite());
       suite.addTest(JMXDependsMCUnitTestCase.suite());
       




More information about the jboss-cvs-commits mailing list