Louis,

your problem stems from the fact that you're using the annotated embedder, and by design it takes all the controls from the annotations, including the meta-filters.

Attached is patch that solves your two issues:

1. defines meta filters via @UsingEmbedder annotation
2. defines the view resources are dependencies, so that the unpack-view-resources knows what to unpack.

Note that the use of a ConfigurableEmbedder (e.g. JUnitStories) may suit you better if you want to control your behaviour externally via command-line properties.

Cheers

On 16/11/2011 14:17, louis gueye wrote:
Thank you Mauro.

I tried that configuration on my project without success.
I still can't make meta-filtering and report feature to work.

I've created a maven project on github which runs with maven plugin.
It invokes the run-stories-with-annotated-embedder goal.
The project uses spring and annotations.
You can run it with mvn clean install -Pembedded
You can clone the project here : git://github.com/figarocms/jbehave-poc.git <http://github.com/figarocms/jbehave-poc.git>

Problem 1 : I defined meta on 2 stories. The build runs all stories/scenarios Problem 2 : I can't see my reports, at least one I can show in demo. I just have the raw one in target/jbehave/view/report.html which is totally naked, no css, nothing. Maybe it need a site goal ... I don't know.

Any help is appreciated.

Cheers,

Louis
@lgueye
http://deepintojee.wordpress.com


2011/11/14 Mauro Talevi <[email protected] <mailto:[email protected]>>

    Hi Louis,
    the idea of meta filtering is that you tag your stories with meta
    tags, eg:

    Meta: @theme Twain

    and then express your meta filter to match that tag, e.g.
    mvn clean install -Dmeta.filter='+theme Twain'
    I've updated the JBehave threads example
    (https://github.com/jbehave/jbehave-core/tree/master/examples/threads)
    to have some meta info to filter on.   You can try different
    filters, e.g.

    mvn clean install -Dmeta.filter='-outcome failed'

    mvn clean install -Dmeta.filter='+actor Tom'
    You'll see different stories being executed.
    Note that as part of http://jira.codehaus.org/browse/JBEHAVE-625
    we're making the meta filter logic expressable in different
    languages, e.g. Groovy.

    If you feel you have a concrete example (e.g. your demo) that's
    not working as you think it should, then feel free to send out way
    and we'd be happy to help.

    Cheers


    On Mon Nov 14 09:46:23 2011, louis gueye wrote:

        Hi all,

        Next monday I will give a presentation of jbehave in my company.
        I'm willing to convince them to switch to jbehave (currently
        they use fitnesse).
        Someone has already given them a presentation about cucumber.
        They found it very interesting though the ruby part cooled
        them a bit.
        Among the features they liked most was the ability to run
        stories by tag which correspond to meta filtering in jbehave.

        My problem is that I could never understand how meta filtering
        works in jbehave. Neither without maven nor with maven.

        Any an explanation and/or working example would be greatly
        appreciated.

        Regards,

        Louis GUEYE.
        @lgueye
        http://deepintojee.wordpress.com




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

    http://xircles.codehaus.org/manage_email




diff --git a/pom.xml b/pom.xml
index f55dbac..21a70dd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -602,6 +602,22 @@
                        <groupId>commons-codec</groupId>
                        <artifactId>commons-codec</artifactId>
                </dependency>
+        <dependency>
+      <groupId>org.jbehave</groupId>
+      <artifactId>jbehave-core</artifactId>
+      <version>${jbehave.version}</version>
+      <classifier>resources</classifier>
+      <type>zip</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jbehave.site</groupId>
+      <artifactId>jbehave-site-resources</artifactId>
+      <version>3.1.1</version>
+      <type>zip</type>
+      <scope>test</scope>
+    </dependency>
+    
        </dependencies>
 
        <build>
@@ -648,7 +664,7 @@
                                        
<version>${maven-failsafe-plugin.version}</version>
                                        <configuration>
                                                <excludes>
-                                                       
<exclude>**/Abstract*</exclude>
+                                                       <exclude>**/*</exclude>
                                                </excludes>
                                        </configuration>
                                        <executions>
@@ -672,7 +688,7 @@
                                        
<version>${maven-surefire-plugin.version}</version>
                                        <configuration>
                                                <excludes>
-                                                       
<exclude>**/Abstract*</exclude>
+                                                       <exclude>**/*</exclude>
                                                </excludes>
                                        </configuration>
                                </plugin>
@@ -923,7 +939,7 @@
                                
<javax.persistence.jdbc.password></javax.persistence.jdbc.password>
                                
<hibernate.hbm2ddl.auto>update</hibernate.hbm2ddl.auto>
                                
<hibernate.dialect>org.hibernate.dialect.H2Dialect</hibernate.dialect>
-                               <hibernate.show_sql>true</hibernate.show_sql>
+                               <hibernate.show_sql>false</hibernate.show_sql>
 
                                <!-- container properties -->
                                <container.host>localhost</container.host>
diff --git a/src/test/java/fr/explorimmo/poc/stories/StoriesRunner.java 
b/src/test/java/fr/explorimmo/poc/stories/StoriesRunner.java
index b714ef2..9bb0f44 100644
--- a/src/test/java/fr/explorimmo/poc/stories/StoriesRunner.java
+++ b/src/test/java/fr/explorimmo/poc/stories/StoriesRunner.java
@@ -22,7 +22,7 @@ import org.junit.runner.RunWith;
  */
 @RunWith(SpringAnnotatedEmbedderRunner.class)
 @Configure
-@UsingEmbedder(embedder = Embedder.class, generateViewAfterStories = true, 
ignoreFailureInStories = false, ignoreFailureInView = false, threads = 1)
+@UsingEmbedder(embedder = Embedder.class, generateViewAfterStories = true, 
ignoreFailureInStories = false, ignoreFailureInView = false, threads = 1, 
metaFilters={"+search on"})
 @UsingSpring(resources = { "jbehave-context.xml", "stories-context.xml" })
 public class StoriesRunner extends InjectableEmbedder {
 
@@ -32,7 +32,9 @@ public class StoriesRunner extends InjectableEmbedder {
        @Test
        @Override
        public void run() throws Throwable {
-               injectedEmbedder().runStoriesAsPaths(storyPaths());
+               Embedder embedder = injectedEmbedder();
+               System.out.println("Using filters "+embedder.metaFilters());
+        embedder.runStoriesAsPaths(storyPaths());
        }
 
        protected List<String> storyPaths() {

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

    http://xircles.codehaus.org/manage_email

Reply via email to