Skip to content

Commit

Permalink
Rearrange unit and integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
valfirst committed Feb 20, 2019
1 parent 69879eb commit f8d201c
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.valfirst.jbehave.junit.monitoring.suite;
package com.github.valfirst.jbehave.junit.monitoring;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
Expand All @@ -18,9 +18,9 @@
import org.junit.runners.Parameterized.Parameters;
import org.mockito.Mock;

import com.github.valfirst.jbehave.junit.monitoring.ExampleScenarioJUnitStories;
import com.github.valfirst.jbehave.junit.monitoring.ExampleScenarioJUnitStoriesLocalized;
import com.github.valfirst.jbehave.junit.monitoring.ExampleScenarioJUnitStory;
import com.github.valfirst.jbehave.junit.monitoring.story.ExampleScenarioJUnitStories;
import com.github.valfirst.jbehave.junit.monitoring.story.ExampleScenarioJUnitStoriesLocalized;
import com.github.valfirst.jbehave.junit.monitoring.story.ExampleScenarioJUnitStory;
import com.github.valfirst.jbehave.junit.monitoring.JUnitReportingRunner;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.valfirst.jbehave.junit.monitoring;
package com.github.valfirst.jbehave.junit.monitoring.story;

import java.util.Arrays;
import java.util.List;
Expand All @@ -10,6 +10,7 @@
import org.jbehave.core.steps.InstanceStepsFactory;
import org.junit.runner.RunWith;

import com.github.valfirst.jbehave.junit.monitoring.JUnitReportingRunner;
import com.github.valfirst.jbehave.junit.monitoring.step.ExampleSteps;

@RunWith(JUnitReportingRunner.class)
Expand All @@ -31,8 +32,8 @@ public Configuration configuration() {

@Override
protected List<String> storyPaths() {
return Arrays.asList("com/github/valfirst/jbehave/junit/monitoring/Multiplication.story",
"com/github/valfirst/jbehave/junit/monitoring/Empty.story");
return Arrays.asList("com/github/valfirst/jbehave/junit/monitoring/story/Multiplication.story",
"com/github/valfirst/jbehave/junit/monitoring/story/Empty.story");
}

}
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package com.github.valfirst.jbehave.junit.monitoring;
package com.github.valfirst.jbehave.junit.monitoring.story;

import java.util.Collections;
import java.util.List;
import java.util.Locale;

import com.github.valfirst.jbehave.junit.monitoring.JUnitReportingRunner;

import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.i18n.LocalizedKeywords;
import org.jbehave.core.parsers.RegexStoryParser;
import org.junit.runner.RunWith;

