Closed GoogleCodeExporter closed 8 years ago
The tests in the client go against a running version of Jetty using the testws
project. Are you running that service and pointing the client test cases to it?
It looks like its timing out trying to connect to the test service. You should
only need to to do this if you have (1) made changes to the source code and
want to test them (2) wish to see how a sample works (3) want to mess around
with sample code. Let me know if you have issues either pointing your test
cases to it or running the test client. I just download the testws project and
run "mvn jetty:run" inside it. Then I make sure the test cases point to my
server url.
Original comment by joshuadmorris@gmail.com
on 28 Sep 2011 at 9:41
[deleted comment]
[deleted comment]
[deleted comment]
BTW, the only testws project I found was under the iOS directory. I'm
interested in an Android client, so I had not played with that directory.
When I follow your directions, the iOS project builds and runs fine. In another
console I then tried 'mvn verify' on the unitt-websocket project and got this:
Running com.unitt.framework.websocket.AbstractNetworkSocketTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.03 sec <<<
FAILURE!
Running com.unitt.framework.websocket.netty.ClientNetworkSocketTest
Sep 28, 2011 3:24:50 PM org.jboss.netty.channel.SimpleChannelUpstreamHandler
WARNING: EXCEPTION, please implement
com.unitt.framework.websocket.netty.NettyClientNetworkSocket.exceptionCaught()
for proper handling.
java.net.ConnectException: connection timed out
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processConnectTimeout(NioClientSocketPipelineSink.java:371)
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:283)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 30.187 sec
Running com.unitt.framework.websocket.simple.NetworkSocketTest
15:25:31,786 ERROR NetworkSocket:210 - Could not connect.
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at com.unitt.framework.websocket.simple.NetworkSocket.createSocket(NetworkSocket.java:181)
at com.unitt.framework.websocket.simple.NetworkSocket.connect(NetworkSocket.java:199)
at com.unitt.framework.websocket.WebSocketConnection.open(WebSocketConnection.java:204)
at com.unitt.framework.websocket.AbstractNetworkSocketTest.testRoundTrip(AbstractNetworkSocketTest.java:43)
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
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 org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 21.011 sec <<<
FAILURE!
Running com.unitt.framework.websocket.WebSocketTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.024 sec
Running com.unitt.framework.websocket.WebSocketUtilTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
Results :
Tests in error:
testRoundTrip(com.unitt.framework.websocket.AbstractNetworkSocketTest)
testRoundTrip(com.unitt.framework.websocket.simple.NetworkSocketTest)
Tests run: 10, Failures: 0, Errors: 2, Skipped: 0
Mike
Original comment by mslinn
on 28 Sep 2011 at 10:26
BTW, I saw this from the iOS project:
[WARNING] 'build.plugins.plugin.version' for
org.apache.maven.plugins:maven-eclipse-plugin is missing. @ line 79, column 21
[WARNING] 'build.plugins.plugin.version' for
org.apache.maven.plugins:maven-source-plugin is missing. @ line 64, column 21
Fixes are the same as I mentioned for the unitt-websocket project
(http://code.google.com/p/unitt/wiki/UnittWebSocket)
added
Original comment by mslinn
on 28 Sep 2011 at 10:34
The testws project was originally created just to test the client-to-server
communication of the iPhone client. When I created the Java/Android client I
reused it for testing. It should be moved out of the iOS directory though. Good
catch! There was a bug in the tests. The abstract test class that is used as a
base for both tests was not marked as abstract. That has been fixed. In
addition, I changed the uri used from a specific IP in the tests to
'config.setUrl( new URI("ws://localhost:8080/testws/ws/test") )'. This should
address your connection timeout issue. The warnings on the plugin versions
should not be an issue. If one is not provided, they should just grab the
latest stable version. I started the testws project this morning by running
"mvn jetty:run". While that was running, I hopped into the unitt-websocket
project and ran "mvn verify". Everything ran smoothly and passed. Grab the
updates from SVN and let me know if you have any more problems.
Original comment by joshuadmorris@gmail.com
on 29 Sep 2011 at 2:24
Everything checks out, thanks!
Original comment by mslinn
on 30 Sep 2011 at 3:47
Closing the ticket now. :)
Original comment by joshuadmorris@gmail.com
on 30 Sep 2011 at 6:09
Original issue reported on code.google.com by
mslinn
on 28 Sep 2011 at 2:35