Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public static class RootType
{
@JsonAlias({"nm", "Name"})
public String name;

public int value;

List<String> other;
}

Expand Down Expand Up @@ -51,7 +51,7 @@ public ByteBuffer getBytes() {
}
}
}

/*
/**********************************************************
/* Tests
Expand Down Expand Up @@ -94,21 +94,21 @@ public void testEmployee() throws Exception
AvroSchema schema = gen.getGeneratedSchema();
assertNotNull(schema);

String json = schema.getAvroSchema().toString(true);
String json = schema.getAvroSchema().toString(true);
assertNotNull(json);
AvroSchema s2 = MAPPER.schemaFrom(json);
assertNotNull(s2);

Employee empl = new Employee();
empl.name = "Bobbee";
empl.age = 39;
empl.emails = new String[] { "[email protected]", "[email protected]" };
empl.boss = null;

// So far so good: try producing actual Avro data...
byte[] bytes = MAPPER.writer(schema).writeValueAsBytes(empl);
assertNotNull(bytes);

// and bring it back, too
Employee e2 = getMapper().readerFor(Employee.class)
.with(schema)
Expand All @@ -131,7 +131,7 @@ public void testMap() throws Exception
assertNotNull(s2);

// should probably verify, maybe... ?

// System.out.println("Map schema:\n"+json);
}

Expand Down Expand Up @@ -165,10 +165,8 @@ public void testSchemaForUntypedMap() throws Exception
try {
MAPPER.schemaFor(Map.class);
fail("Not expected to work yet");
} catch (InvalidDefinitionException e) {
verifyException(e, "\"Any\" type");
verifyException(e, "not supported");
verifyException(e, "`java.lang.Object`");
} catch (UnsupportedOperationException e) {
verifyException(e, "Maps with non-stringable keys are not supported yet");
}
}
}