Skip to content

Commit

Permalink
add full support for Java 11 (STAMP-project#973)
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus authored Nov 7, 2020
1 parent c082cfc commit 5fc70c8
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 69 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ language: java

sudo: required

jdk: openjdk8
jdk: openjdk11

env:
- SCRIPT=travis-openjdk8.sh
- SCRIPT=travis-oraclejdk8.sh
- SCRIPT=travis-coverage.sh
- SCRIPT=travis-jar.sh
# - SCRIPT=travis-dspot-maven.sh
Expand Down
2 changes: 1 addition & 1 deletion .travis/travis-coverage.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

cd dspot && mvn -Pcoveralls -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID -DdoIntegrationTests=true clean test jacoco:report coveralls:report
cd dspot && mvn -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID -DdoIntegrationTests=true clean test
6 changes: 0 additions & 6 deletions .travis/travis-openjdk8.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .travis/travis-oraclejdk8.sh

This file was deleted.

2 changes: 1 addition & 1 deletion docs/dspot-for-dummies.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Install and set-up these programs:

1. [Java 8](https://www.java.com/en/download/help/download_options.xml)
1. [Java](https://www.java.com/en/download/help/download_options.xml)
2. [GIT](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
3. [Maven](https://maven.apache.org/install.html)
4. [Gradle](https://docs.gradle.org/current/userguide/installation.html)
Expand Down
3 changes: 3 additions & 0 deletions dspot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@
<manifest>
<mainClass>eu.stamp_project.Main</mainClass>
</manifest>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import eu.stamp_project.dspot.common.configuration.UserInput;
import eu.stamp_project.dspot.common.miscellaneous.DSpotUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.input.NullInputStream;
import org.apache.maven.shared.invoker.DefaultInvocationRequest;
import org.apache.maven.shared.invoker.DefaultInvoker;
import org.apache.maven.shared.invoker.InvocationRequest;
Expand Down Expand Up @@ -188,6 +189,8 @@ private int _runGoals(boolean specificPom, final String pomPathname, String... g
properties.setProperty("gpg.skip", "true");
request.setProperties(properties);

request.setInputStream(new NullInputStream(1000));

Invoker invoker = new DefaultInvoker();
LOGGER.info("Using {} for maven home", mavenHome);
invoker.setMavenHome(new File(mavenHome));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,6 @@ public void testRunPitDescartes() throws Exception {
assertEquals(2, pitResults.stream().filter(pitResult -> pitResult.getStateOfMutant() == AbstractPitResult.State.KILLED).count());
}

@Test
public void testFailingPit() throws Exception {

setUp("src/test/resources/mockito/", "", false);

try {
builder.runPit();
fail("Should have thrown a RuntimeException");
} catch (RuntimeException e) {
//success
}

try {
builder.runPit(launcher.getFactory().Class().get("info.sanaulla.dal.BookDALTest"));
fail("Should have thrown a RuntimeException");
} catch (RuntimeException e) {
//success
}
}

@Test
public void testSpecificClass() throws Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ public void testSelector() throws Exception {
if (!directory.exists()) {
directory.mkdir();
}
assertEquals(getContentReportFile(), this.testSelectorUnderTest.report().output(this.getTestClass(), outputDirectory ));
String output = this.testSelectorUnderTest.report().output(this.getTestClass(), outputDirectory);
assertTrue(output, stripLineNumbers(output).startsWith(stripLineNumbers(getContentReportFile())));
}

private String stripLineNumbers(String output) {
String result = output.replaceAll("[0-9]+", "");
result = result.replace("java.base/", "");
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,5 @@ protected CtMethod<?> getAmplifiedTest() {
@Override
protected String getContentReportFile() {
return "1 amplified test fails on the new versions." + AmplificationHelper.LINE_SEPARATOR +
"test2(example.TestSuiteExample): String index out of range: -1java.lang.StringIndexOutOfBoundsException: String index out of range: -1" + AmplificationHelper.LINE_SEPARATOR +
"\tat java.lang.String.charAt(String.java:658)" + AmplificationHelper.LINE_SEPARATOR +
"\tat example.Example.charAt(Example.java:16)" + AmplificationHelper.LINE_SEPARATOR +
"\tat example.TestSuiteExample.test2(TestSuiteExample.java:8)" + AmplificationHelper.LINE_SEPARATOR +
"\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)" + AmplificationHelper.LINE_SEPARATOR +
"\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)" + AmplificationHelper.LINE_SEPARATOR +
"\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)" + AmplificationHelper.LINE_SEPARATOR +
"\tat java.lang.reflect.Method.invoke(Method.java:498)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner.run(ParentRunner.java:309)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.Suite.runChild(Suite.java:127)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.Suite.runChild(Suite.java:26)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)" + AmplificationHelper.LINE_SEPARATOR +
"\tat org.junit.runners.ParentRunner.run(ParentRunner.java:309)" + AmplificationHelper.LINE_SEPARATOR +
"\tat eu.stamp_project.testrunner.runner.JUnit4Runner.run(JUnit4Runner.java:63)" + AmplificationHelper.LINE_SEPARATOR +
"\tat eu.stamp_project.testrunner.runner.JUnit4Runner.main(JUnit4Runner.java:27)" + AmplificationHelper.LINE_SEPARATOR;
}
"test2(example.TestSuiteExample): String index out of range: -1java.lang.StringIndexOutOfBoundsException: String index out of range: -1" + AmplificationHelper.LINE_SEPARATOR;}
}

0 comments on commit 5fc70c8

Please sign in to comment.