Skip to content

Commit

Permalink
issue cucumber#322: fixed the lookup of the createSuiteDescription me…
Browse files Browse the repository at this point in the history
…thod in DescriptionFactory and made some classes Serializable
  • Loading branch information
Petter Måhlén committed Jan 3, 2013
1 parent 2e23978 commit 16cb45d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Expand Up @@ -5,12 +5,13 @@
import gherkin.formatter.model.ExamplesTableRow;
import gherkin.formatter.model.Tag;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class CucumberExamples {
public class CucumberExamples implements Serializable {
private final CucumberScenarioOutline cucumberScenarioOutline;
private final Examples examples;

Expand Down
Expand Up @@ -15,12 +15,13 @@
import gherkin.formatter.model.ScenarioOutline;
import gherkin.formatter.model.Step;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class CucumberFeature {
public class CucumberFeature implements Serializable {
private final String uri;
private final Feature feature;
private CucumberBackground cucumberBackground;
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/cucumber/runtime/model/StepContainer.java
Expand Up @@ -6,10 +6,11 @@
import gherkin.formatter.model.BasicStatement;
import gherkin.formatter.model.Step;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class StepContainer {
public class StepContainer implements Serializable {
private final List<Step> steps = new ArrayList<Step>();
final CucumberFeature cucumberFeature;
private final BasicStatement statement;
Expand Down
Expand Up @@ -4,6 +4,7 @@
import cucumber.runtime.Utils;
import org.junit.runner.Description;

import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.Array;
import java.lang.reflect.Method;
Expand All @@ -21,7 +22,7 @@ public class DescriptionFactory {

static {
try {
CREATE_SUITE_DESCRIPTION = Description.class.getMethod("createSuiteDescription", String.class, Object.class, Array.newInstance(Annotation.class, 0).getClass());
CREATE_SUITE_DESCRIPTION = Description.class.getMethod("createSuiteDescription", String.class, Serializable.class, Array.newInstance(Annotation.class, 0).getClass());
USE_UNIQUE_ID = true;
} catch (NoSuchMethodException e) {
try {
Expand All @@ -33,7 +34,7 @@ public class DescriptionFactory {
}
}

public static Description createDescription(String name, Object uniqueId) {
public static Description createDescription(String name, Serializable uniqueId) {
if (USE_UNIQUE_ID) {
try {
return (Description) Utils.invoke(null, CREATE_SUITE_DESCRIPTION, 0, name, uniqueId, Array.newInstance(Annotation.class, 0));
Expand Down

0 comments on commit 16cb45d

Please sign in to comment.