HA3 Exclude *.json files from test generation

0 votes
asked Nov 17, 2018 in SWSV by peternagy1332 (22 points)  
retagged Nov 17, 2018 by peternagy1332

After merging TestInPeace-ris-2018/master with the ris-2018/master branch (e873235 ) and resolving a single conflict in pom.xml, our travis build failed with the following errors:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project swsv-ris: Compilation failure: Compilation failure: 
[ERROR] /home/travis/build/FTSRG-VIMIMA01/TestInPeace-ris-2018/src/swsv-ris/target/generated-test-sources/graphwalker/track1-behavior-2.java:[7,24] '{' expected
[ERROR] /home/travis/build/FTSRG-VIMIMA01/TestInPeace-ris-2018/src/swsv-ris/target/generated-test-sources/graphwalker/track3-behavior-1.java:[7,24] '{' expected
[ERROR] /home/travis/build/FTSRG-VIMIMA01/TestInPeace-ris-2018/src/swsv-ris/target/generated-test-sources/graphwalker/track6-behavior-1.java:[7,24] '{' expected
[ERROR] /home/travis/build/FTSRG-VIMIMA01/TestInPeace-ris-2018/src/swsv-ris/target/generated-test-sources/graphwalker/track5-behavior-1.java:[7,24] '{' expected
[ERROR] /home/travis/build/FTSRG-VIMIMA01/TestInPeace-ris-2018/src/swsv-ris/target/generated-test-sources/graphwalker/track2-behavior-1.java:[7,24] '{' expected
[ERROR] /home/travis/build/FTSRG-VIMIMA01/TestInPeace-ris-2018/src/swsv-ris/target/generated-test-sources/graphwalker/track7-behavior-1.java:[7,24] '{' expected
[ERROR] /home/travis/build/FTSRG-VIMIMA01/TestInPeace-ris-2018/src/swsv-ris/target/generated-test-sources/graphwalker/track4-behavior-1.java:[7,24] '{' expected
[ERROR] /home/travis/build/FTSRG-VIMIMA01/TestInPeace-ris-2018/src/swsv-ris/target/generated-test-sources/graphwalker/track1-behavior-1.java:[7,24] '{' expected

We were able to reproduce the issue locally, by running:

mvn clean verify

This command has generated some strange classes from the integration test resource files (*.json) to the target/generated-test-resources/graphwalker folder.

// Generated by GraphWalker (http://www.graphwalker.org)
import org.graphwalker.java.annotation.Model;
import org.graphwalker.java.annotation.Vertex;
import org.graphwalker.java.annotation.Edge;

@Model(file = "track1-behavior-1.json")
public interface track1-behavior-1 {
}

I suspect we should somehow exclude src/it/resources directory from compiling test sources.

We'd appreciate your help. Many thanks!

commented Nov 19, 2018 by micskeiz (2,873 points)  
For me, GW throws the following errors:

[INFO] --- graphwalker-maven-plugin:3.4.2:generate-test-sources (generate-test-sources) @ swsv-ris ---
[ERROR] No suitable context factory found
[ERROR] java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
[ERROR] com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
[ERROR] java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
[ERROR] com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
[INFO]

But it does not generate test sources from the it jsons.

I see that the build is now passing for you.

How did you solve it?

Please log in or register to answer this question.

...