Skip to content

Commit

Permalink
fix: fixed an issue loading the JSON test reports during aggregate re…
Browse files Browse the repository at this point in the history
…port generation.
  • Loading branch information
wakaleo committed Feb 19, 2015
1 parent 5894af6 commit 93b836f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/net/thucydides/core/model/TestOutcome.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class TestOutcome {
/**
* The class containing the test method, if the test is implemented in a Java class.
*/
private Class<?> testCase;
private transient Class<?> testCase;

private String testCaseName;

Expand Down Expand Up @@ -1732,7 +1732,7 @@ public boolean equals(Object o) {
if (manual != that.manual) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (qualifier != null ? !qualifier.equals(that.qualifier) : that.qualifier != null) return false;
if (testCase != null ? !testCase.equals(that.testCase) : that.testCase != null) return false;
if (testCaseName != null ? !testCaseName.equals(that.testCaseName) : that.testCaseName != null) return false;
if (title != null ? !title.equals(that.title) : that.title != null) return false;
if (userStory != null ? !userStory.equals(that.userStory) : that.userStory != null) return false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,15 @@ class WhenSerializingJSONObjectWithGSON extends Specification {
then:
loadedTestOutcome == testOutcome
}

def "should load serialized test outcomes from JSON"() {
given:
GsonJSONConverter converter = new GsonJSONConverter(environmentVariables)
and:
def jsonFile = this.class.getResource("/json-reports/sample-report-1.json").getPath()
when:
def loadedTestOutcome = converter.fromJson(new FileInputStream(new File(jsonFile)))
then:
loadedTestOutcome != null
}
}

0 comments on commit 93b836f

Please sign in to comment.