Skip to content

Commit 8ac7757

Browse files
authored
Merge pull request gousiosg#14 from bitslab/alekh
Integration Tests - Convex and Mph-Table
2 parents a3faa41 + 9c89a31 commit 8ac7757

File tree

4 files changed

+170
-3
lines changed

4 files changed

+170
-3
lines changed

artifacts/configs/mph-table/mph-table.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ properties:
1919
entryPoint: "com.indeed.mph.serializers.TestSmartLongSerializer.canRoundTripLongs(J)V"
2020
- name: TestSmartPairSerializer#canRoundTripPairs
2121
entryPoint: "com.indeed.mph.serializers.TestSmartPairSerializer.canRoundTripPairs(Lcom/indeed/util/core/Pair;)V"
22-
- name: TestSmartOptionalSerializer#java#canRoundTripPresentOptionals
23-
entryPoint: "com.indeed.mph.serializers.TestSmartOptionalSerializer.java.canRoundTripPresentOptionals(J)V"
2422
- name: TestSmartListSerializer#canRoundTripSerializableLists
2523
entryPoint: "com.indeed.mph.serializers.TestSmartListSerializer.canRoundTripSerializableLists(Ljava/util/List;Ljava/util/List;Ljava/util/List;)V"
2624
- name: TestSmartListSerializer#canRoundTripSerializableListsWithGenerator

pom.xml

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

