geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r385094 - in /geronimo/xbean/trunk/xbean-jmx: pom.xml src/test/java/org/apache/xbean/jmx/JMXService.java src/test/java/org/apache/xbean/jmx/JMXTest.java src/test/resources/org/apache/xbean/jmx/jmx-simple.xml
Date Sat, 11 Mar 2006 15:36:14 GMT
Author: adc
Date: Sat Mar 11 07:36:14 2006
New Revision: 385094

URL: http://svn.apache.org/viewcvs?rev=385094&view=rev
Log:
Cleaned up test with better attribute names.  Updated parent POM version.

Modified:
    geronimo/xbean/trunk/xbean-jmx/pom.xml
    geronimo/xbean/trunk/xbean-jmx/src/test/java/org/apache/xbean/jmx/JMXService.java
    geronimo/xbean/trunk/xbean-jmx/src/test/java/org/apache/xbean/jmx/JMXTest.java
    geronimo/xbean/trunk/xbean-jmx/src/test/resources/org/apache/xbean/jmx/jmx-simple.xml

Modified: geronimo/xbean/trunk/xbean-jmx/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/xbean/trunk/xbean-jmx/pom.xml?rev=385094&r1=385093&r2=385094&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-jmx/pom.xml (original)
+++ geronimo/xbean/trunk/xbean-jmx/pom.xml Sat Mar 11 07:36:14 2006
@@ -2,13 +2,13 @@
     <parent>
         <artifactId>xbean</artifactId>
         <groupId>org.apache.xbean</groupId>
-        <version>2.2-SNAPSHOT</version>
+        <version>2.3-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>xbean-jmx</artifactId>
     <name>XBean :: JMX</name>
-    <version>2.2-SNAPSHOT</version>
+    <version>2.3-SNAPSHOT</version>
 
     <build>
         <resources>

