Package net.sf.katta.operation

Examples of net.sf.katta.operation.OperationId


  @Test(timeout = 10000)
  public void testOperationWatchdog() throws Exception {
    String nodeName = "node1";
    when(_protocol.getLiveNodes()).thenReturn(Arrays.asList(nodeName));
    List<OperationId> operationIds = new ArrayList<OperationId>();
    operationIds.add(new OperationId(nodeName, "e1"));

    final MasterOperation leaderOperation = mock(MasterOperation.class);
    when(leaderOperation.execute(_context, EMPTY_LIST)).thenReturn(operationIds);
    setupExecutionInstruction(leaderOperation, ExecutionInstruction.EXECUTE);
    when(_queue.peek()).thenReturn(leaderOperation).thenAnswer(new SleepingAnswer());
View Full Code Here


  private void runLockSituation(final MasterOperation leaderOperation1, final MasterOperation leaderOperation2,
          ExecutionInstruction instruction) throws Exception, InterruptedException {
    String nodeName = "node1";
    when(_protocol.getLiveNodes()).thenReturn(Arrays.asList(nodeName));
    List<OperationId> operationIds = new ArrayList<OperationId>();
    operationIds.add(new OperationId(nodeName, "e1"));

    when(_protocol.isNodeOperationQueued(operationIds.get(0))).thenReturn(false);
    OperationWatchdog watchdog = mock(OperationWatchdog.class);
    when(_queue.moveOperationToWatching(leaderOperation1, operationIds)).thenReturn(watchdog);
View Full Code Here

TOP

Related Classes of net.sf.katta.operation.OperationId

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.