commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcar...@apache.org
Subject svn commit: r1510014 - in /commons/proper/proxy/branches/version-2.0-work: cglib/src/test/java/org/apache/commons/proxy2/cglib/ core/src/main/java/org/apache/commons/proxy2/provider/ core/src/test/java/org/apache/commons/proxy2/ core/src/test/java/org/...
Date Sat, 03 Aug 2013 15:44:18 GMT
Author: jcarman
Date: Sat Aug  3 15:44:17 2013
New Revision: 1510014

URL: http://svn.apache.org/r1510014
Log:
Converting to JUnit 4 and renaming test classes to make naming consistent (*Test as opposed to Test*).

Added:
    commons/proper/proxy/branches/version-2.0-work/cglib/src/test/java/org/apache/commons/proxy2/cglib/CglibProxyFactoryTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/cglib/src/test/java/org/apache/commons/proxy2/cglib/TestCglibProxyFactory.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/TestProxyUtils.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/DelegateProviderExceptionTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestDelegateProviderException.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/InvocationHandlerExceptionTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestInvocationHandlerException.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/ProxyFactoryExceptionTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestProxyFactoryException.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/impl/MethodSignatureTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/impl/TestMethodSignature.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/InterceptorUtilsTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestInterceptorUtils.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestObjectProviderInterceptor.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/SwitchInterceptorTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestSwitchInterceptor.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/MethodNameMatcherTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/TestMethodNameMatcher.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/ReturnTypeMatcherTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/TestReturnTypeMatcher.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/BeanProviderTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestBeanProvider.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/CloningProviderTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestCloningProvider.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/ConstantProviderTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestConstantProvider.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/NullProviderTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestNullProvider.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/ObjectProviderUtilsTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestObjectProviderUtils.java
    commons/proper/proxy/branches/version-2.0-work/javassist/src/test/java/org/apache/commons/proxy2/javassist/JavassistProxyFactoryTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/javassist/src/test/java/org/apache/commons/proxy2/javassist/TestJavassistProxyFactory.java
    commons/proper/proxy/branches/version-2.0-work/jdk/src/test/java/org/apache/commons/proxy2/jdk/JdkProxyFactoryTest.java
      - copied, changed from r1509994, commons/proper/proxy/branches/version-2.0-work/jdk/src/test/java/org/apache/commons/proxy2/jdk/TestJdkProxyFactory.java
Removed:
    commons/proper/proxy/branches/version-2.0-work/cglib/src/test/java/org/apache/commons/proxy2/cglib/TestCglibProxyFactory.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/TestProxyUtils.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestDelegateProviderException.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestInvocationHandlerException.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestProxyFactoryException.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/impl/TestMethodSignature.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestInterceptorUtils.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestObjectProviderInterceptor.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestSwitchInterceptor.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/TestMethodNameMatcher.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/TestReturnTypeMatcher.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestBeanProvider.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestCloningProvider.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestConstantProvider.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestNullProvider.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestObjectProviderUtils.java
    commons/proper/proxy/branches/version-2.0-work/javassist/src/test/java/org/apache/commons/proxy2/javassist/TestJavassistProxyFactory.java
    commons/proper/proxy/branches/version-2.0-work/jdk/src/test/java/org/apache/commons/proxy2/jdk/TestJdkProxyFactory.java
Modified:
    commons/proper/proxy/branches/version-2.0-work/core/src/main/java/org/apache/commons/proxy2/provider/CloningProvider.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/AbstractProxyFactoryTestCase.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/AbstractSubclassingProxyFactoryTestCase.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/AbstractExceptionClassTestCase.java
    commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/util/AbstractTestCase.java

Copied: commons/proper/proxy/branches/version-2.0-work/cglib/src/test/java/org/apache/commons/proxy2/cglib/CglibProxyFactoryTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/cglib/src/test/java/org/apache/commons/proxy2/cglib/TestCglibProxyFactory.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/cglib/src/test/java/org/apache/commons/proxy2/cglib/CglibProxyFactoryTest.java?p2=commons/proper/proxy/branches/version-2.0-work/cglib/src/test/java/org/apache/commons/proxy2/cglib/CglibProxyFactoryTest.java&p1=commons/proper/proxy/branches/version-2.0-work/cglib/src/test/java/org/apache/commons/proxy2/cglib/TestCglibProxyFactory.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/cglib/src/test/java/org/apache/commons/proxy2/cglib/TestCglibProxyFactory.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/cglib/src/test/java/org/apache/commons/proxy2/cglib/CglibProxyFactoryTest.java Sat Aug  3 15:44:17 2013
@@ -19,13 +19,13 @@ package org.apache.commons.proxy2.cglib;
 
 import org.apache.commons.proxy2.AbstractSubclassingProxyFactoryTestCase;
 
-public class TestCglibProxyFactory extends AbstractSubclassingProxyFactoryTestCase
+public class CglibProxyFactoryTest extends AbstractSubclassingProxyFactoryTestCase
 {
 //**********************************************************************************************************************
 // Constructors
 //**********************************************************************************************************************
 
-    public TestCglibProxyFactory()
+    public CglibProxyFactoryTest()
     {
     }
 }

Modified: commons/proper/proxy/branches/version-2.0-work/core/src/main/java/org/apache/commons/proxy2/provider/CloningProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/main/java/org/apache/commons/proxy2/provider/CloningProvider.java?rev=1510014&r1=1510013&r2=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/main/java/org/apache/commons/proxy2/provider/CloningProvider.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/main/java/org/apache/commons/proxy2/provider/CloningProvider.java Sat Aug  3 15:44:17 2013
@@ -17,13 +17,13 @@
 
 package org.apache.commons.proxy2.provider;
 
+import org.apache.commons.lang3.Validate;
+import org.apache.commons.lang3.reflect.MethodUtils;
 import org.apache.commons.proxy2.ObjectProvider;
