Added gradle build for testing
This commit is contained in:
parent
164bc50089
commit
2eb6bac66b
11 changed files with 431 additions and 12 deletions
|
@ -1,15 +1,13 @@
|
|||
package com.example;
|
||||
|
||||
import rife.bld.BaseProject;
|
||||
import rife.bld.BuildCommand;
|
||||
import rife.bld.Project;
|
||||
import rife.bld.extension.JacocoReportOperation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
|
||||
import static rife.bld.dependencies.Repository.RIFE2_RELEASES;
|
||||
import static rife.bld.dependencies.Scope.compile;
|
||||
import static rife.bld.dependencies.Scope.test;
|
||||
|
||||
public class ExamplesBuild extends Project {
|
||||
|
@ -23,8 +21,6 @@ public class ExamplesBuild extends Project {
|
|||
scope(test)
|
||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 9, 2)))
|
||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 9, 2)));
|
||||
|
||||
testOperation().mainClass("com.example.ExamplesTest");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -32,8 +28,14 @@ public class ExamplesBuild extends Project {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void test() throws Exception {
|
||||
super.test();
|
||||
jacoco();
|
||||
}
|
||||
|
||||
@BuildCommand(summary = "Generates Jacoco Reports")
|
||||
public void jacoco() throws Exception {
|
||||
public void jacoco() throws IOException {
|
||||
new JacocoReportOperation()
|
||||
.fromProject(this)
|
||||
.execute();
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
package com.example;
|
||||
|
||||
;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class ExamplesTest {
|
||||
class ExamplesTest {
|
||||
@Test
|
||||
void verifyHello() {
|
||||
assertEquals("Hello World!", new Examples().getMessage());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new ExamplesTest().verifyHello();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue