Skip to content

Commit 46fc906

Browse files
ZeyuCaicowtowncoder
authored andcommitted
fix 15 flaky tests (#304)
1 parent 78b8efe commit 46fc906

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

cbor/src/test/java/com/fasterxml/jackson/dataformat/cbor/seq/SequenceWriterTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99

1010
import com.fasterxml.jackson.dataformat.cbor.CBORTestBase;
1111

12+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
13+
1214
public class SequenceWriterTest extends CBORTestBase
1315
{
1416
private final ObjectMapper MAPPER = cborMapper();
1517

18+
@JsonPropertyOrder({ "id", "value"})
1619
static class IdValue {
1720
public int id, value;
1821

protobuf/src/test/java/com/fasterxml/jackson/dataformat/protobuf/ProtobufTestBase.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import junit.framework.TestCase;
1212

13+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
14+
1315
public abstract class ProtobufTestBase extends TestCase
1416
{
1517
/*
@@ -149,6 +151,7 @@ static class SearchRequest {
149151
/**********************************************************
150152
*/
151153

154+
@JsonPropertyOrder({ "x", "y"})
152155
static class Point {
153156
public int x;
154157
public int y;
@@ -174,6 +177,7 @@ public boolean equals(Object o) {
174177
}
175178
}
176179

180+
@JsonPropertyOrder({ "x", "y", "z" })
177181
static class Point3 {
178182
public int x, y, z;
179183

@@ -277,6 +281,7 @@ public boolean equals(Object o) {
277281
}
278282
}
279283

284+
@JsonPropertyOrder({ "topLeft", "bottomRight"})
280285
static class Box {
281286
public Point topLeft, bottomRight;
282287

@@ -296,6 +301,7 @@ public String toString() {
296301
}
297302
}
298303

304+
@JsonPropertyOrder({ "first", "last"})
299305
static class Name {
300306
public String first, last;
301307

protobuf/src/test/java/com/fasterxml/jackson/dataformat/protobuf/WriteBinaryTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import com.fasterxml.jackson.databind.*;
66
import com.fasterxml.jackson.dataformat.protobuf.schema.*;
77

8+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
9+
810
public class WriteBinaryTest extends ProtobufTestBase
911
{
1012
final protected static String PROTOC_BINARY =
@@ -15,6 +17,7 @@ public class WriteBinaryTest extends ProtobufTestBase
1517
+"}\n"
1618
;
1719

20+
@JsonPropertyOrder({ "id", "trailer", "data"})
1821
static class Binary {
1922
public int id, trailer;
2023
public byte[] data;

smile/src/test/java/com/fasterxml/jackson/dataformat/smile/seq/SequenceWriterTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99

1010
import com.fasterxml.jackson.dataformat.smile.BaseTestForSmile;
1111

12+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
13+
1214
public class SequenceWriterTest extends BaseTestForSmile
1315
{
1416
private final ObjectMapper MAPPER = smileMapper();
1517

18+
@JsonPropertyOrder({ "id", "value"})
1619
static class IdValue {
1720
public int id, value;
1821

0 commit comments

Comments
 (0)