Skip to content

Commit

Permalink
AVRO-2918: poly
Browse files Browse the repository at this point in the history
  • Loading branch information
clesaec committed Jan 6, 2023
1 parent f5b0f1a commit ed665ae
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
10 changes: 6 additions & 4 deletions lang/java/avro/src/test/java/org/apache/avro/TestSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ void emptyRecordSchema() {
assertNotNull(schemaString);
}

@Test(expected = SchemaParseException.class)
public void testParseEmptySchema() {
new Schema.Parser().parse("");
@Test
void parseEmptySchema() {
assertThrows(SchemaParseException.class, () -> {
new Schema.Parser().parse("");
});
}

@Test
public void testSchemaWithFields() {
void schemaWithFields() {
List<Field> fields = new ArrayList<>();
fields.add(new Field("field_name1", Schema.create(Type.NULL), null, null));
fields.add(new Field("field_name2", Schema.create(Type.INT), null, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,23 @@
*/
package org.apache.avro.generic;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.apache.avro.AvroTypeException;
import org.apache.avro.Schema;
import org.apache.avro.SchemaBuilder;
import org.apache.avro.UnresolvedUnionException;
import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.DecoderFactory;
import org.apache.avro.io.Encoder;
import org.apache.avro.io.EncoderFactory;
import org.apache.avro.util.Utf8;

import org.junit.jupiter.api.Test;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.ConcurrentModificationException;
Expand All @@ -39,20 +46,10 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import org.apache.avro.AvroTypeException;
import org.apache.avro.Schema;
import org.apache.avro.SchemaBuilder;
import org.apache.avro.UnresolvedUnionException;
import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.DecoderFactory;
import org.apache.avro.io.Encoder;
import org.apache.avro.io.EncoderFactory;
import org.apache.avro.util.Utf8;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

public class TestGenericDatumWriter {
@Test
Expand Down

0 comments on commit ed665ae

Please sign in to comment.