Skip to content

Commit 6959888

Browse files
Move to caluclator
1 parent b77ae8c commit 6959888

7 files changed

Lines changed: 66 additions & 95 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Workflow for Codecov example-java
2+
on: [push, pull_request]
3+
jobs:
4+
run:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@v2
9+
- name: Set up JDK 18
10+
uses: actions/setup-java@v1
11+
with:
12+
java-version: 18
13+
- name: Test with Maven
14+
run: mvn -B test --file pom.xml
15+
- name: ls
16+
run: ls
17+
- name: Upload coverage to Codecov
18+
uses: codecov/codecov-action@v3

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

pom.xml

Lines changed: 29 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,48 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

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">
3+
<project>
164
<modelVersion>4.0.0</modelVersion>
5+
<groupId>io.codecov</groupId>
6+
<artifactId>example-java</artifactId>
7+
<version>1.0</version>
178

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>
9+
<name>Codecov example Java repository</name>
10+
<url>http://github.com/codecov/example-java</url>
2511
<properties>
12+
<maven.compiler.release>18</maven.compiler.release>
2613
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
27-
<maven.compiler.source>1.8</maven.compiler.source>
28-
<maven.compiler.target>1.8</maven.compiler.target>
2914
</properties>
3015

3116
<dependencies>
3217
<dependency>
3318
<groupId>junit</groupId>
3419
<artifactId>junit</artifactId>
35-
<version>4.13.2</version>
20+
<version>5.7.1</version>
3621
<scope>test</scope>
3722
</dependency>
3823
</dependencies>
3924

4025
<build>
41-
<sourceDirectory>src/main/java</sourceDirectory>
42-
<plugins>
43-
<plugin>
44-
<groupId>org.jacoco</groupId>
45-
<artifactId>jacoco-maven-plugin</artifactId>
46-
<version>0.8.7</version>
47-
<executions>
48-
<execution>
49-
<goals>
50-
<goal>prepare-agent</goal>
51-
</goals>
52-
</execution>
53-
<execution>
54-
<id>report</id>
55-
<phase>test</phase>
56-
<goals>
57-
<goal>report</goal>
58-
</goals>
59-
</execution>
60-
</executions>
61-
</plugin>
62-
<plugin>
63-
<groupId>org.apache.maven.plugins</groupId>
64-
<artifactId>maven-compiler-plugin</artifactId>
65-
<version>3.8.1</version>
66-
</plugin>
67-
</plugins>
68-
</build>
26+
<plugin>
27+
<groupId>org.jacoco</groupId>
28+
<artifactId>jacoco-maven-plugin</artifactId>
29+
<version>0.8.8</version>
30+
<executions>
31+
<execution>
32+
<id>prepare-agent</id>
33+
<goals>
34+
<goal>prepare-agent</goal>
35+
</goals>
36+
</execution>
37+
<execution>
38+
<id>report</id>
39+
<phase>test</phase>
40+
<goals>
41+
<goal>report</goal>
42+
</goals>
43+
</execution>
44+
</executions>
45+
</plugin>
46+
</build>
6947

7048
</project>

src/Calculator.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package io.codecov;
2+
3+
public class Calculator {
4+
public int add(int x, int y) {
5+
return x + y
6+
}
7+
}

src/CalculatorTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package io.codecov;
2+
3+
import static org.junit.Assert.*;
4+
5+
import org.junit.Test;
6+
7+
public class CalculatorTest {
8+
@Test
9+
public void testAdd() {
10+
assertEquals(new Calculator.add(1, 1), 2);
11+
}
12+
}

src/main/java/org/jacoco/examples/maven/java/HelloWorld.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/test/java/org/jacoco/examples/maven/java/HelloWorldTest.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)