try { t.checkClientGotOps(0, 2).checkClientSentOps().checkClientDoc("<blip><p>XYABabc</p></blip>"); fail("Expected a runtime exception"); } catch (RuntimeException expected) { assertTrue(expected.getCause() instanceof OperationException);
/** * Test errors in the protocol. */ public void testErrorConditions() throws TransformException, OperationException { TestConfig t = new TestConfig(); // Missing ack // c1 /\ s1 // s1' \ // \ s2 t.init(0); t.clientDoOps(1).serverDoOps(0).checkClientSentOps(0).checkClientGotOps(0); try { t.serverDoOps(2); fail("Suppose to fail with unexpected version"); } catch (TransformException ex) { } // Wrong ack // c1 / // // | ack c2 t.init(0); t.clientDoOps(1).checkClientSentOps(0).checkClientGotOps(); try { t.serverAck(2); fail("Suppose to fail with unexpected version"); } catch (TransformException ex) { } }
/** * Test errors in the protocol. */ public void testErrorConditions() throws TransformException, OperationException { TestConfig t = new TestConfig(); // Missing ack // c1 /\ s1 // s1' \ // \ s2 t.init(0); t.clientDoOps(1).serverDoOps(0).checkClientSentOps(0).checkClientGotOps(0); try { t.serverDoOps(2); fail("Suppose to fail with unexpected version"); } catch (TransformException ex) { } // Wrong ack // c1 / // // | ack c2 t.init(0); t.clientDoOps(1).checkClientSentOps(0).checkClientGotOps(); try { t.serverAck(2); fail("Suppose to fail with unexpected version"); } catch (TransformException ex) { } }
try { t.checkClientGotOps(0, 2).checkClientSentOps().checkClientDoc("<blip><p>XYABabc</p></blip>"); fail("Expected a runtime exception"); } catch (RuntimeException expected) { assertTrue(expected.getCause() instanceof OperationException);
fail("ConnectionFailedException expected"); } catch (ChannelException expected) {
fail("ConnectionFailedException expected"); } catch (ChannelException expected) {