Author: dblevins
Date: Tue Feb 23 05:13:12 2010
New Revision: 915186

URL: http://svn.apache.org/viewvc?rev=915186&view=rev
Log:
Thinned out some unused methods, inlined some others

Modified:
    
openejb/trunk/openejb3/container/openejb-junit/src/main/java/org/apache/openejb/junit/OpenEjbRunner.java

Modified: 
openejb/trunk/openejb3/container/openejb-junit/src/main/java/org/apache/openejb/junit/OpenEjbRunner.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-junit/src/main/java/org/apache/openejb/junit/OpenEjbRunner.java?rev=915186&r1=915185&r2=915186&view=diff
==============================================================================
--- 
openejb/trunk/openejb3/container/openejb-junit/src/main/java/org/apache/openejb/junit/OpenEjbRunner.java
 (original)
+++ 
openejb/trunk/openejb3/container/openejb-junit/src/main/java/org/apache/openejb/junit/OpenEjbRunner.java
 Tue Feb 23 05:13:12 2010
@@ -31,9 +31,6 @@
 import java.util.Arrays;
 
 /**
- * To make your own runner, extend this class replacing {...@link 
#newTestContext(String)}  }
- * and {...@link #newTestContext(java.lang.reflect.Method, String)}  }, which
- * would return an implementation of {...@link TestContext}
  *
  * @author quintin
  */
@@ -57,6 +54,7 @@
      * @throws InitializationError
      */
     public OpenEjbRunner(Class<?> testClazz) throws InitializationError {
+        this.testClazz = testClazz;
         try {
             delegate = getDelegateRunner(testClazz);
         }
@@ -82,34 +80,6 @@
     }
 
     /**
-     * @return a new class level context
-     * @see #newTestContext(java.lang.String)
-     */
-    public TestContext newTestContext() {
-        return newTestContext((String) null);
-    }
-
-    /**
-     * This implementation returns a singleton context. Contexts can be reused 
and aren't
-     * attached to a specific instance, so in cases where none of the test's 
methods
-     * have their own configurations, we don't need to construct a new context 
with
-     * every call. This counts even for classes where only some methods have 
their
-     * own contexts, we still benefit from reuse. In those few cases where 
there is
-     * only a single method that doesn't have configuration, we might store the
-     * context for no reason, and not free the memory throughout the run, 
though this
-     * is probably quite rare and doesn't really matter.
-     *
-     * @param roleName
-     * @return a new class level context
-     */
-    public TestContext newTestContext(String roleName) {
-        if (classTestContext == null) {
-            classTestContext = new OpenEjbTestContext(testClazz);
-        }
-        return classTestContext;
-    }
-
-    /**
      * @param method
      * @param method
      * @return a new method level context
@@ -135,7 +105,10 @@
      */
     public TestContext newTestContext(Method method, String roleName) {
         if (method == null) {
-            return newTestContext(roleName);
+            if (classTestContext == null) {
+                classTestContext = new OpenEjbTestContext(testClazz);
+            }
+            return classTestContext;
         } else {
             return new OpenEjbTestContext(method, roleName);
         }


Reply via email to