Examples of handleRefresh()


Examples of org.apache.hadoop.ipc.RefreshHandler.handleRefresh()

  @Test
  public void testMultipleReturnCodeMerging() throws Exception {
    // Two handlers which return two non-zero values
    RefreshHandler handlerOne = Mockito.mock(RefreshHandler.class);
    Mockito.stub(handlerOne.handleRefresh(Mockito.anyString(), Mockito.any(String[].class)))
      .toReturn(new RefreshResponse(23, "Twenty Three"));

    RefreshHandler handlerTwo = Mockito.mock(RefreshHandler.class);
    Mockito.stub(handlerTwo.handleRefresh(Mockito.anyString(), Mockito.any(String[].class)))
      .toReturn(new RefreshResponse(10, "Ten"));
View Full Code Here

Examples of org.apache.hadoop.ipc.RefreshHandler.handleRefresh()

    RefreshHandler handlerOne = Mockito.mock(RefreshHandler.class);
    Mockito.stub(handlerOne.handleRefresh(Mockito.anyString(), Mockito.any(String[].class)))
      .toReturn(new RefreshResponse(23, "Twenty Three"));

    RefreshHandler handlerTwo = Mockito.mock(RefreshHandler.class);
    Mockito.stub(handlerTwo.handleRefresh(Mockito.anyString(), Mockito.any(String[].class)))
      .toReturn(new RefreshResponse(10, "Ten"));

    // Then registered to the same ID
    RefreshRegistry.defaultRegistry().register("shared", handlerOne);
    RefreshRegistry.defaultRegistry().register("shared", handlerTwo);
View Full Code Here

Examples of org.apache.hadoop.ipc.RefreshHandler.handleRefresh()

  @Test
  public void testExceptionResultsInNormalError() throws Exception {
    // In this test, we ensure that all handlers are called even if we throw an exception in one
    RefreshHandler exceptionalHandler = Mockito.mock(RefreshHandler.class);
    Mockito.stub(exceptionalHandler.handleRefresh(Mockito.anyString(), Mockito.any(String[].class)))
      .toThrow(new RuntimeException("Exceptional Handler Throws Exception"));

    RefreshHandler otherExceptionalHandler = Mockito.mock(RefreshHandler.class);
    Mockito.stub(otherExceptionalHandler.handleRefresh(Mockito.anyString(), Mockito.any(String[].class)))
      .toThrow(new RuntimeException("More Exceptions"));
View Full Code Here

Examples of org.apache.hadoop.ipc.RefreshHandler.handleRefresh()

    RefreshHandler exceptionalHandler = Mockito.mock(RefreshHandler.class);
    Mockito.stub(exceptionalHandler.handleRefresh(Mockito.anyString(), Mockito.any(String[].class)))
      .toThrow(new RuntimeException("Exceptional Handler Throws Exception"));

    RefreshHandler otherExceptionalHandler = Mockito.mock(RefreshHandler.class);
    Mockito.stub(otherExceptionalHandler.handleRefresh(Mockito.anyString(), Mockito.any(String[].class)))
      .toThrow(new RuntimeException("More Exceptions"));

    RefreshRegistry.defaultRegistry().register("exceptional", exceptionalHandler);
    RefreshRegistry.defaultRegistry().register("exceptional", otherExceptionalHandler);
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.