Package net.sf.katta.testutil.mockito

Examples of net.sf.katta.testutil.mockito.WaitingAnswer


  @Test
  /**see KATTA-125*/
  public void testConcurrentModification() throws Exception {
    ConnectedComponent component1 = mock(ConnectedComponent.class);
    WaitingAnswer waitingAnswer = new WaitingAnswer();
    doAnswer(waitingAnswer).when(component1).disconnect();
    _protocol = _zk.createInteractionProtocol();
    _protocol.registerComponent(component1);
    WatchedEvent expiredEvent = new WatchedEvent(new WatcherEvent(EventType.None.getIntValue(), KeeperState.Expired
            .getIntValue(), null));
    _protocol.getZkClient().process(
            new WatchedEvent(new WatcherEvent(EventType.None.getIntValue(), KeeperState.SyncConnected.getIntValue(),
                    null)));
    _protocol.getZkClient().process(expiredEvent);
    // verify(component1).disconnect();

    ConnectedComponent component2 = mock(ConnectedComponent.class, "2ndComp");
    _protocol.registerComponent(component2);
    _protocol.unregisterComponent(component2);
    waitingAnswer.release();
    _protocol.disconnect();
  }
View Full Code Here

TOP

Related Classes of net.sf.katta.testutil.mockito.WaitingAnswer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.