@Test public void testOutOfOrderNot() { TestingServerMethodInvoker methodInvoker = new TestingServerMethodInvoker(); int invocationCount = testServerMethodInvoker(methodInvoker, true, ImmutableList.of( address -> testOutOfOrder(address, MESSAGES, new TTransportFactory(), new TBinaryProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrder(address, MESSAGES, new TTransportFactory(), new TCompactProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrder(address, MESSAGES, new TFramedTransport.Factory(), new TBinaryProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrder(address, MESSAGES, new TFramedTransport.Factory(), new TCompactProtocol.Factory(), methodInvoker.getFutureResults()))); List<DriftLogEntry> expectedMessages = newArrayList(concat(nCopies(invocationCount, DRIFT_MESSAGES))); assertEquals(ImmutableList.copyOf(methodInvoker.getMessages()), expectedMessages); }
@Test public void testOutOfOrderNotSupported() { TestingServerMethodInvoker methodInvoker = new TestingServerMethodInvoker(); int invocationCount = testServerMethodInvoker(methodInvoker, false, ImmutableList.of( address -> testOutOfOrderNotSupported(address, MESSAGES, new TTransportFactory(), new TBinaryProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrderNotSupported(address, MESSAGES, new TTransportFactory(), new TCompactProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrderNotSupported(address, MESSAGES, new TFramedTransport.Factory(), new TBinaryProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrderNotSupported(address, MESSAGES, new TFramedTransport.Factory(), new TCompactProtocol.Factory(), methodInvoker.getFutureResults()))); List<DriftLogEntry> expectedMessages = newArrayList(concat(nCopies(invocationCount, DRIFT_MESSAGES))); assertEquals(ImmutableList.copyOf(methodInvoker.getMessages()), expectedMessages); }
@Test public void testOutOfOrderNot() { TestingServerMethodInvoker methodInvoker = new TestingServerMethodInvoker(); int invocationCount = testServerMethodInvoker(methodInvoker, true, ImmutableList.of( address -> testOutOfOrder(address, MESSAGES, new TTransportFactory(), new TBinaryProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrder(address, MESSAGES, new TTransportFactory(), new TCompactProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrder(address, MESSAGES, new TFramedTransport.Factory(), new TBinaryProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrder(address, MESSAGES, new TFramedTransport.Factory(), new TCompactProtocol.Factory(), methodInvoker.getFutureResults()))); List<DriftLogEntry> expectedMessages = newArrayList(concat(nCopies(invocationCount, DRIFT_MESSAGES))); assertEquals(ImmutableList.copyOf(methodInvoker.getMessages()), expectedMessages); }
@Test public void testOutOfOrderNotSupported() { TestingServerMethodInvoker methodInvoker = new TestingServerMethodInvoker(); int invocationCount = testServerMethodInvoker(methodInvoker, false, ImmutableList.of( address -> testOutOfOrderNotSupported(address, MESSAGES, new TTransportFactory(), new TBinaryProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrderNotSupported(address, MESSAGES, new TTransportFactory(), new TCompactProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrderNotSupported(address, MESSAGES, new TFramedTransport.Factory(), new TBinaryProtocol.Factory(), methodInvoker.getFutureResults()), address -> testOutOfOrderNotSupported(address, MESSAGES, new TFramedTransport.Factory(), new TCompactProtocol.Factory(), methodInvoker.getFutureResults()))); List<DriftLogEntry> expectedMessages = newArrayList(concat(nCopies(invocationCount, DRIFT_MESSAGES))); assertEquals(ImmutableList.copyOf(methodInvoker.getMessages()), expectedMessages); }