0

I have written test cases with Jbehave I run it with Junit, Now I need to convert it into Maven target.

How to do it?

what lines should I add to pom.xml to make it work?

EDIT:

How to run it as Maven target?what commands should I use?

I have a test which runs correctly if I run it individually with Junit in Eclipse ... then I
added following lines in pom.xml

<plugin>

<groupId>org.jbehave</groupId>

<artifactId>jbehave-maven-plugin</artifactId>

<executions>
<execution>

  <id>run-scenarios</id>

  <phase>integration-test</phase>

  <configuration>
    <scenarioIncludes>

      <scenarioInclude>**/*Story.java</scenarioInclude>

    </scenarioIncludes>
    <ignoreFailureInStories>true</ignoreFailureInStories>
    <ignoreFailureInView>false</ignoreFailureInView>
    <outputDirectory> ${project.build.directory}/jbehave/view</outputDirectory> 
    </configuration>

  <goals>
    <goal>run-scenarios</goal>

  </goals>
  </execution>

  </executions>
  </plugin>

and try to run pom.xml as "Maven package" by right clicking on Pom.xml ... but it doesn't show anything not even any error/ failure .. precisely, no indication of tests I referenced in pom.xml ...

what I have missed?

how do I know if the test runs?

Just_another_developer
  • 5,737
  • 12
  • 50
  • 83

1 Answers1

1

If it's simply a JUnit you can simply use Maven directly cause maven-surefire-plugin will run unit tests. But the docs about JBehave show examples with jbehave-maven-plugin.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235