Author: sebb
Date: Fri Aug 14 21:46:02 2009
New Revision: 804389

URL: http://svn.apache.org/viewvc?rev=804389&view=rev
Log:
Fix varargs method

Modified:
    
jakarta/jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/sampler/JUnitSampler.java
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
    jakarta/jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java

Modified: 
jakarta/jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/sampler/JUnitSampler.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/sampler/JUnitSampler.java?rev=804389&r1=804388&r2=804389&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/sampler/JUnitSampler.java
 (original)
+++ 
jakarta/jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/sampler/JUnitSampler.java
 Fri Aug 14 21:46:02 2009
@@ -335,7 +335,7 @@
 
                 if (!getDoNotSetUpTearDown() && SETUP_METHOD != null){
                     try {
-                        SETUP_METHOD.invoke(this.TEST_INSTANCE,new Class[0]);
+                        SETUP_METHOD.invoke(this.TEST_INSTANCE,new Object[0]);
                     } catch (InvocationTargetException e) {
                         tr.addFailure(this.TEST_INSTANCE,
                                 new AssertionFailedError(e.getMessage()));
@@ -357,7 +357,7 @@
                 // will include setup and teardown.
                 Protectable p = new Protectable() {
                     public void protect() throws Throwable {
-                        m.invoke(theClazz,new Class[0]);
+                        m.invoke(theClazz,new Object[0]);
                     }
                 };
                 tr.runProtected(theClazz, p);
@@ -365,7 +365,7 @@
                 sresult.sampleEnd();
 
                 if (!getDoNotSetUpTearDown() && TDOWN_METHOD != null){
-                    TDOWN_METHOD.invoke(TEST_INSTANCE,new Class[0]);
+                    TDOWN_METHOD.invoke(TEST_INSTANCE,new Object[0]);
                 }
             } catch (InvocationTargetException e) {
                 // log.warn(e.getMessage());

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java?rev=804389&r1=804388&r2=804389&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
 Fri Aug 14 21:46:02 2009
@@ -102,7 +102,7 @@
             return;
         }
         try {
-            method.invoke(conn, new Integer[]{new Integer(timeout)});
+            method.invoke(conn, new Object[]{new Integer(timeout)});
         } catch (IllegalArgumentException e1) {
             log.warn("Failed to set timeout: "+e1);
         } catch (IllegalAccessException e1) {

Modified: jakarta/jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java?rev=804389&r1=804388&r2=804389&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java 
(original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java Fri Aug 
14 21:46:02 2009
@@ -316,14 +316,14 @@
         int suites=0;
         try {
             log.info("ClassFinder(TestCase)");
-            List classList = 
ClassFinder.findClassesThatExtend(JOrphanUtils.split(searchPaths, ","),
+            List<String> classList = 
ClassFinder.findClassesThatExtend(JOrphanUtils.split(searchPaths, ","),
                     new Class[] { TestCase.class }, true);
             int sz=classList.size();
             log.info("ClassFinder(TestCase) found: "+sz+ " TestCase classes");
             System.out.println("ClassFinder found: "+sz+ " TestCase classes");
-            Iterator classes = classList.iterator();
+            Iterator<String> classes = classList.iterator();
             while (classes.hasNext()) {
-                String name = (String) classes.next();
+                String name = classes.next();
                 try {
                     /*
                      * TestSuite only finds testXXX() methods, and does not 
look
@@ -335,11 +335,11 @@
                      * 
                      */
 
-                    Class clazz = Class.forName(name);
+                    Class<?> clazz = Class.forName(name);
                     Test t = null;
                     try {
                         Method m = clazz.getMethod("suite", new Class[0]);
-                        t = (Test) m.invoke(clazz, null);
+                        t = (Test) m.invoke(clazz, (Object[])null);
                         suites++;
                     } catch (NoSuchMethodException e) {
                     } // this is not an error, the others are



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscr...@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-h...@jakarta.apache.org

Reply via email to