Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B verify --file pom.xml
- if: always()
name: Upload Jacoco coverage report
uses: actions/upload-artifact@v2
with:
name: jacoco-report
path: target/site/jacoco/
run: mvn -B package --file pom.xml
- name: Generate Jacoco Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@v1.0.0
- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
</execution>
<execution>
<id>prepare-coverage-report</id>
<phase>package</phase>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
Expand All @@ -122,7 +122,7 @@
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>90%</minimum>
<minimum>95%</minimum>
</limit>
</limits>
</rule>
Expand Down
16 changes: 5 additions & 11 deletions src/main/java/com/sai/App.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
package com.sai;

public class App {
static void yoyo() {
int a = 1;
String b = "yoyo";
return;
}

static void yoyo2() {
int a = 1;
String b = "yoyo";
return;
}
static void yoyo(){
int a = 1;
String b = "yoyo";
return;
}
}
12 changes: 7 additions & 5 deletions src/main/java/com/sai/objects/AddOperation.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.sai.objects;

/** @author cb-prasanna */
/**
* @author cb-prasanna
*/
public class AddOperation implements Operation {
@Override
public int process(int a, int b) {
return a + b;
}
@Override
public int process(int a, int b) {
return a+b;
}
}
10 changes: 4 additions & 6 deletions src/main/java/com/sai/objects/Base.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.sai.objects;

/** @author cb-prasanna */
/**
* @author cb-prasanna
*/
interface Operation {
int process(int a, int b);

// default void process2(int a, int b) {
// System.out.println("Test");
// }
int process( int a, int b);
}
12 changes: 7 additions & 5 deletions src/main/java/com/sai/objects/SubOperation.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.sai.objects;

/** @author cb-prasanna */
/**
* @author cb-prasanna
*/
public class SubOperation implements Operation {
@Override
public int process(int a, int b) {
return a - b;
}
@Override
public int process(int a, int b) {
return a-b;
}
}
20 changes: 12 additions & 8 deletions src/test/java/com/sai/AppTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
package com.sai;

import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.Test;

/** Unit test for simple App. */
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* Unit test for simple App.
*/
public class AppTest {
@Test
void testMethod() {
App app = new App();
// App.yoyo();
assertTrue(true);
}
@Test
void testMethod() {
App app = new App();
// App.yoyo();
a
assertTrue( true );
}
}
22 changes: 12 additions & 10 deletions src/test/java/com/sai/objects/AddOperationTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package com.sai.objects;

import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.Test;

/** @author cb-prasanna */
import static org.junit.jupiter.api.Assertions.*;

/**
* @author cb-prasanna
*/
class AddOperationTest {
@Test
void processAdd() {
Operation op = new AddOperation();
int processed = op.process(2, 4);
assertEquals(6, processed);
}
}
@Test
void processAdd() {
Operation op = new AddOperation();
int processed = op.process(2, 4);
assertEquals(6, processed);
}
}
8 changes: 6 additions & 2 deletions src/test/java/com/sai/objects/OperationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@

import static org.junit.jupiter.api.Assertions.*;

/** @author cb-prasanna */
class OperationTest {}
/**
* @author cb-prasanna
*/
class OperationTest {

}
22 changes: 12 additions & 10 deletions src/test/java/com/sai/objects/SubOperationTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package com.sai.objects;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

/** @author cb-prasanna */
import static org.junit.jupiter.api.Assertions.assertEquals;

/**
* @author cb-prasanna
*/
class SubOperationTest {
@Test
void processAdd() {
Operation op = new SubOperation();
int processed = op.process(2, 4);
assertEquals(-2, processed);
}
}
@Test
void processAdd() {
Operation op = new SubOperation();
int processed = op.process(2, 4);
assertEquals(-2, processed);
}
}