List<Acceptor> acceptors = connectorService.getAcceptors();
Assert.assertNotNull(acceptors);
Assert.assertEquals(acceptors.size(), 2);
Acceptor acceptor0 = acceptors.get(0);
Assert.assertNotNull(acceptor0);
Assert.assertEquals(acceptor0.getClass(), AndAcceptor.class);
Assert.assertEquals(((AndAcceptor) acceptor0).getAcceptors().size(), 2);
Iterator<Acceptor> andAcceptors = ((AndAcceptor) acceptor0).getAcceptors().iterator();
boolean hasOrAcceptor = false;
while (andAcceptors.hasNext()) {
Acceptor a = andAcceptors.next();
Assert.assertTrue( OrAcceptor.class.isInstance(a) || MockAcceptor.class.isInstance(a));
if (OrAcceptor.class.isInstance(a)) {
hasOrAcceptor = true;
Assert.assertEquals( ((OrAcceptor) a).getAcceptors().size(), 2);
}
}
Assert.assertTrue(hasOrAcceptor);
Acceptor acceptor1 = acceptors.get(1);
Assert.assertNotNull(acceptor1);
Assert.assertEquals(acceptor1.getClass(), OrAcceptor.class);
Assert.assertEquals(((OrAcceptor) acceptor1).getAcceptors().size(), 2);
Iterator<Acceptor> orAcceptors = ((OrAcceptor) acceptor1).getAcceptors().iterator();
boolean hasAndAcceptor = false;
while (orAcceptors.hasNext()) {
Acceptor a = orAcceptors.next();
Assert.assertTrue( AndAcceptor.class.isInstance(a) || MockAcceptor.class.isInstance(a) );
if (AndAcceptor.class.isInstance(a)) {
hasAndAcceptor = true;
Assert.assertEquals( ((AndAcceptor) a).getAcceptors().size(), 2 );