geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akulshresh...@apache.org
Subject svn commit: r474768 - in /geronimo/server/trunk/modules/geronimo-kernel/src: main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java test/java/org/apache/geronimo/gbean/GBeanInfoFactoryTest.java test/java/org/apache/geronimo/gbean/GBeanInfoTest.java
Date Tue, 14 Nov 2006 12:44:14 GMT
Author: akulshreshtha
Date: Tue Nov 14 04:44:14 2006
New Revision: 474768

URL: http://svn.apache.org/viewvc?view=rev&rev=474768
Log:
GERONIMO-2548 exclude operations of java.lang.Object from GBeanInfo

Modified:
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
    geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanInfoFactoryTest.java
    geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanInfoTest.java

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java?view=diff&rev=474768&r1=474767&r2=474768
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
Tue Nov 14 04:44:14 2006
@@ -296,6 +296,7 @@
         Method[] methods = intf.getMethods();
         for (int i = 0; i < methods.length; i++) {
             Method method = methods[i];
+            if ("java.lang.Object".equals(method.getDeclaringClass().getName())) continue;
             if (isGetter(method)) {
                 String attributeName = getAttributeName(method);
                 GAttributeInfo attribute = (GAttributeInfo) attributes.get(attributeName);

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanInfoFactoryTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanInfoFactoryTest.java?view=diff&rev=474768&r1=474767&r2=474768
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanInfoFactoryTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanInfoFactoryTest.java
Tue Nov 14 04:44:14 2006
@@ -68,8 +68,8 @@
         GBeanInfoBuilder gbeanInfoFactory = new GBeanInfoBuilder(MockGBean.class, MockGBean.getGBeanInfo());
         assertEquals(MockGBean.class.getName(), gbeanInfoFactory.getBeanInfo().getName());
         assertEquals(MockGBean.class.getName(), gbeanInfoFactory.getBeanInfo().getClassName());
-        assertEquals(6, gbeanInfoFactory.getBeanInfo().getAttributes().size());
-        assertEquals(11, gbeanInfoFactory.getBeanInfo().getOperations().size());
+        assertEquals(5, gbeanInfoFactory.getBeanInfo().getAttributes().size());
+        assertEquals(3, gbeanInfoFactory.getBeanInfo().getOperations().size());
     }
 
     /*
@@ -80,26 +80,26 @@
 
         gbeanInfoFactory = new GBeanInfoBuilder(MockGBean.class);
         gbeanInfoFactory.addInterface(Serializable.class);
-        assertEquals(4, gbeanInfoFactory.getBeanInfo().getAttributes().size());
-        assertEquals(11, gbeanInfoFactory.getBeanInfo().getOperations().size());
+        assertEquals(3, gbeanInfoFactory.getBeanInfo().getAttributes().size());
+        assertEquals(3, gbeanInfoFactory.getBeanInfo().getOperations().size());
 
         gbeanInfoFactory = new GBeanInfoBuilder(MockGBean.class);
         gbeanInfoFactory.addInterface(GBeanLifecycle.class);
         GBeanInfo gbeanInfo = gbeanInfoFactory.getBeanInfo();
-        assertEquals(4, gbeanInfoFactory.getBeanInfo().getAttributes().size());
-        assertEquals(11, gbeanInfoFactory.getBeanInfo().getOperations().size());
+        assertEquals(3, gbeanInfoFactory.getBeanInfo().getAttributes().size());
+        assertEquals(3, gbeanInfoFactory.getBeanInfo().getOperations().size());
 
         gbeanInfoFactory = new GBeanInfoBuilder(MockGBean.class);
         gbeanInfoFactory.addInterface(SetterOnlyInterface.class);
         gbeanInfo = gbeanInfoFactory.getBeanInfo();
-        assertEquals(4, gbeanInfo.getAttributes().size());
+        assertEquals(3, gbeanInfo.getAttributes().size());
         GAttributeInfo gattrInfo = gbeanInfo.getAttribute("int");
         assertEquals("int", gattrInfo.getName());
         assertEquals("setInt", gattrInfo.getSetterName());
         assertEquals("getInt", gattrInfo.getGetterName());
 
         Set opsSet = gbeanInfo.getOperations();
-        assertEquals(11, opsSet.size());
+        assertEquals(3, opsSet.size());
     }
 
     private static interface SetterOnlyInterface {

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanInfoTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanInfoTest.java?view=diff&rev=474768&r1=474767&r2=474768
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanInfoTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanInfoTest.java
Tue Nov 14 04:44:14 2006
@@ -65,7 +65,7 @@
 
     public void testGetAttributeSet() {
         Set attrSet = gbeanInfo.getAttributes();
-        assertEquals(7, attrSet.size());
+        assertEquals(6, attrSet.size());
         assertTrue(attrSet.contains(persistentAttrInfo));
         assertTrue(attrSet.contains(nonPersistentAttrInfo));
     }
@@ -85,7 +85,7 @@
 
     public void testGetOperationsSet() {
         Set gbeanOpSet = gbeanInfo.getOperations();
-        assertEquals(9, gbeanOpSet.size());
+        assertEquals(1, gbeanOpSet.size());
         assertTrue(gbeanOpSet.contains(opInfo));
     }
 



Mime
View raw message