Skip to content

Commit 03b504a

Browse files
committed
initial commit
0 parents  commit 03b504a

File tree

5 files changed

+126
-0
lines changed

5 files changed

+126
-0
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: java
2+
3+
before_install:
4+
sudo pip install codecov
5+
6+
after_succcess:
7+
codecov

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Java -> Codecov.io
2+
=======
3+
| [https://codecov.io/][1] | [@codecov][2] | [[email protected]][3] |
4+
| ------------------------ | ------------- | --------------------- |
5+
=======
6+
7+
> This repository serves as an **Example** on how to use codecov uploader for Java.
8+
9+
## Usage
10+
11+
# [![travis-org](https://avatars2.githubusercontent.com/u/639823?v=2&s=50)](https://travis-ci.org) Travis C
12+
13+
Add to your `.travis.yml` file.
14+
```yml
15+
language: java
16+
17+
before_install: sudo pip install codecov
18+
19+
after_success: codecov
20+
```
21+
22+
23+
[1]: https://codecov.io/
24+
[2]: https://twitter.com/codecov
25+
[3]: mailto:[email protected]

pom.xml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Copyright (c) 2009, 2012 Mountainminds GmbH & Co. KG and Contributors
5+
All rights reserved. This program and the accompanying materials
6+
are made available under the terms of the Eclipse Public License v1.0
7+
which accompanies this distribution, and is available at
8+
http://www.eclipse.org/legal/epl-v10.html
9+
10+
Contributors:
11+
Marc R. Hoffmann - initial API and implementation
12+
-->
13+
14+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
15+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
16+
<modelVersion>4.0.0</modelVersion>
17+
18+
<groupId>org.jacoco</groupId>
19+
<artifactId>org.jacoco.examples.maven.java</artifactId>
20+
<version>1.0-SNAPSHOT</version>
21+
<packaging>jar</packaging>
22+
23+
<name>JaCoCo Maven plug-in example for Java project</name>
24+
<url>http://www.eclemma.org/jacoco</url>
25+
26+
<dependencies>
27+
<dependency>
28+
<groupId>junit</groupId>
29+
<artifactId>junit</artifactId>
30+
<version>4.10</version>
31+
<scope>test</scope>
32+
</dependency>
33+
</dependencies>
34+
35+
<build>
36+
<plugins>
37+
<plugin>
38+
<groupId>org.jacoco</groupId>
39+
<artifactId>jacoco-maven-plugin</artifactId>
40+
<version>0.5.8.201207111220</version>
41+
<executions>
42+
<execution>
43+
<goals>
44+
<goal>prepare-agent</goal>
45+
</goals>
46+
</execution>
47+
<execution>
48+
<id>report</id>
49+
<phase>prepare-package</phase>
50+
<goals>
51+
<goal>report</goal>
52+
</goals>
53+
</execution>
54+
</executions>
55+
</plugin>
56+
</plugins>
57+
</build>
58+
59+
</project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.jacoco.examples.maven.java;
2+
3+
public class HelloWorld {
4+
5+
public String getMessage(boolean bigger) {
6+
if (bigger) {
7+
return "Hello Universe!";
8+
} else {
9+
return "Hello World!";
10+
}
11+
}
12+
13+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.jacoco.examples.maven.java;
2+
3+
import static org.junit.Assert.*;
4+
5+
import org.junit.Before;
6+
import org.junit.Test;
7+
8+
public class HelloWorldTest {
9+
10+
private HelloWorld subject;
11+
12+
@Before
13+
public void setup() {
14+
subject = new HelloWorld();
15+
}
16+
17+
@Test
18+
public void testGetMessage() {
19+
assertEquals("Hello World!", subject.getMessage(false));
20+
}
21+
22+
}

0 commit comments

Comments
 (0)