Skip to content

Commit

Permalink
add basic hello world step to make sure it can run
Browse files Browse the repository at this point in the history
  • Loading branch information
JakimLi committed Sep 29, 2018
1 parent 4892089 commit cb881af
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ gradle-app.setting

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

*/build/
*/out/
20 changes: 20 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
apply plugin: 'java'

allprojects {
group = 'com.github.jakimli.panda'
version = '0.1.0'
}

allprojects {
repositories {
mavenCentral()
}
}

subprojects {
apply plugin: 'java'

ext {
springboot = '2.0.0.RELEASE'
cucumber = '4.0.0'
}
}
5 changes: 5 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies {
compile(
"org.springframework.boot:spring-boot-starter:${springboot}"
)
}
29 changes: 29 additions & 0 deletions steps/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
dependencies {
compile project(":core")

compile(
"io.cucumber:cucumber-java:${cucumber}",
"org.springframework.boot:spring-boot-starter-test:${springboot}"
)

testCompile(
"io.cucumber:cucumber-junit:${cucumber}"
)
}

configurations {
cucumberRuntime {
extendsFrom testRuntime
}
}

task cucumber() {
dependsOn assemble, compileTestJava
doLast {
javaexec {
main = "cucumber.api.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = ['--plugin', 'pretty', '--glue', 'com.github.jakimli.panda', 'src/test/resources']
}
}
}
9 changes: 9 additions & 0 deletions steps/src/main/java/com/github/jakimli/panda/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.github.jakimli.panda;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan
@SpringBootApplication
public class Application {
}
9 changes: 9 additions & 0 deletions steps/src/main/java/com/github/jakimli/panda/Step.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.github.jakimli.panda;

import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;

@SpringBootTest
@ContextConfiguration(classes = Application.class)
public class Step {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.github.jakimli.panda.steps;

import com.github.jakimli.panda.Step;
import cucumber.api.java.en.Given;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class HelloWorldStep extends Step {

@Given("hello")
public void hello() {
assertThat(1, is(1));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.github.jakimli.panda;

import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
public class RunCucumberTest {
}
5 changes: 5 additions & 0 deletions steps/src/test/resources/features/test.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Hello World
THis is the for test

Scenario: test scenario
* hello

0 comments on commit cb881af

Please sign in to comment.