-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding support for juint5 Suites and applying suite level JUnitPerf annotations --------- Co-authored-by: noconnor <niall.oconnor@yahooinc.com>
- Loading branch information
Showing
22 changed files
with
614 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...-examples/src/test/java/com/github/noconnor/junitperf/examples/ExampleTestSuiteUsage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.github.noconnor.junitperf.examples; | ||
|
||
import com.github.noconnor.junitperf.JUnitPerfReportingConfig; | ||
import com.github.noconnor.junitperf.JUnitPerfTest; | ||
import com.github.noconnor.junitperf.JUnitPerfTestActiveConfig; | ||
import com.github.noconnor.junitperf.JUnitPerfTestRequirement; | ||
import com.github.noconnor.junitperf.examples.existing.TestClassOne; | ||
import com.github.noconnor.junitperf.examples.existing.TestClassTwo; | ||
import org.junit.platform.suite.api.ConfigurationParameter; | ||
import org.junit.platform.suite.api.SelectClasses; | ||
import org.junit.platform.suite.api.Suite; | ||
|
||
import static com.github.noconnor.junitperf.examples.utils.ReportingUtils.newHtmlReporter; | ||
|
||
|
||
// | ||
// To run suite: mvn -Dtest=ExampleTestSuiteUsage -DskipTests=false test | ||
// | ||
|
||
@Suite | ||
//@SelectPackages({ | ||
// "com.github.noconnor.junitperf.examples.existing" | ||
//}) | ||
@SelectClasses({ | ||
TestClassOne.class, | ||
TestClassTwo.class | ||
}) | ||
// ConfigurationParameter: Required to enable Test Suite Interceptor Reference: https://www.baeldung.com/junit-5-extensions#1-automatic-extension-registration | ||
@ConfigurationParameter(key = "junit.jupiter.extensions.autodetection.enabled", value = "true") | ||
@JUnitPerfTest(totalExecutions = 100) | ||
@JUnitPerfTestRequirement(allowedErrorPercentage = 0.01F) | ||
public class ExampleTestSuiteUsage { | ||
|
||
@JUnitPerfTestActiveConfig | ||
public static JUnitPerfReportingConfig config = JUnitPerfReportingConfig.builder() | ||
.reportGenerator(newHtmlReporter("suite_reporter.html")) | ||
.build(); | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...-examples/src/test/java/com/github/noconnor/junitperf/examples/existing/TestClassOne.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.github.noconnor.junitperf.examples.existing; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class TestClassOne { | ||
@Test | ||
public void sample_test1_class1() throws InterruptedException { | ||
Thread.sleep(5); | ||
} | ||
|
||
@Test | ||
public void sample_test2_class1() throws InterruptedException { | ||
// Mock some processing logic | ||
Thread.sleep(1); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...xamples/src/test/java/com/github/noconnor/junitperf/examples/existing/TestClassThree.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.github.noconnor.junitperf.examples.existing; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class TestClassThree { | ||
@Test | ||
public void sample_test1_class3() throws InterruptedException { | ||
Thread.sleep(5); | ||
} | ||
|
||
@Test | ||
public void sample_test2_class3() throws InterruptedException { | ||
// Mock some processing logic | ||
Thread.sleep(1); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...-examples/src/test/java/com/github/noconnor/junitperf/examples/existing/TestClassTwo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.github.noconnor.junitperf.examples.existing; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class TestClassTwo { | ||
|
||
@Test | ||
public void sample_test1_class2() throws InterruptedException { | ||
// Mock some processing logic | ||
Thread.sleep(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.