Package com.google.protobuf

Examples of com.google.protobuf.RpcController.failed()


      if (returnValue != null) {
        builder.setResponseMessage(returnValue.toByteString());
      }

      if (controller.failed()) {
        builder.setErrorMessage(controller.errorText());
      }
      e.getChannel().write(builder.build());
    }
View Full Code Here


          if (returnValue != null) {
            builder.setResponseMessage(returnValue.toByteString());
          }

          if (controller.failed()) {
            builder.setErrorMessage(controller.errorText());
          }

          channel.write(builder.build());
        }
View Full Code Here

    });

    // Wait for a response, and assert that is a complete failure. :-)
    responseLatch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
    assertEquals(Arrays.asList((ProtocolWaveletUpdate) null), responses);
    assertTrue(controller.failed());
    assertEquals(ERROR_TEXT, controller.errorText());
  }

  /**
   * Tests cancelling a streaming RPC. This is achieved by waiting for the first
View Full Code Here

    // Cancel the RPC and wait for it to finish.
    controller.startCancel();
    finishedLatch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
    assertEquals(0, finishedLatch.getCount());
    assertFalse(controller.failed());
  }

}
View Full Code Here

      if (returnValue != null) {
        builder.setResponseMessage(returnValue.toByteString());
      }

      if (controller.failed()) {
        builder.setErrorMessage(controller.errorText());
      }
      e.getChannel().write(builder.build());
    }
View Full Code Here

          if (returnValue != null) {
            builder.setResponseMessage(returnValue.toByteString());
          }

          if (controller.failed()) {
            builder.setErrorMessage(controller.errorText());
          }

          channel.write(builder.build());
        }
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.