Skip to content

Commit 8a4cbba

Browse files
committed
Minor clean up
1 parent 3b0c1ce commit 8a4cbba

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/AvroTestBase.java

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import junit.framework.TestCase;
1010

1111
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
12-
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
13-
import com.fasterxml.jackson.annotation.JsonProperty;
1412
import com.fasterxml.jackson.core.JsonParser;
1513
import com.fasterxml.jackson.core.JsonToken;
1614
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -80,7 +78,7 @@ public abstract class AvroTestBase extends TestCase
8078
/**********************************************************
8179
*/
8280

83-
protected static class PointLong
81+
public static class PointLong
8482
{
8583
public long x, y;
8684

@@ -92,7 +90,7 @@ public PointLong(long x0, long y0) {
9290
}
9391
}
9492

95-
protected static class PointDouble
93+
public static class PointDouble
9694
{
9795
public double x, y;
9896

@@ -104,7 +102,6 @@ public PointDouble(long x0, long y0) {
104102
}
105103
}
106104

107-
// public because needed by "AvroAliasTest"
108105
public static class Employee
109106
{
110107
public Employee() { }
@@ -127,7 +124,7 @@ public static Employee construct() {
127124
}
128125

129126
@JsonPropertyOrder({"content", "images"})
130-
protected static class MediaItem
127+
static class MediaItem
131128
{
132129
private MediaContent _content;
133130
private List<Image> _images;
@@ -154,7 +151,7 @@ public void addPhoto(Image p) {
154151

155152
@JsonPropertyOrder(alphabetic=true, value = {
156153
"uri","title","width","height","format","duration","size","bitrate","persons","player","copyright"})
157-
protected static class MediaContent
154+
static class MediaContent
158155
{
159156
public enum Player { JAVA, FLASH; }
160157

@@ -219,7 +216,7 @@ public void addPerson(String p) {
219216
}
220217

221218
@JsonPropertyOrder({"uri","title","width","height","size"})
222-
protected static class Image
219+
static class Image
223220
{
224221
private String _uri;
225222
private String _title;
@@ -253,19 +250,6 @@ public Image(String uri, String title, int w, int h, Size s)
253250
// public because needed by "AvroAliasTest"
254251
public enum Size { SMALL, LARGE; }
255252

256-
protected enum ABC {
257-
A,
258-
B,
259-
@JsonEnumDefaultValue
260-
C;
261-
}
262-
263-
protected static class ABCDefaultClass {
264-
public String name;
265-
@JsonProperty(required = true)
266-
public ABC abc;
267-
}
268-
269253
/*
270254
/**********************************************************
271255
/* Recycling for commonly needed helper objects

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/EnumTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import org.apache.avro.Schema;
77
import org.apache.avro.Schema.Type;
88

9+
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
10+
import com.fasterxml.jackson.annotation.JsonProperty;
911
import com.fasterxml.jackson.dataformat.avro.schema.AvroSchemaGenerator;
1012

1113
public class EnumTest extends AvroTestBase
@@ -38,6 +40,19 @@ protected static class EmployeeStr {
3840
public String gender;
3941
}
4042

43+
protected enum ABC {
44+
A,
45+
B,
46+
@JsonEnumDefaultValue
47+
C;
48+
}
49+
50+
protected static class ABCDefaultClass {
51+
public String name;
52+
@JsonProperty(required = true)
53+
public ABC abc;
54+
}
55+
4156
private final AvroMapper MAPPER = newMapper();
4257

4358
public void test_avroSchemaWithEnum_fromEnumValueToEnumValue() throws Exception

0 commit comments

Comments
 (0)