[ http://jira.codehaus.org/browse/MSUREFIRE-123?page=comments#action_67225 
] 

Andy Fyfe commented on MSUREFIRE-123:
-------------------------------------

Part of the output of "mvn test" follows:

...
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running test.HandlerTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.329 sec <<< 
FAILURE!

Results :
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
...

$ cat target/surefire-reports/test.HandlerTest.txt
-------------------------------------------------------------------------------
Test set: test.HandlerTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.31 sec <<< 
FAILURE!
testHandelr(test.HandlerTest)  Time elapsed: 1.166 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<hello world> but was:<<!DOCTYPE h>
        at junit.framework.Assert.assertEquals(Assert.java:81)
...

The first line of the default index page returned by apache on my mac when 
visiting http://localhost happens to be
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

If I change the test code to use a different url, say
    URL url = new URL("http://localhost:12345";);
the test will still fail under maven 2, but the error is (obviously) different:

$ cat target/surefire-reports/test.HandlerTest.txt
-------------------------------------------------------------------------------
Test set: test.HandlerTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.184 sec <<< 
FAILURE!
testHandelr(test.HandlerTest)  Time elapsed: 0.078 sec  <<< ERROR!
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)

In either case, the test succeeds with maven 1.0.2.


> 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

Reply via email to