Reputation: 83
sorry if my question seems silly.
I'm doing a simple JBehave test with just a single assert in my steps.java.
@When("I do this")
public void iDoThis() {
Assert.assertEquals(true, true);
System.out.println("log to console...");
}
When I run 'Project > Clean' in Eclipse, I noticed that it generates 'target' folder with 3 files inside (target same level as my src & pom.xml):
So when I execute runner.java in Eclipse 'Run As > JUnit Test', it runs successfully (ex. I can see the "log to console...").
However, when I run 'mvn clean install', it only generates the class files and NOT the story file. So when I run 'mvn test -Dtest=fldr1/fldr2/runner.java', the build is successful, but as expected my Story wasn't executed (no "log to console..." seen).
If I clean in Eclipse, then run test in mvn, it works fine too. So I'm pretty sure it's because of the story file not being generated.
My question is what mvn command to execute so that it performs exactly the same way as Eclipse's Project>Clean?
Thank you very much!
Upvotes: 0
Views: 435
Reputation: 83
I realized what my mistake was. I was placing the story files under the same folder as my java files: (\src\test\java). I simply moved them under a different folder: (src\test\resources). Now I am able to run them successfully using maven as well. Thanks.
Upvotes: 1