@RunWith(JUnitReportingRunner.class)
public class ExampleScenarioJUnitStoriesLocalized extends ExampleScenarioJUnitStories {
public class ExampleScenarioJUnitStoriesLocalized extends ExampleScenarioJUnitStories
{

@Override
public Configuration configuration() {
Expand All @@ -25,6 +28,6 @@ public Configuration configuration() {

@Override
protected List<String> storyPaths() {
return Collections.singletonList("com/github/valfirst/jbehave/junit/monitoring/Multiplication_de.story");
return Collections.singletonList("com/github/valfirst/jbehave/junit/monitoring/story/Multiplication_de.story");
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.valfirst.jbehave.junit.monitoring;
package com.github.valfirst.jbehave.junit.monitoring.story;

import com.github.valfirst.jbehave.junit.monitoring.JUnitReportingRunner;
import com.github.valfirst.jbehave.junit.monitoring.step.ExampleSteps;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.configuration.MostUsefulConfiguration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.valfirst.jbehave.junit.monitoring;
package com.github.valfirst.jbehave.junit.monitoring.story;

import com.github.valfirst.jbehave.junit.monitoring.JUnitReportingRunner;
import com.github.valfirst.jbehave.junit.monitoring.step.ExampleSteps;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.configuration.MostUsefulConfiguration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.valfirst.jbehave.junit.monitoring;
package com.github.valfirst.jbehave.junit.monitoring.story;

import com.github.valfirst.jbehave.junit.monitoring.JUnitReportingRunner;
import com.github.valfirst.jbehave.junit.monitoring.step.ExampleSteps;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.configuration.MostUsefulConfiguration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.github.valfirst.jbehave.junit.monitoring;
package com.github.valfirst.jbehave.junit.monitoring.story;

import java.util.Arrays;

import com.github.valfirst.jbehave.junit.monitoring.JUnitReportingRunner;
import com.github.valfirst.jbehave.junit.monitoring.step.ExampleSteps;

import org.jbehave.core.configuration.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.valfirst.jbehave.junit.monitoring.suite;
package com.github.valfirst.jbehave.junit.monitoring.story;

import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -46,7 +46,7 @@ public InjectableStepsFactory stepsFactory() {

@Override
protected List<String> storyPaths() {
return Collections.singletonList("com/github/valfirst/jbehave/junit/monitoring/Multiplication.story");
return Collections.singletonList("com/github/valfirst/jbehave/junit/monitoring/story/Multiplication.story");
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.valfirst.jbehave.junit.monitoring;
package com.github.valfirst.jbehave.junit.monitoring.story;

import com.github.valfirst.jbehave.junit.monitoring.JUnitReportingRunner;
import com.github.valfirst.jbehave.junit.monitoring.step.ExampleSteps;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.configuration.MostUsefulConfiguration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.valfirst.jbehave.junit.monitoring.suite;
package com.github.valfirst.jbehave.junit.monitoring.story;

import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -72,6 +72,6 @@ public InjectableStepsFactory stepsFactory() {
@Override
protected List<String> storyPaths() {
return Collections.singletonList(
"com/github/valfirst/jbehave/junit/monitoring/MultiplicationWithExamplesAndGiven.story");
"com/github/valfirst/jbehave/junit/monitoring/story/MultiplicationWithExamplesAndGiven.story");
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GivenStories: com/github/valfirst/jbehave/junit/monitoring/Greetings.story
GivenStories: com/github/valfirst/jbehave/junit/monitoring/story/Greetings.story

Scenario: Greetings from Extraterrestrials to Earthlings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ Examples:

Scenario: 2 x 3 success with given stories

GivenStories: com/github/valfirst/jbehave/junit/monitoring/Init.story,
com/github/valfirst/jbehave/junit/monitoring/Greetings.story,
com/github/valfirst/jbehave/junit/monitoring/GreetingsFromExtraterrestrials.story
GivenStories: com/github/valfirst/jbehave/junit/monitoring/story/Init.story,
com/github/valfirst/jbehave/junit/monitoring/story/Greetings.story,
com/github/valfirst/jbehave/junit/monitoring/story/GreetingsFromExtraterrestrials.story

Given a variable x with value 3
When I multiply x by 2
Then x should equal 6

Scenario: 2 x 3 fail with given stories

GivenStories: com/github/valfirst/jbehave/junit/monitoring/Init.story,
com/github/valfirst/jbehave/junit/monitoring/Greetings.story
GivenStories: com/github/valfirst/jbehave/junit/monitoring/story/Init.story,
com/github/valfirst/jbehave/junit/monitoring/story/Greetings.story

Given a variable x with value 3
When I multiply x by 2
Then x should equal 7

Scenario: parameterized given stories

GivenStories: com/github/valfirst/jbehave/junit/monitoring/ParameterizedGreetings.story#{0},
com/github/valfirst/jbehave/junit/monitoring/ParameterizedGreetings.story#{1}
GivenStories: com/github/valfirst/jbehave/junit/monitoring/story/ParameterizedGreetings.story#{0},
com/github/valfirst/jbehave/junit/monitoring/story/ParameterizedGreetings.story#{1}

Given a Greeting to Parameterized Stories
And a Greeting to <name>
Expand All @@ -64,7 +64,7 @@ Examples:

Scenario: non-parameterized given stories with example tables

GivenStories: com/github/valfirst/jbehave/junit/monitoring/Greetings.story
GivenStories: com/github/valfirst/jbehave/junit/monitoring/story/Greetings.story

Given a Greeting to Parameterized Stories
And a Greeting to <name>
Expand Down

0 comments on commit f8d201c

Please sign in to comment.