[ http://jira.codehaus.org/browse/MSUREFIRE-123?page=comments#action_67571
]
Konstantin Pribluda commented on MSUREFIRE-123:
-----------------------------------------------
I also get similar problem with custom protocol handler.
( and it works under 1.0.2 )
from mvn -X I see:
--------------%<---------------------
[DEBUG] Setting system property
[java.protocol.handler.pkgs]=[org.generama.mock.protocol]
[DEBUG] Setting system property
[generama.home]=[/home/ko5tik/xdoclet_2/generama]
[DEBUG] Setting system property [localRepository]=[/home/ko5tik/.m2/repository]
[DEBUG] Setting system property [basedir]=[/home/ko5tik/xdoclet_2/generama]
[INFO] Surefire report directory:
/home/ko5tik/xdoclet_2/generama/target/surefire-reports
Forking command line: java -classpath
/home/ko5tik/.m2/repository/org/apache/maven/surefire/surefire-api/2.0/surefire-api-2.0.jar:/home/ko5tik/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar:/home/ko5tik/.m2/repository/org/apache/maven/surefire/surefire-booter/2.0/surefire-booter-2.0.jar
org.apache.maven.surefire.booter.SurefireBooter /tmp/surefire6470tmp
/tmp/surefire6471tmp
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.generama.mock.protocol.memory.HandlerTestCase
protocol packages: org.generama.mock.protocol
from action: org.generama.mock.protocol
class in question:class org.generama.mock.protocol.memory.Handler
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.088 sec <<<
FAILURE!
............................%<------------------------------
So apparently system propeties are passed to my testcase
where I do some debug output:
................................%<------------------
String protocolPackages =
System.getProperty("java.protocol.handler.pkgs");
String fromaction = ((String)(AccessController.doPrivileged
(new GetPropertyAction("java.protocol.handler.pkgs",
""))));
System.err.println("protocol packages: " + protocolPackages);
System.err.println("from action: " + fromaction);
try {
System.err.println("class in question:" +
Thread.currentThread().getContextClassLoader().loadClass(protocolPackages +
".memory.Handler"));
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
................%<-----------------------
So, apparetnly my settings are seen in testcase.
But then I get:
....................%<--------------------------
testMemoryURL(org.generama.mock.protocol.memory.HandlerTestCase) Time elapsed:
0.026 sec <<< ERROR!
java.net.MalformedURLException: unknown protocol: memory
at java.net.URL.<init>(URL.java:365)
at java.net.URL.<init>(URL.java:253)
at java.net.URL.<init>(URL.java:276)
at
org.generama.mock.protocol.memory.HandlerTestCase.testMemoryURL(HandlerTestCase.java:21)
....................%<--------------------------
> unable to establish my own http protocol handler for unit tests
> ---------------------------------------------------------------
>
> Key: MSUREFIRE-123
> URL: http://jira.codehaus.org/browse/MSUREFIRE-123
> Project: Maven 2.x Surefire Plugin
> Type: Bug
> Versions: 2.2
> Environment: jse 5.0 (osx)
> Reporter: Andy Fyfe
> Attachments: protocol.zip
>
>
> In order to establish my own http protocol handler, I set the system property
> java.protocol.handler.pkgs and ensure that the tests require a fork. The
> test runs fine under maven 1.0.2, but fails under maven 2.0.4. I have tried
> both surefire 2.1.3 and 2.2, and both with the childDelegation option.
> The test sees the system property properly set, but the test's protocol
> handler is not actually used.
> The attached zip file demonstrates this problem (run "maven test" and "mvn
> test").
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira