BDD With JBehave and Netbeans - a First Taste

This is a quick overview of how I created a simple hello world example using JBehave and Netbeans, following the BDD development practices.

Create a New Project

Create a new project in Netbeans Ctrl-Shift-N

Select a Java Application template (from the Java category) and call the project HelloBDDWorld

1
2
3
4
5
6
7
8
9
package org.jr0cket.scenarios;
import org.jbehave.scenario.Scenario;
public class IReceiveAGreetingWhenILogin extends Scenario {
public IReceiveAGreetingWhenILogin(){
super(new LoginSteps());
}
}

``` LoginSteps.java

package org.jr0cket.scenarios;

import org.jbehave.scenario.steps.Steps;

class LoginSteps extends Steps {

public LoginSteps() {   }

}

This exercise is based on the two minute tutorial on the JBehave site, with some added details for Netbeans and a couple of corrections.

Thank you.
@jr0cket


This work is licensed under a Creative Commons Attribution 4.0 ShareAlike License, including custom images & stylesheets. Permissions beyond the scope of this license may be available at @jr0cket
Creative Commons License