org.restlet.test.jaxrs.services.tests.HttpHeaderTest#testLanguage()

fails with:

junit.framework.AssertionFailedError: expected:<OK (200)> but
was:<Communication Error (1001)>
    at junit.framework.Assert.fail(Assert.java:47)
    at junit.framework.Assert.failNotEquals(Assert.java:277)
    at junit.framework.Assert.assertEquals(Assert.java:64)
    at junit.framework.Assert.assertEquals(Assert.java:71)
    at org.restlet.test.jaxrs.services.tests.HttpHeaderTest.testLanguage(
HttpHeaderTest.java:112)

The following error is in the log:
WARNING: An error occured during the communication with the remote HTTP
server.
java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:652)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(
HttpURLConnection.java:1000)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java
:373)
    at com.noelios.restlet.ext.net.HttpUrlConnectionCall.getStatusCode(
HttpUrlConnectionCall.java:245)
    at com.noelios.restlet.http.HttpClientCall.sendRequest(
HttpClientCall.java:338)
    at com.noelios.restlet.ext.net.HttpUrlConnectionCall.sendRequest(
HttpUrlConnectionCall.java:302)
    at com.noelios.restlet.http.HttpClientConverter.commit(
HttpClientConverter.java:101)
    at com.noelios.restlet.http.HttpClientHelper.handle(
HttpClientHelper.java:79)
    at org.restlet.Client.handle(Client.java:103)
    at org.restlet.Uniform.handle(Uniform.java:97)
    at org.restlet.test.jaxrs.services.tests.HttpHeaderTest.testLanguage(
HttpHeaderTest.java:110)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(
JUnit38ClassRunner.java:81)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
JUnit4TestReference.java:38)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:196)

On Feb 11, 2008 11:18 AM, Thierry Boileau <[EMAIL PROTECTED]> wrote:

