949596979899100101102103104105106
return conn; } public void testClosedNotificationAndWriteToClosed() throws Exception { Condition closed = new Condition(); Connection conn = connect(closed); if (!closed.get(3000)) { fail("never got notified of connection close"); } Channel ch = conn.getChannel(0);
404142434445464748495051525354555657585960
{ Connection conn = getConnection("guest", "guest"); conn.start(); final Condition fired = new Condition(); conn.setExceptionListener(new ExceptionListener() { public void onException(JMSException e) { fired.set(); } }); stopBroker(); if (!fired.get(3000)) { fail("exception listener was not fired"); } }
172173174175176177178179180181182
System.setProperty("os.name","windows"); // Start server as 0-9 to froce a ProtocolVersionException startServer(new ProtocolHeader(1, 0, 9)); Condition closed = new Condition(); try { connect(closed); fail("ProtocolVersionException expected");
233234235236237238239240241242243244245246247248249
public void testClosedNotificationAndWriteToClosed() throws Exception { startServer(); Condition closed = new Condition(); Connection conn = connect(closed); Session ssn = conn.createSession(1); send(ssn, "CLOSE"); if (!closed.get(3000)) { fail("never got notified of connection close"); } try
186187188189190191192193194195196
247248249250251252253254255256257258259260261262263