Examples of PerThreadExpectationBuilder


Examples of com.volantis.testtools.mock.concurrency.PerThreadExpectationBuilder

        SendTest threadFour = new SendTest("Thread four", 15, onPoolExhaustion);
        SendTest threadFive = new SendTest("Thread four", 11, onPoolExhaustion);
        SendTest[] threads = new SendTest[] {threadOne, threadTwo,
                threadThree, threadFour, threadFive};

        PerThreadExpectationBuilder perThreadExpectations =
                mockFactory.createPerThreadBuilder();
        ExpectationBuilder expectationsOne = mockFactory.createUnorderedBuilder();
        ExpectationBuilder expectationsTwo = mockFactory.createUnorderedBuilder();
        ExpectationBuilder expectationsThree = mockFactory.createUnorderedBuilder();
        ExpectationBuilder expectationsFour = mockFactory.createUnorderedBuilder();
        ExpectationBuilder expectationsFive = mockFactory.createUnorderedBuilder();

        ThreadMatcher matcherOne = mockFactory.createKnownThreadMatcher(
                threadOne.getName(), threadOne);
        ThreadMatcher matcherTwo = mockFactory.createKnownThreadMatcher(
                threadTwo.getName(), threadTwo);
        ThreadMatcher matcherThree = mockFactory.createKnownThreadMatcher(
                threadThree.getName(), threadThree);
        ThreadMatcher matcherFour = mockFactory.createKnownThreadMatcher(
                threadFour.getName(), threadFour);
        ThreadMatcher matcherFive = mockFactory.createKnownThreadMatcher(
                threadFive.getName(), threadFive);

        perThreadExpectations.addThreadSpecificBuilder(matcherOne,
                expectationsOne);
        perThreadExpectations.addThreadSpecificBuilder(matcherTwo,
                expectationsTwo);
        perThreadExpectations.addThreadSpecificBuilder(matcherThree,
                expectationsThree);
        perThreadExpectations.addThreadSpecificBuilder(matcherFour,
                expectationsFour);
        perThreadExpectations.addThreadSpecificBuilder(matcherFive,
                expectationsFive);

        SynchronizedPoolableSessionFactory sessionFactoryWrapper =
                new SynchronizedPoolableSessionFactory(
                        mockFactory.createOrderedBuilder(), ADDRESS, PORT,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.