Skip to content

Create unit tests for Concurrency #74

Open
@arun-gupta

Description

@arun-gupta
No description provided.

Activity

aslakknutsen

aslakknutsen commented on Nov 27, 2013

@aslakknutsen
Member

Rewrite current Concurrent Tests to use Concurrent Utils; CountDownLatch|CyclicBarrier instead of slow and unsafe Thread.sleep()

e.g. https://github.com/arun-gupta/javaee7-samples/blob/master/concurrency/managedexecutor/src/test/java/org/javaee7/concurrency/managedexecutor/ExecutorInjectTest.java#L72

final CountDownLatch signal = new CountDownLatch(1);
defaultExecutor.submit(new MyRunnableTask(1) {
  void run() {
    super.run();
    signal.countDown();
  }
});
Assert.assertTrue(signal.await(2000, TimeUnit.MILLISECONDS))
arun-gupta

arun-gupta commented on Nov 28, 2013

@arun-gupta
ContributorAuthor

Changed the tests to use CountDownLatch now. Only created unit tests for managedexecutor. Do you want to create for others ?

aslakknutsen

aslakknutsen commented on Nov 28, 2013

@aslakknutsen
Member
added a commit that references this issue on Aug 24, 2022

Merge pull request javaee-samples#74 from breakponchito/FISH-6355-fix…

f37936f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Create unit tests for Concurrency · Issue #74 · javaee-samples/javaee7-samples