result = result && getValueCase().equals( other.getValueCase()); if (!result) return false; switch (valueCase_) {
switch (encodedValue.getValueCase()) { case BINARYRESULT: return encodedValue.getBinaryResult().toByteArray(); "Can't decode a value of type " + encodedValue.getValueCase() + ": " + encodedValue);
public static void validateGetResponse(Socket socket, ProtobufProtocolSerializer protobufProtocolSerializer, Object expectedValue) throws InvalidProtocolMessageException, IOException { ClientProtocol.Message response = protobufProtocolSerializer.deserialize(socket.getInputStream()); assertEquals(ClientProtocol.Message.MessageTypeCase.GETRESPONSE, response.getMessageTypeCase()); RegionAPI.GetResponse getResponse = response.getGetResponse(); BasicTypes.EncodedValue result = getResponse.getResult(); assertEquals(BasicTypes.EncodedValue.ValueCase.STRINGRESULT, result.getValueCase()); assertEquals(expectedValue, result.getStringResult()); } }
public Builder mergeFrom(org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.EncodedValue other) { if (other == org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.EncodedValue.getDefaultInstance()) return this; switch (other.getValueCase()) { case INTRESULT: { setIntResult(other.getIntResult());
switch (encodedValue.getValueCase()) { case BINARYRESULT: return encodedValue.getBinaryResult().toByteArray(); default: throw new DecodingException( "Unknown Protobuf encoding type: " + encodedValue.getValueCase());
private Map<String, String> convertEntryListToMap(List<BasicTypes.Entry> entriesList) { Map<String, String> result = new HashMap<>(); for (BasicTypes.Entry entry : entriesList) { BasicTypes.EncodedValue encodedKey = entry.getKey(); assertEquals(BasicTypes.EncodedValue.ValueCase.STRINGRESULT, encodedKey.getValueCase()); String key = encodedKey.getStringResult(); BasicTypes.EncodedValue encodedValue = entry.getValue(); assertEquals(BasicTypes.EncodedValue.ValueCase.STRINGRESULT, encodedValue.getValueCase()); String value = encodedValue.getStringResult(); result.put(key, value); } return result; } }
@Test public void processReturnsTheEncodedValueFromTheRegion() throws Exception { RegionAPI.GetRequest getRequest = generateTestRequest(false, false, false); Result result = operationHandler.process(serializationService, getRequest, TestExecutionContext.getNoAuthCacheExecutionContext(cacheStub)); Assert.assertTrue(result instanceof Success); RegionAPI.GetResponse response = (RegionAPI.GetResponse) result.getMessage(); Assert.assertEquals(BasicTypes.EncodedValue.ValueCase.STRINGRESULT, response.getResult().getValueCase()); String actualValue = response.getResult().getStringResult(); Assert.assertEquals(TEST_VALUE, actualValue); }