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 java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        at 
org.jbehave.core.reporters.FilePrintStreamFactory$FilePrintStream.<init>(FilePrintStreamFactory.java:137)
        at 
org.jbehave.core.reporters.FilePrintStreamFactory.createPrintStream(FilePrintStreamFactory.java:37)
        ... 31 more

Commenting out the withRelativeDirectory() method and everything works just 
fine.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to