akatie / fitnesse-launcher-maven-plugin

Automatically exported from code.google.com/p/fitnesse-launcher-maven-plugin
0 stars 1 forks source link

Fixtures in my own project are not on maven.classpath for FitNesse #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Configure a Maven project to run FitNesse tests with 
fitnesse-launcher-maven-plugin
2. Create a custom FitNesse fixture in src/test/java
3. Create a FitNesse test that uses the custom fixture

What is the expected output? What do you see instead?

When I run the FitNesse in either wiki mode or run-test mode, the test gets an 
exception saying that it cannot find the fixture.  

What version of the product are you using? On what operating system?

I have seen this behavior with both the deployed 1.1.0-SNAPSHOT and a build 
from the latest source code.

Please provide any additional information below.

I am just assuming that the scenario that I'm describing (a fixture in the same 
project as the FitNesse tests) is reasonable.  I tried putting my fixtures in a 
separate Maven project and had the project with the FitNesse tests depend on 
that other project and it worked fine.  If that is the expected/support use 
case, I can live with that.

However, if the plugin should support testing fixtures from the same project as 
the FitNesse tests, I did a little hacking and modified the plugin to add 
${project.build.directory}/test-classes to the maven.classpath.  When I ran 
with the modified plugin, the FitNesse tests ran successfully in wiki mode.  
For some reason, the test still fails with "could not find fixture" in 
run-tests even though the plugin clearly logs that test-classes is on the 
maven.classpath.  It's acting as if ${maven.classpath} isn't expanded in the 
test.  I don't quite understand it.

Anyway, I've attached my diff for your consideration.

Thanks,

Dave

Original issue reported on code.google.com by david.m....@gmail.com on 4 Dec 2012 at 7:14

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for this feedback, and your diff. I'm glad the plugin is working for 
you in the general sense.
I agree that your expectation of the plugin's behaviour is reasonable and this 
is a valid issue.
If you can live with the fixture-project dependency work around for the 
meanwhile, I'll take a look at this over the next couple of weeks, and see if 
we can't include it in a formal 1.1.0 release by the new year.

Original comment by stewart....@gmail.com on 4 Dec 2012 at 10:01

GoogleCodeExporter commented 8 years ago
Thanks for taking my request under consideration, Stewart.  My Maven project is 
already multi-module, so having a sub-project for fixtures is no big deal.  
Cheers!

Original comment by david.m....@gmail.com on 5 Dec 2012 at 4:02

GoogleCodeExporter commented 8 years ago
Latest 1.1.0-SNAPSHOT now does this.
As well as adding target/test-classes (and target/classes) to 
${maven.classpath}, I found that it also had to be added to Maven's 
"ClassRealm" (Maven's classloading mechanism) for the `run-tests` goal.

Original comment by stewart....@gmail.com on 20 Dec 2012 at 4:02

GoogleCodeExporter commented 8 years ago

Original comment by stewart....@gmail.com on 22 Dec 2012 at 3:00

GoogleCodeExporter commented 8 years ago

Original comment by stewart@javahelp.co.uk on 8 Jan 2013 at 8:33