commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1582563 [4/6] - in /commons/proper/proxy/trunk: asm/src/main/java/org/apache/commons/proxy2/asm/ asm/src/test/java/org/apache/commons/proxy2/asm/ cglib/src/main/java/org/apache/commons/proxy2/cglib/ cglib/src/test/java/org/apache/commons/p...
Date Fri, 28 Mar 2014 00:21:31 GMT
Modified: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/AbstractProxyFactoryTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/AbstractProxyFactoryTestCase.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/AbstractProxyFactoryTestCase.java (original)
+++ commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/AbstractProxyFactoryTestCase.java Fri Mar 28 00:21:29 2014
@@ -1,410 +1,410 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.proxy2;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ServiceLoader;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.apache.commons.proxy2.provider.BeanProvider;
-import org.apache.commons.proxy2.provider.ConstantProvider;
-import org.apache.commons.proxy2.provider.SingletonProvider;
-import org.apache.commons.proxy2.util.AbstractTestCase;
-import org.apache.commons.proxy2.util.DuplicateEcho;
-import org.apache.commons.proxy2.util.Echo;
-import org.apache.commons.proxy2.util.EchoImpl;
-import org.apache.commons.proxy2.util.SuffixInterceptor;
-import org.junit.Test;
-
-@SuppressWarnings("serial")
-public abstract class AbstractProxyFactoryTestCase extends AbstractTestCase
-{
-    //**********************************************************************************************************************
-    // Fields
-    //**********************************************************************************************************************
-
-    private static final Class<?>[] ECHO_ONLY = new Class[] { Echo.class };
-    protected final ProxyFactory factory;
-    private static final Class<?>[] COMPARABLE_ONLY = new Class[] { Comparable.class };
-
-    //**********************************************************************************************************************
-    // Constructors
-    //**********************************************************************************************************************
-
-    protected AbstractProxyFactoryTestCase()
-    {
-        final ServiceLoader<ProxyFactory> serviceLoader = ServiceLoader.load(ProxyFactory.class);
-        Iterator<ProxyFactory> iter = serviceLoader.iterator();
-        if (iter.hasNext())
-        {
-            this.factory = iter.next();
-        }
-        else
-        {
-            throw new RuntimeException("Unable to find proxy factory implementation.");
-        }
-
-    }
-
-    //**********************************************************************************************************************
-    // Other Methods
-    //**********************************************************************************************************************
-
-    private ObjectProvider<Echo> createSingletonEcho()
-    {
-        return new SingletonProvider<Echo>(new BeanProvider<Echo>(EchoImpl.class));
-    }
-
-    @Test
-    public void testInterceptorHashCode()
-    {
-        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
-        assertEquals(proxy.hashCode(), System.identityHashCode(proxy));
-    }
-
-    @Test
-    public void testInvokerHashCode() throws Exception
-    {
-        final Echo proxy = factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
-        assertEquals(proxy.hashCode(), System.identityHashCode(proxy));
-    }
-
-    @Test
-    public void testDelegatorHashCode() throws Exception
-    {
-        final Echo proxy = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
-        assertEquals(proxy.hashCode(), System.identityHashCode(proxy));
-    }
-
-    @Test
-    public void testInterceptorEquals()
-    {
-        final Date date = new Date();
-        final Comparable<?> proxy1 = factory.createInterceptorProxy(date, new NoOpMethodInterceptor(), COMPARABLE_ONLY);
-        final Comparable<?> proxy2 = factory.createInterceptorProxy(date, new NoOpMethodInterceptor(), COMPARABLE_ONLY);
-        assertEquals(proxy1, proxy1);
-        assertFalse(proxy1.equals(proxy2));
-        assertFalse(proxy2.equals(proxy1));
-    }
-
-    @Test
-    public void testInvokerEquals() throws Exception
-    {
-        final Comparable<?> proxy1 = factory.createInvokerProxy(new InvokerTester(), COMPARABLE_ONLY);
-        final Comparable<?> proxy2 = factory.createInvokerProxy(new InvokerTester(), COMPARABLE_ONLY);
-        assertEquals(proxy1, proxy1);
-        assertFalse(proxy1.equals(proxy2));
-        assertFalse(proxy2.equals(proxy1));
-    }
-
-    @Test
-    public void testDelegatorEquals() throws Exception
-    {
-        final Date date = new Date();
-        final Comparable<?> proxy1 = factory.createDelegatorProxy(new ConstantProvider<Date>(date), COMPARABLE_ONLY);
-        final Comparable<?> proxy2 = factory.createDelegatorProxy(new ConstantProvider<Date>(date), COMPARABLE_ONLY);
-        assertEquals(proxy1, proxy1);
-        assertFalse(proxy1.equals(proxy2));
-        assertFalse(proxy2.equals(proxy1));
-    }
-
-    @Test
-    public void testBooleanInterceptorParameter()
-    {
-        final Echo echo = factory.createInterceptorProxy(new EchoImpl(), new InterceptorTester(), ECHO_ONLY);
-        assertFalse(echo.echoBack(false));
-        assertTrue(echo.echoBack(true));
-    }
-
-    @Test
-    public void testCanProxy()
-    {
-        assertTrue(factory.canProxy(Echo.class));
-        assertFalse(factory.canProxy(EchoImpl.class));
-    }
-
-    @Test
-    public void testChangingArguments()
-    {
-        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new ChangeArgumentInterceptor(), ECHO_ONLY);
-        assertEquals("something different", proxy.echoBack("whatever"));
-    }
-
-    @Test
-    public void testCreateDelegatingProxy()
-    {
-        final Echo echo = factory.createDelegatorProxy(createSingletonEcho(), ECHO_ONLY);
-        echo.echo();
-        assertEquals("message", echo.echoBack("message"));
-        assertEquals("ab", echo.echoBack("a", "b"));
-    }
-
-    @Test
-    public void testCreateInterceptorProxy()
-    {
-        final Echo target = factory.createDelegatorProxy(createSingletonEcho(), ECHO_ONLY);
-        final Echo proxy = factory.createInterceptorProxy(target, new SuffixInterceptor(" suffix"), ECHO_ONLY);
-        proxy.echo();
-        assertEquals("message suffix", proxy.echoBack("message"));
-    }
-
-    @Test
-    public void testDelegatingProxyClassCaching() throws Exception
-    {
-        final Echo proxy1 = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
-        final Echo proxy2 = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
-        assertNotSame(proxy1, proxy2);
-        assertSame(proxy1.getClass(), proxy2.getClass());
-    }
-
-    @Test
-    public void testDelegatingProxyInterfaceOrder()
-    {
-        final Echo echo = factory.createDelegatorProxy(createSingletonEcho(), Echo.class, DuplicateEcho.class);
-        final List<Class<?>> expected = new LinkedList<Class<?>>(Arrays.<Class<?>> asList(Echo.class,
-                DuplicateEcho.class));
-        final List<Class<?>> actual = new LinkedList<Class<?>>(Arrays.asList(echo.getClass().getInterfaces()));
-        actual.retainAll(expected); // Doesn't alter order!
-        assertEquals(expected, actual);
-    }
-
-    @Test
-    public void testDelegatingProxySerializable() throws Exception
-    {
-        final Echo proxy = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
-        assertSerializable(proxy);
-    }
-
-    @Test
-    public void testInterceptingProxyClassCaching() throws Exception
-    {
-        final Echo proxy1 = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
-        final Echo proxy2 = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
-        assertNotSame(proxy1, proxy2);
-        assertSame(proxy1.getClass(), proxy2.getClass());
-    }
-
-    @Test
-    public void testInterceptingProxySerializable() throws Exception
-    {
-        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
-        assertSerializable(proxy);
-    }
-
-    @Test(expected = IOException.class)
-    public void testInterceptorProxyWithCheckedException() throws Exception
-    {
-        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
-        proxy.ioException();
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void testInterceptorProxyWithUncheckedException() throws Exception
-    {
-        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
-        proxy.illegalArgument();
-    }
-
-    @Test
-    public void testInterfaceHierarchies()
-    {
-        final SortedSet<String> set = factory.createDelegatorProxy(new ConstantProvider<SortedSet<String>>(
-                new TreeSet<String>()), SortedSet.class);
-        set.add("Hello");
-    }
-
-    @Test
-    public void testInvokerProxy() throws Exception
-    {
-        final InvokerTester tester = new InvokerTester();
-        final Echo echo = factory.createInvokerProxy(tester, ECHO_ONLY);
-        echo.echoBack("hello");
-        assertEquals(Echo.class.getMethod("echoBack", String.class), tester.method);
-        assertSame(echo, tester.proxy);
-        assertNotNull(tester.args);
-        assertEquals(1, tester.args.length);
-        assertEquals("hello", tester.args[0]);
-    }
-
-    @Test
-    public void testInvokerProxyClassCaching() throws Exception
-    {
-        final Echo proxy1 = factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
-        final Echo proxy2 = factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
-        assertNotSame(proxy1, proxy2);
-        assertSame(proxy1.getClass(), proxy2.getClass());
-    }
-
-    @Test
-    public void testInvokerProxySerializable() throws Exception
-    {
-        final Echo proxy = factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
-        assertSerializable(proxy);
-    }
-
-    @Test
-    public void testMethodInvocationClassCaching() throws Exception
-    {
-        final InterceptorTester tester = new InterceptorTester();
-        final EchoImpl target = new EchoImpl();
-        final Echo proxy1 = factory.createInterceptorProxy(target, tester, ECHO_ONLY);
-        final Echo proxy2 = factory.createInterceptorProxy(target, tester, Echo.class, DuplicateEcho.class);
-        proxy1.echoBack("hello1");
-        final Class<?> invocationClass1 = tester.invocationClass;
-        proxy2.echoBack("hello2");
-        assertSame(invocationClass1, tester.invocationClass);
-    }
-
-    @Test
-    public void testMethodInvocationDuplicateMethods() throws Exception
-    {
-        final InterceptorTester tester = new InterceptorTester();
-        final EchoImpl target = new EchoImpl();
-        final Echo proxy = factory.createInterceptorProxy(target, tester, Echo.class, DuplicateEcho.class);
-        proxy.echoBack("hello");
-        assertEquals(Echo.class.getMethod("echoBack", String.class), tester.method);
-    }
-
-    @Test
-    public void testMethodInvocationImplementation() throws Exception
-    {
-        final InterceptorTester tester = new InterceptorTester();
-        final EchoImpl target = new EchoImpl();
-        final Echo proxy = factory.createInterceptorProxy(target, tester, ECHO_ONLY);
-        proxy.echo();
-        assertNotNull(tester.arguments);
-        assertEquals(0, tester.arguments.length);
-        assertEquals(Echo.class.getMethod("echo"), tester.method);
-        assertSame(proxy, tester.proxy);
-        proxy.echoBack("Hello");
-        assertNotNull(tester.arguments);
-        assertEquals(1, tester.arguments.length);
-        assertEquals("Hello", tester.arguments[0]);
-        assertEquals(Echo.class.getMethod("echoBack", String.class), tester.method);
-        proxy.echoBack("Hello", "World");
-        assertNotNull(tester.arguments);
-        assertEquals(2, tester.arguments.length);
-        assertEquals("Hello", tester.arguments[0]);
-        assertEquals("World", tester.arguments[1]);
-        assertEquals(Echo.class.getMethod("echoBack", String.class, String.class), tester.method);
-    }
-
-    @Test
-    public void testPrimitiveParameter()
-    {
-        final Echo echo = factory.createDelegatorProxy(createSingletonEcho(), ECHO_ONLY);
-        assertEquals(1, echo.echoBack(1));
-    }
-
-    @Test(expected = IOException.class)
-    public void testProxyWithCheckedException() throws Exception
-    {
-        final Echo proxy = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
-        proxy.ioException();
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void testProxyWithUncheckedException() throws Exception
-    {
-        final Echo proxy = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
-        proxy.illegalArgument();
-    }
-
-    @Test
-    public void testWithNonAccessibleTargetType()
-    {
-        final Echo proxy = factory.createInterceptorProxy(new PrivateEcho(), new NoOpMethodInterceptor(), ECHO_ONLY);
-        proxy.echo();
-    }
-
-    //**********************************************************************************************************************
-    // Inner Classes
-    //**********************************************************************************************************************
-
-    private static class ChangeArgumentInterceptor implements Interceptor
-    {
-        @Override
-        public Object intercept(Invocation methodInvocation) throws Throwable
-        {
-            methodInvocation.getArguments()[0] = "something different";
-            return methodInvocation.proceed();
-        }
-    }
-
-    protected static class InterceptorTester implements Interceptor
-    {
-        private Object[] arguments;
-        private Method method;
-        private Object proxy;
-        private Class<?> invocationClass;
-
-        @Override
-        public Object intercept(Invocation methodInvocation) throws Throwable
-        {
-            arguments = methodInvocation.getArguments();
-            method = methodInvocation.getMethod();
-            proxy = methodInvocation.getProxy();
-            invocationClass = methodInvocation.getClass();
-            return methodInvocation.proceed();
-        }
-    }
-
-    protected static class InvokerTester implements Invoker
-    {
-        private Object method;
-        private Object[] args;
-        private Object proxy;
-
-        @Override
-        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
-        {
-            this.proxy = proxy;
-            this.method = method;
-            this.args = args;
-            return null;
-        }
-    }
-
-    protected static class NoOpMethodInterceptor implements Interceptor, Serializable
-    {
-        @Override
-        public Object intercept(Invocation methodInvocation) throws Throwable
-        {
-            return methodInvocation.proceed();
-        }
-    }
-
-    private static class PrivateEcho extends EchoImpl
-    {
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.proxy2;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ServiceLoader;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.apache.commons.proxy2.provider.BeanProvider;
+import org.apache.commons.proxy2.provider.ConstantProvider;
+import org.apache.commons.proxy2.provider.SingletonProvider;
+import org.apache.commons.proxy2.util.AbstractTestCase;
+import org.apache.commons.proxy2.util.DuplicateEcho;
+import org.apache.commons.proxy2.util.Echo;
+import org.apache.commons.proxy2.util.EchoImpl;
+import org.apache.commons.proxy2.util.SuffixInterceptor;
+import org.junit.Test;
+
+@SuppressWarnings("serial")
+public abstract class AbstractProxyFactoryTestCase extends AbstractTestCase
+{
+    //**********************************************************************************************************************
+    // Fields
+    //**********************************************************************************************************************
+
+    private static final Class<?>[] ECHO_ONLY = new Class[] { Echo.class };
+    protected final ProxyFactory factory;
+    private static final Class<?>[] COMPARABLE_ONLY = new Class[] { Comparable.class };
+
+    //**********************************************************************************************************************
+    // Constructors
+    //**********************************************************************************************************************
+
+    protected AbstractProxyFactoryTestCase()
+    {
+        final ServiceLoader<ProxyFactory> serviceLoader = ServiceLoader.load(ProxyFactory.class);
+        Iterator<ProxyFactory> iter = serviceLoader.iterator();
+        if (iter.hasNext())
+        {
+            this.factory = iter.next();
+        }
+        else
+        {
+            throw new RuntimeException("Unable to find proxy factory implementation.");
+        }
+
+    }
+
+    //**********************************************************************************************************************
+    // Other Methods
+    //**********************************************************************************************************************
+
+    private ObjectProvider<Echo> createSingletonEcho()
+    {
+        return new SingletonProvider<Echo>(new BeanProvider<Echo>(EchoImpl.class));
+    }
+
+    @Test
+    public void testInterceptorHashCode()
+    {
+        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        assertEquals(proxy.hashCode(), System.identityHashCode(proxy));
+    }
+
+    @Test
+    public void testInvokerHashCode() throws Exception
+    {
+        final Echo proxy = factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
+        assertEquals(proxy.hashCode(), System.identityHashCode(proxy));
+    }
+
+    @Test
+    public void testDelegatorHashCode() throws Exception
+    {
+        final Echo proxy = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
+        assertEquals(proxy.hashCode(), System.identityHashCode(proxy));
+    }
+
+    @Test
+    public void testInterceptorEquals()
+    {
+        final Date date = new Date();
+        final Comparable<?> proxy1 = factory.createInterceptorProxy(date, new NoOpMethodInterceptor(), COMPARABLE_ONLY);
+        final Comparable<?> proxy2 = factory.createInterceptorProxy(date, new NoOpMethodInterceptor(), COMPARABLE_ONLY);
+        assertEquals(proxy1, proxy1);
+        assertFalse(proxy1.equals(proxy2));
+        assertFalse(proxy2.equals(proxy1));
+    }
+
+    @Test
+    public void testInvokerEquals() throws Exception
+    {
+        final Comparable<?> proxy1 = factory.createInvokerProxy(new InvokerTester(), COMPARABLE_ONLY);
+        final Comparable<?> proxy2 = factory.createInvokerProxy(new InvokerTester(), COMPARABLE_ONLY);
+        assertEquals(proxy1, proxy1);
+        assertFalse(proxy1.equals(proxy2));
+        assertFalse(proxy2.equals(proxy1));
+    }
+
+    @Test
+    public void testDelegatorEquals() throws Exception
+    {
+        final Date date = new Date();
+        final Comparable<?> proxy1 = factory.createDelegatorProxy(new ConstantProvider<Date>(date), COMPARABLE_ONLY);
+        final Comparable<?> proxy2 = factory.createDelegatorProxy(new ConstantProvider<Date>(date), COMPARABLE_ONLY);
+        assertEquals(proxy1, proxy1);
+        assertFalse(proxy1.equals(proxy2));
+        assertFalse(proxy2.equals(proxy1));
+    }
+
+    @Test
+    public void testBooleanInterceptorParameter()
+    {
+        final Echo echo = factory.createInterceptorProxy(new EchoImpl(), new InterceptorTester(), ECHO_ONLY);
+        assertFalse(echo.echoBack(false));
+        assertTrue(echo.echoBack(true));
+    }
+
+    @Test
+    public void testCanProxy()
+    {
+        assertTrue(factory.canProxy(Echo.class));
+        assertFalse(factory.canProxy(EchoImpl.class));
+    }
+
+    @Test
+    public void testChangingArguments()
+    {
+        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new ChangeArgumentInterceptor(), ECHO_ONLY);
+        assertEquals("something different", proxy.echoBack("whatever"));
+    }
+
+    @Test
+    public void testCreateDelegatingProxy()
+    {
+        final Echo echo = factory.createDelegatorProxy(createSingletonEcho(), ECHO_ONLY);
+        echo.echo();
+        assertEquals("message", echo.echoBack("message"));
+        assertEquals("ab", echo.echoBack("a", "b"));
+    }
+
+    @Test
+    public void testCreateInterceptorProxy()
+    {
+        final Echo target = factory.createDelegatorProxy(createSingletonEcho(), ECHO_ONLY);
+        final Echo proxy = factory.createInterceptorProxy(target, new SuffixInterceptor(" suffix"), ECHO_ONLY);
+        proxy.echo();
+        assertEquals("message suffix", proxy.echoBack("message"));
+    }
+
+    @Test
+    public void testDelegatingProxyClassCaching() throws Exception
+    {
+        final Echo proxy1 = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
+        final Echo proxy2 = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
+        assertNotSame(proxy1, proxy2);
+        assertSame(proxy1.getClass(), proxy2.getClass());
+    }
+
+    @Test
+    public void testDelegatingProxyInterfaceOrder()
+    {
+        final Echo echo = factory.createDelegatorProxy(createSingletonEcho(), Echo.class, DuplicateEcho.class);
+        final List<Class<?>> expected = new LinkedList<Class<?>>(Arrays.<Class<?>> asList(Echo.class,
+                DuplicateEcho.class));
+        final List<Class<?>> actual = new LinkedList<Class<?>>(Arrays.asList(echo.getClass().getInterfaces()));
+        actual.retainAll(expected); // Doesn't alter order!
+        assertEquals(expected, actual);
+    }
+
+    @Test
+    public void testDelegatingProxySerializable() throws Exception
+    {
+        final Echo proxy = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
+        assertSerializable(proxy);
+    }
+
+    @Test
+    public void testInterceptingProxyClassCaching() throws Exception
+    {
+        final Echo proxy1 = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        final Echo proxy2 = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        assertNotSame(proxy1, proxy2);
+        assertSame(proxy1.getClass(), proxy2.getClass());
+    }
+
+    @Test
+    public void testInterceptingProxySerializable() throws Exception
+    {
+        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        assertSerializable(proxy);
+    }
+
+    @Test(expected = IOException.class)
+    public void testInterceptorProxyWithCheckedException() throws Exception
+    {
+        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        proxy.ioException();
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testInterceptorProxyWithUncheckedException() throws Exception
+    {
+        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        proxy.illegalArgument();
+    }
+
+    @Test
+    public void testInterfaceHierarchies()
+    {
+        final SortedSet<String> set = factory.createDelegatorProxy(new ConstantProvider<SortedSet<String>>(
+                new TreeSet<String>()), SortedSet.class);
+        set.add("Hello");
+    }
+
+    @Test
+    public void testInvokerProxy() throws Exception
+    {
+        final InvokerTester tester = new InvokerTester();
+        final Echo echo = factory.createInvokerProxy(tester, ECHO_ONLY);
+        echo.echoBack("hello");
+        assertEquals(Echo.class.getMethod("echoBack", String.class), tester.method);
+        assertSame(echo, tester.proxy);
+        assertNotNull(tester.args);
+        assertEquals(1, tester.args.length);
+        assertEquals("hello", tester.args[0]);
+    }
+
+    @Test
+    public void testInvokerProxyClassCaching() throws Exception
+    {
+        final Echo proxy1 = factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
+        final Echo proxy2 = factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
+        assertNotSame(proxy1, proxy2);
+        assertSame(proxy1.getClass(), proxy2.getClass());
+    }
+
+    @Test
+    public void testInvokerProxySerializable() throws Exception
+    {
+        final Echo proxy = factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
+        assertSerializable(proxy);
+    }
+
+    @Test
+    public void testMethodInvocationClassCaching() throws Exception
+    {
+        final InterceptorTester tester = new InterceptorTester();
+        final EchoImpl target = new EchoImpl();
+        final Echo proxy1 = factory.createInterceptorProxy(target, tester, ECHO_ONLY);
+        final Echo proxy2 = factory.createInterceptorProxy(target, tester, Echo.class, DuplicateEcho.class);
+        proxy1.echoBack("hello1");
+        final Class<?> invocationClass1 = tester.invocationClass;
+        proxy2.echoBack("hello2");
+        assertSame(invocationClass1, tester.invocationClass);
+    }
+
+    @Test
+    public void testMethodInvocationDuplicateMethods() throws Exception
+    {
+        final InterceptorTester tester = new InterceptorTester();
+        final EchoImpl target = new EchoImpl();
+        final Echo proxy = factory.createInterceptorProxy(target, tester, Echo.class, DuplicateEcho.class);
+        proxy.echoBack("hello");
+        assertEquals(Echo.class.getMethod("echoBack", String.class), tester.method);
+    }
+
+    @Test
+    public void testMethodInvocationImplementation() throws Exception
+    {
+        final InterceptorTester tester = new InterceptorTester();
+        final EchoImpl target = new EchoImpl();
+        final Echo proxy = factory.createInterceptorProxy(target, tester, ECHO_ONLY);
+        proxy.echo();
+        assertNotNull(tester.arguments);
+        assertEquals(0, tester.arguments.length);
+        assertEquals(Echo.class.getMethod("echo"), tester.method);
+        assertSame(proxy, tester.proxy);
+        proxy.echoBack("Hello");
+        assertNotNull(tester.arguments);
+        assertEquals(1, tester.arguments.length);
+        assertEquals("Hello", tester.arguments[0]);
+        assertEquals(Echo.class.getMethod("echoBack", String.class), tester.method);
+        proxy.echoBack("Hello", "World");
+        assertNotNull(tester.arguments);
+        assertEquals(2, tester.arguments.length);
+        assertEquals("Hello", tester.arguments[0]);
+        assertEquals("World", tester.arguments[1]);
+        assertEquals(Echo.class.getMethod("echoBack", String.class, String.class), tester.method);
+    }
+
+    @Test
+    public void testPrimitiveParameter()
+    {
+        final Echo echo = factory.createDelegatorProxy(createSingletonEcho(), ECHO_ONLY);
+        assertEquals(1, echo.echoBack(1));
+    }
+
+    @Test(expected = IOException.class)
+    public void testProxyWithCheckedException() throws Exception
+    {
+        final Echo proxy = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
+        proxy.ioException();
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testProxyWithUncheckedException() throws Exception
+    {
+        final Echo proxy = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
+        proxy.illegalArgument();
+    }
+
+    @Test
+    public void testWithNonAccessibleTargetType()
+    {
+        final Echo proxy = factory.createInterceptorProxy(new PrivateEcho(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        proxy.echo();
+    }
+
+    //**********************************************************************************************************************
+    // Inner Classes
+    //**********************************************************************************************************************
+
+    private static class ChangeArgumentInterceptor implements Interceptor
+    {
+        @Override
+        public Object intercept(Invocation methodInvocation) throws Throwable
+        {
+            methodInvocation.getArguments()[0] = "something different";
+            return methodInvocation.proceed();
+        }
+    }
+
+    protected static class InterceptorTester implements Interceptor
+    {
+        private Object[] arguments;
+        private Method method;
+        private Object proxy;
+        private Class<?> invocationClass;
+
+        @Override
+        public Object intercept(Invocation methodInvocation) throws Throwable
+        {
+            arguments = methodInvocation.getArguments();
+            method = methodInvocation.getMethod();
+            proxy = methodInvocation.getProxy();
+            invocationClass = methodInvocation.getClass();
+            return methodInvocation.proceed();
+        }
+    }
+
+    protected static class InvokerTester implements Invoker
+    {
+        private Object method;
+        private Object[] args;
+        private Object proxy;
+
+        @Override
+        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+        {
+            this.proxy = proxy;
+            this.method = method;
+            this.args = args;
+            return null;
+        }
+    }
+
+    protected static class NoOpMethodInterceptor implements Interceptor, Serializable
+    {
+        @Override
+        public Object intercept(Invocation methodInvocation) throws Throwable
+        {
+            return methodInvocation.proceed();
+        }
+    }
+
+    private static class PrivateEcho extends EchoImpl
+    {
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/AbstractProxyFactoryTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/AbstractSubclassingProxyFactoryTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/AbstractSubclassingProxyFactoryTestCase.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/AbstractSubclassingProxyFactoryTestCase.java (original)
+++ commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/AbstractSubclassingProxyFactoryTestCase.java Fri Mar 28 00:21:29 2014
@@ -1,216 +1,216 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.proxy2;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Date;
-
-import org.apache.commons.proxy2.exception.ProxyFactoryException;
-import org.apache.commons.proxy2.invoker.NullInvoker;
-import org.apache.commons.proxy2.provider.ConstantProvider;
-import org.apache.commons.proxy2.util.AbstractEcho;
-import org.apache.commons.proxy2.util.Echo;
-import org.apache.commons.proxy2.util.EchoImpl;
-import org.junit.Test;
-
-@SuppressWarnings("serial")
-public abstract class AbstractSubclassingProxyFactoryTestCase extends AbstractProxyFactoryTestCase
-{
-    //----------------------------------------------------------------------------------------------------------------------
-    // Fields
-    //----------------------------------------------------------------------------------------------------------------------
-
-    private static final Class<?>[] DATE_ONLY = new Class[] { Date.class };
-
-    //----------------------------------------------------------------------------------------------------------------------
-    // Other Methods
-    //----------------------------------------------------------------------------------------------------------------------
-
-    @Override
-    @Test
-    public void testCanProxy()
-    {
-        assertTrue(factory.canProxy(new Class[] { Echo.class }));
-        assertTrue(factory.canProxy(new Class[] { EchoImpl.class }));
-        assertFalse(factory.canProxy(new Class[] { FinalEcho.class }));
-        assertTrue(factory.canProxy(new Class[] { FinalMethodEcho.class, Echo.class }));
-        assertFalse(factory.canProxy(new Class[] { NoDefaultConstructorEcho.class }));
-        assertTrue(factory.canProxy(new Class[] { ProtectedConstructorEcho.class }));
-        assertFalse(factory.canProxy(new Class[] { InvisibleEcho.class }));
-        assertFalse(factory.canProxy(new Class[] { Echo.class, EchoImpl.class, String.class }));
-    }
-
-    @Override
-    @Test
-    public void testDelegatorEquals() throws Exception
-    {
-        final EqualsEcho echo = new EqualsEcho("text");
-        final Echo proxy1 = factory.createDelegatorProxy(new ConstantProvider<Echo>(echo),
-                new Class[] { EqualsEcho.class });
-        final Echo proxy2 = factory.createDelegatorProxy(new ConstantProvider<Echo>(echo),
-                new Class[] { EqualsEcho.class });
-        assertEquals(proxy1, proxy1);
-        assertFalse(proxy1.equals(proxy2));
-        assertFalse(proxy2.equals(proxy1));
-    }
-
-    @Test(expected = ProxyFactoryException.class)
-    public void testDelegatorWithMultipleSuperclasses()
-    {
-        factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()), new Class[] { EchoImpl.class,
-                String.class });
-    }
-
-    @Test
-    public void testDelegatorWithSuperclass()
-    {
-        final Echo echo = factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()), new Class[] {
-                Echo.class, EchoImpl.class });
-        assertTrue(echo instanceof EchoImpl);
-    }
-
-    @Override
-    @Test
-    public void testInterceptorEquals()
-    {
-        final EqualsEcho echo = new EqualsEcho("text");
-        final Echo proxy1 = factory.createInterceptorProxy(echo, new NoOpMethodInterceptor(),
-                new Class[] { EqualsEcho.class });
-        final Echo proxy2 = factory.createInterceptorProxy(echo, new NoOpMethodInterceptor(),
-                new Class[] { EqualsEcho.class });
-        assertEquals(proxy1, proxy1);
-        assertFalse(proxy1.equals(proxy2));
-        assertFalse(proxy2.equals(proxy1));
-    }
-
-    @Test(expected = ProxyFactoryException.class)
-    public void testInterceptorWithMultipleSuperclasses()
-    {
-        factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), new Class[] { EchoImpl.class,
-                String.class });
-    }
-
-    @Test
-    public void testInterceptorWithSuperclass()
-    {
-        final Echo echo = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), new Class[] {
-                Echo.class, EchoImpl.class });
-        assertTrue(echo instanceof EchoImpl);
-    }
-
-    @Test(expected = ProxyFactoryException.class)
-    public void testInvocationHandlerWithMultipleSuperclasses()
-    {
-        factory.createInvokerProxy(new NullInvoker(), new Class[] { EchoImpl.class, String.class });
-    }
-
-    @Override
-    @Test
-    public void testInvokerEquals() throws Exception
-    {
-        final Date proxy1 = factory.createInvokerProxy(new InvokerTester(), DATE_ONLY);
-        final Date proxy2 = factory.createInvokerProxy(new InvokerTester(), DATE_ONLY);
-        assertEquals(proxy1, proxy1);
-        assertFalse(proxy1.equals(proxy2));
-        assertFalse(proxy2.equals(proxy1));
-    }
-
-    @Test
-    public void testInvokerWithSuperclass()
-    {
-        final Echo echo = factory.createInvokerProxy(new NullInvoker(), new Class[] { Echo.class, EchoImpl.class });
-        assertTrue(echo instanceof EchoImpl);
-    }
-
-    @Test
-    public void testProxiesWithClashingFinalMethodInSuperclass()
-    {
-        final Class<?>[] proxyClasses = new Class[] { Echo.class, FinalMethodEcho.class };
-        Echo proxy = factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()), proxyClasses);
-        assertEquals("final", proxy.echoBack("echo"));
-
-        proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), proxyClasses);
-        assertEquals("final", proxy.echoBack("echo"));
-
-        proxy = factory.createInvokerProxy(new NullInvoker(), proxyClasses);
-        assertEquals("final", proxy.echoBack("echo"));
-    }
-
-    @Test
-    public void testWithAbstractSuperclass()
-    {
-        final Echo echo = factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()),
-                new Class[] { AbstractEcho.class });
-        assertEquals("hello", echo.echoBack("hello"));
-        assertEquals("helloworld", echo.echoBack("hello", "world"));
-    }
-
-    //----------------------------------------------------------------------------------------------------------------------
-    // Inner Classes
-    //----------------------------------------------------------------------------------------------------------------------
-
-    public static class EqualsEcho extends EchoImpl
-    {
-        @SuppressWarnings("unused")
-        private final String text;
-
-        protected EqualsEcho()
-        {
-            this("testing");
-        }
-
-        public EqualsEcho(String text)
-        {
-            this.text = text;
-        }
-    }
-
-    public static final class FinalEcho extends EchoImpl
-    {
-    }
-
-    public static class FinalMethodEcho extends EchoImpl
-    {
-        @Override
-        public final String echoBack(String message)
-        {
-            return "final";
-        }
-    }
-
-    private static class InvisibleEcho extends EchoImpl
-    {
-    }
-
-    public static class NoDefaultConstructorEcho extends EchoImpl
-    {
-        public NoDefaultConstructorEcho(String param)
-        {
-        }
-    }
-
-    public static class ProtectedConstructorEcho extends EchoImpl
-    {
-        protected ProtectedConstructorEcho()
-        {
-        }
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.proxy2;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Date;
+
+import org.apache.commons.proxy2.exception.ProxyFactoryException;
+import org.apache.commons.proxy2.invoker.NullInvoker;
+import org.apache.commons.proxy2.provider.ConstantProvider;
+import org.apache.commons.proxy2.util.AbstractEcho;
+import org.apache.commons.proxy2.util.Echo;
+import org.apache.commons.proxy2.util.EchoImpl;
+import org.junit.Test;
+
+@SuppressWarnings("serial")
+public abstract class AbstractSubclassingProxyFactoryTestCase extends AbstractProxyFactoryTestCase
+{
+    //----------------------------------------------------------------------------------------------------------------------
+    // Fields
+    //----------------------------------------------------------------------------------------------------------------------
+
+    private static final Class<?>[] DATE_ONLY = new Class[] { Date.class };
+
+    //----------------------------------------------------------------------------------------------------------------------
+    // Other Methods
+    //----------------------------------------------------------------------------------------------------------------------
+
+    @Override
+    @Test
+    public void testCanProxy()
+    {
+        assertTrue(factory.canProxy(new Class[] { Echo.class }));
+        assertTrue(factory.canProxy(new Class[] { EchoImpl.class }));
+        assertFalse(factory.canProxy(new Class[] { FinalEcho.class }));
+        assertTrue(factory.canProxy(new Class[] { FinalMethodEcho.class, Echo.class }));
+        assertFalse(factory.canProxy(new Class[] { NoDefaultConstructorEcho.class }));
+        assertTrue(factory.canProxy(new Class[] { ProtectedConstructorEcho.class }));
+        assertFalse(factory.canProxy(new Class[] { InvisibleEcho.class }));
+        assertFalse(factory.canProxy(new Class[] { Echo.class, EchoImpl.class, String.class }));
+    }
+
+    @Override
+    @Test
+    public void testDelegatorEquals() throws Exception
+    {
+        final EqualsEcho echo = new EqualsEcho("text");
+        final Echo proxy1 = factory.createDelegatorProxy(new ConstantProvider<Echo>(echo),
+                new Class[] { EqualsEcho.class });
+        final Echo proxy2 = factory.createDelegatorProxy(new ConstantProvider<Echo>(echo),
+                new Class[] { EqualsEcho.class });
+        assertEquals(proxy1, proxy1);
+        assertFalse(proxy1.equals(proxy2));
+        assertFalse(proxy2.equals(proxy1));
+    }
+
+    @Test(expected = ProxyFactoryException.class)
+    public void testDelegatorWithMultipleSuperclasses()
+    {
+        factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()), new Class[] { EchoImpl.class,
+                String.class });
+    }
+
+    @Test
+    public void testDelegatorWithSuperclass()
+    {
+        final Echo echo = factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()), new Class[] {
+                Echo.class, EchoImpl.class });
+        assertTrue(echo instanceof EchoImpl);
+    }
+
+    @Override
+    @Test
+    public void testInterceptorEquals()
+    {
+        final EqualsEcho echo = new EqualsEcho("text");
+        final Echo proxy1 = factory.createInterceptorProxy(echo, new NoOpMethodInterceptor(),
+                new Class[] { EqualsEcho.class });
+        final Echo proxy2 = factory.createInterceptorProxy(echo, new NoOpMethodInterceptor(),
+                new Class[] { EqualsEcho.class });
+        assertEquals(proxy1, proxy1);
+        assertFalse(proxy1.equals(proxy2));
+        assertFalse(proxy2.equals(proxy1));
+    }
+
+    @Test(expected = ProxyFactoryException.class)
+    public void testInterceptorWithMultipleSuperclasses()
+    {
+        factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), new Class[] { EchoImpl.class,
+                String.class });
+    }
+
+    @Test
+    public void testInterceptorWithSuperclass()
+    {
+        final Echo echo = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), new Class[] {
+                Echo.class, EchoImpl.class });
+        assertTrue(echo instanceof EchoImpl);
+    }
+
+    @Test(expected = ProxyFactoryException.class)
+    public void testInvocationHandlerWithMultipleSuperclasses()
+    {
+        factory.createInvokerProxy(new NullInvoker(), new Class[] { EchoImpl.class, String.class });
+    }
+
+    @Override
+    @Test
+    public void testInvokerEquals() throws Exception
+    {
+        final Date proxy1 = factory.createInvokerProxy(new InvokerTester(), DATE_ONLY);
+        final Date proxy2 = factory.createInvokerProxy(new InvokerTester(), DATE_ONLY);
+        assertEquals(proxy1, proxy1);
+        assertFalse(proxy1.equals(proxy2));
+        assertFalse(proxy2.equals(proxy1));
+    }
+
+    @Test
+    public void testInvokerWithSuperclass()
+    {
+        final Echo echo = factory.createInvokerProxy(new NullInvoker(), new Class[] { Echo.class, EchoImpl.class });
+        assertTrue(echo instanceof EchoImpl);
+    }
+
+    @Test
+    public void testProxiesWithClashingFinalMethodInSuperclass()
+    {
+        final Class<?>[] proxyClasses = new Class[] { Echo.class, FinalMethodEcho.class };
+        Echo proxy = factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()), proxyClasses);
+        assertEquals("final", proxy.echoBack("echo"));
+
+        proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), proxyClasses);
+        assertEquals("final", proxy.echoBack("echo"));
+
+        proxy = factory.createInvokerProxy(new NullInvoker(), proxyClasses);
+        assertEquals("final", proxy.echoBack("echo"));
+    }
+
+    @Test
+    public void testWithAbstractSuperclass()
+    {
+        final Echo echo = factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()),
+                new Class[] { AbstractEcho.class });
+        assertEquals("hello", echo.echoBack("hello"));
+        assertEquals("helloworld", echo.echoBack("hello", "world"));
+    }
+
+    //----------------------------------------------------------------------------------------------------------------------
+    // Inner Classes
+    //----------------------------------------------------------------------------------------------------------------------
+
+    public static class EqualsEcho extends EchoImpl
+    {
+        @SuppressWarnings("unused")
+        private final String text;
+
+        protected EqualsEcho()
+        {
+            this("testing");
+        }
+
+        public EqualsEcho(String text)
+        {
+            this.text = text;
+        }
+    }
+
+    public static final class FinalEcho extends EchoImpl
+    {
+    }
+
+    public static class FinalMethodEcho extends EchoImpl
+    {
+        @Override
+        public final String echoBack(String message)
+        {
+            return "final";
+        }
+    }
+
+    private static class InvisibleEcho extends EchoImpl
+    {
+    }
+
+    public static class NoDefaultConstructorEcho extends EchoImpl
+    {
+        public NoDefaultConstructorEcho(String param)
+        {
+        }
+    }
+
+    public static class ProtectedConstructorEcho extends EchoImpl
+    {
+        protected ProtectedConstructorEcho()
+        {
+        }
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/AbstractSubclassingProxyFactoryTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/exception/AbstractExceptionClassTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/exception/DelegateProviderExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/exception/InvocationHandlerExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/exception/ProxyFactoryExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/impl/MethodSignatureTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/interceptor/InterceptorUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/interceptor/InvokerInterceptorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/interceptor/SwitchInterceptorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/DeclaredByMatcherTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/MethodNameMatcherTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/ReturnTypeMatcherTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/argument/ArgumentMatcherUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/invoker/DelegatingInvokerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/provider/BeanProviderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/provider/CloningProviderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/provider/ConstantProviderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/provider/CountingProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/provider/NullProviderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/provider/ObjectProviderUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/AbstractEcho.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/AbstractEcho.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/AbstractEcho.java (original)
+++ commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/AbstractEcho.java Fri Mar 28 00:21:29 2014
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.proxy2.util;
-
-import java.io.Serializable;
-
-@SuppressWarnings("serial")
-public abstract class AbstractEcho implements Echo, Serializable
-{
-    //**********************************************************************************************************************
-    // Echo Implementation
-    //**********************************************************************************************************************
-
-    @Override
-    public String echoBack(String message)
-    {
-        return message;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.proxy2.util;
+
+import java.io.Serializable;
+
+@SuppressWarnings("serial")
+public abstract class AbstractEcho implements Echo, Serializable
+{
+    //**********************************************************************************************************************
+    // Echo Implementation
+    //**********************************************************************************************************************
+
+    @Override
+    public String echoBack(String message)
+    {
+        return message;
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/AbstractEcho.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/AbstractTestCase.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/AbstractTestCase.java (original)
+++ commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/AbstractTestCase.java Fri Mar 28 00:21:29 2014
@@ -1,83 +1,83 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.proxy2.util;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.apache.commons.lang3.Validate;
-import org.apache.commons.lang3.builder.Builder;
-import org.apache.commons.proxy2.Invocation;
-import org.apache.commons.proxy2.ProxyUtils;
-
-public abstract class AbstractTestCase
-{
-    //**********************************************************************************************************************
-    // Other Methods
-    //**********************************************************************************************************************
-
-    protected void assertSerializable(Object o)
-    {
-        assertTrue(o instanceof Serializable);
-        SerializationUtils.clone((Serializable) o);
-    }
-
-    protected MockInvocationBuilder mockInvocation(Class<?> type, String name, Class<?>... argumentTypes)
-    {
-        try
-        {
-            return new MockInvocationBuilder(Validate.notNull(type).getMethod(name, argumentTypes));
-        }
-        catch (NoSuchMethodException e)
-        {
-            throw new IllegalArgumentException("Method not found.", e);
-        }
-    }
-
-    protected static final class MockInvocationBuilder implements Builder<Invocation>
-    {
-        private final Method method;
-        private Object[] arguments = ProxyUtils.EMPTY_ARGUMENTS;
-        private Object returnValue = null;
-
-        public MockInvocationBuilder(Method method)
-        {
-            this.method = method;
-        }
-
-        public MockInvocationBuilder withArguments(Object... arguments)
-        {
-            this.arguments = arguments;
-            return this;
-        }
-
-        public MockInvocationBuilder returning(Object value)
-        {
-            this.returnValue = value;
-            return this;
-        }
-
-        @Override
-        public Invocation build()
-        {
-            return new MockInvocation(method, returnValue, arguments);
-        }
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.proxy2.util;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.apache.commons.lang3.Validate;
+import org.apache.commons.lang3.builder.Builder;
+import org.apache.commons.proxy2.Invocation;
+import org.apache.commons.proxy2.ProxyUtils;
+
+public abstract class AbstractTestCase
+{
+    //**********************************************************************************************************************
+    // Other Methods
+    //**********************************************************************************************************************
+
+    protected void assertSerializable(Object o)
+    {
+        assertTrue(o instanceof Serializable);
+        SerializationUtils.clone((Serializable) o);
+    }
+
+    protected MockInvocationBuilder mockInvocation(Class<?> type, String name, Class<?>... argumentTypes)
+    {
+        try
+        {
+            return new MockInvocationBuilder(Validate.notNull(type).getMethod(name, argumentTypes));
+        }
+        catch (NoSuchMethodException e)
+        {
+            throw new IllegalArgumentException("Method not found.", e);
+        }
+    }
+
+    protected static final class MockInvocationBuilder implements Builder<Invocation>
+    {
+        private final Method method;
+        private Object[] arguments = ProxyUtils.EMPTY_ARGUMENTS;
+        private Object returnValue = null;
+
+        public MockInvocationBuilder(Method method)
+        {
+            this.method = method;
+        }
+
+        public MockInvocationBuilder withArguments(Object... arguments)
+        {
+            this.arguments = arguments;
+            return this;
+        }
+
+        public MockInvocationBuilder returning(Object value)
+        {
+            this.returnValue = value;
+            return this;
+        }
+
+        @Override
+        public Invocation build()
+        {
+            return new MockInvocation(method, returnValue, arguments);
+        }
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/AbstractTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/DuplicateEcho.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/DuplicateEcho.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/DuplicateEcho.java (original)
+++ commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/DuplicateEcho.java Fri Mar 28 00:21:29 2014
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.proxy2.util;
-
-public interface DuplicateEcho
-{
-    //**********************************************************************************************************************
-    // Other Methods
-    //**********************************************************************************************************************
-
-    public String echoBack(String message);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.proxy2.util;
+
+public interface DuplicateEcho
+{
+    //**********************************************************************************************************************
+    // Other Methods
+    //**********************************************************************************************************************
+
+    public String echoBack(String message);
+}

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/DuplicateEcho.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/Echo.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/Echo.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/Echo.java (original)
+++ commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/Echo.java Fri Mar 28 00:21:29 2014
@@ -1,48 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.proxy2.util;
-
-import java.io.IOException;
-
-public interface Echo
-{
-    //**********************************************************************************************************************
-    // Other Methods
-    //**********************************************************************************************************************
-
-    public void echo();
-
-    public String echoBack(String message);
-
-    public String echoBack(String[] messages);
-
-    public String echoBack(String[][] messages);
-
-    public String echoBack(String[][][] messages);
-
-    public int echoBack(int i);
-
-    public boolean echoBack(boolean b);
-
-    public String echoBack(String message1, String message2);
-
-    public void illegalArgument();
-
-    public void ioException() throws IOException;
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.proxy2.util;
+
+import java.io.IOException;
+
+public interface Echo
+{
+    //**********************************************************************************************************************
+    // Other Methods
+    //**********************************************************************************************************************
+
+    public void echo();
+
+    public String echoBack(String message);
+
+    public String echoBack(String[] messages);
+
+    public String echoBack(String[][] messages);
+
+    public String echoBack(String[][][] messages);
+
+    public int echoBack(int i);
+
+    public boolean echoBack(boolean b);
+
+    public String echoBack(String message1, String message2);
+
+    public void illegalArgument();
+
+    public void ioException() throws IOException;
+
+}

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/Echo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/EchoImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/EchoImpl.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/EchoImpl.java (original)
+++ commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/EchoImpl.java Fri Mar 28 00:21:29 2014
@@ -1,103 +1,103 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.proxy2.util;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-public class EchoImpl extends AbstractEcho implements DuplicateEcho, Serializable
-{
-    //**********************************************************************************************************************
-    // Fields
-    //**********************************************************************************************************************
-
-    private static final long serialVersionUID = -4844873352607521103L;
-
-    //**********************************************************************************************************************
-    // Echo Implementation
-    //**********************************************************************************************************************
-
-    @Override
-    public void echo()
-    {
-    }
-
-    @Override
-    public boolean echoBack(boolean b)
-    {
-        return b;
-    }
-
-    @Override
-    public String echoBack(String[] messages)
-    {
-        final StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < messages.length; i++)
-        {
-            String message = messages[i];
-            sb.append(message);
-        }
-        return sb.toString();
-    }
-
-    @Override
-    public String echoBack(String[][] messages)
-    {
-        final StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < messages.length; i++)
-        {
-            sb.append(echoBack(messages[i]));
-        }
-        return sb.toString();
-    }
-
-    @Override
-    public String echoBack(String[][][] messages)
-    {
-        final StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < messages.length; i++)
-        {
-            sb.append(echoBack(messages[i]));
-        }
-        return sb.toString();
-    }
-
-    @Override
-    public int echoBack(int i)
-    {
-        return i;
-    }
-
-    @Override
-    public String echoBack(String message1, String message2)
-    {
-        return message1 + message2;
-    }
-
-    @Override
-    public void illegalArgument()
-    {
-        throw new IllegalArgumentException("dummy message");
-    }
-
-    @Override
-    public void ioException() throws IOException
-    {
-        throw new IOException("dummy message");
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.proxy2.util;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+public class EchoImpl extends AbstractEcho implements DuplicateEcho, Serializable
+{
+    //**********************************************************************************************************************
+    // Fields
+    //**********************************************************************************************************************
+
+    private static final long serialVersionUID = -4844873352607521103L;
+
+    //**********************************************************************************************************************
+    // Echo Implementation
+    //**********************************************************************************************************************
+
+    @Override
+    public void echo()
+    {
+    }
+
+    @Override
+    public boolean echoBack(boolean b)
+    {
+        return b;
+    }
+
+    @Override
+    public String echoBack(String[] messages)
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < messages.length; i++)
+        {
+            String message = messages[i];
+            sb.append(message);
+        }
+        return sb.toString();
+    }
+
+    @Override
+    public String echoBack(String[][] messages)
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < messages.length; i++)
+        {
+            sb.append(echoBack(messages[i]));
+        }
+        return sb.toString();
+    }
+
+    @Override
+    public String echoBack(String[][][] messages)
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < messages.length; i++)
+        {
+            sb.append(echoBack(messages[i]));
+        }
+        return sb.toString();
+    }
+
+    @Override
+    public int echoBack(int i)
+    {
+        return i;
+    }
+
+    @Override
+    public String echoBack(String message1, String message2)
+    {
+        return message1 + message2;
+    }
+
+    @Override
+    public void illegalArgument()
+    {
+        throw new IllegalArgumentException("dummy message");
+    }
+
+    @Override
+    public void ioException() throws IOException
+    {
+        throw new IOException("dummy message");
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/EchoImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/MockInvocation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/QuoteService.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/QuoteService.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/QuoteService.java (original)
+++ commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/QuoteService.java Fri Mar 28 00:21:29 2014
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.proxy2.util;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface QuoteService extends Remote
-{
-    //**********************************************************************************************************************
-    // Other Methods
-    //**********************************************************************************************************************
-
-    public float getQuote(String symbol) throws RemoteException;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.proxy2.util;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+public interface QuoteService extends Remote
+{
+    //**********************************************************************************************************************
+    // Other Methods
+    //**********************************************************************************************************************
+
+    public float getQuote(String symbol) throws RemoteException;
+}

Propchange: commons/proper/proxy/trunk/core/src/test/java/org/apache/commons/proxy2/util/QuoteService.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message