Package net.sf.katta.testutil.mockito

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


    master.start();

    MasterOperation operation1 = mock(MasterOperation.class, withSettings().serializable());
    MasterOperation operation2 = mock(MasterOperation.class, withSettings().serializable());

    SerializableCountDownLatchAnswer answer = new SerializableCountDownLatchAnswer(2);
    when(operation1.getExecutionInstruction((List<MasterOperation>) notNull()))
            .thenReturn(ExecutionInstruction.EXECUTE);
    when(operation2.getExecutionInstruction((List<MasterOperation>) notNull()))
            .thenReturn(ExecutionInstruction.EXECUTE);
    when(operation1.execute((MasterContext) notNull(), (List<MasterOperation>) notNull())).thenAnswer(answer);
    when(operation2.execute((MasterContext) notNull(), (List<MasterOperation>) notNull())).thenAnswer(answer);
    _protocol.addMasterOperation(operation1);
    _protocol.addMasterOperation(operation2);
    answer.getCountDownLatch().await();

    master.shutdown();
  }
View Full Code Here


    node.start();

    NodeOperation operation1 = mock(NodeOperation.class, withSettings().serializable());
    NodeOperation operation2 = mock(NodeOperation.class, withSettings().serializable());

    SerializableCountDownLatchAnswer answer = new SerializableCountDownLatchAnswer(2);
    when(operation1.execute((NodeContext) notNull())).thenAnswer(answer);
    when(operation2.execute((NodeContext) notNull())).thenAnswer(answer);
    _protocol.addNodeOperation(node.getName(), operation1);
    _protocol.addNodeOperation(node.getName(), operation2);
    answer.getCountDownLatch().await();

    node.shutdown();
  }
View Full Code Here

    node.disconnect();
    node.reconnect();
    NodeOperation operation1 = mock(NodeOperation.class, withSettings().serializable());
    NodeOperation operation2 = mock(NodeOperation.class, withSettings().serializable());

    SerializableCountDownLatchAnswer answer = new SerializableCountDownLatchAnswer(2);
    when(operation1.execute((NodeContext) notNull())).thenAnswer(answer);
    when(operation2.execute((NodeContext) notNull())).thenAnswer(answer);
    _protocol.addNodeOperation(node.getName(), operation1);
    _protocol.addNodeOperation(node.getName(), operation2);
    answer.getCountDownLatch().await();

    node.shutdown();
  }
View Full Code Here

    node.start();

    NodeOperation operation1 = mock(NodeOperation.class, withSettings().serializable());
    NodeOperation operation2 = mock(NodeOperation.class, withSettings().serializable());

    SerializableCountDownLatchAnswer answer = new SerializableCountDownLatchAnswer(2);
    when(operation1.execute((NodeContext) notNull())).thenAnswer(answer);
    when(operation2.execute((NodeContext) notNull())).thenAnswer(answer);
    _protocol.addNodeOperation(node.getName(), operation1);
    _protocol.addNodeOperation(node.getName(), operation2);
    answer.getCountDownLatch().await();

    node.shutdown();
  }
View Full Code Here

TOP

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

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.