[jbehave-scm] [748] trunk/plugins/maven/src/it: JBEHAVE-92: Made story parser and renderer configurable and defaulting to text-based implementations.
Title: [748] trunk/plugins/maven/src/it: JBEHAVE-92: Made story parser and renderer configurable and defaulting to text-based implementations. Revision 748 Author mauro Date 2007-07-11 07:30:57 -0500 (Wed, 11 Jul 2007) Log Message JBEHAVE-92: Made story parser and renderer configurable and defaulting to text-based implementations. Modified Paths trunk/plugins/maven/src/it/pom.xml trunk/plugins/maven/src/main/java/org/jbehave/mojo/StoryPrinterMojo.java trunk/plugins/maven/src/main/java/org/jbehave/mojo/StoryRunnerMojo.java Added Paths trunk/core/src/java/org/jbehave/core/story/renderer/ConsolePlainTextRenderer.java trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItRenderer.java trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItStoryParser.java trunk/plugins/maven/src/it/test5/ trunk/plugins/maven/src/it/test5/pom.xml trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java Diff Added: trunk/core/src/java/org/jbehave/core/story/renderer/ConsolePlainTextRenderer.java (0 => 748) --- trunk/core/src/java/org/jbehave/core/story/renderer/ConsolePlainTextRenderer.java (rev 0) +++ trunk/core/src/java/org/jbehave/core/story/renderer/ConsolePlainTextRenderer.java 2007-07-11 12:30:57 UTC (rev 748) @@ -0,0 +1,17 @@ +/* + * (c) 2003-2004 ThoughtWorks Ltd + * + * See license.txt for license details + */ +package org.jbehave.core.story.renderer; + +/** + * @author Mauro Talevi + */ +public class ConsolePlainTextRenderer extends PlainTextRenderer { + +public ConsolePlainTextRenderer() { +super(System.out); +} + +} Modified: trunk/plugins/maven/src/it/pom.xml (747 => 748) --- trunk/plugins/maven/src/it/pom.xml 2007-07-11 10:07:57 UTC (rev 747) +++ trunk/plugins/maven/src/it/pom.xml 2007-07-11 12:30:57 UTC (rev 748) @@ -14,6 +14,7 @@ moduletest2/module moduletest3/module moduletest4/module +moduletest5/module /modules /project Added: trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItRenderer.java (0 => 748) --- trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItRenderer.java (rev 0) +++ trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItRenderer.java 2007-07-11 12:30:57 UTC (rev 748) @@ -0,0 +1,15 @@ +package org.jbehave.it; + +import org.jbehave.core.story.renderer.ConsolePlainTextRenderer; + +/** + * @author Mauro Talevi + */ +public class ItRenderer extends ConsolePlainTextRenderer { + +public ItRenderer() { +super(); +System.out.println(Using ItRenderer); +} + +} Added: trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItStoryParser.java (0 => 748) --- trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItStoryParser.java (rev 0) +++ trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItStoryParser.java 2007-07-11 12:30:57 UTC (rev 748) @@ -0,0 +1,16 @@ +package org.jbehave.it; + +import java.io.Reader; + +import org.jbehave.core.story.codegen.domain.StoryDetails; +import org.jbehave.core.story.codegen.parser.TextStoryParser; + + +public class ItStoryParser extends TextStoryParser { + +public ItStoryParser(){ +super(); +System.out.println(Using ItStoryParser); +} + +} Property changes: trunk/plugins/maven/src/it/test5 Name: svn:ignore + target Added: trunk/plugins/maven/src/it/test5/pom.xml (0 => 748) --- trunk/plugins/maven/src/it/test5/pom.xml (rev 0) +++ trunk/plugins/maven/src/it/test5/pom.xml 2007-07-11 12:30:57 UTC (rev 748) @@ -0,0 +1,53 @@ +project xmlns=http://maven.apache.org/POM/4.0.0 + xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance + xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd + modelVersion4.0.0/modelVersion + + groupIdorg.jbehave/groupId + artifactIdjbehave-maven-plugin-it-test5/artifactId + version1.1-SNAPSHOT/version + packagingjar/packaging + namejBehave Maven Plugin Integration Test 5/name + + dependencies + dependency + groupId${pom.groupId}/groupId + artifactIdjbehave/artifactId + version${pom.version}/version + /dependency + /dependencies + + build + sourceDirectory${basedir}/../src/main/sourceDirectory +resources +resource +directory${basedir}/../src/main/java/directory +includes +include**/*.story/include +/includes +/resource +/resources + plugins + plugin +groupIdorg.jbehave/groupId +artifactIdjbehave-maven-plugin/artifactId +executions + execution + idrun-behaviours/id + phaseintegration-test/phase + configuration +storyPathorg/jbehave/it/stories/it.story/storyPath +storyPackageorg.jbehave.it.stories/storyPackage +
[jbehave-scm] [749] trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java: Set log level to debug.
Title: [749] trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java: Set log level to debug. Revision 749 Author mauro Date 2007-07-11 07:44:27 -0500 (Wed, 11 Jul 2007) Log Message Set log level to debug. Modified Paths trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java Diff Modified: trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java (748 => 749) --- trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java 2007-07-11 12:30:57 UTC (rev 748) +++ trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java 2007-07-11 12:44:27 UTC (rev 749) @@ -46,13 +46,13 @@ protected StoryParser getStoryParser() { StoryParser storyParser = (StoryParser) createInstance(storyParserClassName); -getLog().info(Using story parser +storyParser.getClass().getName()); +getLog().debug(Using story parser +storyParser.getClass().getName()); return storyParser; } protected Renderer getStoryRenderer() { Renderer storyRenderer = (Renderer) createInstance(storyRendererClassName); -getLog().info(Using story renderer +storyRenderer.getClass().getName()); +getLog().debug(Using story renderer +storyRenderer.getClass().getName()); return storyRenderer; } To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
[jbehave-scm] [750] trunk/plugins/maven/src/main/java/org/jbehave/mojo: JBEHAVE-91: Refactored story mojos to print and run a list of stories.
Title: [750] trunk/plugins/maven/src/main/java/org/jbehave/mojo: JBEHAVE-91: Refactored story mojos to print and run a list of stories. Revision 750 Author mauro Date 2007-07-11 07:57:51 -0500 (Wed, 11 Jul 2007) Log Message JBEHAVE-91: Refactored story mojos to print and run a list of stories. The configuration still supports the specification of a single story and configuration of multiple stories will be optional - and still to be added. Modified Paths trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java trunk/plugins/maven/src/main/java/org/jbehave/mojo/StoryPrinterMojo.java trunk/plugins/maven/src/main/java/org/jbehave/mojo/StoryRunnerMojo.java Diff Modified: trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java (749 => 750) --- trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java 2007-07-11 12:44:27 UTC (rev 749) +++ trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractStoryMojo.java 2007-07-11 12:57:51 UTC (rev 750) @@ -1,6 +1,8 @@ package org.jbehave.mojo; import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.List; import org.jbehave.core.story.StoryLoader; import org.jbehave.core.story.codegen.parser.StoryParser; @@ -17,13 +19,13 @@ * @parameter * @required true */ -protected String storyPath; +private String storyPath; /** * @parameter * @required true */ -protected String storyPackage; +private String storyPackage; /** * @parameter default-value=org.jbehave.core.story.codegen.parser.TextStoryParser @@ -60,10 +62,25 @@ return new StoryLoader(getStoryParser(), createBehavioursClassLoader()); } +protected String getStoryPackage() { +return storyPackage; +} + +protected List getStoryPaths() { +List storyPaths = new ArrayList(); +// a single story path is specified +if ( storyPath != null ){ +storyPaths.add(storyPath); +return storyPaths; +} +return storyPaths; +} + public static class InvalidClassNameException extends RuntimeException { public InvalidClassNameException(String message, Throwable cause) { super(message, cause); } } + } Modified: trunk/plugins/maven/src/main/java/org/jbehave/mojo/StoryPrinterMojo.java (749 => 750) --- trunk/plugins/maven/src/main/java/org/jbehave/mojo/StoryPrinterMojo.java 2007-07-11 12:44:27 UTC (rev 749) +++ trunk/plugins/maven/src/main/java/org/jbehave/mojo/StoryPrinterMojo.java 2007-07-11 12:57:51 UTC (rev 750) @@ -1,11 +1,15 @@ package org.jbehave.mojo; +import java.net.MalformedURLException; +import java.util.Iterator; +import java.util.List; + import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.jbehave.core.story.StoryPrinter; /** - * Mojo to print a story + * Mojo to print stories * * @author Mauro Talevi * @goal print-story @@ -13,13 +17,22 @@ public class StoryPrinterMojo extends AbstractStoryMojo { public void execute() throws MojoExecutionException, MojoFailureException { +String storyPackage = getStoryPackage(); +List storyPaths = getStoryPaths(); try { -getLog().debug(Printing story + storyPath); -StoryPrinter storyPrinter = new StoryPrinter(getStoryLoader(), getStoryRenderer()); -storyPrinter.print(storyPath, storyPackage); +for ( Iterator i = storyPaths.iterator(); i.hasNext(); ){ +String storyPath = (String)i.next(); +printStory(storyPackage, storyPath); +} } catch (Exception e) { -throw new MojoExecutionException(Failed to print story +storyPath+ with package +storyPackage, e); +throw new MojoExecutionException(Failed to print stories +storyPaths+ with package +storyPackage, e); } } + +private void printStory(String storyPackage, String storyPath) throws MalformedURLException { +getLog().debug(Printing story + storyPath+ using package +storyPackage); +StoryPrinter storyPrinter = new StoryPrinter(getStoryLoader(), getStoryRenderer()); +storyPrinter.print(storyPath, storyPackage); +} } Modified: trunk/plugins/maven/src/main/java/org/jbehave/mojo/StoryRunnerMojo.java (749 => 750) --- trunk/plugins/maven/src/main/java/org/jbehave/mojo/StoryRunnerMojo.java 2007-07-11 12:44:27 UTC (rev 749) +++ trunk/plugins/maven/src/main/java/org/jbehave/mojo/StoryRunnerMojo.java 2007-07-11 12:57:51 UTC (rev 750) @@ -1,6 +1,10 @@ package org.jbehave.mojo; +import java.net.MalformedURLException; +import java.util.Iterator; +import java.util.List; + import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import
[jbehave-dev] [jira] Work started: (JBEHAVE-91) Allow multiple stories to be run
[ http://jira.codehaus.org/browse/JBEHAVE-91?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on JBEHAVE-91 started by Mauro Talevi. Allow multiple stories to be run Key: JBEHAVE-91 URL: http://jira.codehaus.org/browse/JBEHAVE-91 Project: JBehave Issue Type: Improvement Components: Maven Plugin Reporter: Mauro Talevi Assignee: Mauro Talevi Fix For: 1.1 Currently, only one story path can be specified. Allow multiple story paths to be specified as relative to a story base dir - with includes/excludes patterns. -- 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
[jbehave-scm] [751] trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractJBehaveMojo.java: Reduced unnecessary mojo member variable visibility.
Title: [751] trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractJBehaveMojo.java: Reduced unnecessary mojo member variable visibility. Revision 751 Author mauro Date 2007-07-11 08:02:51 -0500 (Wed, 11 Jul 2007) Log Message Reduced unnecessary mojo member variable visibility. Modified Paths trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractJBehaveMojo.java Diff Modified: trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractJBehaveMojo.java (750 => 751) --- trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractJBehaveMojo.java 2007-07-11 12:57:51 UTC (rev 750) +++ trunk/plugins/maven/src/main/java/org/jbehave/mojo/AbstractJBehaveMojo.java 2007-07-11 13:02:51 UTC (rev 751) @@ -21,7 +21,7 @@ * @required * @readonly */ -protected List compileClasspathElements; +private List compileClasspathElements; /** * Test classpath. @@ -30,14 +30,14 @@ * @required * @readonly */ -protected List testClasspathElements; +private List testClasspathElements; /** * The scope of the mojo classpath * * @parameter default-value=compile */ -protected String scope; +private String scope; /** * Creates the Behaviours ClassLoader with the classpath element of the selected scope To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
[jbehave-scm] [756] trunk/core/pom.xml: Updated core dependencies.
Title: [756] trunk/core/pom.xml: Updated core dependencies. Revision 756 Author mauro Date 2007-07-11 17:13:20 -0500 (Wed, 11 Jul 2007) Log Message Updated core dependencies. Modified Paths trunk/core/pom.xml Diff Modified: trunk/core/pom.xml (755 => 756) --- trunk/core/pom.xml 2007-07-11 22:10:48 UTC (rev 755) +++ trunk/core/pom.xml 2007-07-11 22:13:20 UTC (rev 756) @@ -47,6 +47,12 @@ version3.8.2/version scopeprovided/scope /dependency +dependency + groupIdvelocity/groupId + artifactIdvelocity-dep/artifactId + version1.4/version + scopeprovided/scope +/dependency /dependencies build To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email