Package uk.co.thebadgerset.junit.concurrency

Examples of uk.co.thebadgerset.junit.concurrency.ThreadTestCoordinator


    {
        // Create a session in auto acknowledge mode. This problem shows up in auto acknowledge if the client acks
        // message at the end of the onMessage method, after a close has been sent.
        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        ThreadTestCoordinator tt = new ThreadTestCoordinator(2);

        tt.addTestThread(testThread1, 0);
        tt.addTestThread(testThread2, 1);
        tt.setDeadlockTimeout(500);
        tt.run();

        String errorMessage = tt.joinAndRetrieveMessages();

        // Print any error messages or exceptions.
        log.debug(errorMessage);

        if (!tt.getExceptions().isEmpty())
        {
            for (Exception e : tt.getExceptions())
            {
                log.debug("Exception thrown during test thread: ", e);
            }
        }
View Full Code Here

TOP

Related Classes of uk.co.thebadgerset.junit.concurrency.ThreadTestCoordinator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.