commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r278955 - /jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java
Date Tue, 06 Sep 2005 09:29:45 GMT
Author: knut
Date: Tue Sep  6 02:29:41 2005
New Revision: 278955

URL: http://svn.apache.org/viewcvs?rev=278955&view=rev
Log:
- assert that clashing final and non-final methods are not overridden by the proxy

Modified:
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java

Modified: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java?rev=278955&r1=278954&r2=278955&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java
(original)
+++ jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java
Tue Sep  6 02:29:41 2005
@@ -67,19 +67,17 @@
         assertTrue( echo instanceof EchoImpl );
     }
 
-    public void testProxiesWithFinalMethodSuperclass()
+    public void testProxiesWithClashingFinalMethodInSuperclass()
     {
-        Echo proxy = ( Echo )factory.createDelegatorProxy(
-                new ConstantProvider( new EchoImpl() ), Echo.class, FinalMethodEcho.class
);
-        assertTrue( proxy instanceof FinalMethodEcho );
-
-        proxy = ( Echo )factory.createInterceptorProxy(
-                new EchoImpl(), new NoOpMethodInterceptor(), Echo.class, FinalMethodEcho.class
);
-        assertTrue( proxy instanceof EchoImpl );
-
-        proxy = ( Echo )factory.createInvocationHandlerProxy(
-                new NullInvocationHandler(), Echo.class, FinalMethodEcho.class );
-        assertTrue( proxy instanceof FinalMethodEcho );
+        final Class[] proxyClasses = new Class[]{Echo.class, FinalMethodEcho.class};
+        Echo proxy = ( Echo )factory.createDelegatorProxy( new ConstantProvider( new EchoImpl()
), proxyClasses );
+        assertEquals( "final", proxy.echoBack("echo") );
+
+        proxy = ( Echo )factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(),
proxyClasses );
+        assertEquals( "final", proxy.echoBack("echo") );
+
+        proxy = ( Echo )factory.createInvocationHandlerProxy( new NullInvocationHandler(),
proxyClasses );
+        assertEquals( "final", proxy.echoBack("echo") );
     }
 
     public void testDelegatorWithMultipleSuperclasses()
@@ -128,9 +126,9 @@
     public static class FinalMethodEcho extends EchoImpl
     {
         @Override
-        public final void echo()
+        public final String echoBack( String message )
         {
-            super.echo();
+            return "final";
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message