[ 
https://issues.apache.org/jira/browse/GEODE-3213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16094918#comment-16094918
 ] 

ASF GitHub Bot commented on GEODE-3213:
---------------------------------------

Github user kohlmu-pivotal commented on a diff in the pull request:

    https://github.com/apache/geode/pull/646#discussion_r128386432
  
    --- Diff: 
geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutRequestOperationHandlerJUnitTest.java
 ---
    @@ -99,23 +105,21 @@ public void test_codecNotRegistered() throws 
CodecAlreadyRegisteredForTypeExcept
             TEST_KEY.getBytes(Charset.forName("UTF-8")))).thenThrow(exception);
         PutRequestOperationHandler operationHandler = new 
PutRequestOperationHandler();
     
    -    ClientProtocol.Response response =
    +    Result<RegionAPI.PutResponse> result =
             operationHandler.process(serializationServiceStub, 
generateTestRequest(), cacheStub);
     
    -    
Assert.assertEquals(ClientProtocol.Response.ResponseAPICase.ERRORRESPONSE,
    -        response.getResponseAPICase());
    +    Assert.assertTrue(result instanceof Failure);
       }
     
       @Test
       public void test_RegionNotFound() throws 
CodecAlreadyRegisteredForTypeException,
           UnsupportedEncodingTypeException, CodecNotRegisteredForTypeException 
{
         when(cacheStub.getRegion(TEST_REGION)).thenReturn(null);
         PutRequestOperationHandler operationHandler = new 
PutRequestOperationHandler();
    -    ClientProtocol.Response response =
    +    Result<RegionAPI.PutResponse> result =
             operationHandler.process(serializationServiceStub, 
generateTestRequest(), cacheStub);
     
    -    
Assert.assertEquals(ClientProtocol.Response.ResponseAPICase.ERRORRESPONSE,
    -        response.getResponseAPICase());
    +    Assert.assertTrue(result instanceof Failure);
    --- End diff --
    
    We need to assert at least the error message. Maybe later on the error code


> Refactor Protobuf Serialization Implemenation
> ---------------------------------------------
>
>                 Key: GEODE-3213
>                 URL: https://issues.apache.org/jira/browse/GEODE-3213
>             Project: Geode
>          Issue Type: Improvement
>          Components: client/server, serialization
>            Reporter: Udo Kohlmeyer
>
> In the Protobuf serialization implementation, there are some refactorings we 
> want to make:
> * OperationHandlers take OperationRequest and OperationResponse message, not 
> the parent Request/Response Object
> * A generic flow needs to be implemented that all OperationHandlers follow. 
> No bespoke flows for any OperationHandlers... way too much maintenance
> * Use Functional semantics to configure the functionality to extract 
> OperationRequest from Request (per OperationHandler)
> * Use Functional semantics to configure the functionality to populate 
> OperationResponse in the relevant Response
> * Have generic Error Handling framework to populate "known" errors and error 
> codes



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to