113112
<build>
114113
<plugins>
114+
<plugin>
115+
<groupId>org.apache.maven.plugins</groupId>
116+
<artifactId>maven-failsafe-plugin</artifactId>
117+
<version>2.22.0</version>
118+
<configuration>
119+
<skipTests>false</skipTests>
120+
<includes>
121+
<include>**/**/*IT.java</include>
122+
<include>**/*IT.java</include>
123+
<include>**IT.java</include>
124+
</includes>
125+
<runOrder>alphabetical</runOrder>
126+
</configuration>
127+
<executions>
128+
<execution>
129+
<goals>
130+
<goal>integration-test</goal>
131+
<goal>verify</goal>
132+
</goals>
133+
</execution>
134+
</executions>
135+
</plugin>
136+
115137
<plugin>
116138
<groupId>org.codehaus.mojo</groupId>
117139
<artifactId>jaxb2-maven-plugin</artifactId>

src/test/java/inttest/ConvexIT.java

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package inttest;
2+
3+
import gr.gousiosg.javacg.stat.JCallGraph;
4+
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;
13+
14+
public class ConvexIT {
15+
16+
// private static final Logger LOGGER = LoggerFactory.getLogger(ConvexIT.class);
17+
//
18+
// @Test
19+
// public void testA(){
20+
// String [] args = {"git", "-c", "convex"};
21+
// JCallGraph.main(args);
22+
// }
23+
//
24+
// @Test
25+
// public void testB(){
26+
// String [] args = {"build", "-j", "./artifacts/output/convex-core-0.7.1.jar",
27+
// "-t", "./artifacts/output/convex-core-0.7.1-tests.jar", "-o", "convex_core_graph"};
28+
// JCallGraph.main(args);
29+
// }
30+
//
31+
// @Test
32+
// public void testC(){
33+
// String [] args = {"test", "-c", "convex", "-f", "convex_core_graph"};
34+
// JCallGraph.main(args);
35+
// }
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+
// }
62+
}

src/test/java/inttest/MphTableIT.java

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
package inttest;
2+
3+
import gr.gousiosg.javacg.stat.JCallGraph;
4+
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;
13+
14+
public class MphTableIT {
15+
private static final Logger LOGGER = LoggerFactory.getLogger(MphTableIT.class);
16+
17+
@Test
18+
public void testA(){
19+
String [] args = {"git", "-c", "mph-table"};
20+
JCallGraph.main(args);
21+
}
22+
@Test
23+
public void testB(){
24+
String [] args = {"build", "-j", "./artifacts/output/mph-table-1.0.6-SNAPSHOT.jar",
25+
"-t", "./artifacts/output/mph-table-1.0.6-SNAPSHOT-tests.jar", "-o", "mph_table_graph"};
26+
JCallGraph.main(args);
27+
}
28+
29+
@Test
30+
public void testC(){
31+
String [] args = {"test", "-c", "mph-table", "-f", "mph_table_graph"};
32+
JCallGraph.main(args);
33+
}
34+
35+
@Test
36+
public void testD(){
37+
// Git Stage
38+
Path mphJar = Paths.get(System.getProperty("user.dir"),"artifacts","output","mph-table-1.0.6-SNAPSHOT.jar");
39+
Path mphTestJar = Paths.get(System.getProperty("user.dir"),"artifacts","output","mph-table-1.0.6-SNAPSHOT-tests.jar");
40+
LOGGER.info("Starting Mph-Table Git Verification");
41+
assertTrue(Files.exists(mphJar));
42+
assertTrue(Files.exists(mphTestJar));
43+
44+
45+
// Build Stage
46+
Path mphGraph = Paths.get(System.getProperty("user.dir"),"mph_table_graph");
47+
LOGGER.info("Starting Mph-Table Build Verification");
48+
assertTrue(Files.exists(mphGraph));
49+
50+
// Test Stage
51+
Path mphSmartByteSerializer = Paths.get(System.getProperty("user.dir"),"output","TestSmartByteSerializer#canRoundTripBytes.dot");
52+
Path mphSmartByteSerializerReachability = Paths.get(System.getProperty("user.dir"),"output","TestSmartByteSerializer#canRoundTripBytes-reachability.dot");
53+
Path mphSmartIntegerSerializer = Paths.get(System.getProperty("user.dir"),"output","TestSmartIntegerSerializer#canRoundTripIntegers.dot");
54+
Path mphSmartIntegerSerializerReachability = Paths.get(System.getProperty("user.dir"),"output","TestSmartIntegerSerializer#canRoundTripIntegers-reachability.dot");
55+
Path mphSmartListSerializer = Paths.get(System.getProperty("user.dir"),"output","TestSmartListSerializer#canRoundTripSerializableLists.dot");
56+
Path mphSmartListSerializerReachability = Paths.get(System.getProperty("user.dir"),"output","TestSmartListSerializer#canRoundTripSerializableLists-reachability.dot");
57+
Path mphSmartListSerializerWithGenerator = Paths.get(System.getProperty("user.dir"),"output","TestSmartListSerializer#canRoundTripSerializableListsWithGenerator.dot");
58+
Path mphSmartListSerializerWithGeneratorReachability = Paths.get(System.getProperty("user.dir"),"output","TestSmartListSerializer#canRoundTripSerializableListsWithGenerator-reachability.dot");
59+
Path mphSmartLongSerializer = Paths.get(System.getProperty("user.dir"),"output","TestSmartLongSerializer#canRoundTripLongs.dot");
60+
Path mphSmartLongSerializerReachability = Paths.get(System.getProperty("user.dir"),"output","TestSmartLongSerializer#canRoundTripLongs-reachability.dot");
61+
Path mphSmartPairSerializer = Paths.get(System.getProperty("user.dir"),"output","TestSmartPairSerializer#canRoundTripPairs.dot");
62+
Path mphSmartPairSerializerReachability = Paths.get(System.getProperty("user.dir"),"output","TestSmartPairSerializer#canRoundTripPairs-reachability.dot");
63+
Path mphSmartShortSerializer = Paths.get(System.getProperty("user.dir"),"output","TestSmartShortSerializer#canRoundTripShort.dot");
64+
Path mphSmartShortSerializerReachability = Paths.get(System.getProperty("user.dir"),"output","TestSmartShortSerializer#canRoundTripShort-reachability.dot");
65+
Path mphSmartStringSerializer = Paths.get(System.getProperty("user.dir"),"output","TestSmartStringSerializer#canRoundTripStrings.dot");
66+
Path mphSmartStringSerializerReachability = Paths.get(System.getProperty("user.dir"),"output","TestSmartStringSerializer#canRoundTripStrings-reachability.dot");
67+
assertTrue(Files.exists(mphSmartByteSerializer));
68+
assertTrue(Files.exists(mphSmartByteSerializerReachability));
69+
assertTrue(Files.exists(mphSmartIntegerSerializer));
70+
assertTrue(Files.exists(mphSmartIntegerSerializerReachability));
71+
assertTrue(Files.exists(mphSmartListSerializer));
72+
assertTrue(Files.exists(mphSmartListSerializerReachability));
73+
assertTrue(Files.exists(mphSmartListSerializerWithGenerator));
74+
assertTrue(Files.exists(mphSmartListSerializerWithGeneratorReachability));
75+
assertTrue(Files.exists(mphSmartLongSerializer));
76+
assertTrue(Files.exists(mphSmartLongSerializerReachability));
77+
assertTrue(Files.exists(mphSmartPairSerializer));
78+
assertTrue(Files.exists(mphSmartPairSerializerReachability));
79+
assertTrue(Files.exists(mphSmartShortSerializer));
80+
assertTrue(Files.exists(mphSmartShortSerializerReachability));
81+
assertTrue(Files.exists(mphSmartStringSerializer));
82+
assertTrue(Files.exists(mphSmartStringSerializerReachability));
83+
84+
}
85+
}

0 commit comments

Comments
 (0)