Examples of ChainedAnswer


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

  public void testAddIndex_WithSlowProxyEstablishment() throws Exception {
    Client client = new Client(ILuceneServer.class, _protocol);
    INodeProxyManager proxyCreator = client.getProxyManager();
    INodeProxyManager proxyCreatorSpy = spy(proxyCreator);
    PauseAnswer<Void> pauseAnswer = new PauseAnswer<Void>(null);
    doAnswer(new ChainedAnswer(pauseAnswer, new CallsRealMethods())).when(proxyCreatorSpy).getProxy(anyString(),
            eq(true));
    client.setProxyCreator(proxyCreatorSpy);
    IndexMetaData indexMD = deployIndex(INDEX_NAME, INDEX_FILE, getNodeCount());
    pauseAnswer.joinExecutionBegin();
    assertThat(client.getSelectionPolicy().getShardNodes(indexMD.getShards().iterator().next().getName())).isEmpty();
View Full Code Here

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

            return indexSearcher;
          }
          shardsWithTiemoutCount.incrementAndGet();
        }
        IndexSearcher indexSearcherSpy = spy(indexSearcher);
        doAnswer(new ChainedAnswer(new SleepingAnswer(serverTimeout * 2), new CallsRealMethods())).when(
                indexSearcherSpy).search(any(Weight.class), any(Filter.class), any(Collector.class));
        return indexSearcherSpy;
      }
    });
    server = new LuceneServer("server", mockSeacherFactory, 0.01f);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.