[testng] 204/355: Remove unused parameters and methods

Eugene Zhukov eugene-guest at moszumanska.debian.org
Tue Aug 18 10:20:05 UTC 2015


This is an automated email from the git hooks/post-receive script.

eugene-guest pushed a commit to annotated tag OpenBSD
in repository testng.

commit 00234ed4e19c38374d0bbd5bc2de771c90b16209
Author: Julien Herr <julien.herr at alcatel-lucent.com>
Date:   Wed Apr 22 23:04:30 2015 +0200

    Remove unused parameters and methods
---
 .../java/org/testng/internal/InvokedMethod.java    |  6 ----
 src/main/java/org/testng/internal/Invoker.java     | 39 +---------------------
 .../java/org/testng/junit/JUnit4TestRunner.java    |  2 +-
 .../java/org/testng/junit/JUnitTestRunner.java     |  2 +-
 4 files changed, 3 insertions(+), 46 deletions(-)

diff --git a/src/main/java/org/testng/internal/InvokedMethod.java b/src/main/java/org/testng/internal/InvokedMethod.java
index 36d4048..d97da6c 100755
--- a/src/main/java/org/testng/internal/InvokedMethod.java
+++ b/src/main/java/org/testng/internal/InvokedMethod.java
@@ -11,8 +11,6 @@ public class InvokedMethod implements Serializable, IInvokedMethod {
   transient private Object m_instance;
   private ITestNGMethod m_testMethod;
   private Object[] m_parameters;
-  private boolean m_isTest = true;
-  private boolean m_isConfigurationMethod = false;
   private long m_date = System.currentTimeMillis();
   private ITestResult m_testResult;
 
@@ -24,15 +22,11 @@ public class InvokedMethod implements Serializable, IInvokedMethod {
   public InvokedMethod(Object instance,
                        ITestNGMethod method,
                        Object[] parameters,
-                       boolean isTest,
-                       boolean isConfiguration,
                        long date,
                        ITestResult testResult) {
     m_instance = instance;
     m_testMethod = method;
     m_parameters = parameters;
-    m_isTest = isTest;
-    m_isConfigurationMethod = isConfiguration;
     m_date = date;
     m_testResult = testResult;
   }
diff --git a/src/main/java/org/testng/internal/Invoker.java b/src/main/java/org/testng/internal/Invoker.java
index 3133eb5..8a15ae7 100644
--- a/src/main/java/org/testng/internal/Invoker.java
+++ b/src/main/java/org/testng/internal/Invoker.java
@@ -187,8 +187,6 @@ public class Invoker implements IInvoker {
           configurationAnnotation = AnnotationHelper.findConfiguration(m_annotationFinder, method);
 
           if (MethodHelper.isEnabled(configurationAnnotation)) {
-            boolean isClassConfiguration = isClassConfiguration(configurationAnnotation);
-            boolean isSuiteConfiguration = isSuiteConfiguration(configurationAnnotation);
             boolean alwaysRun= isAlwaysRun(configurationAnnotation);
 
             if (!confInvocationPassed(tm, currentTestMethod, testClass, instance) && !alwaysRun) {
@@ -213,7 +211,7 @@ public class Invoker implements IInvoker {
             runConfigurationListeners(testResult, true /* before */);
 
             invokeConfigurationMethod(newInstance, tm,
-              parameters, isClassConfiguration, isSuiteConfiguration, testResult);
+              parameters, testResult);
 
             // TODO: probably we should trigger the event for each instance???
             testResult.setEndMillis(System.currentTimeMillis());
@@ -264,34 +262,6 @@ public class Invoker implements IInvoker {
   }
 
   /**
-   * Is the current <code>IConfiguration</code> a class-level method.
-   */
-  private  boolean isClassConfiguration(IConfigurationAnnotation configurationAnnotation) {
-    if (null == configurationAnnotation) {
-      return false;
-    }
-
-    boolean before = configurationAnnotation.getBeforeTestClass();
-    boolean after = configurationAnnotation.getAfterTestClass();
-
-    return before || after;
-  }
-
-  /**
-   * Is the current <code>IConfiguration</code> a suite level method.
-   */
-  private  boolean isSuiteConfiguration(IConfigurationAnnotation configurationAnnotation) {
-    if (null == configurationAnnotation) {
-      return false;
-    }
-
-    boolean before = configurationAnnotation.getBeforeSuite();
-    boolean after = configurationAnnotation.getAfterSuite();
-
-    return before || after;
-  }
-
-  /**
    * Is the <code>IConfiguration</code> marked as alwaysRun.
    */
   private boolean isAlwaysRun(IConfigurationAnnotation configurationAnnotation) {
@@ -503,7 +473,6 @@ public class Invoker implements IInvoker {
    * @param targetInstance the instance to invoke the configuration method on
    * @param tm the configuration method
    * @param params the parameters needed for method invocation
-   * @param isClass flag if the configuration method is a class level method // FIXME: this looks like a missusage
    * @param testResult
    * @throws InvocationTargetException
    * @throws IllegalAccessException
@@ -511,8 +480,6 @@ public class Invoker implements IInvoker {
   private void invokeConfigurationMethod(Object targetInstance,
                                          ITestNGMethod tm,
                                          Object[] params,
-                                         boolean isClass,
-                                         boolean isSuite,
                                          ITestResult testResult)
     throws InvocationTargetException, IllegalAccessException
   {
@@ -523,8 +490,6 @@ public class Invoker implements IInvoker {
       InvokedMethod invokedMethod= new InvokedMethod(targetInstance,
                                           tm,
                                           params,
-                                          false, /* isTest */
-                                          isClass, /* ??? */
                                           System.currentTimeMillis(),
                                           testResult);
 
@@ -656,8 +621,6 @@ public class Invoker implements IInvoker {
       invokedMethod= new InvokedMethod(instance,
           tm,
           parameterValues,
-          true /* isTest */,
-          false /* isConfiguration */,
           System.currentTimeMillis(),
           testResult);
 
diff --git a/src/main/java/org/testng/junit/JUnit4TestRunner.java b/src/main/java/org/testng/junit/JUnit4TestRunner.java
index 2b81fcc..ef627f2 100644
--- a/src/main/java/org/testng/junit/JUnit4TestRunner.java
+++ b/src/main/java/org/testng/junit/JUnit4TestRunner.java
@@ -198,7 +198,7 @@ public class JUnit4TestRunner implements IJUnitTestRunner {
                     0,
                     null);
 
-            InvokedMethod im = new InvokedMethod(tr.getTestClass(), tr.getMethod(), new Object[0], true, false, tr.getStartMillis(), tr);
+            InvokedMethod im = new InvokedMethod(tr.getTestClass(), tr.getMethod(), new Object[0], tr.getStartMillis(), tr);
             m_parentRunner.addInvokedMethod(im);
             for (IInvokedMethodListener l: m_invokeListeners) {
                 l.beforeInvocation(im, tr);
diff --git a/src/main/java/org/testng/junit/JUnitTestRunner.java b/src/main/java/org/testng/junit/JUnitTestRunner.java
index ac44b62..402d530 100755
--- a/src/main/java/org/testng/junit/JUnitTestRunner.java
+++ b/src/main/java/org/testng/junit/JUnitTestRunner.java
@@ -133,7 +133,7 @@ public class JUnitTestRunner implements TestListener, IJUnitTestRunner {
       m_parentRunner.addPassedTest(tm, tr);
     }
 
-    InvokedMethod im = new InvokedMethod(test, tm, new Object[0], true, false, tri.m_start, tr);
+    InvokedMethod im = new InvokedMethod(test, tm, new Object[0], tri.m_start, tr);
     m_parentRunner.addInvokedMethod(im);
     m_methods.add(tm);
     for (IInvokedMethodListener l: m_invokedMethodListeners) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/testng.git



More information about the pkg-java-commits mailing list