geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel GBeanTest.java MockEndpoint.java MockGBean.java
Date Thu, 22 Jan 2004 18:34:13 GMT
jboynes     2004/01/22 10:34:13

  Modified:    modules/kernel/src/test/org/apache/geronimo/kernel
                        GBeanTest.java MockEndpoint.java MockGBean.java
  Log:
  Testcase for endpoint issue
  
  Revision  Changes    Path
  1.2       +21 -1     incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java
  
  Index: GBeanTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GBeanTest.java	21 Jan 2004 22:53:42 -0000	1.1
  +++ GBeanTest.java	22 Jan 2004 18:34:13 -0000	1.2
  @@ -55,6 +55,7 @@
    */
   package org.apache.geronimo.kernel;
   
  +import java.util.Collections;
   import javax.management.ObjectName;
   
   import org.apache.geronimo.gbean.jmx.GBeanMBean;
  @@ -68,6 +69,7 @@
    */
   public class GBeanTest extends TestCase {
       private ObjectName name;
  +    private ObjectName name2;
       private Kernel kernel;
   
       public void testLoad() throws Exception {
  @@ -83,8 +85,26 @@
           kernel.unloadGBean(name);
       }
   
  +    public void XtestEndpoint() throws Exception {
  +        GBeanMBean gbean1 = new GBeanMBean(MockGBean.getGBeanInfo());
  +        gbean1.setAttribute("MutableInt", new Integer(123));
  +        gbean1.setAttribute("FinalInt", new Integer(123));
  +        kernel.loadGBean(name, gbean1);
  +        kernel.startGBean(name);
  +
  +        GBeanMBean gbean2 = new GBeanMBean(MockGBean.getGBeanInfo());
  +        gbean2.setAttribute("MutableInt", new Integer(123));
  +        gbean2.setAttribute("FinalInt", new Integer(123));
  +        gbean2.setEndpointPatterns("MockEndpoint", Collections.singleton(name));
  +        kernel.loadGBean(name2, gbean2);
  +        kernel.startGBean(name2);
  +
  +        assertEquals("endpointCheck", kernel.getMBeanServer().invoke(name2, "checkEndpoint",
null, null));
  +    }
  +
       protected void setUp() throws Exception {
           name = new ObjectName("test:name=MyMockGBean");
  +        name2 = new ObjectName("test:name=MyMockGBean2");
           kernel = new Kernel("test");
           kernel.boot();
       }
  
  
  
  1.4       +2 -2      incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/MockEndpoint.java
  
  Index: MockEndpoint.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/MockEndpoint.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MockEndpoint.java	17 Jan 2004 00:32:10 -0000	1.3
  +++ MockEndpoint.java	22 Jan 2004 18:34:13 -0000	1.4
  @@ -8,7 +8,7 @@
    * */
   public interface MockEndpoint {
   
  -    String doSomething(String name);
  +    String endpointDoSomething(String name);
   
       int getMutableInt();
   
  
  
  
  1.8       +7 -3      incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/MockGBean.java
  
  Index: MockGBean.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/MockGBean.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MockGBean.java	19 Jan 2004 06:35:36 -0000	1.7
  +++ MockGBean.java	22 Jan 2004 18:34:13 -0000	1.8
  @@ -162,18 +162,22 @@
           return name;
       }
   
  +    public String endpointDoSomething(String name) {
  +        return name;
  +    }
  +
       public String checkEndpoint() {
           if (endpoint == null) {
               return "no endpoint";
           }
  -        return endpoint.doSomething("endpointCheck");
  +        return endpoint.endpointDoSomething("endpointCheck");
       }
   
       public int checkEndpointCollection() {
           int successCount = 0;
           for (Iterator iterator = endpointCollection.iterator(); iterator.hasNext();) {
               MockEndpoint mockEndpoint = (MockEndpoint) iterator.next();
  -            String result = mockEndpoint.doSomething("endpointCheck");
  +            String result = mockEndpoint.endpointDoSomething("endpointCheck");
               if ("endpointCheck".equals(result)) {
                   successCount++;
               }
  
  
  

Mime
View raw message