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,