> Hi Kevin,
>
> could you precise the failing test? I feel that the case reported by
> Stephan is already taken into account.
>
> best regards,
> Thierry Boileau
>
> On Feb 11, 2008 4:49 PM, Stephan Koops <[EMAIL PROTECTED]> wrote:
> > Yes, because the Response will not return an entity on HEAD requests as
> > before. But to check the MediaType of the HEAD request (for example) the
> > entity is needed or anything else to request it from the response.
> >
> > I think this is a bug in the Restlet API. I will submit a bug report.
> >
> > best regards
> >    Stephan
> >
> > Kevin Conaway schrieb:
> > > I also receive errors running the test case by itself in Eclipse.
> > >
> > > On Feb 11, 2008 8:51 AM, Jerome Louvel <[EMAIL PROTECTED]
> > > <mailto:[EMAIL PROTECTED]>> wrote:
> > >
> > >
> > >     Hi Stephan,
> > >
> > >     There can be some differences (classpath) between running the Ant
> > >     test cases
> > >     from Eclipse compared to command line.
> > >
> > >     I think people have the errors via command line. You can get more
> > >     details
> > >     about installing and running Ant here (old doc):
> > >     http://wiki.java.net/bin/view/Javawsxml/RestletHowToBuild
> > >
> > >     The traces of tests are put in the "build\temp\test" directory.
> > >
> > >     Best regards,
> > >     Jerome
> > >
> > >     > -----Message d'origine-----
> > >     > De : [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > >     [mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>]
> > >     > Envoyé : lundi 11 février 2008 12:43
> > >     > À : discuss@restlet.tigris.org <mailto:
> discuss@restlet.tigris.org>
> >
> > >     > Objet : Re: Failed during the build with the latest version
> > >     > from the trunk
> > >     >
> > >     > Hello,
> > >     >
> > >     > sorry that I didn't answered the last half week. On thursday I
> was
> > >     > working and at the weekend I wasn't at home.
> > >     >
> > >     > Can anybody tell me how to reprocude this errors? I've never
> > >     > worked with
> > >     > ant before (or I don't know that I've done it :-) ).
> > >     > I've tried to reproduce the messages, buy run the Restlet ant
> (right
> > >     > click, run as "ant build"), but I can't get the stack traces.
> > >     > I only get
> > >     > the following message:
> > >     > [...]
> > >     >     [junit] Running org.restlet.test.RestletTestSuite
> > >     >     [junit] Tests run: 184, Failures: 0, Errors: 69, Time
> > >     > elapsed: 7,89 sec
> > >     > BUILD FAILED
> > >     > [...]
> > >     >
> > >     > I don't know where this errors occur. Where do you copy the
> > >     > stack trace
> > >     > from?
> > >     >
> > >     > Will the tests called parallel or one by one? Because I'm
> starting a
> > >     > Restlet server for every test method with the same port it's
> > >     > clear that
> > >     > it produces problems, if they are called prallel.
> > >     >
> > >     > If I run's the RestletTestCase, I've get no one of this
> problems.
> > >     > But I get some NullPointerExceptions now, when I want to read
> the
> > >     > metadata (MediaType and so on) from a HEAD request as client.
> > >     > The entity
> > >     > is not available, because there is no response message body.
> > >     > How can I
> > >     > read the MediaType?
> > >     >
> > >     > best regards
> > >     >    Stephan
> > >     >
> > >     > Todd Nguyen schrieb:
> > >     > > got BindingException for 195 times and I still have the
> > >     > same number of
> > >     > > exceptions after changing the port to 9999. Before running
> > >     > the test, i
> > >     > > ran netstat -an|grep 9999 and no process binding to that port.
> > >     > >
> > >     > > On Feb 7, 2008 11:35 AM, Stephan Koops <[EMAIL PROTECTED]
> > >     <mailto:[EMAIL PROTECTED]>
> > >     > > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>>
> >
> > >     wrote:
> > >     > >
> > >     > >     Hello Todd,
> > >     > >
> > >     > >     do you get this error only twice as shown in the email,
> > >     > or did you get
> > >     > >     it very offen?
> > >     > >     My test cases starts for a lot of test methods a Restlet
> > >     Server
> > >     > >     and shut
> > >     > >     it down after a test. If the Port 8181 is used by
> > >     > another process,
> > >     > >     this
> > >     > >     Exception is clear.
> > >     > >     You can try to change the constant PORT at the
> > >     > beginning of the class
> > >     > >     org.restlet.test.jaxrs.services.tests.JaxRsTestCase .
> > >     > Let me know,
> > >     > >     what
> > >     > >     happens. Perhaps I should change the server port.
> > >     > >
> > >     > >     best regards
> > >     > >        Stephan
> > >     > >
> > >     > >     Todd Nguyen schrieb:
> > >     > >     > Got this error when running ant. I presume I should
> > >     > ignore these
> > >     > >     > errors for now.
> > >     > >     >
> > >     > >     > 2008-02-07 08:42:46.753::WARN:  failed
> > >     > >     [EMAIL PROTECTED]:8181
> > >     > >     > java.net.BindException: Address already in use
> > >     > >     >         at sun.nio.ch.Net.bind(Native Method)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImp
> > >     > l.java:119)
> > >     > >     >         at
> > >     > >     >
> > >     > sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChanne
> > >     > lConnector.java:205)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectCha
> > >     > nnelConnector.java:304)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycl
> > >     > e.java:40)
> > >     > >     >         at org.mortbay.jetty.Server.doStart(Server.java
> :233)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycl
> > >     > e.java:40)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > com.noelios.restlet.ext.jetty.JettyServerHelper.start(JettySer
> > >     > verHelper.java:171)
> > >     > >     >         at org.restlet.Server.start(Server.java:345)
> > >     > >     >         at
> > >     > org.restlet.Component.startServers(Component.java:343)
> > >     > >     >         at org.restlet.Component.start(Component.java
> :306)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.restlet.test.jaxrs.services.tests.RestletServerWrapper.sta
> > >     > rtServer(RestletServerWrapper.java:107)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.restlet.test.jaxrs.services.tests.JaxRsTestCase.startServe
> > >     > r(JaxRsTestCase.java:463)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.restlet.test.jaxrs.services.tests.JaxRsTestCase.startServe
> > >     > r(JaxRsTestCase.java:438)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.restlet.test.jaxrs.services.tests.JaxRsTestCase.setUp(JaxR
> > >     > sTestCase.java:416)
> > >     > >     >         at
> > >     junit.framework.TestCase.runBare(TestCase.java:132)
> > >     > >     >         at
> > >     > junit.framework.TestResult$1.protect(TestResult.java:110)
> > >     > >     >         at
> > >     > >     junit.framework.TestResult.runProtected(TestResult.java
> :128)
> > >     > >     >         at
> > >     junit.framework.TestResult.run(TestResult.java:113)
> > >     > >     >         at junit.framework.TestCase.run(TestCase.java
> :124)
> > >     > >     >         at
> > >     > junit.framework.TestSuite.runTest(TestSuite.java:232)
> > >     > >     >         at junit.framework.TestSuite.run(TestSuite.java
> :227)
> > >     > >     >         at
> > >     > junit.framework.TestSuite.runTest(TestSuite.java:232)
> > >     > >     >         at junit.framework.TestSuite.run(TestSuite.java
> :227)
> > >     > >     >         at
> > >     > junit.framework.TestSuite.runTest(TestSuite.java:232)
> > >     > >     >         at junit.framework.TestSuite.run(TestSuite.java
> :227)
> > >     > >     >         at
> > >     > junit.framework.TestSuite.runTest(TestSuite.java:232)
> > >     > >     >         at junit.framework.TestSuite.run(TestSuite.java
> :227)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.r
> > >     > un(JUnitTestRunner.java:421)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.l
> > >     > aunch(JUnitTestRunner.java:912)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.m
> > >     > ain(JUnitTestRunner.java:766)
> > >     > >     > 2008-02-07 08:42:46.754::WARN:  failed
> > >     > >     > [EMAIL PROTECTED]
> > >     > >     > java.net.BindException: Address already in use
> > >     > >     >         at sun.nio.ch.Net.bind(Native Method)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImp
> > >     > l.java:119)
> > >     > >     >         at
> > >     > >     >
> > >     > sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChanne
> > >     > lConnector.java:205)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectCha
> > >     > nnelConnector.java:304)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycl
> > >     > e.java:40)
> > >     > >     >         at org.mortbay.jetty.Server.doStart(Server.java
> :233)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycl
> > >     > e.java:40)
> > >     > >     >         at
> > >     > >     >
> > >     > >
> > >     > com.noelios.restlet.ext.jetty.JettyServerHelper.start(JettySer
> > >     > verHelper.java:171)
> > >     > >     >         at org.restlet.Server.start(Server.java:345)
> > >     > >     >         at
> > >     > org.restlet.Component.startServers(Component.java:343)
> > >     > >     >         at org.restlet.Component.start(Component.java
> :306)
> > >     > >     >
> > >     > >
> > >     > >
> > >
> > >
> >
>

Reply via email to