[jboss-cvs] JBossAS SVN: r76733 - projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/lang/unit.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 6 23:45:23 EDT 2008


Author: ALRubinger
Date: 2008-08-06 23:45:23 -0400 (Wed, 06 Aug 2008)
New Revision: 76733

Modified:
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/lang/unit/SerializableMethodTestCase.java
Log:
[EJBTHREE-1400] Set SerializableMethod actualClass to declaringClass if not specified

Modified: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/lang/unit/SerializableMethodTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/lang/unit/SerializableMethodTestCase.java	2008-08-06 22:22:35 UTC (rev 76732)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/lang/unit/SerializableMethodTestCase.java	2008-08-07 03:45:23 UTC (rev 76733)
@@ -28,6 +28,8 @@
 import java.lang.reflect.Method;
 import java.util.List;
 
+import junit.framework.TestCase;
+
 import org.jboss.ejb3.common.lang.SerializableMethod;
 import org.jboss.ejb3.test.proxy.lang.MyChildClass;
 import org.jboss.ejb3.test.proxy.lang.MyClass;
@@ -626,4 +628,31 @@
 
       logger.info("Completed testing toMethod() with serialization");
    }
+   
+   /**
+    * Test to ensure that when no actual class is specified,
+    * this field is automatically populated to the value of the declaring
+    * class 
+    * 
+    * @throws Throwable
+    */
+   @Test
+   public void testDeclaringClassDefaultsWhenNoActualClassSpecified() throws Throwable
+   {
+      // Obtain a method
+      Method method = Object.class.getMethod("toString", new Class<?>[]{});
+      
+      // Create a Serializable View, without noting an actual class
+      SerializableMethod sm = new SerializableMethod(method);
+      
+      // Get the actual and declaring class names
+      String declaringClassName = sm.getDeclaringClassName();
+      String actualClassName = sm.getActualClassName();
+      
+      // Ensure they're equal
+      assertEquals("When no actual class is specified, should default to the declaring class", declaringClassName,
+            actualClassName);
+      
+   }
+   
 }




More information about the jboss-cvs-commits mailing list