Skip to content

Commit

Permalink
JAL-217 Add Cucumber to Hello World
Browse files Browse the repository at this point in the history
  • Loading branch information
vvedenin committed Apr 13, 2016
1 parent deea71e commit 9dfb500
Show file tree
Hide file tree
Showing 55 changed files with 124 additions and 3 deletions.
59 changes: 59 additions & 0 deletions hellowords/1.1-common-frameworks-and-lib/cucumber/pom.xml
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>1.1-common-frameworks-and-lib</artifactId>
<groupId>com.github.vedenin</groupId>
<version>0.01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cucumber</artifactId>
<name>Common frameworks:: Cucumber</name>

<properties>
<java.version>1.7</java.version>
<junit.version>4.12</junit.version>
<cucumber.version>1.2.4</cucumber.version>
<maven.compiler.version>3.3</maven.compiler.version>
</properties>

<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgument>-Werror</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,12 @@
/**
* Cucumber Hello World
*
* * To run using "maven test"
*/
public class Belly {
public void eat(int cukes) {
for(int i=0; i< cukes; i++ ){
System.out.println("I'm eating " + (i + 1) + " cuke");
}
}
}
@@ -0,0 +1,11 @@
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

/**
* To run using "maven test"
*/
@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty"})
public class HelloWorldTest {
}
@@ -0,0 +1,31 @@
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;

/**
* To run using "maven test"
*/
public class Stepdefs {
@Given("^I have (\\d+) cukes in my belly$")
public void I_have_cukes_in_my_belly(int cukes) throws Throwable {
Belly belly = new Belly();
belly.eat(cukes);
}

@When("^I wait (\\d+) seconds$")
public void i_wait_hour(int arg1) throws Throwable {
Thread.sleep(10000);
}

@Then("^my belly should growl$")
public void my_belly_should_growl() throws Throwable {
System.out.println("My belly growl");
}

@Then("^I say Hello World!$")
public void i_say_Hello_World() throws Throwable {
System.out.println();
System.out.println("Hello World!");
}

}
@@ -0,0 +1,7 @@
Feature: Belly

Scenario: a few cukes
Given I have 42 cukes in my belly
When I wait 10 seconds
Then my belly should growl
Then I say Hello World!
Expand Up @@ -5,7 +5,7 @@
<packaging>pom</packaging>

<groupId>com.github.vedenin</groupId>
<artifactId>1.1-common-frameworks</artifactId>
<artifactId>1.1-common-frameworks-and-lib</artifactId>
<version>0.01</version>
<name>Common frameworks</name>

Expand All @@ -28,5 +28,6 @@
<module>quasar</module>
<module>apache-commons</module>
<module>guava</module>
<module>cucumber</module>
</modules>
</project>
@@ -1,5 +1,5 @@
#Generated by Maven
#Wed Apr 13 11:29:23 CEST 2016
#Wed Apr 13 14:45:57 CEST 2016
version=0.1-SNAPSHOT
groupId=com.github.vedenin
artifactId=dependency-injection-guice
2 changes: 1 addition & 1 deletion hellowords/pom.xml
Expand Up @@ -25,7 +25,7 @@


<modules>
<module>1.1-common-frameworks</module>
<module>1.1-common-frameworks-and-lib</module>
<module>1.6-usefull-libraries</module>
<module>2.8-machine-learning</module>
<module>2.8-natural-language-processing</module>
Expand Down

0 comments on commit 9dfb500

Please sign in to comment.