[ 
https://issues.apache.org/jira/browse/BEAM-6904?focusedWorklogId=223669&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-223669
 ]

ASF GitHub Bot logged work on BEAM-6904:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Apr/19 16:03
            Start Date: 05/Apr/19 16:03
    Worklog Time Spent: 10m 
      Work Description: kennknowles commented on pull request #8208: 
[BEAM-6904] Add tests for structuralValue implementation in coders
URL: https://github.com/apache/beam/pull/8208#discussion_r272650666
 
 

 ##########
 File path: 
sdks/java/core/src/test/java/org/apache/beam/sdk/coders/BigIntegerCoderTest.java
 ##########
 @@ -96,4 +96,19 @@ public void testStructuralValueReturnTheSameValue() {
     Object actual = TEST_CODER.structuralValue(expected);
     assertEquals(expected, actual);
   }
+
+  @Test
+  public void testStructuralValueDecodeEncodeEqual() throws Exception {
+    for (BigInteger value : TEST_VALUES) {
+      CoderProperties.structuralValueDecodeEncodeEqual(TEST_CODER, value);
+    }
+  }
+
+  @Test
+  public void testStructuralValueConsistentWithEquals() throws Exception {
 
 Review comment:
   For `structuralValueConsistentWithEquals` it is also good to check non-equal 
members. So the test at 
`BitSetCoderTest.testStructuralValueConsistentWithEquals` is a good example of 
how to use it.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 223669)
    Time Spent: 50m  (was: 40m)

> Test all Coder structuralValue implementations
> ----------------------------------------------
>
>                 Key: BEAM-6904
>                 URL: https://issues.apache.org/jira/browse/BEAM-6904
>             Project: Beam
>          Issue Type: Test
>          Components: sdk-java-core
>            Reporter: Kenneth Knowles
>            Assignee: Alexander Savchenko
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Here is a test helper that check that structuralValue is consistent with 
> equals: 
> https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/CoderProperties.java#L200
> And here is one that tests it another way: 
> https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/CoderProperties.java#L226
> With the deprecation of consistentWithEquals and implementing all the 
> structualValue methods, we should add these tests to every coder.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to