geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r154951 - in geronimo/trunk/modules/kernel/src/test/org/apache/geronimo: gbean/Speed.java kernel/GBeanTest.java
Date Wed, 23 Feb 2005 04:26:22 GMT
Author: jboynes
Date: Tue Feb 22 20:26:21 2005
New Revision: 154951

URL: http://svn.apache.org/viewcvs?view=rev&rev=154951
Log:
remove useof deprecated GBeanMBean

Modified:
    geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java
    geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java

Modified: geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java?view=diff&r1=154950&r2=154951
==============================================================================
--- geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java (original)
+++ geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java Tue Feb 22
20:26:21 2005
@@ -23,7 +23,6 @@
 import javax.management.ObjectName;
 
 import net.sf.cglib.reflect.FastClass;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.MockGBean;
 import org.apache.geronimo.gbean.runtime.RawInvoker;
@@ -97,11 +96,11 @@
         // start a kernel
         Kernel kernel = new Kernel("speed");
         kernel.boot();
-        GBeanMBean mockGBean = new GBeanMBean(MockGBean.getGBeanInfo(), Speed.class.getClassLoader());
+        ObjectName objectName = new ObjectName("speed:type=MockGBean");
+        GBeanData mockGBean = new GBeanData(objectName, MockGBean.getGBeanInfo());
         mockGBean.setAttribute("Name", "bar");
         mockGBean.setAttribute("FinalInt", new Integer(57));
-        ObjectName objectName = new ObjectName("speed:type=MockGBean");
-        kernel.loadGBean(objectName, mockGBean);
+        kernel.loadGBean(mockGBean, Speed.class.getClassLoader());
         kernel.startGBean(objectName);
 
         // reflect proxy
@@ -227,11 +226,11 @@
         // start a kernel
         Kernel kernel = new Kernel("speed");
         kernel.boot();
-        GBeanMBean mockGBean = new GBeanMBean(MockGBean.getGBeanInfo(), Speed.class.getClassLoader());
+        ObjectName objectName = new ObjectName("speed:type=MockGBean");
+        GBeanData mockGBean = new GBeanData(objectName, MockGBean.getGBeanInfo());
         mockGBean.setAttribute("Name", "bar");
         mockGBean.setAttribute("FinalInt", new Integer(57));
-        ObjectName objectName = new ObjectName("speed:type=MockGBean");
-        kernel.loadGBean(objectName, mockGBean);
+        kernel.loadGBean(mockGBean, Speed.class.getClassLoader());
         kernel.startGBean(objectName);
 
         // reflect proxy

Modified: geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java?view=diff&r1=154950&r2=154951
==============================================================================
--- geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java (original)
+++ geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java Tue Feb
22 20:26:21 2005
@@ -23,8 +23,9 @@
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
+
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanLifecycleController;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.management.State;
 
 /**
@@ -38,10 +39,10 @@
     public void testLoad() throws Exception {
         ClassLoader cl = getClass().getClassLoader();
         ClassLoader myCl = new URLClassLoader(new URL[0], cl);
-        GBeanMBean gbean = new GBeanMBean(MockGBean.getGBeanInfo(), myCl);
+        GBeanData gbean = new GBeanData(name, MockGBean.getGBeanInfo());
         gbean.setAttribute("name", "Test");
         gbean.setAttribute("finalInt", new Integer(123));
-        kernel.loadGBean(name, gbean);
+        kernel.loadGBean(gbean, myCl);
         kernel.startGBean(name);
         assertEquals(new Integer(State.RUNNING_INDEX), kernel.getAttribute(name, "state"));
         assertEquals("Hello", kernel.invoke(name, "doSomething", new Object[]{"Hello"}, new
String[]{String.class.getName()}));
@@ -67,15 +68,16 @@
     }
 
     public void testEndpoint() throws Exception {
-        GBeanMBean gbean1 = new GBeanMBean(MockGBean.getGBeanInfo());
+        ClassLoader cl = MockGBean.class.getClassLoader();
+        GBeanData gbean1 = new GBeanData(name, MockGBean.getGBeanInfo());
         gbean1.setAttribute("finalInt", new Integer(123));
-        kernel.loadGBean(name, gbean1);
+        kernel.loadGBean(gbean1, cl);
         kernel.startGBean(name);
 
-        GBeanMBean gbean2 = new GBeanMBean(MockGBean.getGBeanInfo());
+        GBeanData gbean2 = new GBeanData(name2, MockGBean.getGBeanInfo());
         gbean2.setAttribute("finalInt", new Integer(123));
         gbean2.setReferencePatterns("MockEndpoint", Collections.singleton(name));
-        kernel.loadGBean(name2, gbean2);
+        kernel.loadGBean(gbean2, cl);
         kernel.startGBean(name2);
 
         assertEquals("endpointCheck", kernel.invoke(name2, "checkEndpoint", null, null));



Mime
View raw message