New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: when Fitnesse is launched to run a test or a suite (with -c Wik... #706

Merged
merged 4 commits into from Apr 18, 2015

Conversation

Projects
None yet
2 participants
@andrey012
Contributor

andrey012 commented Apr 4, 2015

Problem: when Fitnesse is launched to run a test or a suite (with -c WikiName?test) - and if WikiName does not exist (e.g. mistyped in build file) - there were NullPointerException, and java returned exit code = 0, which made Maven think, that build have succeeded.

Fix: track the fact, that responder tries to return 404 and throw an exception, then catch exceptions in FitNesseMain.main() and set exit code to 1

Problem: when Fitnesse is launched to run a test or a suite (with -c …
…WikiName) - and if WikiName does not exists - there were NullPointerException, and java returned exit code = 0, which made Maven think, that build have succeeded.

Fix: track the fact, that responder tries to return 404 and throw an exception, then catch exceptions in FitNesseMain.main() and set exit code to 1
@amolenaar

This comment has been minimized.

Collaborator

amolenaar commented Apr 13, 2015

Hi,

I think this is a nice fix. However, can you please add a test case that describes this behaviour?

@andrey012

This comment has been minimized.

Contributor

andrey012 commented Apr 15, 2015

I'd be glad to, but can you, please give me one hint.
The problem which I try to solve is following: when I have a Fitnesse test job in build file (e.g. Maven), it looks like launching java with -c pathToSuitePage?suite or something like that.
This means, that to try behaviour we need to fork new java process.

I've walked through existing Fitnesse testsuite (controlled by JUnit) - and I couldn't find any similar scenarios there. I mean - in all the tests I have found we do not fork java.

So, before building such a new thing, I want your advice.
As I understand, I can:

  1. either add another taget to Ant build.xml, and expect exit code = 1 for launching java -jar fitnesse-standalone.jar -c FitNesse.NonExistentTestSuite?suite
  2. either add JUnit test for this case
  3. either try to add a page to AcceptanceTests suite (not sure if there is possibility to fork process and expect exit code right now).

Which way will be better?

Thank you.

@andrey012

This comment has been minimized.

Contributor

andrey012 commented Apr 15, 2015

Sorry, I should be more thoughtful.
I've added test case FitNesseMainTest.runningCommandWithNonExistentAddressResultsInError()
Please take a look.

@amolenaar amolenaar added this to the Next release milestone Apr 18, 2015

@amolenaar

This comment has been minimized.

Collaborator

amolenaar commented Apr 18, 2015

That's a nice and concise fix. Thanks!

@amolenaar amolenaar merged commit 4a80edb into unclebob:master Apr 18, 2015

amolenaar added a commit that referenced this pull request Apr 18, 2015

Merge pull request #706 from andrey012/report-404-in-single-command-mode
Problem: when Fitnesse is launched to run a test or a suite (with -c Wik...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment