Details
Description
I'm trying to run JBehave from Ant using the following ant code:
<taskdef name="runStoriesWithAnnotatedEmbedderRunner" classname="org.jbehave.ant.RunStoriesWithAnnotatedEmbedderRunner" classpathref="integration.tests.classpath" /> <runStoriesWithAnnotatedEmbedderRunner includes="**/*StoryEmbedder.java" sourceDirectory="src/integration" systemProperties="java.awt.headless=true,web.project.dir=${build.integration.web.dir}" ignoreFailureInStories="true" ignoreFailureInView="false" generateViewAfterStories="true" />
At the momment I'm getting a class not found which the story embedder I've written starts up (doesn't happen from a junit run inside eclipse!).
I think that it's running from the default directory because it appears that the systemProperties are not making it through to the embedder. Here's the log showing the startup:
run-bdd-tests: [runStoriesWithAnnotatedEmbedderRunner] Running stories with annotated embedder org.jbehave.core.junit.AnnotatedEmbedderRunner [runStoriesWithAnnotatedEmbedderRunner] Found class names : [au.com.sensis.wireless.smsmanager.integration.bdd.stories.AnnotatedStoryEmbedder] [runStoriesWithAnnotatedEmbedderRunner] 2011-05-03 16:12:21,042 DEBUG [runStoriesWithAnnotatedEmbedderRunner] Processing system properties {}
As you can see it's reporting no properties passed. Digging into the Ant task code supports that the properties are not getting through, but from what I can see in the source there is no obvious reason. Possibly the code that loads the properties has a bug and is throwing an exception because it's try-catch silently swallows any errors.
Activity
Mauro Talevi
made changes -
Field | Original Value | New Value |
---|---|---|
Affects Version/s | 3.3.2 [ 17308 ] | |
Affects Version/s | web-3.2 [ 16758 ] | |
Description |
I'm trying to run JBehave from Ant using the following ant code:
{code:ant} <taskdef name="runStoriesWithAnnotatedEmbedderRunner" classname="org.jbehave.ant.RunStoriesWithAnnotatedEmbedderRunner" classpathref="integration.tests.classpath" /> <runStoriesWithAnnotatedEmbedderRunner includes="**/*StoryEmbedder.java" sourceDirectory="src/integration" systemProperties="java.awt.headless=true,web.project.dir=${build.integration.web.dir}" ignoreFailureInStories="true" ignoreFailureInView="false" generateViewAfterStories="true" /> {code} At the momment I'm getting a class not found which the story embedder I've written starts up (doesn't happen from a junit run inside eclipse!). I think that it's running from the default directory because it appears that the systemProperties are not making it through to the embedder. Here's the log showing the startup: {code} run-bdd-tests: [runStoriesWithAnnotatedEmbedderRunner] Running stories with annotated embedder org.jbehave.core.junit.AnnotatedEmbedderRunner [runStoriesWithAnnotatedEmbedderRunner] Found class names : [au.com.sensis.wireless.smsmanager.integration.bdd.stories.AnnotatedStoryEmbedder] [runStoriesWithAnnotatedEmbedderRunner] 2011-05-03 16:12:21,042 DEBUG [runStoriesWithAnnotatedEmbedderRunner] Processing system properties {} {code} As you can see it's reporting no properties passed. Digging into the Ant task code supports that the properties are not getting through, but from what I can see in the source there is no obvious reason. Possibly the code that loads the properties has a bug and is throwing an exception because it's try-catch silently swallows any errors. |
I'm trying to run JBehave from Ant using the following ant code:
{code:xml} <taskdef name="runStoriesWithAnnotatedEmbedderRunner" classname="org.jbehave.ant.RunStoriesWithAnnotatedEmbedderRunner" classpathref="integration.tests.classpath" /> <runStoriesWithAnnotatedEmbedderRunner includes="**/*StoryEmbedder.java" sourceDirectory="src/integration" systemProperties="java.awt.headless=true,web.project.dir=${build.integration.web.dir}" ignoreFailureInStories="true" ignoreFailureInView="false" generateViewAfterStories="true" /> {code} At the momment I'm getting a class not found which the story embedder I've written starts up (doesn't happen from a junit run inside eclipse!). I think that it's running from the default directory because it appears that the systemProperties are not making it through to the embedder. Here's the log showing the startup: {code} run-bdd-tests: [runStoriesWithAnnotatedEmbedderRunner] Running stories with annotated embedder org.jbehave.core.junit.AnnotatedEmbedderRunner [runStoriesWithAnnotatedEmbedderRunner] Found class names : [au.com.sensis.wireless.smsmanager.integration.bdd.stories.AnnotatedStoryEmbedder] [runStoriesWithAnnotatedEmbedderRunner] 2011-05-03 16:12:21,042 DEBUG [runStoriesWithAnnotatedEmbedderRunner] Processing system properties {} {code} As you can see it's reporting no properties passed. Digging into the Ant task code supports that the properties are not getting through, but from what I can see in the source there is no obvious reason. Possibly the code that loads the properties has a bug and is throwing an exception because it's try-catch silently swallows any errors. |
Mauro Talevi
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Fix Version/s | 3.4 [ 17278 ] | |
Resolution | Won't Fix [ 2 ] |
Derek, system properties (or other configurable properties) are all ignored when running with AnnotatedEmbedderRunner, which by design gets the Embedder configuration from the annotation @UsingEmbedder.
The system properties were missing in the @UsingEmbedder (now fixed in
JBEHAVE-506).If you want to specify your configuration via Ant task, you can use a ConfigurableEmbedder instance, e.g. JUnitStories.