-import org.apache.commons.proxy2.ProxyUtils;
 import org.apache.commons.proxy2.exception.ObjectProviderException;
 
 import java.io.Serializable;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 
 /**
  * Merely calls <code>clone()</code> (reflectively) on the given {@link Cloneable} object.
@@ -33,7 +33,9 @@ import java.lang.reflect.Method;
  */
 public class CloningProvider<T extends Cloneable> implements ObjectProvider<T>, Serializable
 {
-    /** Serialization version */
+    /**
+     * Serialization version
+     */
     private static final long serialVersionUID = 1L;
 
 //**********************************************************************************************************************
@@ -41,7 +43,6 @@ public class CloningProvider<T extends C
 //**********************************************************************************************************************
 
     private final T cloneable;
-    private Method cloneMethod;
 
 //**********************************************************************************************************************
 // Constructors
@@ -53,14 +54,18 @@ public class CloningProvider<T extends C
      *
      * @param cloneable the object to clone
      */
-    public CloningProvider( T cloneable )
+    public CloningProvider(T cloneable)
     {
-        this.cloneable = cloneable;
+        Validate.isTrue(
+                MethodUtils.getAccessibleMethod(cloneable.getClass(), "clone") != null,
+                String.format("Class %s does not override clone() method as public.",
+                        cloneable.getClass().getName()));
+        this.cloneable = Validate.notNull(cloneable, "Cloneable object cannot be null.");
     }
 
-  //**********************************************************************************************************************
- // ObjectProvider Implementation
- //**********************************************************************************************************************
+    //**********************************************************************************************************************
+    // ObjectProvider Implementation
+    //**********************************************************************************************************************
 
     /**
      * {@inheritDoc}
@@ -70,38 +75,28 @@ public class CloningProvider<T extends C
     {
         try
         {
-            return (T)getCloneMethod().invoke(cloneable, ProxyUtils.EMPTY_ARGUMENTS);
+            return (T) MethodUtils.invokeExactMethod(cloneable, "clone");
         }
-        catch( IllegalAccessException e )
+        catch (IllegalAccessException e)
         {
             throw new ObjectProviderException(
                     "Class " + cloneable.getClass().getName() + " does not have a public clone() method.", e);
         }
-        catch( InvocationTargetException e )
+        catch (InvocationTargetException e)
         {
             throw new ObjectProviderException(
                     "Attempt to clone object of type " + cloneable.getClass().getName() + " threw an exception.", e);
         }
+        catch (NoSuchMethodException e)
+        {
+            throw new ObjectProviderException(
+                    String.format("Class %s does not have a clone() method (should never happen).", cloneable.getClass().getName()));
+        }
     }
 
 //**********************************************************************************************************************
 // Getter/Setter Methods
 //**********************************************************************************************************************
 
-    private synchronized Method getCloneMethod()
-    {
-        if( cloneMethod == null )
-        {
-            try
-            {
-                cloneMethod = cloneable.getClass().getMethod("clone", ProxyUtils.EMPTY_ARGUMENT_TYPES);
-            }
-            catch( NoSuchMethodException e )
-            {
-                throw new ObjectProviderException(
-                        "Class " + cloneable.getClass().getName() + " does not have a public clone() method.", e);
-            }
-        }
-        return cloneMethod;
-    }
+
 }

Modified: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/AbstractProxyFactoryTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/AbstractProxyFactoryTestCase.java?rev=1510014&r1=1510013&r2=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/AbstractProxyFactoryTestCase.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/AbstractProxyFactoryTestCase.java Sat Aug  3 15:44:17 2013
@@ -21,12 +21,15 @@ import org.apache.commons.proxy2.provide
 import org.apache.commons.proxy2.provider.ConstantProvider;
 import org.apache.commons.proxy2.provider.SingletonProvider;
 import org.apache.commons.proxy2.util.*;
+import org.junit.Test;
 
 import java.io.IOException;
 import java.io.Serializable;
 import java.lang.reflect.Method;
 import java.util.*;
 
+import static org.junit.Assert.*;
+
 /**
  * @author James Carman
  * @since 1.0
@@ -40,7 +43,7 @@ public abstract class AbstractProxyFacto
 
     private static final Class<?>[] ECHO_ONLY = new Class[]{Echo.class};
     protected final ProxyFactory factory;
-    private static final Class<?>[] COMPARABLE_ONLY = new Class[] { Comparable.class };
+    private static final Class<?>[] COMPARABLE_ONLY = new Class[]{Comparable.class};
 
 //**********************************************************************************************************************
 // Constructors
@@ -50,9 +53,9 @@ public abstract class AbstractProxyFacto
     {
         final ServiceLoader<ProxyFactory> serviceLoader = ServiceLoader.load(ProxyFactory.class);
         Iterator<ProxyFactory> iter = serviceLoader.iterator();
-        if(iter.hasNext())
+        if (iter.hasNext())
         {
-            this.factory= iter.next();
+            this.factory = iter.next();
         }
         else
         {
@@ -70,93 +73,104 @@ public abstract class AbstractProxyFacto
         return new SingletonProvider<Echo>(new BeanProvider<Echo>(EchoImpl.class));
     }
 
+    @Test
     public void testInterceptorHashCode()
     {
-        final Echo proxy = (Echo) factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        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 = (Echo) factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
+        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 = (Comparable<?>) factory.createInterceptorProxy(date,
+        final Comparable<?> proxy1 = factory.createInterceptorProxy(date,
                 new NoOpMethodInterceptor(), COMPARABLE_ONLY);
-        final Comparable<?> proxy2 = (Comparable<?>) factory.createInterceptorProxy(date,
+        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 = (Comparable<?>) factory.createInvokerProxy(new InvokerTester(), COMPARABLE_ONLY);
-        final Comparable<?> proxy2 = (Comparable<?>) factory.createInvokerProxy(new InvokerTester(), COMPARABLE_ONLY);
+        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 = (Comparable<?>) factory.createDelegatorProxy(new ConstantProvider<Date>(date),
+        final Comparable<?> proxy1 = factory.createDelegatorProxy(new ConstantProvider<Date>(date),
                 COMPARABLE_ONLY);
-        final Comparable<?> proxy2 = (Comparable<?>) factory.createDelegatorProxy(new ConstantProvider<Date>(date),
+        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 = (Echo) factory.createInterceptorProxy(new EchoImpl(), new InterceptorTester(), ECHO_ONLY);
+        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 = (Echo) factory.createInterceptorProxy(new EchoImpl(), new ChangeArgumentInterceptor(), ECHO_ONLY);
+        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new ChangeArgumentInterceptor(), ECHO_ONLY);
         assertEquals("something different", proxy.echoBack("whatever"));
     }
 
+    @Test
     public void testCreateDelegatingProxy()
     {
-        final Echo echo = (Echo) factory.createDelegatorProxy(createSingletonEcho(), ECHO_ONLY);
+        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 = (Echo) factory.createDelegatorProxy(createSingletonEcho(), ECHO_ONLY);
-        final Echo proxy = (Echo) factory.createInterceptorProxy(target, new SuffixInterceptor(" suffix"), ECHO_ONLY);
+        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);
@@ -165,72 +179,66 @@ public abstract class AbstractProxyFacto
         assertSame(proxy1.getClass(), proxy2.getClass());
     }
 
+    @Test
     public void testDelegatingProxyInterfaceOrder()
     {
-        final Echo echo = (Echo) factory.createDelegatorProxy(createSingletonEcho(), Echo.class, DuplicateEcho.class);
-        final List<Class<?>> expected = new LinkedList<Class<?>>(Arrays.<Class<?>> asList(Echo.class, DuplicateEcho.class));
+        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 = (Echo) factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
-        final Echo proxy2 = (Echo) factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        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 = (Echo) factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        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 = (Echo) factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
-        try
-        {
-            proxy.ioException();
-            fail();
-        }
-        catch (IOException e)
-        {
-        }
+        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 = (Echo) factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
-        try
-        {
-            proxy.illegalArgument();
-            fail();
-        }
-        catch (IllegalArgumentException e)
-        {
-        }
+        final Echo proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        proxy.illegalArgument();
     }
 
     @SuppressWarnings("unchecked")
+    @Test
     public void testInterfaceHierarchies()
     {
         final SortedSet set = factory.createDelegatorProxy(new ConstantProvider<SortedSet>(new TreeSet()), SortedSet.class);
         set.add("Hello");
     }
 
+    @Test
     public void testInvokerProxy() throws Exception
     {
         final InvokerTester tester = new InvokerTester();
-        final Echo echo = (Echo) factory.createInvokerProxy(tester, ECHO_ONLY);
+        final Echo echo = factory.createInvokerProxy(tester, ECHO_ONLY);
         echo.echoBack("hello");
         assertEquals(Echo.class.getMethod("echoBack", String.class), tester.method);
         assertSame(echo, tester.proxy);
@@ -239,46 +247,51 @@ public abstract class AbstractProxyFacto
         assertEquals("hello", tester.args[0]);
     }
 
+    @Test
     public void testInvokerProxyClassCaching() throws Exception
     {
-        final Echo proxy1 = (Echo) factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
-        final Echo proxy2 = (Echo) factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
+        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 = (Echo) factory.createInvokerProxy(new InvokerTester(), ECHO_ONLY);
+        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 = (Echo) factory.createInterceptorProxy(target, tester, ECHO_ONLY);
-        final Echo proxy2 = (Echo) factory.createInterceptorProxy(target, tester, Echo.class, DuplicateEcho.class);
+        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 = (Echo) factory.createInterceptorProxy(target, tester, Echo.class, DuplicateEcho.class);
+        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 = (Echo) factory.createInterceptorProxy(target, tester, ECHO_ONLY);
+        final Echo proxy = factory.createInterceptorProxy(target, tester, ECHO_ONLY);
         proxy.echo();
         assertNotNull(tester.arguments);
         assertEquals(0, tester.arguments.length);
@@ -297,41 +310,31 @@ public abstract class AbstractProxyFacto
         assertEquals(Echo.class.getMethod("echoBack", String.class, String.class), tester.method);
     }
 
+    @Test
     public void testPrimitiveParameter()
     {
-        final Echo echo = (Echo) factory.createDelegatorProxy(createSingletonEcho(), ECHO_ONLY);
+        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);
-        try
-        {
-            proxy.ioException();
-            fail();
-        }
-        catch (IOException e)
-        {
-        }
+        proxy.ioException();
     }
 
+    @Test(expected = IllegalArgumentException.class)
     public void testProxyWithUncheckedException() throws Exception
     {
         final Echo proxy = factory.createDelegatorProxy(new ConstantProvider<Echo>(new EchoImpl()), Echo.class);
-        try
-        {
-            proxy.illegalArgument();
-            fail();
-        }
-        catch (IllegalArgumentException e)
-        {
-        }
+        proxy.illegalArgument();
     }
 
+    @Test
     public void testWithNonAccessibleTargetType()
     {
-        final Echo proxy = (Echo) factory.createInterceptorProxy(new PrivateEcho(), new NoOpMethodInterceptor(), ECHO_ONLY);
+        final Echo proxy = factory.createInterceptorProxy(new PrivateEcho(), new NoOpMethodInterceptor(), ECHO_ONLY);
         proxy.echo();
     }
 

Modified: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/AbstractSubclassingProxyFactoryTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/AbstractSubclassingProxyFactoryTestCase.java?rev=1510014&r1=1510013&r2=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/AbstractSubclassingProxyFactoryTestCase.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/AbstractSubclassingProxyFactoryTestCase.java Sat Aug  3 15:44:17 2013
@@ -23,9 +23,12 @@ import org.apache.commons.proxy2.provide
 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;
 
 import java.util.Date;
 
+import static org.junit.Assert.*;
+
 /**
  * @author James Carman
  * @since 1.0
@@ -33,15 +36,17 @@ import java.util.Date;
 @SuppressWarnings("serial")
 public abstract class AbstractSubclassingProxyFactoryTestCase extends AbstractProxyFactoryTestCase
 {
+//----------------------------------------------------------------------------------------------------------------------
+// Fields
+//----------------------------------------------------------------------------------------------------------------------
+
     private static final Class<?>[] DATE_ONLY = new Class[]{Date.class};
-//**********************************************************************************************************************
-// Constructors
-//**********************************************************************************************************************
 
-//**********************************************************************************************************************
+//----------------------------------------------------------------------------------------------------------------------
 // Other Methods
-//**********************************************************************************************************************
+//----------------------------------------------------------------------------------------------------------------------
 
+    @Test
     public void testCanProxy()
     {
         assertTrue(factory.canProxy(new Class[]{Echo.class}));
@@ -54,141 +59,119 @@ public abstract class AbstractSubclassin
         assertFalse(factory.canProxy(new Class[]{Echo.class, EchoImpl.class, String.class}));
     }
 
+    @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()
     {
-        try
-        {
-            factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()),
-                    new Class[]{EchoImpl.class, String.class});
-            fail();
-        }
-        catch (ProxyFactoryException e)
-        {
-        }
+        factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()),
+                new Class[]{EchoImpl.class, String.class});
     }
 
+    @Test
     public void testDelegatorWithSuperclass()
     {
-        final Echo echo = (Echo) factory
+        final Echo echo = factory
                 .createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()), new Class[]{Echo.class, EchoImpl.class});
         assertTrue(echo instanceof EchoImpl);
     }
 
+    @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()
     {
-        try
-        {
-            factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(),
-                    new Class[]{EchoImpl.class, String.class});
-            fail();
-        }
-        catch (ProxyFactoryException e)
-        {
-        }
+        factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(),
+                new Class[]{EchoImpl.class, String.class});
     }
 
+    @Test
     public void testInterceptorWithSuperclass()
     {
-        final Echo echo = (Echo) factory
+        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()
     {
-        try
-        {
-            factory.createInvokerProxy(new NullInvoker(),
-                    new Class[]{EchoImpl.class, String.class});
-            fail();
-        }
-        catch (ProxyFactoryException e)
-        {
-        }
+        factory.createInvokerProxy(new NullInvoker(),
+                new Class[]{EchoImpl.class, String.class});
     }
 
+    @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 = (Echo) factory
+        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 = (Echo) factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()), proxyClasses);
+        Echo proxy = factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()), proxyClasses);
         assertEquals("final", proxy.echoBack("echo"));
 
-        proxy = (Echo) factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), proxyClasses);
+        proxy = factory.createInterceptorProxy(new EchoImpl(), new NoOpMethodInterceptor(), proxyClasses);
         assertEquals("final", proxy.echoBack("echo"));
 
-        proxy = (Echo) factory.createInvokerProxy(new NullInvoker(), proxyClasses);
+        proxy = factory.createInvokerProxy(new NullInvoker(), proxyClasses);
         assertEquals("final", proxy.echoBack("echo"));
     }
 
+    @Test
     public void testWithAbstractSuperclass()
     {
-        final Echo echo = (Echo) factory.createDelegatorProxy(new ConstantProvider<EchoImpl>(new EchoImpl()), new Class[]{AbstractEcho.class});
+        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"));
     }
 
-    public void testInterceptorEquals()
-    {
-        final EqualsEcho echo = new EqualsEcho("text");
-        final Echo proxy1 = (Echo) factory.createInterceptorProxy(echo,
-                new NoOpMethodInterceptor(), new Class[] { EqualsEcho.class } );
-        final Echo proxy2 = (Echo) factory.createInterceptorProxy(echo,
-                new NoOpMethodInterceptor(), new Class[] { EqualsEcho.class } );
-        assertEquals(proxy1, proxy1);
-        assertFalse(proxy1.equals(proxy2));
-        assertFalse(proxy2.equals(proxy1));
-    }
-
-    public void testInvokerEquals() throws Exception
-    {
-        final Date proxy1 = (Date) factory.createInvokerProxy(new InvokerTester(), DATE_ONLY);
-        final Date proxy2 = (Date) factory.createInvokerProxy(new InvokerTester(), DATE_ONLY);
-        assertEquals(proxy1, proxy1);
-        assertFalse(proxy1.equals(proxy2));
-        assertFalse(proxy2.equals(proxy1));
-    }
-
-    public void testDelegatorEquals() throws Exception
-    {
-        final EqualsEcho echo = new EqualsEcho("text");
-        final Echo proxy1 = (Echo) factory.createDelegatorProxy(new ConstantProvider<Echo>(echo),
-                new Class[] { EqualsEcho.class });
-        final Echo proxy2 = (Echo) factory.createDelegatorProxy(new ConstantProvider<Echo>(echo),
-                new Class[] { EqualsEcho.class });
-        assertEquals(proxy1, proxy1);
-        assertFalse(proxy1.equals(proxy2));
-        assertFalse(proxy2.equals(proxy1));
-    }
-
-//**********************************************************************************************************************
+//----------------------------------------------------------------------------------------------------------------------
 // Inner Classes
-//**********************************************************************************************************************
-
-    public static final class FinalEcho extends EchoImpl
-    {
-    }
-
-    public static class FinalMethodEcho extends EchoImpl
-    {
-        public final String echoBack(String message)
-        {
-            return "final";
-        }
-    }
+//----------------------------------------------------------------------------------------------------------------------
 
     public static class EqualsEcho extends EchoImpl
     {
         @SuppressWarnings("unused")
         private final String text;
 
-        public EqualsEcho()
+        protected EqualsEcho()
         {
             this("testing");
         }
@@ -199,6 +182,18 @@ public abstract class AbstractSubclassin
         }
     }
 
+    public static final class FinalEcho extends EchoImpl
+    {
+    }
+
+    public static class FinalMethodEcho extends EchoImpl
+    {
+        public final String echoBack(String message)
+        {
+            return "final";
+        }
+    }
+
     private static class InvisibleEcho extends EchoImpl
     {
     }

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/TestProxyUtils.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/TestProxyUtils.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/TestProxyUtils.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/ProxyUtilsTest.java Sat Aug  3 15:44:17 2013
@@ -17,16 +17,22 @@
 
 package org.apache.commons.proxy2;
 
-import junit.framework.TestCase;
+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.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 
 import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Properties;
 
-public class TestProxyUtils extends TestCase
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+public class ProxyUtilsTest extends AbstractTestCase
 {
 //**********************************************************************************************************************
 // Fields
@@ -38,17 +44,20 @@ public class TestProxyUtils extends Test
 // Other Methods
 //**********************************************************************************************************************
 
-    protected void setUp() throws Exception
+    @Before
+    public void setUp() throws Exception
     {
         prevProperties = System.getProperties();
         System.setProperties(new Properties());
     }
 
-    protected void tearDown() throws Exception
+    @After
+    public void tearDown() throws Exception
     {
         System.setProperties(prevProperties);
     }
 
+    @Test
     public void testNullValue()
     {
         assertNullValue(null, String.class);
@@ -67,25 +76,7 @@ public class TestProxyUtils extends Test
         assertEquals(expected, ProxyUtils.nullValue(type));
     }
 
-    public void testCreateNullObject() throws Exception
-    {
-        /*final Echo nullEcho = ( Echo ) ProxyUtils
-                .createNullObject(new JavassistProxyFactory(), new Class[] {Echo.class});
-        assertNull(nullEcho.echoBack("hello"));
-        assertNull(nullEcho.echoBack("hello", "world"));
-        assertEquals(( int ) 0, nullEcho.echoBack(12345));*/
-    }
-
-    public void testCreateNullObjectWithClassLoader() throws Exception
-    {
-        /*final Echo nullEcho = ( Echo ) ProxyUtils.createNullObject(new JavassistProxyFactory(),
-                                                                   Echo.class.getClassLoader(),
-                                                                   new Class[] {Echo.class});
-        assertNull(nullEcho.echoBack("hello"));
-        assertNull(nullEcho.echoBack("hello", "world"));
-        assertEquals(( int ) 0, nullEcho.echoBack(12345));*/
-    }
-
+    @Test
     public void testGetAllInterfaces()
     {
         assertNull(ProxyUtils.getAllInterfaces(null));
@@ -93,6 +84,7 @@ public class TestProxyUtils extends Test
                      Arrays.asList(ProxyUtils.getAllInterfaces(EchoImpl.class)));
     }
 
