[ 
http://jira.codehaus.org/browse/JBEHAVE-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=261558#action_261558
 ] 

Cristiano GaviĆ£o commented on JBEHAVE-454:
------------------------------------------

Edward, 

Don't take me bad, but it is always a good practice to send an email to the 
user list before open issues like this, mostly without a good reproducible 
example. Always will be someone to help you there.
You should think that people that is 'given' this amazing tool to the community 
(as Mauro and Paul) is not receiving nothing for this and they have to work to 
pay bills too. ok? ;-)

So, for your example you just don't put the <scope>test</scope> in your POM, as 
stated here: http://jbehave.org/reference/latest/maven-goals.html
{code}
          <execution>
            <id>run-stories</id>
            <phase>integration-test</phase>
            <configuration>
            -<scope>test</scope>-
              <includes>
                <include>**/stories/*.java</include>
              </includes>
            </configuration>
            <goals>
              <goal>run-stories-as-embeddables</goal>
            </goals>
          </execution>

{code}

I did what you suggested. See the result:

{code}
Mob4biz:gameoflife cvgaviao$ mvn integration-test
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building JBehave Game of Life Example 3.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.4:resources (default-resources) @ 
jbehave-gameoflife-example ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- jbehave-maven-plugin:3.3-SNAPSHOT:unpack-view-resources 
(unpack-view-resources) @ jbehave-gameoflife-example ---
[INFO] Unpacked 
/Users/cvgaviao/.m2/repository/org/jbehave/site/jbehave-site-resources/3.1.1/jbehave-site-resources-3.1.1.zip
 to 
/Users/cvgaviao/Development/Development_Projects/jbehave-fork/jbehave-core/examples/gameoflife/target/jbehave/view
[INFO] Unpacked 
/Users/cvgaviao/.m2/repository/org/jbehave/jbehave-core/3.3-SNAPSHOT/jbehave-core-3.3-SNAPSHOT-resources.zip
 to 
/Users/cvgaviao/Development/Development_Projects/jbehave-fork/jbehave-core/examples/gameoflife/target/jbehave/view
[INFO] 
[INFO] --- maven-compiler-plugin:2.1:compile (default-compile) @ 
jbehave-gameoflife-example ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.4:testResources (default-testResources) @ 
jbehave-gameoflife-example ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/Users/cvgaviao/Development/Development_Projects/jbehave-fork/jbehave-core/examples/gameoflife/src/test/resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.1:testCompile (default-testCompile) @ 
jbehave-gameoflife-example ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.5:test (default-test) @ 
jbehave-gameoflife-example ---
[INFO] Surefire report directory: 
/Users/cvgaviao/Development/Development_Projects/jbehave-fork/jbehave-core/examples/gameoflife/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.lunivore.gameoflife.domain.CellBehaviour
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.095 sec
Running com.lunivore.gameoflife.view.string.StringRendererBehaviour
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.21 sec
Running com.lunivore.gameoflife.domain.GameBehaviour
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec

Results :

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ 
jbehave-gameoflife-example ---
[INFO] 
[INFO] --- jbehave-maven-plugin:3.3-SNAPSHOT:run-stories-as-embeddables 
(embeddable-stories) @ jbehave-gameoflife-example ---
[INFO] Running stories using embedder 
Embedder[configuration=org.jbehave.core.configuration.MostUsefulConfiguration@552297d7,candidateSteps=[],classLoader=EmbedderClassLoader[urls=[/Users/cvgaviao/Development/Development_Projects/jbehave-fork/jbehave-core/examples/gameoflife/target/classes/,
 jbehave-core-3.3-SNAPSHOT.jar, commons-collections-3.2.1.jar, 
commons-io-1.4.jar, commons-lang-2.5.jar, plexus-utils-2.0.5.jar, 
freemarker-2.3.16.jar, paranamer-2.3.jar, jbehave-ant-3.3-SNAPSHOT.jar, 
ant-1.7.1.jar, ant-launcher-1.7.1.jar, xstream-1.3.1.jar, xpp3_min-1.1.4c.jar, 
junit-dep-4.8.2.jar, hamcrest-all-1.1.jar, 
maven-default-skin-1.0.jar],parent=ClassRealm[plugin>org.jbehave:jbehave-maven-plugin:3.3-SNAPSHOT,
 parent: 
sun.misc.Launcher$AppClassLoader@535ff48b]],embedderControls=UnmodifiableEmbedderControls[EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=true,threads=2]],metaFilters=[null],systemProperties={},storyMapper=StoryMapper,storyRunner=StoryRunner,embedderMonitor=MavenEmbedderMonitor,executorService=org.jbehave.core.embedder.Embedder$NonThreadingExecutorService@a9db0e2]
[INFO] Found class names: []
[INFO] 
[INFO] --- jbehave-maven-plugin:3.3-SNAPSHOT:run-stories-as-embeddables 
(run-stories) @ jbehave-gameoflife-example ---
[INFO] Running stories using embedder 
Embedder[configuration=org.jbehave.core.configuration.MostUsefulConfiguration@7371b4ca,candidateSteps=[],classLoader=EmbedderClassLoader[urls=[/Users/cvgaviao/Development/Development_Projects/jbehave-fork/jbehave-core/examples/gameoflife/target/test-classes/,
 
/Users/cvgaviao/Development/Development_Projects/jbehave-fork/jbehave-core/examples/gameoflife/target/classes/,
 jbehave-core-3.3-SNAPSHOT.jar, commons-collections-3.2.1.jar, 
commons-io-1.4.jar, commons-lang-2.5.jar, plexus-utils-2.0.5.jar, 
freemarker-2.3.16.jar, paranamer-2.3.jar, jbehave-ant-3.3-SNAPSHOT.jar, 
ant-1.7.1.jar, ant-launcher-1.7.1.jar, xstream-1.3.1.jar, xpp3_min-1.1.4c.jar, 
junit-dep-4.8.2.jar, hamcrest-all-1.1.jar, 
maven-default-skin-1.0.jar],parent=ClassRealm[plugin>org.jbehave:jbehave-maven-plugin:3.3-SNAPSHOT,
 parent: 
sun.misc.Launcher$AppClassLoader@535ff48b]],embedderControls=UnmodifiableEmbedderControls[EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=false,ignoreFailureInView=false,threads=1]],metaFilters=[],systemProperties={},storyMapper=StoryMapper,storyRunner=StoryRunner,embedderMonitor=MavenEmbedderMonitor,executorService=org.jbehave.core.embedder.Embedder$NonThreadingExecutorService@72cc5002]
[INFO] Found class names: [com.lunivore.gameoflife.stories.ICanToggleACell, 
com.lunivore.gameoflife.stories.TheGridStartsEmpty]
[INFO] Running embeddable com.lunivore.gameoflife.stories.ICanToggleACell
[INFO] Processing system properties {}
[INFO] Running story com/lunivore/gameoflife/stories/i_can_toggle_a_cell.story

(com/lunivore/gameoflife/stories/i_can_toggle_a_cell.story)
Scenario: 
Given a 5 by 5 game
When I toggle the cell at (2, 3)
Then the grid should look like
.....
.....
.....
..X..
.....
When I toggle the cell at (2, 4)
Then the grid should look like
.....
.....
.....
..X..
..X..
When I toggle the cell at (2, 3)
Then the grid should look like
.....
.....
.....
.....
..X..


[INFO] Generating reports view to 
'/Users/cvgaviao/Development/Development_Projects/jbehave-fork/jbehave-core/examples/gameoflife/target/jbehave'
 using formats '[stats, console, txt]' and view properties 
'{defaultFormats=stats, decorateNonHtml=true, viewDirectory=view, 
decorated=ftl/jbehave-report-decorated.ftl, 
reports=ftl/jbehave-reports-with-totals.ftl, maps=ftl/jbehave-maps.ftl, 
navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, 
nonDecorated=ftl/jbehave-report-non-decorated.ftl}'
[INFO] Reports view generated with 1 stories containing 1 scenarios (of which  
0 failed)
[INFO] Running embeddable com.lunivore.gameoflife.stories.TheGridStartsEmpty
[INFO] Processing system properties {}
[INFO] Running story com/lunivore/gameoflife/stories/the_grid_starts_empty.story

(com/lunivore/gameoflife/stories/the_grid_starts_empty.story)
Scenario: 
Given a new game: 5 by 5
Then the grid should be
.....
.....
.....
.....
.....


[INFO] Generating reports view to 
'/Users/cvgaviao/Development/Development_Projects/jbehave-fork/jbehave-core/examples/gameoflife/target/jbehave'
 using formats '[stats, console, txt]' and view properties 
'{defaultFormats=stats, decorateNonHtml=true, viewDirectory=view, 
decorated=ftl/jbehave-report-decorated.ftl, 
reports=ftl/jbehave-reports-with-totals.ftl, maps=ftl/jbehave-maps.ftl, 
navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, 
nonDecorated=ftl/jbehave-report-non-decorated.ftl}'
[INFO] Reports view generated with 2 stories containing 2 scenarios (of which  
0 failed)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.384s
[INFO] Finished at: Fri Mar 25 23:34:22 BRT 2011
[INFO] Final Memory: 6M/265M
[INFO] ------------------------------------------------------------------------

{code}

regards


> Can't run-stories-as-embeddables from test directory using Maven plugin
> -----------------------------------------------------------------------
>
>                 Key: JBEHAVE-454
>                 URL: http://jira.codehaus.org/browse/JBEHAVE-454
>             Project: JBehave
>          Issue Type: Bug
>          Components: Maven Plugin
>    Affects Versions: 3.1.2
>            Reporter: Edward Staub
>
> When I tried to use it, the plugin couldn't find my .java file.  
> I suspect that this is because the classloader obtained under Maven with a 
> story that uses 
>           new LoadFromClasspath(this.getClass().getClassLoader())
> as a StoryLoader doesn't include the test class directory - even though the 
> running class is IN the test class directory. The same code works correctly 
> under the Eclipse debugger (including the test class directory in the 
> classpath).  Everything else works correctly in Maven - unit tests, etc.
> The configuration:
>                         <configuration>
>                             
> <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
>                             
> <testSourceDirectory>${project.build.testSourceDirectory}</testSourceDirectory>
>                             <includes>
>                                 <include>**/ProcessorTestStory.java</include>
>                             </includes>
>                             <metaFilters>
>                                 <metaFilter>+author *</metaFilter>
>                                 <metaFilter>-skip</metaFilter>
>                             </metaFilters>
>                             <systemProperties>
>                                 <property>
>                                     <name>java.awt.headless</name>
>                                     <value>true</value>
>                                 </property>
>                             </systemProperties>
>                             
> <ignoreFailureInStories>true</ignoreFailureInStories>
>                             <ignoreFailureInView>false</ignoreFailureInView>
>                         </configuration>
> -Ed

-- 
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