Skip to content

Commit e7646df

Browse files
authored
Merge pull request #5068 from antlechner/antonia/load-whole-jar-option
[TG-9219] Add new option --ignore-manifest-main-class
2 parents a3aee7d + 54ee1a9 commit e7646df

15 files changed

+173
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<groupId>org.cprover.regression</groupId>
7+
<artifactId>regression</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
10+
<build>
11+
<finalName>jar-file</finalName>
12+
<plugins>
13+
<plugin>
14+
<groupId>org.apache.maven.plugins</groupId>
15+
<artifactId>maven-jar-plugin</artifactId>
16+
<configuration>
17+
<archive>
18+
<manifest>
19+
<mainClass>org.cprover.first.RelevantClass</mainClass>
20+
</manifest>
21+
</archive>
22+
</configuration>
23+
</plugin>
24+
</plugins>
25+
</build>
26+
27+
<properties>
28+
<maven.compiler.source>1.8</maven.compiler.source>
29+
<maven.compiler.target>1.8</maven.compiler.target>
30+
</properties>
31+
32+
</project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.cprover.first;
2+
3+
public class IrrelevantClass {
4+
5+
public static void notImportant() { assert true; }
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package org.cprover.first;
2+
3+
public class RelatedClass { public int i; }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.cprover.first;
2+
3+
import org.cprover.second.RelatedClassOtherPkg;
4+
5+
public class RelevantClass {
6+
7+
public static void entry(RelatedClass rc, RelatedClassOtherPkg rcop) {
8+
assert false;
9+
}
10+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.cprover.second;
2+
3+
public class IrrelevantClassOtherPkg {
4+
5+
public static void notImportant() { assert true; }
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package org.cprover.second;
2+
3+
public class RelatedClassOtherPkg { public int i; }
4.35 KB
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CORE
2+
target/jar-file.jar
3+
--verbosity 10
4+
^EXIT=6$
5+
^SIGNAL=0$
6+
Getting class 'org\.cprover\.first\.RelevantClass' from JAR target\/jar-file.jar
7+
Getting class 'org\.cprover\.first\.RelatedClass' from JAR target\/jar-file.jar
8+
Getting class 'org\.cprover\.second\.RelatedClassOtherPkg' from JAR target\/jar-file.jar
9+
no entry point
10+
--
11+
Getting class 'org\.cprover\.first\.IrrelevantClass' from JAR target\/jar-file.jar
12+
Getting class 'org\.cprover\.second\.IrrelevantClassOtherPkg' from JAR target\/jar-file.jar
13+
--
14+
This test checks that without the --ignore-manifest-main-class method, we only
15+
load those classes that are referenced by the main class specified in the
16+
manifest file of a jar file.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CORE
2+
target/jar-file.jar
3+
--verbosity 10 --ignore-manifest-main-class --function 'org.cprover.second.IrrelevantClassOtherPkg.<init>'
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
Getting class 'org\.cprover\.second\.IrrelevantClassOtherPkg' from JAR target\/jar-file.jar
7+
--
8+
Getting class 'org\.cprover\.first\.RelevantClass' from JAR target\/jar-file.jar
9+
Getting class 'org\.cprover\.first\.RelatedClass' from JAR target\/jar-file.jar
10+
Getting class 'org\.cprover\.second\.RelatedClassOtherPkg' from JAR target\/jar-file.jar
11+
Getting class 'org\.cprover\.first\.IrrelevantClass' from JAR target\/jar-file.jar
12+
--
13+
This test checks that when both --ignore-manifest-main-class and --function are
14+
specified, we use the declaring class of the argument of --function as the main
15+
class from where to start loading other classes.
16+
The difference from the similar test test-ignore-and-function.desc is that in
17+
this case, the main class specified by --function is different from the main
18+
class specified in the JAR manifest file.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CORE
2+
target/jar-file.jar
3+
--verbosity 10 --ignore-manifest-main-class --function org.cprover.first.RelevantClass.entry
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
Getting class 'org\.cprover\.first\.RelevantClass' from JAR target\/jar-file.jar
7+
Getting class 'org\.cprover\.first\.RelatedClass' from JAR target\/jar-file.jar
8+
Getting class 'org\.cprover\.second\.RelatedClassOtherPkg' from JAR target\/jar-file.jar
9+
--
10+
Getting class 'org\.cprover\.first\.IrrelevantClass' from JAR target\/jar-file.jar
11+
Getting class 'org\.cprover\.second\.IrrelevantClassOtherPkg' from JAR target\/jar-file.jar
12+
--
13+
This test checks that when both --ignore-manifest-main-class and --function are
14+
specified, we use the declaring class of the argument of --function as the main
15+
class from where to start loading other classes.

0 commit comments

Comments
 (0)