diff options
author | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2016-08-17 22:15:54 +0200 |
---|---|---|
committer | Evgeny Mandrikov <Godin@users.noreply.github.com> | 2016-08-17 22:15:54 +0200 |
commit | e26ee1e398c838e0d300e67d1fe4788fc73ff63a (patch) | |
tree | bf17b55258c6b67ee0c4ee168084a11d47ca5863 /org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java | |
parent | 54334f20cfd15dbd62929ed77464a7fcf3353ef8 (diff) | |
download | jacoco-e26ee1e398c838e0d300e67d1fe4788fc73ff63a.tar.gz |
Improve ValidationTestBase (#440)
- Allow multiple classes to be instrumented from a package
- Common validation test base for "bad cycles test"
- Use "main(String[])" method as common execution interface
- Use identifiers for all line tags
Diffstat (limited to 'org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java')
-rw-r--r-- | org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java index 26b3b13b..efa1354c 100644 --- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java +++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java @@ -20,9 +20,10 @@ import org.jacoco.core.test.validation.targets.Stubs.StubException; /** * This target produces exception based control flow examples. */ -public class Target03 implements Runnable { +public class Target03 { + + public static void main(String[] args) { - public void run() { try { implicitException(); } catch (StubException e) { @@ -46,18 +47,18 @@ public class Target03 implements Runnable { } } - private void implicitException() { + private static void implicitException() { nop(); // $line-implicitException.before$ ex(); // $line-implicitException.exception$ nop(); // $line-implicitException.after$ } - private void explicitException() { + private static void explicitException() { nop(); // $line-explicitException.before$ throw new StubException(); // $line-explicitException.throw$ } - private void noExceptionTryCatch() { + private static void noExceptionTryCatch() { nop(); // $line-noExceptionTryCatch.beforeBlock$ try { nop(); // $line-noExceptionTryCatch.tryBlock$ @@ -66,7 +67,7 @@ public class Target03 implements Runnable { } } - private void implicitExceptionTryCatch() { + private static void implicitExceptionTryCatch() { nop(); // $line-implicitExceptionTryCatch.beforeBlock$ try { nop(); // $line-implicitExceptionTryCatch.before$ @@ -77,7 +78,7 @@ public class Target03 implements Runnable { } } - private void implicitExceptionTryCatchAfterCondition() { + private static void implicitExceptionTryCatchAfterCondition() { if (f()) { // $line-implicitExceptionTryCatchAfterCondition.condition$ return; } @@ -88,7 +89,7 @@ public class Target03 implements Runnable { } } - private void explicitExceptionTryCatch() { + private static void explicitExceptionTryCatch() { nop(); // $line-explicitExceptionTryCatch.beforeBlock$ try { nop(); // $line-explicitExceptionTryCatch.before$ @@ -98,7 +99,7 @@ public class Target03 implements Runnable { } } - private void noExceptionFinally() { + private static void noExceptionFinally() { nop(); // $line-noExceptionFinally.beforeBlock$ try { nop(); // $line-noExceptionFinally.tryBlock$ @@ -107,7 +108,7 @@ public class Target03 implements Runnable { } } - private void implicitExceptionFinally() { + private static void implicitExceptionFinally() { nop(); // $line-implicitExceptionFinally.beforeBlock$ try { nop(); // $line-implicitExceptionFinally.before$ @@ -118,7 +119,7 @@ public class Target03 implements Runnable { } } - private void explicitExceptionFinally() { + private static void explicitExceptionFinally() { nop(); // $line-explicitExceptionFinally.beforeBlock$ try { nop(); // $line-explicitExceptionFinally.before$ @@ -128,8 +129,4 @@ public class Target03 implements Runnable { } } - public static void main(String[] args) { - new Target03().run(); - } - } |