public void testOpenRpcTerminationAfterUpdatesAndCloseTriggersCloseCallback() { open(); respondWithEmptyUpdate(WAVELET_ID); viewOpenListener.clear(); close(); // The service should cause the open rpc to terminate successfully. terminateOpenRpcWithSuccess(); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); }
public void testCloseTriggersCloseCallback() { open(); viewOpenListener.clear(); close(); // The underlying service is expected to have the following behaviour. terminateOpenRpcWithSuccess(); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); }
public void testFailedOpenCallsListenerFailure() { halfOpen(); // fail the open terminateOpenRpcWithFailure("WAVE_SERVER_ERROR"); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); }
public void testOpenRpcOnFailureAndThenTerminationWithoutCloseTriggersOneFailureAndClose() { open(); viewOpenListener.clear(); terminateOpenRpcWithFailure("WAVE_SERVER_ERROR"); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); terminateOpenRpcWithError(); viewOpenListener.expectedNothing(); }
public void testOpenRpcTerminationWithoutCloseTriggersFailureAndClose() { open(); viewOpenListener.clear(); terminateOpenRpcWithSuccess(); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); }
public void testOpenRpcTerminationAfterUpdatesAndCloseTriggersCloseCallback() { open(); respondWithEmptyUpdate(WAVELET_ID); viewOpenListener.clear(); close(); // The service should cause the open rpc to terminate successfully. terminateOpenRpcWithSuccess(); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); }
/** * Tests a channel closes if it receives failure before channel id. */ public void testFailureBeforeChannelIdClosesChannel() { halfOpen(); channel.onFailure("for testing"); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); }
/** * Tests that a channel fails if it does not receive a channel id in the first * message. */ public void testInitialUpdateWithoutAChannelIdFails() { halfOpen(); // Receive an update with no channel id. waveViewService.lastOpen().callback.onUpdate(new FakeWaveViewServiceUpdate()); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_EXCEPTION); }
public void testOpenRpcTerminationWithoutCloseTriggersFailureAndClose() { open(); viewOpenListener.clear(); terminateOpenRpcWithSuccess(); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); }
/** * Tests that an update with the end-marker triggers the open-finished * callback. */ public void testChannelIdTriggersConnectCallback() { halfOpen(); respondWithChannelId(); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CONNECTED); }
/** * Tests a channel closes if it receives failure before channel id. */ public void testFailureBeforeChannelIdClosesChannel() { halfOpen(); channel.onFailure("for testing"); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); }
/** * Tests a channel fails if it receives success before channel id. */ public void testSuccessBeforeChannelIdFails() { halfOpen(); channel.onSuccess("for testing"); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_EXCEPTION); }
/** * Tests that an update with the end-marker triggers the open-finished * callback. */ public void testChannelIdTriggersConnectCallback() { halfOpen(); respondWithChannelId(); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CONNECTED); }
public void testFailedOpenCallsListenerFailure() { halfOpen(); // fail the open terminateOpenRpcWithFailure("WAVE_SERVER_ERROR"); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); }
public void testCloseTriggersCloseCallback() { open(); viewOpenListener.clear(); close(); // The underlying service is expected to have the following behaviour. terminateOpenRpcWithSuccess(); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); }
/** * Tests that an update with the end-marker triggers the open-finished * callback. */ public void testMarkerTriggersOpenFinished() { halfOpen(); respondWithChannelId(); viewOpenListener.clear(); respondWithMarker(false); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_OPEN_FINISHED); }
/** * Tests a channel fails if it receives success before channel id. */ public void testSuccessBeforeChannelIdFails() { halfOpen(); channel.onSuccess("for testing"); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_EXCEPTION); }
public void testMultipleClose() { open(); viewOpenListener.clear(); close(); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); close(); viewOpenListener.expectedNothing(); }
/** * Tests that an update with the end-marker triggers the open-finished * callback. */ public void testMarkerTriggersOpenFinished() { halfOpen(); respondWithChannelId(); viewOpenListener.clear(); respondWithMarker(false); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_OPEN_FINISHED); }
public void testMultipleClose() { open(); viewOpenListener.clear(); close(); viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED); close(); viewOpenListener.expectedNothing(); }