-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix reporting and add a minimal set of it-tests
- Loading branch information
Showing
23 changed files
with
526 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>it.scoverage-maven-plugin</groupId> | ||
<artifactId>integration_tests_parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
<name>Scoverage Plugin Integration Tests Parent</name> | ||
<description>Scoverage Plugin Integration Tests Parent</description> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<junit.version>4.13</junit.version> | ||
<scalatest.version>3.2.17</scalatest.version> | ||
|
||
<compiler.plugin.version>3.11.0</compiler.plugin.version> | ||
<surefire.plugin.version>3.1.2</surefire.plugin.version> | ||
<scala.plugin.version>4.8.1</scala.plugin.version> | ||
<scalatest.plugin.version>2.0.0</scalatest.plugin.version> | ||
<project-info-reports.plugin.version>3.5.0</project-info-reports.plugin.version> | ||
<site.plugin.version>3.12.1</site.plugin.version> | ||
|
||
<scala.compat.version>2.13</scala.compat.version> | ||
<scala.minor.version>12</scala.minor.version> | ||
<scala.version>${scala.compat.version}.${scala.minor.version}</scala.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.scala-lang</groupId> | ||
<artifactId>scala-library</artifactId> | ||
<version>${scala.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>${junit.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.scalatest</groupId> | ||
<artifactId>scalatest_${scala.compat.version}</artifactId> | ||
<version>${scalatest.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<sourceDirectory>src/main/scala</sourceDirectory> | ||
<testSourceDirectory>src/test/scala</testSourceDirectory> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>${compiler.plugin.version}</version> | ||
<configuration> | ||
<skipMain>true</skipMain> <!-- skip compile --> | ||
<skip>true</skip> <!-- skip testCompile --> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>${surefire.plugin.version}</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>net.alchim31.maven</groupId> | ||
<artifactId>scala-maven-plugin</artifactId> | ||
<version>${scala.plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<id>default-sbt-compile</id> | ||
<goals> | ||
<goal>compile</goal> | ||
<goal>testCompile</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-site-plugin</artifactId> | ||
<version>${site.plugin.version}</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.scalatest</groupId> | ||
<artifactId>scalatest-maven-plugin</artifactId> | ||
<version>${scalatest.plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<id>test</id> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>test</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
<reporting> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>${project-info-reports.plugin.version}</version> | ||
<reportSets> | ||
<reportSet> | ||
<reports> | ||
<report>index</report> | ||
</reports> | ||
</reportSet> | ||
</reportSets> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<reportSets> | ||
<reportSet> | ||
<reports> | ||
<report>report</report> <!-- select only one report from: report, integration-report and report-only reporters --> | ||
</reports> | ||
</reportSet> | ||
</reportSets> | ||
</plugin> | ||
</plugins> | ||
</reporting> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals=clean verify site -e -ntp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>it.scoverage-maven-plugin</groupId> | ||
<artifactId>integration_tests_parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>../integration_tests_parent/pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>test_ScalaMavenPlugin_Scala212_JUnit</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<name>Test Scoverage Report using scala-maven-plugin, Scala 2.12 and JUnit</name> | ||
<description>Test Scoverage Report using scala-maven-plugin, Scala 2.12 and JUnit</description> | ||
|
||
<properties> | ||
<scala.compat.version>2.12</scala.compat.version> | ||
<scala.minor.version>18</scala.minor.version> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>net.alchim31.maven</groupId> | ||
<artifactId>scala-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
6 changes: 6 additions & 0 deletions
6
src/it/test_ScalaMavenPlugin_Scala212_JUnit/src/main/scala/HelloServiceScala.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package service | ||
|
||
object HelloServiceScala { | ||
def hello = { "Hello" } | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/it/test_ScalaMavenPlugin_Scala212_JUnit/src/test/scala/HelloServiceScalaTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package service | ||
|
||
import org.junit.Test; | ||
import org.junit.Assert.assertEquals | ||
|
||
class HelloServiceScalaTest | ||
{ | ||
@Test | ||
def test1() = assertEquals("Hello", HelloServiceScala.hello) | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
src/it/test_ScalaMavenPlugin_Scala212_JUnit/validate.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
try { | ||
|
||
def logFile = new File(basedir, "build.log") | ||
def lines = logFile.readLines() | ||
assert lines.contains("[INFO] Statement coverage.: 100.00%") | ||
assert lines.contains("[INFO] Branch coverage....: 100.00%") | ||
|
||
def scoverageFile = new File(basedir, "target/scoverage.xml") | ||
assert scoverageFile.exists() | ||
|
||
def reportFile = new File(basedir, "target/site/scoverage/index.html") | ||
assert reportFile.exists() | ||
|
||
return true | ||
|
||
} catch (Throwable e) { | ||
e.printStackTrace() | ||
return false | ||
} |
1 change: 1 addition & 0 deletions
1
src/it/test_ScalaMavenPlugin_Scala212_ScalaTest/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals=clean verify site -e -ntp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>it.scoverage-maven-plugin</groupId> | ||
<artifactId>integration_tests_parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>../integration_tests_parent/pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>test_ScalaMavenPlugin_Scala212_ScalaTest</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<name>Test Scoverage Report using scala-maven-plugin, Scala 2.12 and ScalaTest</name> | ||
<description>Test Scoverage Report using scala-maven-plugin, Scala 2.12 and ScalaTest</description> | ||
|
||
<properties> | ||
<scala.compat.version>2.12</scala.compat.version> | ||
<scala.minor.version>18</scala.minor.version> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>net.alchim31.maven</groupId> | ||
<artifactId>scala-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.scalatest</groupId> | ||
<artifactId>scalatest-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
6 changes: 6 additions & 0 deletions
6
src/it/test_ScalaMavenPlugin_Scala212_ScalaTest/src/main/scala/HelloServiceScala.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package service | ||
|
||
object HelloServiceScala { | ||
def hello = { "Hello" } | ||
|
||
} |
Oops, something went wrong.