vmassol 2004/04/09 09:52:00
Modified: framework/src/java/share/org/apache/cactus/util
JUnitVersionHelper.java
framework/src/java/share/org/apache/cactus/internal/client
ClientTestCaseCaller.java
framework/src/java/share/org/apache/cactus
AbstractTestSuite.java
Log:
fixed PMD-reported errors
Revision Changes Path
1.11 +7 -3
jakarta-cactus/framework/src/java/share/org/apache/cactus/util/JUnitVersionHelper.java
Index: JUnitVersionHelper.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/util/JUnitVersionHelper.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- JUnitVersionHelper.java 29 Feb 2004 09:42:33 -0000 1.10
+++ JUnitVersionHelper.java 9 Apr 2004 16:52:00 -0000 1.11
@@ -69,7 +69,7 @@
*/
public static String getTestCaseName(Test theTest)
{
- String name = "unknown";
+ String name;
if (theTest instanceof TestCase && (testCaseName != null))
{
@@ -79,8 +79,12 @@
}
catch (Throwable e)
{
- // We return "unknown"
+ name = "unknown";
}
+ }
+ else
+ {
+ name = "unknown";
}
return name;
1.5 +1 -36
jakarta-cactus/framework/src/java/share/org/apache/cactus/internal/client/ClientTestCaseCaller.java
Index: ClientTestCaseCaller.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/internal/client/ClientTestCaseCaller.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ClientTestCaseCaller.java 16 Mar 2004 21:45:02 -0000 1.4
+++ ClientTestCaseCaller.java 9 Apr 2004 16:52:00 -0000 1.5
@@ -29,7 +29,6 @@
import org.apache.cactus.client.ResponseObjectFactory;
import org.apache.cactus.client.connector.ProtocolHandler;
import org.apache.cactus.client.connector.ProtocolState;
-import org.apache.cactus.configuration.Configuration;
import org.apache.cactus.util.JUnitVersionHelper;
import org.apache.cactus.util.TestCaseImplementChecker;
import org.apache.commons.logging.Log;
@@ -79,11 +78,6 @@
private Log logger;
/**
- * The Cactus configuration.
- */
- private Configuration configuration;
-
- /**
* Pure JUnit Test Case that we are wrapping (if any)
*/
private Test wrappedTest;
@@ -462,15 +456,6 @@
}
/**
- * @see #getCurrentTestName()
- * @deprecated Use [EMAIL PROTECTED] #getCurrentTestName()} instead
- */
- private String getCurrentTestMethod()
- {
- return getCurrentTestName();
- }
-
- /**
* @return the name of the current test case being executed (it corresponds
* to the name of the test method with the "test" prefix removed.
* For example, for "testSomeTestOk" would return "someTestOk".
@@ -478,25 +463,5 @@
private String getCurrentTestName()
{
return JUnitVersionHelper.getTestCaseName(getDelegatedTest());
- }
-
- /**
- * @return The wrapped test name, if any (null otherwise).
- */
- private String getWrappedTestName()
- {
- if (isWrappingATest())
- {
- return getWrappedTest().getClass().getName();
- }
- return null;
- }
-
- /**
- * @return whether this test case wraps another
- */
- private boolean isWrappingATest()
- {
- return (getWrappedTest() != null);
}
}
1.9 +5 -5
jakarta-cactus/framework/src/java/share/org/apache/cactus/AbstractTestSuite.java
Index: AbstractTestSuite.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/AbstractTestSuite.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- AbstractTestSuite.java 29 Feb 2004 09:42:32 -0000 1.8
+++ AbstractTestSuite.java 9 Apr 2004 16:52:00 -0000 1.9
@@ -277,16 +277,16 @@
public static Constructor getTestConstructor(Class theClass)
throws NoSuchMethodException
{
- Class[] args = {String.class};
+ Constructor result;
try
{
- return theClass.getConstructor(args);
+ result = theClass.getConstructor(new Class[] {String.class});
}
catch (NoSuchMethodException e)
{
- // fall through
+ result = theClass.getConstructor(new Class[0]);
}
- return theClass.getConstructor(new Class[0]);
+ return result;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]