Skip to content

Commit 62f6f4a

Browse files
committed
Merge pull request #18 from TimSoethout/maven-samples
added maven samples with README
2 parents 8114523 + 8899307 commit 62f6f4a

File tree

18 files changed

+438
-0
lines changed

18 files changed

+438
-0
lines changed

samples/maven/.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
*.class
2+
*.log
3+
4+
# Package files
5+
*.war
6+
*.jar
7+
*.ear
8+
9+
# Maven
10+
out/
11+
target/
12+
13+
# Eclipse
14+
.project
15+
.classpath
16+
.settings/
17+
18+
# IDEA
19+
*.iml
20+
.idea
21+
22+
# OSX
23+
.DS_STORE
24+
.Trashes
25+
26+
# Windows
27+
Desktop.ini
28+
Thumbs.db
29+
30+
# Python
31+
*.pyc
32+

samples/maven/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Run with:
2+
3+
`mvn clean scoverage:report sonar:sonar`
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<artifactId>combined-scala-java-multi-module-sonar</artifactId>
6+
<groupId>test</groupId>
7+
<version>1.0.0</version>
8+
</parent>
9+
<artifactId>module1</artifactId>
10+
<packaging>jar</packaging>
11+
<version>1.0.0</version>
12+
</project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package module1;
2+
3+
/**
4+
* Created by tim on 01/05/15.
5+
*/
6+
public class HelloWorld {
7+
8+
public String hello() {
9+
return "Hello";
10+
}
11+
12+
public void notCovered() {
13+
System.out.println("YOLO");
14+
}
15+
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package module1
2+
3+
class HelloScala {
4+
5+
case class TryOut(some: String, fields: List[String])
6+
7+
def test = "Hello"
8+
9+
def someOther = 42
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package module1;
2+
3+
import static org.junit.Assert.assertEquals;
4+
5+
public class HelloWorldTest {
6+
7+
@org.junit.Test
8+
public void testHello() throws Exception {
9+
assertEquals("Hello", new HelloWorld().hello());
10+
}
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import org.junit.runner.RunWith
2+
import org.scalatest.junit.JUnitRunner
3+
import org.scalatest.{FlatSpec, ShouldMatchers}
4+
import module1.HelloScala
5+
6+
@RunWith(classOf[JUnitRunner])
7+
class HelloScalaTest extends FlatSpec with ShouldMatchers {
8+
9+
"it" should "work" in {
10+
val scala: HelloScala = new HelloScala()
11+
scala.test should equal("Hello")
12+
13+
scala.TryOut("String", List()) should not equal(true)
14+
}
15+
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<artifactId>combined-scala-java-multi-module-sonar</artifactId>
6+
<groupId>test</groupId>
7+
<version>1.0.0</version>
8+
</parent>
9+
<artifactId>module2</artifactId>
10+
<packaging>jar</packaging>
11+
<version>1.0.0</version>
12+
</project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package module2;
2+
3+
/**
4+
* Created by tim on 01/05/15.
5+
*/
6+
public class HelloWorld2 {
7+
8+
public String hello() {
9+
return "Hello";
10+
}
11+
12+
public void notCovered() {
13+
System.out.println("YOLO");
14+
}
15+
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package module2
2+
3+
class HelloScala2 {
4+
5+
case class TryOut(some: String, fields: List[String])
6+
7+
def test = "Hello"
8+
9+
def someOther = 42
10+
}

0 commit comments

Comments
 (0)