Java Code Examples for org.apache.flink.formats.avro.utils.AvroTestUtils#getSpecificTestData()
The following examples show how to use
org.apache.flink.formats.avro.utils.AvroTestUtils#getSpecificTestData() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 2
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 3
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 4
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 5
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 6
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromSchema() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 7
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSerializability() throws Exception { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); // from class final AvroRowSerializationSchema classSer = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema classDeser = new AvroRowDeserializationSchema(testData.f0); testSerializability(classSer, classDeser, testData.f2); // from schema string final AvroRowSerializationSchema schemaSer = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema schemaDeser = new AvroRowDeserializationSchema(schemaString); testSerializability(schemaSer, schemaDeser, testData.f2); }
Example 8
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSerializability() throws Exception { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); // from class final AvroRowSerializationSchema classSer = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema classDeser = new AvroRowDeserializationSchema(testData.f0); testSerializability(classSer, classDeser, testData.f2); // from schema string final AvroRowSerializationSchema schemaSer = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema schemaDeser = new AvroRowDeserializationSchema(schemaString); testSerializability(schemaSer, schemaDeser, testData.f2); }
Example 9
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 10
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 11
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromClass() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 12
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 13
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromSchema() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 14
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromClass() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 15
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSerializability() throws Exception { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); // from class final AvroRowSerializationSchema classSer = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema classDeser = new AvroRowDeserializationSchema(testData.f0); testSerializability(classSer, classDeser, testData.f2); // from schema string final AvroRowSerializationSchema schemaSer = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema schemaDeser = new AvroRowDeserializationSchema(schemaString); testSerializability(schemaSer, schemaDeser, testData.f2); }
Example 16
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 17
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 18
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 19
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example 20
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromSchema() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }