unclebob / fitnesse

FitNesse -- The Acceptance Test Wiki
fitnesse.org
Other
2.04k stars 713 forks source link

Debugging fitslim hangs #389

Closed starguy closed 10 years ago

starguy commented 10 years ago

Hello *,

iam confronted with the following problem debugging fitnesse v20131110:

fitnesse is started with the following params:

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=11100 -cp %p %m -jar fitnesse-standalone.jar -p 8182

a .jar providing some simple fitslim fixture code is loaded via frontpage (and the testingsystem changed to fitslim):

!define TEST_SYSTEM {slim} !path lib/*.jar

and a debugger (eclipse or netbeans) is attached via socket-attach on the port 11100.

Now the bug:

Starting a Test (with debug params) calling the fixture (contained in the .jar described above) will cause the fitnesse server to hang for a certain amount of time (about 2 mins), not reaching the fixture code, resulting in an exception of the fitnesse-server listed bellow.

Is it a bug or a wrong / incomplete configuration?

Any help would be appreciated!

All the best cj


fitnesse.slim.SlimError: Error connecting to SLiM server on localhost:8391 at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:100) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) [... and so on] at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) at fitnesse.testsystems.slim.SlimCommandRunningClient.connect(SlimCommandRunningClient.java:78) at fitnesse.testsystems.slim.SlimCommandRunningClient.start(SlimCommandRunningClient.java:50) at fitnesse.testsystems.slim.SlimTestSystem.start(SlimTestSystem.java:69) at fitnesse.testsystems.TestSystemGroup.startTestSystem(TestSystemGroup.java:44) at fitnesse.testrunner.MultipleTestsRunner.startTestSystemAndExecutePages(MultipleTestsRunner.java:81) at fitnesse.testrunner.MultipleTestsRunner.internalExecuteTestPages(MultipleTestsRunner.java:71) at fitnesse.testrunner.MultipleTestsRunner.executeTestPages(MultipleTestsRunner.java:52) at fitnesse.responders.run.TestResponder.performExecution(TestResponder.java:203) at fitnesse.responders.run.TestResponder.doExecuteTests(TestResponder.java:81) at fitnesse.responders.run.TestResponder$TestExecutor.execute(TestResponder.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.Template.merge(Template.java:356) at org.apache.velocity.Template.merge(Template.java:260) at fitnesse.html.template.HtmlPage.render(HtmlPage.java:80) at fitnesse.responders.run.TestResponder.doSending(TestResponder.java:69) at fitnesse.responders.ChunkingResponder.startSending(ChunkingResponder.java:66) at fitnesse.http.ChunkedResponse.sendTo(ChunkedResponse.java:25) at fitnesse.FitNesseExpediter.sendResponse(FitNesseExpediter.java:94) at fitnesse.FitNesseExpediter.start(FitNesseExpediter.java:46) at fitnesse.FitNesseServer.serve(FitNesseServer.java:24) at fitnesse.FitNesseServer.serve(FitNesseServer.java:17) at fitnesse.socketservice.SocketService$ServerRunner.run(SocketService.java:99) at java.lang.Thread.run(Unknown Source) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.(Unknown Source) at java.net.Socket.(Unknown Source) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:97) ... 234 more fitnesse.slim.SlimError: Error connecting to SLiM server on localhost:8391 at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:100) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) [... and so on] at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) at fitnesse.testsystems.slim.SlimCommandRunningClient.connect(SlimCommandRunningClient.java:78) at fitnesse.testsystems.slim.SlimCommandRunningClient.start(SlimCommandRunningClient.java:50) at fitnesse.testsystems.slim.SlimTestSystem.start(SlimTestSystem.java:69) at fitnesse.testsystems.TestSystemGroup.startTestSystem(TestSystemGroup.java:44) at fitnesse.testrunner.MultipleTestsRunner.startTestSystemAndExecutePages(MultipleTestsRunner.java:81) at fitnesse.testrunner.MultipleTestsRunner.internalExecuteTestPages(MultipleTestsRunner.java:71) at fitnesse.testrunner.MultipleTestsRunner.executeTestPages(MultipleTestsRunner.java:52) at fitnesse.responders.run.TestResponder.performExecution(TestResponder.java:203) at fitnesse.responders.run.TestResponder.doExecuteTests(TestResponder.java:81) at fitnesse.responders.run.TestResponder$TestExecutor.execute(TestResponder.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.Template.merge(Template.java:356) at org.apache.velocity.Template.merge(Template.java:260) at fitnesse.html.template.HtmlPage.render(HtmlPage.java:80) at fitnesse.responders.run.TestResponder.doSending(TestResponder.java:69) at fitnesse.responders.ChunkingResponder.startSending(ChunkingResponder.java:66) at fitnesse.http.ChunkedResponse.sendTo(ChunkedResponse.java:25) at fitnesse.FitNesseExpediter.sendResponse(FitNesseExpediter.java:94) at fitnesse.FitNesseExpediter.start(FitNesseExpediter.java:46) at fitnesse.FitNesseServer.serve(FitNesseServer.java:24) at fitnesse.FitNesseServer.serve(FitNesseServer.java:17) at fitnesse.socketservice.SocketService$ServerRunner.run(SocketService.java:99) at java.lang.Thread.run(Unknown Source) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.(Unknown Source) at java.net.Socket.(Unknown Source) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:97) ... 234 more java.lang.NullPointerException at fitnesse.testsystems.slim.SlimCommandRunningClient.writeString(SlimCommandRunningClient.java:201) at fitnesse.testsystems.slim.SlimCommandRunningClient.invokeAndGetResponse(SlimCommandRunningClient.java:125) at fitnesse.testsystems.slim.SlimTestSystem.processTable(SlimTestSystem.java:120) at fitnesse.testsystems.slim.HtmlSlimTestSystem.processAllTablesOnPage(HtmlSlimTestSystem.java:43) at fitnesse.testsystems.slim.SlimTestSystem.runTests(SlimTestSystem.java:98) at fitnesse.testrunner.MultipleTestsRunner.executeTestSystemPages(MultipleTestsRunner.java:101) at fitnesse.testrunner.MultipleTestsRunner.startTestSystemAndExecutePages(MultipleTestsRunner.java:87) at fitnesse.testrunner.MultipleTestsRunner.internalExecuteTestPages(MultipleTestsRunner.java:71) at fitnesse.testrunner.MultipleTestsRunner.executeTestPages(MultipleTestsRunner.java:52) at fitnesse.responders.run.TestResponder.performExecution(TestResponder.java:203) at fitnesse.responders.run.TestResponder.doExecuteTests(TestResponder.java:81) at fitnesse.responders.run.TestResponder$TestExecutor.execute(TestResponder.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.Template.merge(Template.java:356) at org.apache.velocity.Template.merge(Template.java:260) at fitnesse.html.template.HtmlPage.render(HtmlPage.java:80) at fitnesse.responders.run.TestResponder.doSending(TestResponder.java:69) at fitnesse.responders.ChunkingResponder.startSending(ChunkingResponder.java:66) at fitnesse.http.ChunkedResponse.sendTo(ChunkedResponse.java:25) at fitnesse.FitNesseExpediter.sendResponse(FitNesseExpediter.java:94) at fitnesse.FitNesseExpediter.start(FitNesseExpediter.java:46) at fitnesse.FitNesseServer.serve(FitNesseServer.java:24) at fitnesse.FitNesseServer.serve(FitNesseServer.java:17) at fitnesse.socketservice.SocketService$ServerRunner.run(SocketService.java:99) at java.lang.Thread.run(Unknown Source)

amolenaar commented 10 years ago

Hi,

Are you attempting to debug fitnesse or do you want to test the code in a.jar?

Regards,

Arjan Op 14 jan. 2014 15:01 schreef "starguy" notifications@github.com:

Hello *,

iam confronted with the following problem debugging fitnesse v20131110:

fitnesse is started with the following params:

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=11100 -cp %p %m -jar fitnesse-standalone.jar -p 8182

a .jar providing some simple fitslim fixture code is loaded via frontpage (and the testingsystem changed to fitslim):

!define TEST_SYSTEM {slim} !path lib/*.jar

and a debugger (eclipse or netbeans) is attached via socket-attach on the port 11100.

Now the bug:

Starting a Test (with debug params) calling the fixture (contained in the .jar described above) will cause the fitnesse server to hang for a certain amount of time (about 2 mins), not reaching the fixture code, resulting in an exception of the fitnesse-server listed bellow.

Is it a bug or a wrong / incomplete configuration?

Any help would be appreciated!

All the best

cj

fitnesse.slim.SlimError: Error connecting to SLiM server on localhost:8391 at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:100) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) [... and so on] at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) at fitnesse.testsystems.slim.SlimCommandRunningClient.connect(SlimCommandRunningClient.java:78) at fitnesse.testsystems.slim.SlimCommandRunningClient.start(SlimCommandRunningClient.java:50) at fitnesse.testsystems.slim.SlimTestSystem.start(SlimTestSystem.java:69) at fitnesse.testsystems.TestSystemGroup.startTestSystem(TestSystemGroup.java:44) at fitnesse.testrunner.MultipleTestsRunner.startTestSystemAndExecutePages(MultipleTestsRunner.java:81) at fitnesse.testrunner.MultipleTestsRunner.internalExecuteTestPages(MultipleTestsRunner.java:71) at fitnesse.testrunner.MultipleTestsRunner.executeTestPages(MultipleTestsRunner.java:52) at fitnesse.responders.run.TestResponder.performExecution(TestResponder.java:203) at fitnesse.responders.run.TestResponder.doExecuteTests(TestResponder.java:81) at fitnesse.responders.run.TestResponder$TestExecutor.execute(TestResponder.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.Template.merge(Template.java:356) at org.apache.velocity.Template.merge(Template.java:260) at fitnesse.html.template.HtmlPage.render(HtmlPage.java:80) at fitnesse.responders.run.TestResponder.doSending(TestResponder.java:69) at fitnesse.responders.ChunkingResponder.startSending(ChunkingResponder.java:66) at fitnesse.http.ChunkedResponse.sendTo(ChunkedResponse.java:25) at fitnesse.FitNesseExpediter.sendResponse(FitNesseExpediter.java:94) at fitnesse.FitNesseExpediter.start(FitNesseExpediter.java:46) at fitnesse.FitNesseServer.serve(FitNesseServer.java:24) at fitnesse.FitNesseServer.serve(FitNesseServer.java:17) at fitnesse.socketservice.SocketService$ServerRunner.run(SocketService.java:99) at java.lang.Thread.run(Unknown Source) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.(Unknown Source) at java.net.Socket.(Unknown Source) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:97) ... 234 more fitnesse.slim.SlimError: Error connecting to SLiM server on localhost:8391 at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:100) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) [... and so on] at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:107) at fitnesse.testsystems.slim.SlimCommandRunningClient.connect(SlimCommandRunningClient.java:78) at fitnesse.testsystems.slim.SlimCommandRunningClient.start(SlimCommandRunningClient.java:50) at fitnesse.testsystems.slim.SlimTestSystem.start(SlimTestSystem.java:69) at fitnesse.testsystems.TestSystemGroup.startTestSystem(TestSystemGroup.java:44) at fitnesse.testrunner.MultipleTestsRunner.startTestSystemAndExecutePages(MultipleTestsRunner.java:81) at fitnesse.testrunner.MultipleTestsRunner.internalExecuteTestPages(MultipleTestsRunner.java:71) at fitnesse.testrunner.MultipleTestsRunner.executeTestPages(MultipleTestsRunner.java:52) at fitnesse.responders.run.TestResponder.performExecution(TestResponder.java:203) at fitnesse.responders.run.TestResponder.doExecuteTests(TestResponder.java:81) at fitnesse.responders.run.TestResponder$TestExecutor.execute(TestResponder.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.Template.merge(Template.java:356) at org.apache.velocity.Template.merge(Template.java:260) at fitnesse.html.template.HtmlPage.render(HtmlPage.java:80) at fitnesse.responders.run.TestResponder.doSending(TestResponder.java:69) at fitnesse.responders.ChunkingResponder.startSending(ChunkingResponder.java:66) at fitnesse.http.ChunkedResponse.sendTo(ChunkedResponse.java:25) at fitnesse.FitNesseExpediter.sendResponse(FitNesseExpediter.java:94) at fitnesse.FitNesseExpediter.start(FitNesseExpediter.java:46) at fitnesse.FitNesseServer.serve(FitNesseServer.java:24) at fitnesse.FitNesseServer.serve(FitNesseServer.java:17) at fitnesse.socketservice.SocketService$ServerRunner.run(SocketService.java:99) at java.lang.Thread.run(Unknown Source) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.(Unknown Source) at java.net.Socket.(Unknown Source) at fitnesse.testsystems.slim.SlimCommandRunningClient.tryConnect(SlimCommandRunningClient.java:97) ... 234 more java.lang.NullPointerException at fitnesse.testsystems.slim.SlimCommandRunningClient.writeString(SlimCommandRunningClient.java:201) at fitnesse.testsystems.slim.SlimCommandRunningClient.invokeAndGetResponse(SlimCommandRunningClient.java:125) at fitnesse.testsystems.slim.SlimTestSystem.processTable(SlimTestSystem.java:120) at fitnesse.testsystems.slim.HtmlSlimTestSystem.processAllTablesOnPage(HtmlSlimTestSystem.java:43) at fitnesse.testsystems.slim.SlimTestSystem.runTests(SlimTestSystem.java:98) at fitnesse.testrunner.MultipleTestsRunner.executeTestSystemPages(MultipleTestsRunner.java:101) at fitnesse.testrunner.MultipleTestsRunner.startTestSystemAndExecutePages(MultipleTestsRunner.java:87) at fitnesse.testrunner.MultipleTestsRunner.internalExecuteTestPages(MultipleTestsRunner.java:71) at fitnesse.testrunner.MultipleTestsRunner.executeTestPages(MultipleTestsRunner.java:52) at fitnesse.responders.run.TestResponder.performExecution(TestResponder.java:203) at fitnesse.responders.run.TestResponder.doExecuteTests(TestResponder.java:81) at fitnesse.responders.run.TestResponder$TestExecutor.execute(TestResponder.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.Template.merge(Template.java:356) at org.apache.velocity.Template.merge(Template.java:260) at fitnesse.html.template.HtmlPage.render(HtmlPage.java:80) at fitnesse.responders.run.TestResponder.doSending(TestResponder.java:69) at fitnesse.responders.ChunkingResponder.startSending(ChunkingResponder.java:66) at fitnesse.http.ChunkedResponse.sendTo(ChunkedResponse.java:25) at fitnesse.FitNesseExpediter.sendResponse(FitNesseExpediter.java:94) at fitnesse.FitNesseExpediter.start(FitNesseExpediter.java:46) at fitnesse.FitNesseServer.serve(FitNesseServer.java:24) at fitnesse.FitNesseServer.serve(FitNesseServer.java:17) at fitnesse.socketservice.SocketService$ServerRunner.run(SocketService.java:99) at java.lang.Thread.run(Unknown Source)

— Reply to this email directly or view it on GitHubhttps://github.com/unclebob/fitnesse/issues/389 .

starguy commented 10 years ago

Hello Arjan,

i want to debug my own .jar, called by the fitnesse slim server (not the fitnesse-standalone.jar)

Regards cj

amolenaar commented 10 years ago

Okay. Instead you enabled debugging on the FitNesse wiki itself. What you want is make sure your application is launched with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=11100

See http://fitnesse.org/FitNesse.UserGuide.DebugingFixtureCode for some guidance.

amolenaar commented 10 years ago

The -cp argument of Java is ignored if you provide a -jar parameter too.

amolenaar commented 10 years ago

Solved?

starguy commented 10 years ago

Somehow, i neither want to debug my SUT nor FitNesse itself.. Actually i want to debug the Fixture code called by FitNesse. But I think your proposals where helpfull in that way that i probably will have to load and debug the FitNesse Source to reach my Fixture code!?

amolenaar commented 10 years ago

Ehhmmm.... That should not be necessary, I suppose. Have you written unit tests for the fixtures?

starguy commented 10 years ago

Nope, no time for testing (at least of testing fixtures) ;)

My target was to debug through a FitNesse run to be able to watch the execution code (e.g. my fixture code calls the SUT through RMI and i was interested in the results of this calls).

So writing Unit-Tests instantiating the SUT and (re) writing the content of the FitNesse-Test itself as preparation of the Unit-Test to take the Fixture / SUT to the point i want to debug may be a bit oversized / doubled -> than i also might write all tests as Unit-Tests instead of FitNesse-Tests?

amolenaar commented 10 years ago

I was suggesting writing a unit test for just the fixture ;).

So you want to see what happens inside the SLim server started from FitNesse. You can do that by adding the debug commands described above, although the time slot is a little small (I applied a patch lately to make the timeouts configurable).

starguy commented 10 years ago

Yeah, i got that about writing a unit test for the fixture :) Following the path of this thought i might also need to write some unit test testing the unit test i wrote to test the fixture :D ?

@timeouts: Thx, that might help.

A last question at debugging: There are no active breakpoints in the FitNesse itself that might avoid the debugger from reaching my fixture code?

ggramlich commented 10 years ago

Have you tried the remote debugging as described on http://fitnesse.org/FitNesse.UserGuide.DebugingFixtureCode

This works well for us for fixture code as well as SUT code, if the jar and and the code are consistent in your IDE where you start the remote debugging.

starguy commented 10 years ago

Hello ggramlich and amolenaar,

thx for your answers, the userguide was one of the points I started at, unfortunately without any success.. ..first :)

After a few more tries i finally figured it out now with your help, using the following configuration:

1 command pattern (some top level of your FitNesse root) in my case for fit-slim java:

!define TEST_SYSTEM {slim} !define REMOTE_DEBUG_COMMAND {java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8470 -cp %p %m}

2 Create Attach Debugger Config (Example for NetBeans 7.4):

Connector: SocketAttach(Attaches by socket to other VMs) Transport: dt_socket Host: IP where your FitNesse Server (fitnesse jar) runs at Port: 8470 Timeout: 5000

3 Run your Test via debugger command:

--url-to-your-fitnesse-test-page--?responder=test&remote_debug=true

4 Attach debugger

So with conistent Fixture code and .jar (withoud needing the FitNesse or source code) I'm able to debug my Fixtures (even running FitNesse on some other (virtual) machine) :)

@UserGuide description: its a bit confusing by mixing up .NET and JAVA debug configurations, e.g. REMOTE_DEBUG_RUNNER relate to the .NET runnerw.exe (in my case i use the java slim runner) and also the chapter about 'Alternative way to debug when using Slim' is only valid for .NET So who is in charge of the UserGuide? Would you also see any need of updating it?

Anyway thx again for your help, I would also see this issue as solved.

mgaertne commented 10 years ago

You can avoid calling your system under test in a unit test for your fixture code if you make use of dependency injection (the pattern, not the frameworks).

Dipl.-Inform. Markus Gärtner Author of ATDD by Example - A Practical Guide to Acceptance Test-Driven Development

http://www.shino.de/blog http://www.mgaertne.de http://www.it-agile.de Twitter: @mgaertne

On 08.04.2014, at 14:18, starguy notifications@github.com wrote:

Nope, no time for testing (at least of testing fixtures) ;)

My target was to debug through a FitNesse run to be able to watch the execution code (e.g. my fixture code calls the SUT through RMI and i was interested in the results of this calls).

So writing Unit-Tests instantiating the SUT and (re) writing the content of the FitNesse-Test itself as preparation of the Unit-Test to take the Fixture / SUT to the point i want to debug may be a bit oversized / doubled -> than i also might write all tests as Unit-Tests instead of FitNesse-Tests?

— Reply to this email directly or view it on GitHub.

starguy commented 10 years ago

Yeah you probably mean the good old mock'n'stubbing (will do as far as the SUT allows it..)?

I like unit tests, but I'm not sure as far to take it concerning testing test code (is a Fixture part of the test or part of the test framework)? Should I invest the time writing unit tests for all my FitNesse Fixtures? If I will use / develop there any methods or classes helping me to test the FitNesse Fixture (they will also be some kind of 'Fixture') should I test them too by unit tests?

So it might be also some kind of philosophical question how far to test your testing mechanisms and what to do in real life.. What are your experiences, do you write unit tests for any of your FitNesse Fixtures?

Greetz

c