Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6760723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:05:53+00:00 2026-05-26T14:05:53+00:00

Is there already some existing JUnit test for testing a BlockingQueue interface? Some class

  • 0

Is there already some existing JUnit test for testing a BlockingQueue interface? Some class I can download, press play and then it turns red (hopefully green :-)), without me having to spend a day thinking of all test cases?

I googled but couldn’t find anything.

some ideas?

EDIT: The test case that G_H provided was very good for debugging the basics. Is there maybe still a good test for heavy multithreaded use, that really provokes races and deadlocks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:05:53+00:00Added an answer on May 26, 2026 at 2:05 pm

    Since the BlockingQueue interface is part of the Java concurrency utilities, which were developed under the Java Specification Request 166 (JSR-166), I figure the code from the corresponding technology compatibility toolkit (or “tck”) should be a good starting point. After all, implementations of the spec must pass said kit’s tests in order to be considered compatible.

    I’ve had no luck getting it from the JCP site (maybe requires membership), but the resources seem to be available here. Of interest are BlockingQueueTest and its super class JSR166TestCase, the most recent revisions of which can be found respectively here and here. Seems to be licensed under creative commons, but I advise you to verify the reliability of the given link and licensing constraints vis-a-vis your use for yourself.

    Fortunately all of this seems to be using JUnit. I’m not certain about the version, but they’re using the testMethod convention rather than annotations. With some adaptation I guess this code could be good to get you going.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to add some new functionality to an existing interface. There are already
Is there some way through the standard library or some already existing library to
There's already some shipping modules such as FEDEX, Flat Rate, Per pieced and UPS
I am focusing on an input field with jQuery: $(input:text).focus(); There is already some
I'm already aware of some browser-specific DOM documentation out there (Gecko DOM Reference for
When I need some complex algorithm I first check if there's anything relevant already
There are already lots of questions on SO about exceptions, but I can't find
Is there an already existing function in PHP for creating an associative array from
There are already a couple of questions on finding cycles, but I did not
There are already jQuery based Edit in place plug ins available. But i am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.