Skip to content

Commit df96bde

Browse files
committed
work for #29
1 parent ebdf13a commit df96bde

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
<plugin>
204204
<groupId>org.jacoco</groupId>
205205
<artifactId>jacoco-maven-plugin</artifactId>
206-
<version>0.8.4</version>
206+
<version>0.8.12</version>
207207
<executions>
208208
<execution>
209209
<goals>

src/main/java/fr/inria/spirals/npefix/main/all/Launcher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void instrument() {
109109
compiler.compile();
110110
} catch (Throwable e) {
111111
e.printStackTrace();
112-
throw e;
112+
//throw e;
113113
}
114114
logger.debug("End code instrumentation");
115115
}

src/main/java/fr/inria/spirals/npefix/main/run/Main.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static void main(String[] args) throws Exception {
5454
} finally {
5555

5656
}
57-
System.exit(0);
57+
//System.exit(0);// don't do that, it does not run in a test
5858
}
5959

6060
private RepairStrategy getRepairStrategy() throws Exception {
@@ -101,6 +101,9 @@ private NPEOutput multipleRuns(Launcher npefix, List<String> npeTests, Selector
101101
DecisionServer decisionServer = new DecisionServer(selector);
102102
decisionServer.startServer();
103103
List<String> testMethods = npefix.getTests(npeTests.toArray(new String[0]));
104+
if (testMethods.isEmpty()) {
105+
throw new RuntimeException("No test found");
106+
}
104107

105108
NPEOutput output = new NPEOutput();
106109

@@ -224,7 +227,7 @@ private void initJSAP() throws JSAPException {
224227
testOpt.setShortFlag('t');
225228
testOpt.setList(true);
226229
testOpt.setStringParser(JSAP.STRING_PARSER);
227-
testOpt.setHelp("Define the tests of the project (both failing and passing), fully-qualified, separated with ':' (even if the classpath contains other tests, only those are considered.");
230+
testOpt.setHelp("Define the test classes of the project to take into account (both failing and passing), fully-qualified class names, separated with ':' (even if the classpath contains other tests, only those are considered.");
228231
jsap.registerParameter(testOpt);
229232

230233
FlaggedOption complianceLevelOpt = new FlaggedOption("complianceLevel");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package fr.inria.spirals.npefix.main.all;
2+
3+
import org.junit.Ignore;
4+
import org.junit.Test;
5+
6+
public class End2EndTest {
7+
@Test
8+
@Ignore
9+
public void test() throws Exception {
10+
// test end 2 end for helping @Peanu11 in https://github.com/SpoonLabs/npefix/issues/29
11+
12+
// execute command ls
13+
Runtime.getRuntime().exec("rm -rf npefix-src");
14+
15+
fr.inria.spirals.npefix.main.run.Main.main(new String[] { "-s"
16+
, "../npe-dataset/pdfbox_2965/src/"
17+
, "-c"
18+
, "../npe-dataset/pdfbox_2965/target/classes/:../npe-dataset/pdfbox_2965/target/test-classes/:/home/martin/.m2/repository/org/apache/pdfbox/fontbox/2.0.0-RC1/fontbox-2.0.0-RC1.jar:/home/martin/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/home/martin/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.50/bcpkix-jdk15on-1.50.jar:/home/martin/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.50/bcprov-jdk15on-1.50.jar:/home/martin/.m2/repository/junit/junit/4.12/junit-4.12.jar:/home/martin/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"
19+
, "-t"
20+
, "org.apache.pdfbox.pdmodel.interactive.form.PDAcroFormTest"
21+
});
22+
23+
24+
}
25+
}

0 commit comments

Comments
 (0)