Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
maosuhan committed Feb 28, 2021
1 parent 1c6f6ae commit a721a9d
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions flink-formats/flink-protobuf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ under the License.
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protobuf.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.janino</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void testSimple() throws Exception {
.setD(0.1f)
.setE(0.01)
.setF("haha")
.setG(ByteString.copyFrom(new byte[]{1}))
.setG(ByteString.copyFrom(new byte[] {1}))
.build();

RowData row = deserializationSchema.deserialize(simple.toByteArray());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void testMessage() throws Exception {
.setF(Corpus.IMAGES)
.setG(innerMessageTest)
.addH(innerMessageTest)
.setI(ByteString.copyFrom(new byte[]{100}))
.setI(ByteString.copyFrom(new byte[] {100}))
.putMap1("a", "b")
.putMap1("c", "d")
.putMap2("f", innerMessageTest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

public class RowToMultipleLevelMessageProtoBytesTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class RowToRepeatedMessageProtoBytesTest {
@Test
public void testRepeatedMessage() throws Exception {
RowData subRow = GenericRowData.of(1, 2L);
RowData subRow2 = GenericRowData.of(3, 4L);
ArrayData tmp = new GenericArrayData(new Object[]{subRow, subRow2});
ArrayData tmp = new GenericArrayData(new Object[] {subRow, subRow2});
RowData row = GenericRowData.of(tmp);

RowType rowType = PbRowTypeInformation.generateRowType(RepeatedMessageTest.getDescriptor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class RowToRepeatedProtoBytesTest {
@Test
public void testSimple() throws Exception {
RowData row =
GenericRowData.of(
1,
new GenericArrayData(new Object[]{1L, 2L, 3L}),
new GenericArrayData(new Object[] {1L, 2L, 3L}),
false,
0.1f,
0.01,
Expand All @@ -59,7 +61,7 @@ public void testEmptyArray() throws Exception {
RowData row =
GenericRowData.of(
1,
new GenericArrayData(new Object[]{}),
new GenericArrayData(new Object[] {}),
false,
0.1f,
0.01,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testSimple() throws Exception {
0.1f,
0.01,
StringData.fromString("hello"),
new byte[]{1},
new byte[] {1},
StringData.fromString("IMAGES"),
1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void testSimple() throws Exception {
.setD(0.1f)
.setE(0.01)
.setF("haha")
.setG(ByteString.copyFrom(new byte[]{1}))
.setG(ByteString.copyFrom(new byte[] {1}))
.setH(SimpleTest.Corpus.IMAGES)
.setFAbc7D(1) // test fieldNameToJsonName
.build();
Expand Down

0 comments on commit a721a9d

Please sign in to comment.