+    @Test
     public void testGetJavaClassName() throws Exception
     {
         assertEquals("java.lang.Object[]", ProxyUtils.getJavaClassName(Object[].class));

Modified: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/AbstractExceptionClassTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/AbstractExceptionClassTestCase.java?rev=1510014&r1=1510013&r2=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/AbstractExceptionClassTestCase.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/AbstractExceptionClassTestCase.java Sat Aug  3 15:44:17 2013
@@ -17,13 +17,15 @@
 
 package org.apache.commons.proxy2.exception;
 
-import junit.framework.TestCase;
+import org.apache.commons.proxy2.util.AbstractTestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 /**
  * @author James Carman
  * @since 1.0
  */
-public abstract class AbstractExceptionClassTestCase extends TestCase
+public abstract class AbstractExceptionClassTestCase extends AbstractTestCase
 {
 //**********************************************************************************************************************
 // Fields
@@ -44,6 +46,7 @@ public abstract class AbstractExceptionC
 // Other Methods
 //**********************************************************************************************************************
 
+    @Test
     public void testCauseOnlyConstructor() throws Exception
     {
         final Exception cause = new Exception();
@@ -52,6 +55,7 @@ public abstract class AbstractExceptionC
         assertEquals(cause, e.getCause());
     }
 
+    @Test
     public void testMessageAndCauseConstructor() throws Exception
     {
         final Exception cause = new Exception();
@@ -61,6 +65,7 @@ public abstract class AbstractExceptionC
         assertEquals(cause, e.getCause());
     }
 
+    @Test
     public void testMessageOnlyConstructor() throws Exception
     {
         final String message = "message";
@@ -69,6 +74,7 @@ public abstract class AbstractExceptionC
         assertNull(e.getCause());
     }
 
+    @Test
     public void testNoArgConstructor() throws Exception
     {
         Exception e = ( Exception ) exceptionClass.getConstructor(new Class[] {}).newInstance(new Object[] {});

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/DelegateProviderExceptionTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestDelegateProviderException.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/DelegateProviderExceptionTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/DelegateProviderExceptionTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestDelegateProviderException.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestDelegateProviderException.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/DelegateProviderExceptionTest.java Sat Aug  3 15:44:17 2013
@@ -17,13 +17,13 @@
 
 package org.apache.commons.proxy2.exception;
 
-public class TestDelegateProviderException extends AbstractExceptionClassTestCase
+public class DelegateProviderExceptionTest extends AbstractExceptionClassTestCase
 {
 //**********************************************************************************************************************
 // Constructors
 //**********************************************************************************************************************
 
-    public TestDelegateProviderException()
+    public DelegateProviderExceptionTest()
     {
         super(ObjectProviderException.class);
     }

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/InvocationHandlerExceptionTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestInvocationHandlerException.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/InvocationHandlerExceptionTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/InvocationHandlerExceptionTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestInvocationHandlerException.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestInvocationHandlerException.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/InvocationHandlerExceptionTest.java Sat Aug  3 15:44:17 2013
@@ -17,13 +17,13 @@
 
 package org.apache.commons.proxy2.exception;
 
-public class TestInvocationHandlerException extends AbstractExceptionClassTestCase
+public class InvocationHandlerExceptionTest extends AbstractExceptionClassTestCase
 {
 //**********************************************************************************************************************
 // Constructors
 //**********************************************************************************************************************
 
-    public TestInvocationHandlerException()
+    public InvocationHandlerExceptionTest()
     {
         super(InvokerException.class);
     }

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/ProxyFactoryExceptionTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestProxyFactoryException.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/ProxyFactoryExceptionTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/ProxyFactoryExceptionTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestProxyFactoryException.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/TestProxyFactoryException.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/exception/ProxyFactoryExceptionTest.java Sat Aug  3 15:44:17 2013
@@ -21,13 +21,13 @@ package org.apache.commons.proxy2.except
  * @author James Carman
  * @since 1.0
  */
-public class TestProxyFactoryException extends AbstractExceptionClassTestCase
+public class ProxyFactoryExceptionTest extends AbstractExceptionClassTestCase
 {
 //**********************************************************************************************************************
 // Constructors
 //**********************************************************************************************************************
 
-    public TestProxyFactoryException()
+    public ProxyFactoryExceptionTest()
     {
         super(ProxyFactoryException.class);
     }

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/impl/MethodSignatureTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/impl/TestMethodSignature.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/impl/MethodSignatureTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/impl/MethodSignatureTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/impl/TestMethodSignature.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/impl/TestMethodSignature.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/impl/MethodSignatureTest.java Sat Aug  3 15:44:17 2013
@@ -17,16 +17,20 @@
 
 package org.apache.commons.proxy2.impl;
 
-import junit.framework.TestCase;
+import org.apache.commons.proxy2.util.AbstractTestCase;
 import org.apache.commons.proxy2.util.DuplicateEcho;
 import org.apache.commons.proxy2.util.Echo;
+import org.junit.Test;
 
-public class TestMethodSignature extends TestCase
+import static org.junit.Assert.*;
+
+public class MethodSignatureTest extends AbstractTestCase
 {
 //**********************************************************************************************************************
 // Other Methods
 //**********************************************************************************************************************
 
+    @Test
     public void testEquals() throws Exception
     {
         final MethodSignature sig = new MethodSignature(Echo.class.getMethod("echoBack", new Class[] {String.class}));

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/InterceptorUtilsTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestInterceptorUtils.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/InterceptorUtilsTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/InterceptorUtilsTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestInterceptorUtils.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestInterceptorUtils.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/InterceptorUtilsTest.java Sat Aug  3 15:44:17 2013
@@ -22,11 +22,15 @@ import org.apache.commons.proxy2.Invocat
 import org.apache.commons.proxy2.util.AbstractTestCase;
 import org.apache.commons.proxy2.util.Echo;
 import org.apache.commons.proxy2.util.MockInvocation;
+import org.junit.Test;
 
 import java.lang.reflect.Method;
 
-public class TestInterceptorUtils extends AbstractTestCase
+import static org.junit.Assert.*;
+
+public class InterceptorUtilsTest extends AbstractTestCase
 {
+    @Test
     public void testConstant() throws Throwable
     {
         Interceptor interceptor = InterceptorUtils.constant("Hello!");

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestObjectProviderInterceptor.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestObjectProviderInterceptor.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestObjectProviderInterceptor.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/ObjectProviderInterceptorTest.java Sat Aug  3 15:44:17 2013
@@ -19,28 +19,26 @@ package org.apache.commons.proxy2.interc
 
 import org.apache.commons.proxy2.provider.ObjectProviderUtils;
 import org.apache.commons.proxy2.util.AbstractTestCase;
+import org.junit.Test;
 
-public class TestObjectProviderInterceptor extends AbstractTestCase
+import static org.junit.Assert.*;
+
+public class ObjectProviderInterceptorTest extends AbstractTestCase
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Other Methods
 //----------------------------------------------------------------------------------------------------------------------
 
+    @Test
     public void testIntercept() throws Throwable
     {
         ObjectProviderInterceptor interceptor = new ObjectProviderInterceptor(ObjectProviderUtils.constant("Hello!"));
         assertEquals("Hello!", interceptor.intercept(null));
     }
 
+    @Test(expected = NullPointerException.class)
     public void testWithNullProvider()
     {
-        try
-        {
-            new ObjectProviderInterceptor(null);
-        }
-        catch (NullPointerException e)
-        {
-            assertEquals("Provider cannot be null.", e.getMessage());
-        }
+        new ObjectProviderInterceptor(null);
     }
 }

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/SwitchInterceptorTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestSwitchInterceptor.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/SwitchInterceptorTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/SwitchInterceptorTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestSwitchInterceptor.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/TestSwitchInterceptor.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/SwitchInterceptorTest.java Sat Aug  3 15:44:17 2013
@@ -22,17 +22,21 @@ import org.apache.commons.proxy2.interce
 import org.apache.commons.proxy2.util.AbstractTestCase;
 import org.apache.commons.proxy2.util.Echo;
 import org.apache.commons.proxy2.util.MockInvocation;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
 
 import java.lang.reflect.Method;
 
 import static org.apache.commons.proxy2.interceptor.InterceptorUtils.constant;
 
-public class TestSwitchInterceptor extends AbstractTestCase
+public class SwitchInterceptorTest extends AbstractTestCase
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Other Methods
 //----------------------------------------------------------------------------------------------------------------------
 
+    @Test
     public void testWithMultipleAdvices() throws Throwable
     {
         SwitchInterceptor interceptor = new SwitchInterceptor();
@@ -43,6 +47,7 @@ public class TestSwitchInterceptor exten
         assertEquals("baz", interceptor.intercept(invocation));
     }
 
+    @Test
     public void testWithNoAdvice() throws Throwable
     {
         SwitchInterceptor interceptor = new SwitchInterceptor();
@@ -51,6 +56,7 @@ public class TestSwitchInterceptor exten
         assertEquals("foo", interceptor.intercept(invocation));
     }
 
+    @Test
     public void testWithSingleAdviceWhichDoesNotMatch() throws Throwable
     {
         SwitchInterceptor interceptor = new SwitchInterceptor().when(new MethodNameMatcher("echoBackZZZZ")).then(constant("bar"));
@@ -59,6 +65,7 @@ public class TestSwitchInterceptor exten
         assertEquals("foo", interceptor.intercept(invocation));
     }
 
+    @Test
     public void testWithSingleAdviceWhichMatches() throws Throwable
     {
         SwitchInterceptor interceptor = new SwitchInterceptor().when(new MethodNameMatcher("echoBack")).then(constant("bar"));

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/MethodNameMatcherTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/TestMethodNameMatcher.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/MethodNameMatcherTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/MethodNameMatcherTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/TestMethodNameMatcher.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/TestMethodNameMatcher.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/MethodNameMatcherTest.java Sat Aug  3 15:44:17 2013
@@ -21,15 +21,19 @@ import org.apache.commons.proxy2.interce
 import org.apache.commons.proxy2.util.AbstractTestCase;
 import org.apache.commons.proxy2.util.Echo;
 import org.apache.commons.proxy2.util.MockInvocation;
+import org.junit.Test;
 
 import java.lang.reflect.Method;
 
-public class TestMethodNameMatcher extends AbstractTestCase
+import static org.junit.Assert.*;
+
+public class MethodNameMatcherTest extends AbstractTestCase
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Other Methods
 //----------------------------------------------------------------------------------------------------------------------
 
+    @Test
     public void testWithMatchingMethod() throws Exception
     {
         MethodNameMatcher matcher = new MethodNameMatcher("echo");
@@ -37,6 +41,7 @@ public class TestMethodNameMatcher exten
         assertTrue(matcher.matches(new MockInvocation(method,null)));
     }
 
+    @Test
     public void testWithNonMatchingMethod() throws Exception
     {
         MethodNameMatcher matcher = new MethodNameMatcher("foo");

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/ReturnTypeMatcherTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/TestReturnTypeMatcher.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/ReturnTypeMatcherTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/ReturnTypeMatcherTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/TestReturnTypeMatcher.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/TestReturnTypeMatcher.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/ReturnTypeMatcherTest.java Sat Aug  3 15:44:17 2013
@@ -22,16 +22,20 @@ import org.apache.commons.proxy2.interce
 import org.apache.commons.proxy2.util.AbstractTestCase;
 import org.apache.commons.proxy2.util.Echo;
 import org.apache.commons.proxy2.util.MockInvocation;
+import org.junit.Test;
 
 import java.io.Serializable;
 import java.lang.reflect.Method;
 
-public class TestReturnTypeMatcher extends AbstractTestCase
+import static org.junit.Assert.*;
+
+public class ReturnTypeMatcherTest extends AbstractTestCase
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Other Methods
 //----------------------------------------------------------------------------------------------------------------------
 
+    @Test
     public void testExactMatchNonMatching() throws Throwable
     {
         Method method = Echo.class.getMethod("echoBack", String.class);
@@ -40,6 +44,7 @@ public class TestReturnTypeMatcher exten
         assertFalse(matcher.matches(invocation));
     }
 
+    @Test
     public void testMatchVoid() throws Throwable
     {
         Method method = Echo.class.getMethod("echo");
@@ -48,6 +53,7 @@ public class TestReturnTypeMatcher exten
         assertTrue(matcher.matches(invocation));
     }
 
+    @Test
     public void testWithSupertypeMatch() throws Throwable
     {
         Method method = Echo.class.getMethod("echoBack", String.class);

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/BeanProviderTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestBeanProvider.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/BeanProviderTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/BeanProviderTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestBeanProvider.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestBeanProvider.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/BeanProviderTest.java Sat Aug  3 15:44:17 2013
@@ -19,54 +19,38 @@ package org.apache.commons.proxy2.provid
 
 import org.apache.commons.proxy2.exception.ObjectProviderException;
 import org.apache.commons.proxy2.util.AbstractTestCase;
+import org.junit.Test;
 
-public class TestBeanProvider extends AbstractTestCase
+public class BeanProviderTest extends AbstractTestCase
 {
 //**********************************************************************************************************************
 // Other Methods
 //**********************************************************************************************************************
 
+    @Test(expected = ObjectProviderException.class)
     public void testAbstractBeanClass()
     {
-        try
-        {
-            final BeanProvider<Number> p = new BeanProvider<Number>(Number.class);
-            p.getObject();
-            fail();
-        }
-        catch( ObjectProviderException e )
-        {
-        }
+        final BeanProvider<Number> p = new BeanProvider<Number>(Number.class);
+        p.getObject();
     }
 
+    @Test(expected = ObjectProviderException.class)
     public void testNonAccessibleConstructor()
     {
-        try
-        {
-            new BeanProvider<MyBean>(MyBean.class).getObject();
-            fail();
-        }
-        catch( ObjectProviderException e )
-        {
-        }
+        new BeanProvider<MyBean>(MyBean.class).getObject();
     }
 
+    @Test
     public void testSerialization()
     {
         assertSerializable(new BeanProvider<MyBean>(MyBean.class));
     }
 
+    @Test(expected = NullPointerException.class)
     public void testWithNullBeanClass()
     {
-        try
-        {
-            final BeanProvider<Object> p = new BeanProvider<Object>(null);
-            p.getObject();
-            fail("Should throw NullPointerException.");
-        }
-        catch( NullPointerException e )
-        {
-        }
+        final BeanProvider<Object> p = new BeanProvider<Object>(null);
+        p.getObject();
     }
 
 //**********************************************************************************************************************

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/CloningProviderTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestCloningProvider.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/CloningProviderTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/CloningProviderTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestCloningProvider.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestCloningProvider.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/CloningProviderTest.java Sat Aug  3 15:44:17 2013
@@ -19,33 +19,39 @@ package org.apache.commons.proxy2.provid
 
 import org.apache.commons.proxy2.exception.ObjectProviderException;
 import org.apache.commons.proxy2.util.AbstractTestCase;
+import org.junit.Test;
 
 import java.util.Date;
 
-public class TestCloningProvider extends AbstractTestCase
+import static org.junit.Assert.*;
+
+public class CloningProviderTest extends AbstractTestCase
 {
 //**********************************************************************************************************************
 // Other Methods
 //**********************************************************************************************************************
 
+    @Test
     public void testSerialization()
     {
         assertSerializable(new CloningProvider<Date>(new Date()));
     }
 
+    @Test
     public void testValidCloneable()
     {
         final Date now = new Date();
         final CloningProvider<Date> provider = new CloningProvider<Date>(now);
-        final Date clone1 = ( Date ) provider.getObject();
+        final Date clone1 = (Date) provider.getObject();
         assertEquals(now, clone1);
         assertNotSame(now, clone1);
-        final Date clone2 = ( Date ) provider.getObject();
+        final Date clone2 = (Date) provider.getObject();
         assertEquals(now, clone2);
         assertNotSame(now, clone2);
         assertNotSame(clone2, clone1);
     }
 
+    @Test
     public void testWithExceptionThrown()
     {
         final CloningProvider<ExceptionCloneable> provider = new CloningProvider<ExceptionCloneable>(new ExceptionCloneable());
@@ -54,35 +60,22 @@ public class TestCloningProvider extends
             provider.getObject();
             fail();
         }
-        catch( ObjectProviderException e )
+        catch (ObjectProviderException e)
         {
         }
     }
 
+    @Test(expected = IllegalArgumentException.class)
     public void testWithInvalidCloneable()
     {
-        final CloningProvider<InvalidCloneable> provider = new CloningProvider<InvalidCloneable>(new InvalidCloneable());
-        try
-        {
-            provider.getObject();
-            fail();
-        }
-        catch( ObjectProviderException e )
-        {
-        }
+        new CloningProvider<InvalidCloneable>(new InvalidCloneable());
     }
 
-    public void testWithPrivateCloneMethod()
+    @Test(expected = IllegalArgumentException.class)
+    public void testWithProtectedCloneMethod()
     {
-        final CloningProvider<PrivateCloneable> provider = new CloningProvider<PrivateCloneable>(new PrivateCloneable());
-        try
-        {
-            provider.getObject();
-            fail();
-        }
-        catch( ObjectProviderException e )
-        {
-        }
+        final CloningProvider<ProtectedCloneable> provider = new CloningProvider<ProtectedCloneable>(new ProtectedCloneable());
+        provider.getObject();
     }
 
 //**********************************************************************************************************************
@@ -101,7 +94,7 @@ public class TestCloningProvider extends
     {
     }
 
-    public static class PrivateCloneable implements Cloneable
+    public static class ProtectedCloneable implements Cloneable
     {
         protected Object clone()
         {

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/ConstantProviderTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestConstantProvider.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/ConstantProviderTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/ConstantProviderTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestConstantProvider.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestConstantProvider.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/ConstantProviderTest.java Sat Aug  3 15:44:17 2013
@@ -18,16 +18,20 @@
 package org.apache.commons.proxy2.provider;
 
 import org.apache.commons.proxy2.util.AbstractTestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
 
 /**
  * @since 1.0
  */
-public class TestConstantProvider extends AbstractTestCase
+public class ConstantProviderTest extends AbstractTestCase
 {
 //**********************************************************************************************************************
 // Other Methods
 //**********************************************************************************************************************
 
+    @Test
     public void testGetObject() throws Exception
     {
         final String s = "Hello, World!";
@@ -35,6 +39,7 @@ public class TestConstantProvider extend
         assertSame(s, provider.getObject());
     }
 
+    @Test
     public void testSerialization()
     {
         assertSerializable(new ConstantProvider<String>("Hello, World!"));

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/NullProviderTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestNullProvider.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/NullProviderTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/NullProviderTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestNullProvider.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestNullProvider.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/NullProviderTest.java Sat Aug  3 15:44:17 2013
@@ -18,23 +18,28 @@
 package org.apache.commons.proxy2.provider;
 
 import org.apache.commons.proxy2.util.AbstractTestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
 
 /**
  * @author James Carman
  * @since 1.0
  */
-public class TestNullProvider extends AbstractTestCase
+public class NullProviderTest extends AbstractTestCase
 {
 //**********************************************************************************************************************
 // Other Methods
 //**********************************************************************************************************************
 
+    @Test
     public void testGetObject()
     {
         final NullProvider<Object> provider = new NullProvider<Object>();
         assertNull(provider.getObject());
     }
 
+    @Test
     public void testSerialization()
     {
         assertSerializable(new NullProvider<Object>());

Copied: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/ObjectProviderUtilsTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestObjectProviderUtils.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/ObjectProviderUtilsTest.java?p2=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/ObjectProviderUtilsTest.java&p1=commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestObjectProviderUtils.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/TestObjectProviderUtils.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/provider/ObjectProviderUtilsTest.java Sat Aug  3 15:44:17 2013
@@ -19,31 +19,39 @@ package org.apache.commons.proxy2.provid
 
 import org.apache.commons.proxy2.util.AbstractTestCase;
 import org.apache.commons.proxy2.util.EchoImpl;
+import org.junit.Test;
 
 import java.util.Date;
 
-public class TestObjectProviderUtils extends AbstractTestCase
+import static org.junit.Assert.*;
+
+public class ObjectProviderUtilsTest extends AbstractTestCase
 {
+    @Test
     public void testBean() throws Exception
     {
         assertTrue(ObjectProviderUtils.bean(EchoImpl.class) instanceof BeanProvider);
     }
 
+    @Test
     public void testCloning() throws Exception
     {
         assertTrue(ObjectProviderUtils.cloning(new Date()) instanceof CloningProvider);
     }
 
+    @Test
     public void testConstant() throws Exception
     {
         assertTrue(ObjectProviderUtils.constant("Hello") instanceof ConstantProvider);
     }
 
+    @Test
     public void testNullValue() throws Exception
     {
         assertTrue(ObjectProviderUtils.nullValue() instanceof NullProvider);
     }
 
+    @Test
     public void testSingleton() throws Exception
     {
         assertTrue(ObjectProviderUtils.singleton(new ConstantProvider<Object>("Hello")) instanceof SingletonProvider);

Modified: commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/util/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/util/AbstractTestCase.java?rev=1510014&r1=1510013&r2=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/util/AbstractTestCase.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/core/src/test/java/org/apache/commons/proxy2/util/AbstractTestCase.java Sat Aug  3 15:44:17 2013
@@ -1,15 +1,16 @@
 package org.apache.commons.proxy2.util;
 
-import junit.framework.TestCase;
 import org.apache.commons.lang3.SerializationUtils;
 
 import java.io.Serializable;
 
+import static org.junit.Assert.*;
+
 /**
  * @author James Carman
  * @since 1.1
  */
-public abstract class AbstractTestCase extends TestCase
+public abstract class AbstractTestCase
 {
 //**********************************************************************************************************************
 // Other Methods

Copied: commons/proper/proxy/branches/version-2.0-work/javassist/src/test/java/org/apache/commons/proxy2/javassist/JavassistProxyFactoryTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/javassist/src/test/java/org/apache/commons/proxy2/javassist/TestJavassistProxyFactory.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/javassist/src/test/java/org/apache/commons/proxy2/javassist/JavassistProxyFactoryTest.java?p2=commons/proper/proxy/branches/version-2.0-work/javassist/src/test/java/org/apache/commons/proxy2/javassist/JavassistProxyFactoryTest.java&p1=commons/proper/proxy/branches/version-2.0-work/javassist/src/test/java/org/apache/commons/proxy2/javassist/TestJavassistProxyFactory.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/javassist/src/test/java/org/apache/commons/proxy2/javassist/TestJavassistProxyFactory.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/javassist/src/test/java/org/apache/commons/proxy2/javassist/JavassistProxyFactoryTest.java Sat Aug  3 15:44:17 2013
@@ -2,7 +2,7 @@ package org.apache.commons.proxy2.javass
 
 import org.apache.commons.proxy2.AbstractSubclassingProxyFactoryTestCase;
 
-public class TestJavassistProxyFactory extends AbstractSubclassingProxyFactoryTestCase
+public class JavassistProxyFactoryTest extends AbstractSubclassingProxyFactoryTestCase
 {
 //**********************************************************************************************************************
 // Constructors

Copied: commons/proper/proxy/branches/version-2.0-work/jdk/src/test/java/org/apache/commons/proxy2/jdk/JdkProxyFactoryTest.java (from r1509994, commons/proper/proxy/branches/version-2.0-work/jdk/src/test/java/org/apache/commons/proxy2/jdk/TestJdkProxyFactory.java)
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/jdk/src/test/java/org/apache/commons/proxy2/jdk/JdkProxyFactoryTest.java?p2=commons/proper/proxy/branches/version-2.0-work/jdk/src/test/java/org/apache/commons/proxy2/jdk/JdkProxyFactoryTest.java&p1=commons/proper/proxy/branches/version-2.0-work/jdk/src/test/java/org/apache/commons/proxy2/jdk/TestJdkProxyFactory.java&r1=1509994&r2=1510014&rev=1510014&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/jdk/src/test/java/org/apache/commons/proxy2/jdk/TestJdkProxyFactory.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/jdk/src/test/java/org/apache/commons/proxy2/jdk/JdkProxyFactoryTest.java Sat Aug  3 15:44:17 2013
@@ -2,6 +2,6 @@ package org.apache.commons.proxy2.jdk;
 
 import org.apache.commons.proxy2.AbstractProxyFactoryTestCase;
 
-public class TestJdkProxyFactory extends AbstractProxyFactoryTestCase
+public class JdkProxyFactoryTest extends AbstractProxyFactoryTestCase
 {
 }



Mime
View raw message