My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
UsingEasybWithJUnit  
You can run your easyb behaviors in JUnit
Featured, Cookbook
Updated Jan 8, 2010 by ajglo...@gmail.com

The easyb-junit project facilitates running easyb behaviors via JUnit. By extending the project's EasybSuite class, you can then have any JUnit runner (Eclipse, Ant, etc) execute behaviors found in a specified directory. The project's homepage documents this nicely.

What's more, because instances of EasybSuite are JUnit instances, valid JUnit reports can be created. Thus, you can use an instance of EasybSuite in a project that leverages Hudson (for instance) to track behavior status and history.

For example, in an Ant project monitored by Hudson, you can run your behaviors like so:

<target name="junit" depends="compile" description="runs easyb stories via junit">
 <mkdir dir="./target/test-reports" />
 <junit printsummary="yes" haltonfailure="yes">
  <classpath refid="classpath" />
  <formatter type="xml" />
  <batchtest fork="yes" todir="./target/test-reports">
   <fileset dir="test/java">
    <include name="**/*EasybBehaviorRunner*.java" />
   </fileset>
  </batchtest>
 </junit>
</target>

Then in Hudson, for the build step, execute the task "junit" and you'll have a test graph and historical data available for subsequent builds.

Comment by walsh.br...@gmail.com, Oct 20, 2010

Can you provide an example on how it can be used in Maven? For some reason tests are skipped when run under maven

Comment by seba.arm...@gmail.com, May 12, 2011

any way to launch easyb from testNG? (Example with Maven please)


Sign in to add a comment
Powered by Google Project Hosting