y1chi commented on a change in pull request #15137:
URL: https://github.com/apache/beam/pull/15137#discussion_r670875356



##########
File path: 
sdks/java/core/src/test/java/org/apache/beam/sdk/coders/TimestampPrefixingWindowCoderTest.java
##########
@@ -107,15 +140,32 @@ public void testEncodeAndDecode() throws Exception {
         TimestampPrefixingWindowCoder.of(GlobalWindow.Coder.INSTANCE);
     CoderProperties.coderDecodeEncodeEqual(coder2, globalWindow);
 
-    List<CustomWindow> customWindowsToTest =
-        Lists.newArrayList(
-            new CustomWindow(new Instant(0L), new Instant(1L), true),
-            new CustomWindow(new Instant(100L), new Instant(200L), false),
-            new CustomWindow(new Instant(0L), 
BoundedWindow.TIMESTAMP_MAX_VALUE, true));
-    TimestampPrefixingWindowCoder<CustomWindow> coder3 =
-        TimestampPrefixingWindowCoder.of(CustomWindowCoder.of());
-    for (CustomWindow window : customWindowsToTest) {
-      CoderProperties.coderDecodeEncodeEqual(coder3, window);
+    for (CustomWindow window : CUSTOM_WINDOW_LIST) {
+      CoderProperties.coderDecodeEncodeEqual(TEST_CODER, window);
+    }
+  }
+
+  @Test
+  public void testConsistentWithEquals() {
+    assertThat(TEST_CODER.consistentWithEquals(), equalTo(true));
+  }
+
+  @Test
+  public void testIsRegisterByteSizeObserverCheap() {
+    assertThat(
+        TEST_CODER.isRegisterByteSizeObserverCheap(CUSTOM_WINDOW_LIST.get(0)), 
equalTo(true));
+  }
+
+  @Test
+  public void testGetEncodedElementByteSize() throws Exception {
+    TestElementByteSizeObserver observer = new TestElementByteSizeObserver();
+    for (CustomWindow value : CUSTOM_WINDOW_LIST) {
+      TEST_CODER.registerByteSizeObserver(value, observer);
+      observer.advance();
+      assertThat(
+          observer.getSumAndReset(),

Review comment:
       done.

##########
File path: 
sdks/java/core/src/test/java/org/apache/beam/sdk/coders/TimestampPrefixingWindowCoderTest.java
##########
@@ -107,15 +140,32 @@ public void testEncodeAndDecode() throws Exception {
         TimestampPrefixingWindowCoder.of(GlobalWindow.Coder.INSTANCE);
     CoderProperties.coderDecodeEncodeEqual(coder2, globalWindow);
 
-    List<CustomWindow> customWindowsToTest =
-        Lists.newArrayList(
-            new CustomWindow(new Instant(0L), new Instant(1L), true),
-            new CustomWindow(new Instant(100L), new Instant(200L), false),
-            new CustomWindow(new Instant(0L), 
BoundedWindow.TIMESTAMP_MAX_VALUE, true));
-    TimestampPrefixingWindowCoder<CustomWindow> coder3 =
-        TimestampPrefixingWindowCoder.of(CustomWindowCoder.of());
-    for (CustomWindow window : customWindowsToTest) {
-      CoderProperties.coderDecodeEncodeEqual(coder3, window);
+    for (CustomWindow window : CUSTOM_WINDOW_LIST) {
+      CoderProperties.coderDecodeEncodeEqual(TEST_CODER, window);
+    }
+  }
+
+  @Test
+  public void testConsistentWithEquals() {
+    assertThat(TEST_CODER.consistentWithEquals(), equalTo(true));

Review comment:
       done.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to