From 07d917375712f7e3c663dfef1766f3f8eba9be1d Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Fri, 6 Nov 2020 12:15:48 +0100 Subject: [PATCH] @monperrus at work --- .travis/travis-coverage.sh | 7 ++++++- .../maven/MavenAutomaticBuilder.java | 2 +- .../maven/MavenAutomaticBuilderTest.java | 15 +++------------ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.travis/travis-coverage.sh b/.travis/travis-coverage.sh index d475c92e3..ec4212117 100755 --- a/.travis/travis-coverage.sh +++ b/.travis/travis-coverage.sh @@ -1,3 +1,8 @@ #!/usr/bin/env bash -cd dspot && mvn -Pcoveralls -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID -DdoIntegrationTests=true clean test jacoco:report coveralls:report +set -e +cd dspot + +mvn test -D test=eu.stamp_project.dspot.selector.ChangeDetectorSelectorTest + +mvn -Pcoveralls -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID -DdoIntegrationTests=true clean test jacoco:report coveralls:report diff --git a/dspot/src/main/java/eu/stamp_project/dspot/common/automaticbuilder/maven/MavenAutomaticBuilder.java b/dspot/src/main/java/eu/stamp_project/dspot/common/automaticbuilder/maven/MavenAutomaticBuilder.java index 1c775eeab..1fceb59cc 100644 --- a/dspot/src/main/java/eu/stamp_project/dspot/common/automaticbuilder/maven/MavenAutomaticBuilder.java +++ b/dspot/src/main/java/eu/stamp_project/dspot/common/automaticbuilder/maven/MavenAutomaticBuilder.java @@ -149,7 +149,7 @@ public void runPit(CtType... testClasses) { "" // }; if (this.runGoals(true, goals) != 0) { - throw new RuntimeException("Maven build failed! Enable verbose mode for more information (--verbose)"); + throw new RuntimeException("Maven build failed! Enable verbose mode for more information (--verbose)" + t); } } catch (Exception e) { throw new RuntimeException(e); diff --git a/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/maven/MavenAutomaticBuilderTest.java b/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/maven/MavenAutomaticBuilderTest.java index 05518a7c0..f1e7a0c33 100644 --- a/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/maven/MavenAutomaticBuilderTest.java +++ b/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/maven/MavenAutomaticBuilderTest.java @@ -95,20 +95,11 @@ public void testRunPitDescartes() throws Exception { @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"); + setUp("src/test/resources/mockito/", "", false); + fail(); } catch (RuntimeException e) { - //success + assertTrue(e.getMessage().startsWith("Maven build failed")); } }