Modified: geronimo/xbean/trunk/xbean-jmx/src/test/java/org/apache/xbean/jmx/JMXService.java
URL: http://svn.apache.org/viewcvs/geronimo/xbean/trunk/xbean-jmx/src/test/java/org/apache/xbean/jmx/JMXService.java?rev=385094&r1=385093&r2=385094&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-jmx/src/test/java/org/apache/xbean/jmx/JMXService.java (original)
+++ geronimo/xbean/trunk/xbean-jmx/src/test/java/org/apache/xbean/jmx/JMXService.java Sat
Mar 11 07:36:14 2006
@@ -27,49 +27,49 @@
  */
 public class JMXService {
     private List listeners = new ArrayList();
-    private int attr1;
-    private Integer attr2;
-    private boolean dog;
+    private int intAttr;
+    private Integer integerAttr;
+    private boolean booleanAttr;
 
     public JMXService() {
     }
 
-    public JMXService(int attr1, Integer attr2, boolean dog) {
-        this.attr1 = attr1;
-        this.attr2 = attr2;
-        this.dog = dog;
+    public JMXService(int intAttr, Integer integerAttr, boolean booleanAttr) {
+        this.intAttr = intAttr;
+        this.integerAttr = integerAttr;
+        this.booleanAttr = booleanAttr;
     }
 
-    public int getAttr1() {
-        return attr1;
+    public int getIntAttr() {
+        return intAttr;
     }
 
-    public void setAttr1(int attr1) {
-        this.attr1 = attr1;
+    public void setIntAttr(int intAttr) {
+        this.intAttr = intAttr;
     }
 
-    public Integer getAttr2() {
-        return attr2;
+    public Integer getIntegerAttr() {
+        return integerAttr;
     }
 
-    public void setAttr2(Integer attr2) {
-        this.attr2 = attr2;
+    public void setIntegerAttr(Integer integerAttr) {
+        this.integerAttr = integerAttr;
     }
 
-    public boolean isDog() {
-        return dog;
+    public boolean isBooleanAttr() {
+        return booleanAttr;
     }
 
-    public void setDog(boolean dog) {
-        this.dog = dog;
+    public void setBooleanAttr(boolean booleanAttr) {
+        this.booleanAttr = booleanAttr;
     }
 
-    public String getFoo() {
+    public String getReadOnly() {
         return "BAR";
     }
 
-    public void setBar(String bar) {
-        if (!"FOO".equals(bar)) throw new IllegalArgumentException("Only FOO is accepted");
+    public void setWriteOnly(String value) {
+        if (!"FOO".equals(value)) throw new IllegalArgumentException("Only FOO is accepted");
     }
 
     public void addPropertyChangeListener(PropertyChangeListener listener) {

Modified: geronimo/xbean/trunk/xbean-jmx/src/test/java/org/apache/xbean/jmx/JMXTest.java
URL: http://svn.apache.org/viewcvs/geronimo/xbean/trunk/xbean-jmx/src/test/java/org/apache/xbean/jmx/JMXTest.java?rev=385094&r1=385093&r2=385094&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-jmx/src/test/java/org/apache/xbean/jmx/JMXTest.java (original)
+++ geronimo/xbean/trunk/xbean-jmx/src/test/java/org/apache/xbean/jmx/JMXTest.java Sat Mar
11 07:36:14 2006
@@ -52,31 +52,31 @@
             ObjectName objectName = ObjectName.getInstance(":type=JMXService");
             assertTrue(mbeanServer.isRegistered(objectName));
 
-            assertEquals("BAR", mbeanServer.getAttribute(objectName, "foo"));
+            assertEquals("BAR", mbeanServer.getAttribute(objectName, "readOnly"));
             try {
-                mbeanServer.setAttribute(objectName, new Attribute("foo", "CDR"));
+                mbeanServer.setAttribute(objectName, new Attribute("readOnly", "CDR"));
                 fail("Should have thrown an AttributeNotFoundException");
             } catch (AttributeNotFoundException doNothing) {
             }
 
             // iniital value should have been set by spring
-            assertEquals(new Integer(32), mbeanServer.getAttribute(objectName, "attr1"));
-            mbeanServer.setAttribute(objectName, new Attribute("attr1", new Integer(5)));
-            assertEquals(new Integer(5), mbeanServer.getAttribute(objectName, "attr1"));
+            assertEquals(new Integer(32), mbeanServer.getAttribute(objectName, "intAttr"));
+            mbeanServer.setAttribute(objectName, new Attribute("intAttr", new Integer(5)));
+            assertEquals(new Integer(5), mbeanServer.getAttribute(objectName, "intAttr"));
 
             // iniital value should have been set by spring
-            assertEquals(new Integer(64), mbeanServer.getAttribute(objectName, "attr2"));
-            mbeanServer.setAttribute(objectName, new Attribute("attr2", new Integer(7)));
-            assertEquals(new Integer(7), mbeanServer.getAttribute(objectName, "attr2"));
+            assertEquals(new Integer(64), mbeanServer.getAttribute(objectName, "integerAttr"));
+            mbeanServer.setAttribute(objectName, new Attribute("integerAttr", new Integer(7)));
+            assertEquals(new Integer(7), mbeanServer.getAttribute(objectName, "integerAttr"));
 
-            mbeanServer.setAttribute(objectName, new Attribute("dog", Boolean.FALSE));
-            assertEquals(Boolean.FALSE, mbeanServer.getAttribute(objectName, "dog"));
-            mbeanServer.setAttribute(objectName, new Attribute("dog", Boolean.TRUE));
-            assertEquals(Boolean.TRUE, mbeanServer.getAttribute(objectName, "dog"));
+            mbeanServer.setAttribute(objectName, new Attribute("booleanAttr", Boolean.FALSE));
+            assertEquals(Boolean.FALSE, mbeanServer.getAttribute(objectName, "booleanAttr"));
+            mbeanServer.setAttribute(objectName, new Attribute("booleanAttr", Boolean.TRUE));
+            assertEquals(Boolean.TRUE, mbeanServer.getAttribute(objectName, "booleanAttr"));
 
-            mbeanServer.setAttribute(objectName, new Attribute("bar", "FOO"));
+            mbeanServer.setAttribute(objectName, new Attribute("writeOnly", "FOO"));
             try {
-                mbeanServer.getAttribute(objectName, "bar");
+                mbeanServer.getAttribute(objectName, "writeOnly");
                 fail("Should have thrown an AttributeNotFoundException");
             } catch (AttributeNotFoundException doNothing) {
             }

Modified: geronimo/xbean/trunk/xbean-jmx/src/test/resources/org/apache/xbean/jmx/jmx-simple.xml
URL: http://svn.apache.org/viewcvs/geronimo/xbean/trunk/xbean-jmx/src/test/resources/org/apache/xbean/jmx/jmx-simple.xml?rev=385094&r1=385093&r2=385094&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-jmx/src/test/resources/org/apache/xbean/jmx/jmx-simple.xml
(original)
+++ geronimo/xbean/trunk/xbean-jmx/src/test/resources/org/apache/xbean/jmx/jmx-simple.xml
Sat Mar 11 07:36:14 2006
@@ -2,8 +2,8 @@
 <beans xmlns:jmx="http://xbean.apache.org/schemas/jmx">
 
     <bean id="jmxService" class="org.apache.xbean.jmx.JMXService">
-        <property name="attr1" value="32"/>
-        <property name="attr2" value="64"/>
+        <property name="intAttr" value="32"/>
+        <property name="integerAttr" value="64"/>
     </bean>
 
     <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">



Mime
View raw message