[jbehave-dev] [jira] Commented: (JBEHAVE-498) withRelativeDirectory appears to be broken

2011-05-02 Thread Mauro Talevi (JIRA)

[ 
http://jira.codehaus.org/browse/JBEHAVE-498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=265426#action_265426
 ] 

Mauro Talevi commented on JBEHAVE-498:
--

The relativeDirectory is the directory where the JBehave reporting outputs are 
written to (defaults to jbehave), relative to the story builder code location 
(defaults to CodeLocations.codeLocationFromPath(target/classes)). 

If you change the relative directory and you're not using the Maven standard 
layout, you'll probably need to set the code location accordingly, e.g. 
CodeLocations.codeLocationFromPath(build/publish) and 
withRelativeDirectory(story-reports), or combinations thereof.  

You could also try seting the code location from the JUnitStories class:  
CodeLocations.codeLocationFromClass(this.getClass());


 

 withRelativeDirectory appears to be broken
 --

 Key: JBEHAVE-498
 URL: http://jira.codehaus.org/browse/JBEHAVE-498
 Project: JBehave
  Issue Type: Bug
  Components: Core
Affects Versions: web-3.3
 Environment: Linux. Jdk6
Reporter: Derek Clarkson

 I'm working in a non maven environment. I attempted to set the output 
 directory for reports as follows
 public static class MyReportBuilder extends StoryReporterBuilder {
 public MyReportBuilder() {
 super();
 this.withRelativeDirectory(../build/publish/story-reports);
 this.withFormats(CONSOLE, HTML, XML);
 }
 }
 Upon running the JUnits I get the following:
 org.jbehave.core.reporters.FilePrintStreamFactory$PrintStreamCreationFailed: 
 Failed to create print stream for file 
 /home/derek/workspace/smsManagerGit/target/../build/publish/story-reports/BeforeStories.html
   at 
 org.jbehave.core.reporters.FilePrintStreamFactory.createPrintStream(FilePrintStreamFactory.java:39)
   at 
 org.jbehave.core.reporters.Format$4.createStoryReporter(Format.java:43)
   at 
 org.jbehave.core.reporters.StoryReporterBuilder.reporterFor(StoryReporterBuilder.java:310)
   at 
 org.jbehave.core.reporters.StoryReporterBuilder.build(StoryReporterBuilder.java:285)
   at 
 org.jbehave.core.configuration.Configuration.storyReporter(Configuration.java:200)
   at 
 org.jbehave.core.embedder.StoryRunner.runBeforeOrAfterStories(StoryRunner.java:58)
   at 
 org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:209)
   at 
 au.com.sensis.wireless.smsmanager.integration.bdd.stories.AnnotatedStoryEmbedder.run(AnnotatedStoryEmbedder.java:48)
   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:73)
   at 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
   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.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
   at 
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
 Caused by: java.io.FileNotFoundException: 
 /home/derek/workspace/smsManagerGit/target/../build/publish/story-reports/BeforeStories.html
  (No such file or directory)
   at 

[jbehave-dev] [jira] Commented: (JBEHAVE-498) withRelativeDirectory appears to be broken

2011-05-02 Thread Derek Clarkson (JIRA)

[ 
http://jira.codehaus.org/browse/JBEHAVE-498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=265520#action_265520
 ] 

Derek Clarkson commented on JBEHAVE-498:


Thanks for getting back to me so fast.

I've now tried:


this.withCodeLocation(CodeLocations.codeLocationFromPath(build/publish));
this.withRelativeDirectory(story-reports);

Which almost works. It creates the files in build/story-reports. I don't know 
why it's ignoring the publish directory.

Just done some experimenting. It seems that you have to put in one more 
directory level than you want to use. ie. build/publish maps to build, 
build/publish/x maps to build/publish

So there still appears to be a bug in that it is not correctly assembling the 
output path from the code location.

Secondly I'd like to request that StoryReportBuilder.withCodeLocation(...) be 
renamed to StoryReportBuilder.withReportLocation(...). Calling it 
withCodeLocation is anything but intuitive and the whole reason I wasted 
several hours trying to figure out how to do this before posting the bug 
report. In addition, I don't see the need for a separation of the location and 
relative directory. It just adds to the confusion.

 withRelativeDirectory appears to be broken
 --

 Key: JBEHAVE-498
 URL: http://jira.codehaus.org/browse/JBEHAVE-498
 Project: JBehave
  Issue Type: Bug
  Components: Core
Affects Versions: web-3.3
 Environment: Linux. Jdk6
Reporter: Derek Clarkson

 I'm working in a non maven environment. I attempted to set the output 
 directory for reports as follows
 public static class MyReportBuilder extends StoryReporterBuilder {
 public MyReportBuilder() {
 super();
 this.withRelativeDirectory(../build/publish/story-reports);
 this.withFormats(CONSOLE, HTML, XML);
 }
 }
 Upon running the JUnits I get the following:
 org.jbehave.core.reporters.FilePrintStreamFactory$PrintStreamCreationFailed: 
 Failed to create print stream for file 
 /home/derek/workspace/smsManagerGit/target/../build/publish/story-reports/BeforeStories.html
   at 
 org.jbehave.core.reporters.FilePrintStreamFactory.createPrintStream(FilePrintStreamFactory.java:39)
   at 
 org.jbehave.core.reporters.Format$4.createStoryReporter(Format.java:43)
   at 
 org.jbehave.core.reporters.StoryReporterBuilder.reporterFor(StoryReporterBuilder.java:310)
   at 
 org.jbehave.core.reporters.StoryReporterBuilder.build(StoryReporterBuilder.java:285)
   at 
 org.jbehave.core.configuration.Configuration.storyReporter(Configuration.java:200)
   at 
 org.jbehave.core.embedder.StoryRunner.runBeforeOrAfterStories(StoryRunner.java:58)
   at 
 org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:209)
   at 
 au.com.sensis.wireless.smsmanager.integration.bdd.stories.AnnotatedStoryEmbedder.run(AnnotatedStoryEmbedder.java:48)
   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:73)
   at 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
   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.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
   at 
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
   at