MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / deserializeActionException

Method deserializeActionException

test/TestMultiAction.java:779–804  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

777 }
778
779 @Test
780 public void deserializeActionException() throws Exception {
781 final Builder rar = RegionActionResult.newBuilder();
782 rar.setException(PBufResponses.buildException(new RuntimeException("Boo!")));
783 MultiResponse response = MultiResponse.newBuilder()
784 .addRegionActionResult(rar.build()).build();
785
786 PutRequest put1 = new PutRequest(TABLE, KEY, FAMILY, QUALIFIER, VALUE);
787 put1.region = region;
788 PutRequest put2 = new PutRequest(TABLE, KEY, FAMILY, "myqual".getBytes(), VALUE);
789 put2.region = region;
790 MultiAction multi = new MultiAction();
791 multi.add(put1);
792 multi.add(put2);
793
794 final MultiAction.Response decoded =
795 (MultiAction.Response)multi.deserialize(
796 PBufResponses.encodeResponse(response), 0);
797 assertEquals(2, decoded.size());
798 assertTrue(decoded.result(0) instanceof RuntimeException);
799 RuntimeException e = (RuntimeException)decoded.result(0);
800 assertTrue(e.getMessage().contains("Boo!"));
801 assertTrue(decoded.result(1) instanceof RuntimeException);
802 e = (RuntimeException)decoded.result(1);
803 assertTrue(e.getMessage().contains("Boo!"));
804 }
805
806 @Test
807 public void deserializeMultipleActions() throws Exception {

Callers

nothing calls this directly

Calls 8

buildExceptionMethod · 0.95
addMethod · 0.95
deserializeMethod · 0.95
encodeResponseMethod · 0.95
resultMethod · 0.80
containsMethod · 0.80
sizeMethod · 0.45
getMessageMethod · 0.45

Tested by

no test coverage detected