diff options
author | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2016-08-18 09:52:43 +0200 |
---|---|---|
committer | Evgeny Mandrikov <Godin@users.noreply.github.com> | 2016-08-18 09:52:43 +0200 |
commit | a0afcd67fa64432e089df89fc7b50676ee64e915 (patch) | |
tree | 49dcfdf347d6742ca131afa5a1a74fcef21a8405 /org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java | |
parent | e26ee1e398c838e0d300e67d1fe4788fc73ff63a (diff) | |
download | jacoco-a0afcd67fa64432e089df89fc7b50676ee64e915.tar.gz |
Assert execution order in validation tests with type cycles (#443)
The method execution order in type cycles depends on the JVM
implementation. This validation ensure our test setup produce the
required scenarios.
Diffstat (limited to 'org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java')
-rw-r--r-- | org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java index eae387b7..c4cb5d48 100644 --- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java +++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java @@ -11,6 +11,9 @@ *******************************************************************************/ package org.jacoco.core.test.validation.targets; +import java.util.ArrayList; +import java.util.List; + /** * Collection of stub methods that are called from the coverage targets. * */ @@ -117,4 +120,24 @@ public class Stubs { public static void noexec(Runnable task) { } + /** + * List of logged events. Using a static member here works as this class is + * loaded in a new class loader for every test case. + */ + private static List<String> events = new ArrayList<String>(); + + /** + * Records a event with the given id for later verification. + */ + public static void logEvent(String id) { + events.add(id); + } + + /** + * Returns a list of all recorded events in the sequence of recording. + */ + public static List<String> getLogEvents() { + return events; + } + } |