[jboss-cvs] JBossAS SVN: r68003 - in trunk/system-jmx/src: tests/org/jboss/test/system/controller/integration/support and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Dec 6 16:50:56 EST 2007
Author: alesj
Date: 2007-12-06 16:50:56 -0500 (Thu, 06 Dec 2007)
New Revision: 68003
Added:
trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase-mc.xml
trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase.xml
trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/support/SimpleStringBean.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase.java
Log:
JBAS-4009.
Added: trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase-mc.xml
===================================================================
--- trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase-mc.xml (rev 0)
+++ trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase-mc.xml 2007-12-06 21:50:56 UTC (rev 68003)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="Test" class="org.jboss.test.system.controller.integration.support.SimpleStringBean">
+ <property name="string1"><inject bean="jboss.test:type=test" property="Attribute1"/></property>
+ <property name="string2"><inject bean="jboss.test:type=test" property="attribute1"/></property>
+ </bean>
+</deployment>
Added: trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase.xml
===================================================================
--- trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase.xml (rev 0)
+++ trunk/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase.xml 2007-12-06 21:50:56 UTC (rev 68003)
@@ -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="Attribute1">someattrib</attribute>
+ </mbean>
+</server>
\ No newline at end of file
Added: trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/support/SimpleStringBean.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/support/SimpleStringBean.java (rev 0)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/support/SimpleStringBean.java 2007-12-06 21:50:56 UTC (rev 68003)
@@ -0,0 +1,53 @@
+/*
+* 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.support;
+
+/**
+ * SimpleStringBean.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SimpleStringBean
+{
+ private String string1;
+ private String string2;
+
+ public String getString1()
+ {
+ return string1;
+ }
+
+ public void setString1(String string1)
+ {
+ this.string1 = string1;
+ }
+
+ public String getString2()
+ {
+ return string2;
+ }
+
+ public void setString2(String string2)
+ {
+ this.string2 = string2;
+ }
+}
Added: trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase.java (rev 0)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureMCFromJMXWithPropertyUnitTestCase.java 2007-12-06 21:50:56 UTC (rev 68003)
@@ -0,0 +1,67 @@
+/*
+* 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;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.test.system.controller.integration.support.SimpleStringBean;
+import org.jboss.test.system.controller.support.Simple;
+
+/**
+ * ConfigureMCFromJMXUWithPropertynitTestCase.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ConfigureMCFromJMXWithPropertyUnitTestCase extends AbstractIntegrationTest
+{
+ public static Test suite()
+ {
+ return suite(ConfigureMCFromJMXWithPropertyUnitTestCase.class);
+ }
+
+ public ConfigureMCFromJMXWithPropertyUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testConfigureMCFromJMX() throws Throwable
+ {
+ ControllerContext mbeanContext = getControllerContext("jboss.test:type=test");
+ assertNotNull(mbeanContext);
+ Object mbean = mbeanContext.getTarget();
+ assertNotNull(mbean);
+ assertInstanceOf(Simple.class, mbean);
+ Simple simple = (Simple)mbean;
+ String string = simple.getAttribute1();
+ assertEquals("someattrib", string);
+
+ ControllerContext beanContext = getControllerContext("Test");
+ assertNotNull(beanContext);
+ Object bean = beanContext.getTarget();
+ assertNotNull(bean);
+ assertInstanceOf(SimpleStringBean.class, bean);
+
+ SimpleStringBean simpleBean = (SimpleStringBean) bean;
+ assertEquals(string, simpleBean.getString1());
+ assertEquals(string, simpleBean.getString2());
+ }
+}
More information about the jboss-cvs-commits
mailing list