commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1580986 - in /commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub: AbstractProxyFactoryAgnosticTest.java AbstractStubTestCase.java
Date Mon, 24 Mar 2014 18:42:57 GMT
Author: mbenson
Date: Mon Mar 24 18:42:56 2014
New Revision: 1580986

URL: http://svn.apache.org/r1580986
Log:
extracted AbstractProxyFactoryAgnosticTest

Added:
    commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractProxyFactoryAgnosticTest.java
  (with props)
Modified:
    commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractStubTestCase.java

Added: commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractProxyFactoryAgnosticTest.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractProxyFactoryAgnosticTest.java?rev=1580986&view=auto
==============================================================================
--- commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractProxyFactoryAgnosticTest.java
(added)
+++ commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractProxyFactoryAgnosticTest.java
Mon Mar 24 18:42:56 2014
@@ -0,0 +1,50 @@
+/*
+ * 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.stub;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.proxy2.ProxyFactory;
+import org.apache.commons.proxy2.asm4.ASM4ProxyFactory;
+import org.apache.commons.proxy2.cglib.CglibProxyFactory;
+import org.apache.commons.proxy2.javassist.JavassistProxyFactory;
+import org.apache.commons.proxy2.jdk.JdkProxyFactory;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Conveniently defines the setup for a unit test class that runs with all known {@link ProxyFactory}
implementations.
+ */
+@RunWith(Parameterized.class)
+public abstract class AbstractProxyFactoryAgnosticTest {
+
+    @Parameters(name = "{0}")
+    public static List<Object[]> createParameters() {
+        final List<Object[]> result = new ArrayList<Object[]>();
+        result.add(new Object[] { new JdkProxyFactory() });
+        result.add(new Object[] { new CglibProxyFactory() });
+        result.add(new Object[] { new JavassistProxyFactory() });
+        result.add(new Object[] { new ASM4ProxyFactory() });
+        return result;
+    }
+
+    @Parameter
+    public ProxyFactory proxyFactory;
+}

Propchange: commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractProxyFactoryAgnosticTest.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractStubTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractStubTestCase.java?rev=1580986&r1=1580985&r2=1580986&view=diff
==============================================================================
--- commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractStubTestCase.java
(original)
+++ commons/proper/proxy/trunk/test/src/test/java/org/apache/commons/proxy2/stub/AbstractStubTestCase.java
Mon Mar 24 18:42:56 2014
@@ -5,33 +5,19 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.List;
 
-import org.apache.commons.proxy2.ProxyFactory;
-import org.apache.commons.proxy2.asm4.ASM4ProxyFactory;
-import org.apache.commons.proxy2.cglib.CglibProxyFactory;
 import org.apache.commons.proxy2.invoker.NullInvoker;
-import org.apache.commons.proxy2.javassist.JavassistProxyFactory;
-import org.apache.commons.proxy2.jdk.JdkProxyFactory;
 import org.apache.commons.proxy2.provider.ObjectProviderUtils;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameter;
-import org.junit.runners.Parameterized.Parameters;
 
-@RunWith(Parameterized.class)
-public abstract class AbstractStubTestCase
+public abstract class AbstractStubTestCase extends AbstractProxyFactoryAgnosticTest
 {
     // ----------------------------------------------------------------------------------------------------------------------
     // Fields
     // ----------------------------------------------------------------------------------------------------------------------
 
-    @Parameter
-    public ProxyFactory proxyFactory;
     protected StubInterface target;
 
     // ----------------------------------------------------------------------------------------------------------------------
@@ -44,16 +30,6 @@ public abstract class AbstractStubTestCa
     // Other Methods
     // ----------------------------------------------------------------------------------------------------------------------
 
-    @Parameters(name = "{0}")
-    public static List<Object[]> createParameters() {
-        final List<Object[]> result = new ArrayList<Object[]>();
-        result.add(new Object[] { new JdkProxyFactory() });
-        result.add(new Object[] { new CglibProxyFactory() });
-        result.add(new Object[] { new JavassistProxyFactory() });
-        result.add(new Object[] { new ASM4ProxyFactory() });
-        return result;
-    }
-
     @Before
     public final void setUpProxyFactory()
     {



Mime
View raw message