diff options
author | Jiayu Liu <Jimexist@users.noreply.github.com> | 2022-05-06 12:56:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 00:56:42 -0400 |
commit | 53ec08228a14130909d4dd6fc2c98f47a09d76b0 (patch) | |
tree | 19fd3589502b5471be23efe4d1190ad26fcbc91e /lib/java/src/test/java/org/apache/thrift/transport/TestTMemoryTransport.java | |
parent | 23b86364ef3dbccc19f5f3828e6d115f7b015651 (diff) | |
download | thrift-53ec08228a14130909d4dd6fc2c98f47a09d76b0.tar.gz |
THRIFT-5568: enforce consistent Java formatting (#2581)
* use spotless plugin and google-java-format to enforce a consistent code format
* add a step of spotless check before building
* only run spotless on the src/ directory
Co-authored-by: Christopher Tubbs <ctubbsii@apache.org>
Diffstat (limited to 'lib/java/src/test/java/org/apache/thrift/transport/TestTMemoryTransport.java')
-rw-r--r-- | lib/java/src/test/java/org/apache/thrift/transport/TestTMemoryTransport.java | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/java/src/test/java/org/apache/thrift/transport/TestTMemoryTransport.java b/lib/java/src/test/java/org/apache/thrift/transport/TestTMemoryTransport.java index 6d221db96..9575610a0 100644 --- a/lib/java/src/test/java/org/apache/thrift/transport/TestTMemoryTransport.java +++ b/lib/java/src/test/java/org/apache/thrift/transport/TestTMemoryTransport.java @@ -19,15 +19,14 @@ package org.apache.thrift.transport; -import org.apache.thrift.TByteArrayOutputStream; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.function.Executable; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import java.nio.ByteBuffer; import java.util.Random; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.apache.thrift.TByteArrayOutputStream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.function.Executable; public class TestTMemoryTransport { @@ -51,12 +50,14 @@ public class TestTMemoryTransport { public void testReadMoreThanRemaining() throws TTransportException { TMemoryTransport transport = new TMemoryTransport(new byte[] {0x00, 0x32}); byte[] read = new byte[3]; - assertThrows(TTransportException.class, new Executable() { - @Override - public void execute() throws Throwable { - transport.read(read, 0, 3); - } - }); + assertThrows( + TTransportException.class, + new Executable() { + @Override + public void execute() throws Throwable { + transport.read(read, 0, 3); + } + }); } @Test @@ -68,6 +69,8 @@ public class TestTMemoryTransport { transport.write(output2, 0, 2); byte[] expected = {0x72, 0x56, 0x29, (byte) 0xAF, (byte) 0x9B, (byte) 0x83, 0x10}; TByteArrayOutputStream outputByteArray = transport.getOutput(); - assertEquals(ByteBuffer.wrap(expected), ByteBuffer.wrap(outputByteArray.get(), 0, outputByteArray.len())); + assertEquals( + ByteBuffer.wrap(expected), + ByteBuffer.wrap(outputByteArray.get(), 0, outputByteArray.len())); } } |