Here's how to reproduce:

JBehave911Test .java
public class JBehave911Test extends JUnitStory{
	private ByteArrayOutputStream output;
	private PrintStream ps;
	
	public JBehave911Test(){
		Embedder emb = configuredEmbedder();
		emb.embedderControls().useStoryTimeoutInSecs(1L);
		
		output = new ByteArrayOutputStream();
		ps = new PrintStream(output);
	}
	
	@Override
    public Configuration configuration() {
		
		final XmlOutput output = new XmlOutput(ps);
		
        return new MostUsefulConfiguration()
            // where to find the stories
            .useStoryLoader(new MyStoryLoader()) 
            // CONSOLE and TXT reporting
            .useStoryReporterBuilder(new StoryReporterBuilder(){
            	@Override
            	public StoryReporter build(String storyPath) {
            		if(storyPath.contains("j_behave911_test.story")){
            			return output;
            		}else{
            			return new TxtOutput(new PrintStream(new ByteArrayOutputStream()));
            		}
            		
            	}
            }.withFormats(Format.XML));
    }
	
    @Override
    public InjectableStepsFactory stepsFactory() {
        return new InstanceStepsFactory(this.configuration(), this);
    }
    
    @Given("something too long")
    public void somethingLong() throws Exception{
    	Thread.sleep(2000L);
    }
    
    @AfterStories
    public void after() throws Exception{
    	String str = output.toString("UTF-8");
    	System.out.println();
    	System.out.println();
    	System.out.println(str);
    	System.out.println();
    	System.out.println();
    }
    
    public static class MyStoryLoader implements StoryLoader{

		public String loadStoryAsText(String storyPath) {
			return "Scenario: \n"
					+ "Given something too long";
		}
    	
    }
}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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