Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tests Depending on Static Counter by Resetting Before Tests #456

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void isShutdown() {
@Assertion(id = "SPEC:83 SPEC:83.1 SPEC:83.2 SPEC:83.3 SPEC:103 SPEC:96.5 SPEC:96.6 SPEC:105 SPEC:96 SPEC:93 SPEC:96.3",
strategy = "Interrupt thread and ensure the thread did not run.")
public void interruptThreadApiTest() {
StaticCounter.reset();
CounterRunnableTask task = new CounterRunnableTask(TestConstants.pollInterval);
Thread thread = threadFactory.newThread(task);
thread.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import ee.jakarta.tck.concurrent.framework.junit.extensions.Wait;
import jakarta.annotation.Resource;
import jakarta.enterprise.concurrent.ManagedExecutorService;
import org.junit.jupiter.api.BeforeEach;

@Web
@Common({ PACKAGE.TASKS, PACKAGE.FIXED_COUNTER })
Expand All @@ -57,6 +58,11 @@ public static WebArchive createDeployment() {
@Resource(lookup = TestConstants.defaultManagedExecutorService)
private ManagedExecutorService executor;

@BeforeEach
public void reset() {
StaticCounter.reset();
}

@Assertion(id = "SPEC:10.2; SPEC:13; SPEC:13.1; SPEC:13.2",
strategy = "Test basic function for ManagedExecutorService: execute")
public void testExecute() {
Expand Down