Author: brett
Date: Sat May 13 18:42:59 2006
New Revision: 406182
URL: http://svn.apache.org/viewcvs?rev=406182&view=rev
Log:
[MSUREFIRE-99] load other classloader first to keep commons-logging happy
Modified:
maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
Modified:
maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
URL:
http://svn.apache.org/viewcvs/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java?rev=406182&r1=406181&r2=406182&view=diff
==============================================================================
---
maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
(original)
+++
maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
Sat May 13 18:42:59 2006
@@ -204,11 +204,13 @@
//noinspection CatchGenericClass,OverlyBroadCatchBlock
try
{
+ // The test classloader must be constructed first to avoid issues
with commons-logging until we properly
+ // separate the TestNG classloader
+ ClassLoader testsClassLoader = createClassLoader( classPathUrls,
childDelegation, true );
+
ClassLoader surefireClassLoader =
createClassLoader( surefireClassPathUrls,
getClass().getClassLoader(), true );
- ClassLoader testsClassLoader = createClassLoader( classPathUrls,
childDelegation, true );
-
Class surefireClass = surefireClassLoader.loadClass(
Surefire.class.getName() );
Object surefire = surefireClass.newInstance();
@@ -628,8 +630,9 @@
Object[] paramObjects = null;
if ( paramProperty != null )
{
- String[] params = StringUtils.split( StringUtils.replace(
paramProperty, "||", "| |" ), "|" );
- String[] types = StringUtils.split( StringUtils.replace(
typeProperty, "||", "| |" ), "|" );
+ // bit of a glitch that it need sto be done twice to do an odd
number of vertical bars (eg |||, |||||).
+ String[] params = StringUtils.split( StringUtils.replace(
StringUtils.replace( paramProperty, "||", "| |" ), "||", "| |" ), "|" );
+ String[] types = StringUtils.split( StringUtils.replace(
StringUtils.replace( typeProperty, "||", "| |" ), "||", "| |" ), "|" );
paramObjects = new Object[params.length];