Skip to content

Commit 384d02a

Browse files
Alekh MekaAlekh Meka
authored andcommitted
Added 'runOrder' parameter in POM for Int Tests, Updated Integration tests to sequentially run and added assert statements
1 parent 6e2e412 commit 384d02a

File tree

3 files changed

+102
-7
lines changed

3 files changed

+102
-7
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
<version>0.9.9</version>
108108
<scope>provided</scope>
109109
</dependency>
110-
111110
</dependencies>
112111

113112
<build>
@@ -123,6 +122,7 @@
123122
<include>**/*IT.java</include>
124123
<include>**IT.java</include>
125124
</includes>
125+
<runOrder>alphabetical</runOrder>
126126
</configuration>
127127
<executions>
128128
<execution>

src/test/java/inttest/ConvexIT.java

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,61 @@
22

33
import gr.gousiosg.javacg.stat.JCallGraph;
44
import org.junit.Test;
5+
import org.slf4j.Logger;
6+
import org.slf4j.LoggerFactory;
7+
8+
import java.nio.file.Files;
9+
import java.nio.file.Path;
10+
import java.nio.file.Paths;
11+
12+
import static org.junit.Assert.assertTrue;
513

614
public class ConvexIT {
715

16+
private static final Logger LOGGER = LoggerFactory.getLogger(ConvexIT.class);
17+
818
@Test
9-
public void testGitCase(){
19+
public void testA(){
1020
String [] args = {"git", "-c", "convex"};
1121
JCallGraph.main(args);
1222
}
23+
1324
@Test
14-
public void testBuildCase(){
25+
public void testB(){
1526
String [] args = {"build", "-j", "./artifacts/output/convex-core-0.7.1.jar",
1627
"-t", "./artifacts/output/convex-core-0.7.1-tests.jar", "-o", "convex_core_graph"};
1728
JCallGraph.main(args);
1829
}
1930

2031
@Test
21-
public void testTestCase(){
32+
public void testC(){
2233
String [] args = {"test", "-c", "convex", "-f", "convex_core_graph"};
2334
JCallGraph.main(args);
2435
}
36+
37+
@Test
38+
public void testFinalAssertions(){
39+
40+
// Git Stage
41+
Path convexJar = Paths.get("/artifacts/output/convex-core-0.7.1.jar");
42+
Path convexDependencyJar = Paths.get("/artifacts/output/convex-core-0.7.1-jar-with-dependencies.jar");
43+
Path convexTestJar = Paths.get("/artifacts/output/convex-core-0.7.1-tests.jar");
44+
LOGGER.info("Starting Convex Git Verification");
45+
assertTrue(Files.exists(convexJar));
46+
assertTrue(Files.exists(convexDependencyJar));
47+
assertTrue(Files.exists(convexTestJar));
48+
49+
// Build Stage
50+
Path convexGraph = Paths.get("convex_core_graph");
51+
LOGGER.info("Starting Convex Build Verification");
52+
assertTrue(Files.exists(convexGraph));
53+
54+
55+
// Test Stage
56+
Path genTestFormat = Paths.get("/output/GenTestFormat#primitiveRoundTrip.dot");
57+
Path genTestFormatReachability = Paths.get("/output/GenTestFormat#primitiveRoundTrip-reachability.dot");
58+
assertTrue(Files.exists(genTestFormat));
59+
assertTrue(Files.exists(genTestFormatReachability));
60+
61+
}
2562
}

src/test/java/inttest/MphTableIT.java

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,82 @@
55
import org.slf4j.Logger;
66
import org.slf4j.LoggerFactory;
77

8+
import java.nio.file.Files;
9+
import java.nio.file.Path;
10+
import java.nio.file.Paths;
11+
12+
import static org.junit.Assert.assertTrue;
13+
814
public class MphTableIT {
915
private static final Logger LOGGER = LoggerFactory.getLogger(MphTableIT.class);
1016

1117
@Test
12-
public void testGitCase(){
18+
public void testA(){
1319
String [] args = {"git", "-c", "mph-table"};
1420
JCallGraph.main(args);
1521
}
1622
@Test
17-
public void testBuildCase(){
23+
public void testB(){
1824
String [] args = {"build", "-j", "./artifacts/output/mph-table-1.0.6-SNAPSHOT.jar",
1925
"-t", "./artifacts/output/mph-table-1.0.6-SNAPSHOT-tests.jar", "-o", "mph_table_graph"};
2026
JCallGraph.main(args);
2127
}
2228

2329
@Test
24-
public void testTestCase(){
30+
public void testC(){
2531
String [] args = {"test", "-c", "mph-table", "-f", "mph_table_graph"};
2632
JCallGraph.main(args);
2733
}
34+
35+
@Test
36+
public void testFinalAssertions(){
37+
38+
// Git Stage
39+
Path mphJar = Paths.get("/artifacts/output/mph-table-1.0.6-SNAPSHOT.jar");
40+
Path mphTestJar = Paths.get("/artifacts/output/mph-table-1.0.6-SNAPSHOT-tests.jar");
41+
LOGGER.info("Starting Mph-Table Git Verification");
42+
assertTrue(Files.exists(mphJar));
43+
assertTrue(Files.exists(mphTestJar));
44+
45+
// Build Stage
46+
Path mphGraph = Paths.get("mph_table_graph");
47+
LOGGER.info("Starting Mph-Table Build Verification");
48+
assertTrue(Files.exists(mphGraph));
49+
50+
51+
// Test Stage
52+
Path mphSmartByteSerializer = Paths.get("/output/TestSmartByteSerializer#canRoundTripBytes.dot");
53+
Path mphSmartByteSerializerReachability = Paths.get("/output/TestSmartByteSerializer#canRoundTripBytes-reachability.dot");
54+
Path mphSmartIntegerSerializer = Paths.get("/output/TestSmartIntegerSerializer#canRoundTripIntegers.dot");
55+
Path mphSmartIntegerSerializerReachability = Paths.get("/output/TestSmartIntegerSerializer#canRoundTripIntegers-reachability.dot");
56+
Path mphSmartListSerializer = Paths.get("/output/TestSmartListSerializer#canRoundTripSerializableLists.dot");
57+
Path mphSmartListSerializerReachability = Paths.get("/output/TestSmartListSerializer#canRoundTripSerializableLists-reachability.dot");
58+
Path mphSmartListSerializerWithGenerator = Paths.get("/output/TestSmartListSerializer#canRoundTripSerializableListsWithGenerator.dot");
59+
Path mphSmartListSerializerWithGeneratorReachability = Paths.get("/output/TestSmartListSerializer#canRoundTripSerializableListsWithGenerator-reachability.dot");
60+
Path mphSmartLongSerializer = Paths.get("/output/TestSmartLongSerializer#canRoundTripLongs.dot");
61+
Path mphSmartLongSerializerReachability = Paths.get("/output/TestSmartLongSerializer#canRoundTripLongs-reachability.dot");
62+
Path mphSmartPairSerializer = Paths.get("/output/TestSmartPairSerializer#canRoundTripPairs.dot");
63+
Path mphSmartPairSerializerReachability = Paths.get("/output/TestSmartPairSerializer#canRoundTripPairs-reachability.dot");
64+
Path mphSmartShortSerializer = Paths.get("/output/TestSmartShortSerializer#canRoundTripShort.dot");
65+
Path mphSmartShortSerializerReachability = Paths.get("/output/TestSmartShortSerializer#canRoundTripShort-reachability.dot");
66+
Path mphSmartStringSerializer = Paths.get("/output/TestSmartStringSerializer#canRoundTripStrings.dot");
67+
Path mphSmartStringSerializerReachability = Paths.get("/output/TestSmartStringSerializer#canRoundTripStrings-reachability.dot");
68+
assertTrue(Files.exists(mphSmartByteSerializer));
69+
assertTrue(Files.exists(mphSmartByteSerializerReachability));
70+
assertTrue(Files.exists(mphSmartIntegerSerializer));
71+
assertTrue(Files.exists(mphSmartIntegerSerializerReachability));
72+
assertTrue(Files.exists(mphSmartListSerializer));
73+
assertTrue(Files.exists(mphSmartListSerializerReachability));
74+
assertTrue(Files.exists(mphSmartListSerializerWithGenerator));
75+
assertTrue(Files.exists(mphSmartListSerializerWithGeneratorReachability));
76+
assertTrue(Files.exists(mphSmartLongSerializer));
77+
assertTrue(Files.exists(mphSmartLongSerializerReachability));
78+
assertTrue(Files.exists(mphSmartPairSerializer));
79+
assertTrue(Files.exists(mphSmartPairSerializerReachability));
80+
assertTrue(Files.exists(mphSmartShortSerializer));
81+
assertTrue(Files.exists(mphSmartShortSerializerReachability));
82+
assertTrue(Files.exists(mphSmartStringSerializer));
83+
assertTrue(Files.exists(mphSmartStringSerializerReachability));
84+
85+
}
2886
}

0 commit comments

Comments
 (0)