Author: brett
Date: Sun Apr 30 18:13:13 2006
New Revision: 398490
URL: http://svn.apache.org/viewcvs?rev=398490&view=rev
Log:
put the nested exceptions back in surefire - they're zero maintenance. Reuse
plexus utils for split and replace
Added:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java
(with props)
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
(with props)
Removed:
maven/surefire/branches/surefire-testng/surefire-booter/src/test/
Modified:
maven/surefire/branches/surefire-testng/surefire-api/pom.xml
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/assertion/SurefireAssertionFailedException.java
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterException.java
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestSetFailedException.java
maven/surefire/branches/surefire-testng/surefire-api/src/test/java/org/apache/maven/surefire/report/XMLReporterTest.java
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireExecutionException.java
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/shell/Shell.java
Modified: maven/surefire/branches/surefire-testng/surefire-api/pom.xml
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-api/pom.xml?rev=398490&r1=398489&r2=398490&view=diff
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire-api/pom.xml (original)
+++ maven/surefire/branches/surefire-testng/surefire-api/pom.xml Sun Apr 30
18:13:13 2006
@@ -16,8 +16,8 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>surefire</artifactId>
<groupId>org.apache.maven.surefire</groupId>
@@ -31,11 +31,6 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.util</groupId>
- <artifactId>jdk13-util</artifactId>
- <version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Modified:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/assertion/SurefireAssertionFailedException.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/assertion/SurefireAssertionFailedException.java?rev=398490&r1=398489&r2=398490&view=diff
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/assertion/SurefireAssertionFailedException.java
(original)
+++
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/assertion/SurefireAssertionFailedException.java
Sun Apr 30 18:13:13 2006
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-import org.apache.maven.util.jdk13.NestedRuntimeException;
+import org.apache.maven.surefire.util.NestedRuntimeException;
/**
* @noinspection UncheckedExceptionClass
Modified:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterException.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterException.java?rev=398490&r1=398489&r2=398490&view=diff
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterException.java
(original)
+++
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterException.java
Sun Apr 30 18:13:13 2006
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-import org.apache.maven.util.jdk13.NestedCheckedException;
+import org.apache.maven.surefire.util.NestedCheckedException;
/**
* Exception occurring during report generation.
Modified:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java?rev=398490&r1=398489&r2=398490&view=diff
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java
(original)
+++
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java
Sun Apr 30 18:13:13 2006
@@ -17,6 +17,7 @@
*/
import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.Xpp3DomWriter;
@@ -42,7 +43,7 @@
extends AbstractReporter
{
- private static final String LS = System.getProperty("line.separator");
+ private static final String LS = System.getProperty( "line.separator" );
private PrintWriter writer;
@@ -194,7 +195,7 @@
if ( message != null && message.trim().length() > 0 )
{
- element.setAttribute( "message", escapeAttribute( message ));
+ element.setAttribute( "message", escapeAttribute( message ) );
element.setAttribute( "type", stackTrace.substring( 0,
stackTrace.indexOf( ":" ) ) );
}
@@ -269,42 +270,9 @@
private static String escapeAttribute( String attribute )
{
// Shouldn't Xpp3Dom do this itself?
- String s = replaceAll( attribute, "<", "<" );
- s = replaceAll( s, ">", ">" );
+ String s = StringUtils.replace( attribute, "<", "<" );
+ s = StringUtils.replace( s, ">", ">" );
return s;
}
-
- /**
- * Replace all ocurrences of a value in a string. Same as Java 1.4
String.replaceAll( String, String )
- *
- * @param s the string to search into
- * @param from original String to look for
- * @param to String to change for
- * @return the modified String
- */
- public static String replaceAll( String source, String pattern, String
replace )
- {
- if ( ( source != null ) && ( pattern.length() > 0 ) )
- {
- final int len = pattern.length();
- StringBuffer sb = new StringBuffer();
- int found = -1;
- int start = 0;
-
- while ( ( found = source.indexOf( pattern, start ) ) != -1 )
- {
- sb.append( source.substring( start, found ) );
- sb.append( replace );
- start = found + len;
- }
-
- sb.append( source.substring( start ) );
-
- return sb.toString();
- }
- else
- return "";
- }
-
}
Modified:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestSetFailedException.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestSetFailedException.java?rev=398490&r1=398489&r2=398490&view=diff
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestSetFailedException.java
(original)
+++
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestSetFailedException.java
Sun Apr 30 18:13:13 2006
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-import org.apache.maven.util.jdk13.NestedCheckedException;
+import org.apache.maven.surefire.util.NestedCheckedException;
/**
* Exception that indicates a test failed.
Added:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java?rev=398490&view=auto
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java
(added)
+++
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java
Sun Apr 30 18:13:13 2006
@@ -0,0 +1,222 @@
+package org.apache.maven.surefire.util;
+
+/*
+ * Copyright 2002-2005 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+/*
+ * Some portions are
+ *
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
+/**
+ * <p>Copied from Spring framework to keep Java 1.3 compatability.</p>
+ * <p/>
+ * <p>Handy class for wrapping checked Exceptions with a root cause.</p>
+ * <p/>
+ * <p>This time-honored technique is no longer necessary in Java 1.4, which
+ * finally provides built-in support for exception nesting. Thus exceptions in
+ * applications written to use Java 1.4 need not extend this class. To ease
+ * migration, this class mirrors Java 1.4's nested exceptions as closely as
possible.
+ * <p/>
+ * <p>Abstract to force the programmer to extend the class.
<code>getMessage</code>
+ * will include nested exception information; <code>printStackTrace</code> etc
will
+ * delegate to the wrapped exception, if any.
+ * <p/>
+ * <p>The similarity between this class and the NestedRuntimeException class is
+ * unavoidable, as Java forces these two classes to have different superclasses
+ * (ah, the inflexibility of concrete inheritance!).
+ * <p/>
+ * <p>As discussed in
+ * <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/">Expert
One-On-One J2EE Design and Development</a>,
+ * runtime exceptions are often a better alternative to checked exceptions.
+ * However, all exceptions should preserve their stack trace, if caused by a
+ * lower-level exception.
+ *
+ * @author Rod Johnson
+ * @author Juergen Hoeller
+ * @see #getMessage
+ * @see #printStackTrace
+ * @see NestedRuntimeException
+ */
+public class NestedCheckedException
+ extends Exception
+{
+
+ /**
+ * Root cause of this nested exception
+ */
+ private Throwable cause;
+
+ /**
+ * Construct a <code>NestedCheckedException</code> with no message or
exception
+ */
+ public NestedCheckedException()
+ {
+ super();
+ }
+
+ /**
+ * Construct a <code>NestedCheckedException</code> with the specified
detail message.
+ *
+ * @param msg the detail message
+ */
+ public NestedCheckedException( String msg )
+ {
+ super( msg );
+ }
+
+ /**
+ * Construct a <code>NestedCheckedException</code> with the specified
detail message
+ * and nested exception.
+ *
+ * @param msg the detail message
+ * @param ex the nested exception
+ */
+ public NestedCheckedException( String msg, Throwable ex )
+ {
+ super( msg );
+ this.cause = ex;
+ }
+
+ /**
+ * Construct a <code>NestedCheckedException</code> with the specified
nested exception.
+ *
+ * @param ex the nested exception
+ */
+ public NestedCheckedException( Throwable ex )
+ {
+ super();
+ this.cause = ex;
+ }
+
+ /**
+ * Return the nested cause, or <code>null</code> if none.
+ */
+ public Throwable getCause()
+ {
+ // Even if you cannot set the cause of this exception other than
through
+ // the constructor, we check for the cause being "this" here, as the
cause
+ // could still be set to "this" via reflection: for example, by a
remoting
+ // deserializer like Hessian's.
+ return ( this.cause == this ? null : this.cause );
+ }
+
+ /**
+ * Return the detail message, including the message from the nested
exception
+ * if there is one.
+ */
+ public String getMessage()
+ {
+ if ( getCause() == null )
+ {
+ return super.getMessage();
+ }
+ else
+ {
+ return super.getMessage() + "; nested exception is " +
getCause().getClass().getName() + ": " +
+ getCause().getMessage();
+ }
+ }
+
+ /**
+ * Print the composite message and the embedded stack trace to the
specified stream.
+ *
+ * @param ps the print stream
+ */
+ public void printStackTrace( PrintStream ps )
+ {
+ if ( getCause() == null )
+ {
+ super.printStackTrace( ps );
+ }
+ else
+ {
+ ps.println( this );
+ getCause().printStackTrace( ps );
+ }
+ }
+
+ /**
+ * Print the composite message and the embedded stack trace to the
specified print writer.
+ *
+ * @param pw the print writer
+ */
+ public void printStackTrace( PrintWriter pw )
+ {
+ if ( getCause() == null )
+ {
+ super.printStackTrace( pw );
+ }
+ else
+ {
+ pw.println( this );
+ getCause().printStackTrace( pw );
+ }
+ }
+
+ /**
+ * Check whether this exception contains an exception of the given class:
+ * either it is of the given class itself or it contains a nested cause
+ * of the given class.
+ * <p>Currently just traverses NestedCheckedException causes. Will use
+ * the JDK 1.4 exception cause mechanism once Spring requires JDK 1.4.
+ *
+ * @param exClass the exception class to look for
+ */
+ public boolean contains( Class exClass )
+ {
+ if ( exClass == null )
+ {
+ return false;
+ }
+ Throwable ex = this;
+ while ( ex != null )
+ {
+ if ( exClass.isInstance( ex ) )
+ {
+ return true;
+ }
+ if ( ex instanceof NestedCheckedException )
+ {
+ // Cast is necessary on JDK 1.3, where Throwable does not
+ // provide a "getCause" method itself.
+ ex = ( (NestedCheckedException) ex ).getCause();
+ }
+ else
+ {
+ ex = null;
+ }
+ }
+ return false;
+ }
+
+}
Propchange:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java?rev=398490&view=auto
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
(added)
+++
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
Sun Apr 30 18:13:13 2006
@@ -0,0 +1,240 @@
+package org.apache.maven.surefire.util;
+
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+/*
+ * Some portions are
+ *
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
+/**
+ * <p>Copied from Spring framework to keep Java 1.3 compatability.</p>
+ * <p/>
+ * <p>Handy class for wrapping runtime Exceptions with a root cause.</p>
+ * <p/>
+ * <p>This time-honoured technique is no longer necessary in Java 1.4, which
+ * finally provides built-in support for exception nesting. Thus exceptions in
+ * applications written to use Java 1.4 need not extend this class. To ease
+ * migration, this class mirrors Java 1.4's nested exceptions as closely as
possible.
+ * <p/>
+ * <p>Abstract to force the programmer to extend the class.
<code>getMessage</code>
+ * will include nested exception information; <code>printStackTrace</code> etc
will
+ * delegate to the wrapped exception, if any.
+ * <p/>
+ * <p>The similarity between this class and the NestedCheckedException class is
+ * unavoidable, as Java forces these two classes to have different superclasses
+ * (ah, the inflexibility of concrete inheritance!).
+ * <p/>
+ * <p>As discussed in
+ * <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/">Expert
One-On-One J2EE Design and Development</a>,
+ * runtime exceptions are often a better alternative to checked exceptions.
+ * However, all exceptions should preserve their stack trace, if caused by a
+ * lower-level exception.
+ *
+ * @author Rod Johnson
+ * @author Juergen Hoeller
+ * @see #getMessage
+ * @see #printStackTrace
+ * @see NestedCheckedException
+ */
+public class NestedRuntimeException
+ extends RuntimeException
+{
+
+ /**
+ * Root cause of this nested exception
+ */
+ private Throwable cause;
+
+ /**
+ * Construct a <code>NestedRuntimeException</code> with no message or
exception
+ */
+ public NestedRuntimeException()
+ {
+ super();
+ }
+
+ /**
+ * Construct a <code>NestedRuntimeException</code> with the specified
detail message.
+ *
+ * @param msg the detail message
+ */
+ public NestedRuntimeException( String msg )
+ {
+ super( msg );
+ }
+
+ /**
+ * Construct a <code>NestedRuntimeException</code> with the specified
detail message
+ * and nested exception.
+ *
+ * @param msg the detail message
+ * @param ex the nested exception
+ */
+ public NestedRuntimeException( String msg, Throwable ex )
+ {
+ super( msg );
+ this.cause = ex;
+ }
+
+ /**
+ * Construct a <code>NestedRuntimeException</code> with the specified
nested exception.
+ *
+ * @param ex the nested exception
+ */
+ public NestedRuntimeException( Throwable ex )
+ {
+ super();
+ this.cause = ex;
+ }
+
+ /**
+ * Return the nested cause, or <code>null</code> if none.
+ * <p>Note that this will only check one level of nesting.
+ * Use <code>getRootCause()</code> to retrieve the innermost cause.
+ *
+ * @see #getRootCause()
+ */
+ public Throwable getCause()
+ {
+ // Even if you cannot set the cause of this exception other than
through
+ // the constructor, we check for the cause being "this" here, as the
cause
+ // could still be set to "this" via reflection: for example, by a
remoting
+ // deserializer like Hessian's.
+ return ( this.cause == this ? null : this.cause );
+ }
+
+ /**
+ * Return the detail message, including the message from the nested
exception
+ * if there is one.
+ */
+ public String getMessage()
+ {
+ if ( getCause() == null )
+ {
+ return super.getMessage();
+ }
+ else
+ {
+ return super.getMessage() + "; nested exception is " +
getCause().getClass().getName() + ": " +
+ getCause().getMessage();
+ }
+ }
+
+ /**
+ * Print the composite message and the embedded stack trace to the
specified stream.
+ *
+ * @param ps the print stream
+ */
+ public void printStackTrace( PrintStream ps )
+ {
+ if ( getCause() == null )
+ {
+ super.printStackTrace( ps );
+ }
+ else
+ {
+ ps.println( this );
+ getCause().printStackTrace( ps );
+ }
+ }
+
+ /**
+ * Print the composite message and the embedded stack trace to the
specified writer.
+ *
+ * @param pw the print writer
+ */
+ public void printStackTrace( PrintWriter pw )
+ {
+ if ( getCause() == null )
+ {
+ super.printStackTrace( pw );
+ }
+ else
+ {
+ pw.println( this );
+ getCause().printStackTrace( pw );
+ }
+ }
+
+ /**
+ * Retrieve the innermost cause of this exception, if any.
+ * <p>Currently just traverses NestedRuntimeException causes. Will use
+ * the JDK 1.4 exception cause mechanism once Spring requires JDK 1.4.
+ *
+ * @return the innermost exception, or <code>null</code> if none
+ */
+ public Throwable getRootCause()
+ {
+ Throwable cause = getCause();
+ if ( cause instanceof NestedRuntimeException )
+ {
+ return ( (NestedRuntimeException) cause ).getRootCause();
+ }
+ else
+ {
+ return cause;
+ }
+ }
+
+ /**
+ * Check whether this exception contains an exception of the given class:
+ * either it is of the given class itself or it contains a nested cause
+ * of the given class.
+ * <p>Currently just traverses NestedRuntimeException causes. Will use
+ * the JDK 1.4 exception cause mechanism once Spring requires JDK 1.4.
+ *
+ * @param exClass the exception class to look for
+ */
+ public boolean contains( Class exClass )
+ {
+ if ( exClass == null )
+ {
+ return false;
+ }
+ if ( exClass.isInstance( this ) )
+ {
+ return true;
+ }
+ Throwable cause = getCause();
+ if ( cause instanceof NestedRuntimeException )
+ {
+ return ( (NestedRuntimeException) cause ).contains( exClass );
+ }
+ else
+ {
+ return ( cause != null && exClass.isInstance( cause ) );
+ }
+ }
+
+}
\ No newline at end of file
Propchange:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/surefire/branches/surefire-testng/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified:
maven/surefire/branches/surefire-testng/surefire-api/src/test/java/org/apache/maven/surefire/report/XMLReporterTest.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-api/src/test/java/org/apache/maven/surefire/report/XMLReporterTest.java?rev=398490&r1=398489&r2=398490&view=diff
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-api/src/test/java/org/apache/maven/surefire/report/XMLReporterTest.java
(original)
+++
maven/surefire/branches/surefire-testng/surefire-api/src/test/java/org/apache/maven/surefire/report/XMLReporterTest.java
Sun Apr 30 18:13:13 2006
@@ -58,22 +58,6 @@
assertResult( reporter, message );
}
- public void testReplaceAll()
- {
- String s, from, to;
- s = "";
- from = "";
- to = "";
- String result = XMLReporter.replaceAll( s, from, to );
- assertEquals( "", result );
-
- s = "xxfromyytozz";
- from = "from";
- to = "to";
- result = XMLReporter.replaceAll( s, from, to );
- assertEquals( "xxtoyytozz", result );
- }
-
private void assertResult( XMLReporter reporter, String message )
{
Xpp3Dom result = reporter.getTestCase();
Modified:
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java?rev=398490&r1=398489&r2=398490&view=diff
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
(original)
+++
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
Sun Apr 30 18:13:13 2006
@@ -541,7 +541,7 @@
List list = new ArrayList();
- String[] stringArray = split( sl, "," );
+ String[] stringArray = StringUtils.split( sl, "," );
for ( int i = 0; i < stringArray.length; i++ )
{
@@ -589,8 +589,8 @@
Object[] paramObjects = null;
if ( paramProperty != null )
{
- String[] params = split( paramProperty, "\\|" );
- String[] types = split( typeProperty, "\\|" );
+ String[] params = StringUtils.split( paramProperty, "|" );
+ String[] types = StringUtils.split( typeProperty, "|" );
paramObjects = new Object[params.length];
@@ -700,17 +700,5 @@
System.exit( result ? TESTS_SUCCEEDED_EXIT_CODE :
TESTS_FAILED_EXIT_CODE );
}
- /**
- * Split a string in a List of Strings using a delimiter. Same as Java 1.4
String.split( String )
- *
- * @param s the string to be splitted
- * @param delimiter the delimiter to be used
- * @return an array with the Strings between the delimiters
- * @since 1.5.4
- */
- public static String[] split( String s, String delimiter )
- {
- return StringUtils.split( s, delimiter );
- }
}
Modified:
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java?rev=398490&r1=398489&r2=398490&view=diff
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
(original)
+++
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
Sun Apr 30 18:13:13 2006
@@ -16,12 +16,12 @@
* limitations under the License.
*/
-import org.apache.maven.util.jdk13.NestedCheckedException;
+import org.apache.maven.surefire.util.NestedCheckedException;
/**
* Encapsulates exceptions thrown during Surefire forking.
- *
- * @version $Id$
+ *
+ * @version $Id$
*/
public class SurefireBooterForkException
extends NestedCheckedException
Modified:
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireExecutionException.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireExecutionException.java?rev=398490&r1=398489&r2=398490&view=diff
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireExecutionException.java
(original)
+++
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireExecutionException.java
Sun Apr 30 18:13:13 2006
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-import org.apache.maven.util.jdk13.NestedCheckedException;
+import org.apache.maven.surefire.util.NestedCheckedException;
/**
* An error occurring during the invocation of Surefire via an alternate class
loader.
Modified:
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/shell/Shell.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/shell/Shell.java?rev=398490&r1=398489&r2=398490&view=diff
==============================================================================
---
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/shell/Shell.java
(original)
+++
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/shell/Shell.java
Sun Apr 30 18:13:13 2006
@@ -16,20 +16,20 @@
* limitations under the License.
*/
+import org.apache.maven.surefire.util.NestedRuntimeException;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.Commandline;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.apache.maven.util.jdk13.NestedRuntimeException;
-import org.codehaus.plexus.util.cli.CommandLineException;
-import org.codehaus.plexus.util.cli.Commandline;
-
/**
- * <p>
+ * <p/>
* Class with patches copied from plexus-utils with fix for PLX-161,
* as we can not upgrade plexus-utils until it's upgraded in core Maven
* </p>
- *
+ * <p/>
* TODO deprecate when plexus-utils 1.2 can be used
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carlos Sanchez</a>