Search in sources :

Example 1 with FooV2

use of org.apache.pulsar.client.impl.schema.SchemaTestUtils.FooV2 in project pulsar by apache.

the class GenericAvroReaderTest method setup.

@BeforeMethod
public void setup() {
    fooSchema = AvroSchema.of(Foo.class);
    fooV2Schema = AvroSchema.of(FooV2.class);
    fooSchemaNotNull = AvroSchema.of(SchemaDefinition.builder().withAlwaysAllowNull(false).withPojo(Foo.class).build());
    fooOffsetSchema = AvroSchema.of(Foo.class);
    fooOffsetSchema.getAvroSchema().addProp(GenericAvroSchema.OFFSET_PROP, 5);
    foo = new Foo();
    foo.setField1("foo1");
    foo.setField2("bar1");
    foo.setField4(new SchemaTestUtils.Bar());
    foo.setFieldUnableNull("notNull");
    fooV2 = new FooV2();
    fooV2.setField1("foo1");
    fooV2.setField3(10);
}
Also used : SchemaTestUtils(org.apache.pulsar.client.impl.schema.SchemaTestUtils) Foo(org.apache.pulsar.client.impl.schema.SchemaTestUtils.Foo) FooV2(org.apache.pulsar.client.impl.schema.SchemaTestUtils.FooV2) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with FooV2

use of org.apache.pulsar.client.impl.schema.SchemaTestUtils.FooV2 in project pulsar by yahoo.

the class GenericAvroReaderTest method setup.

@BeforeMethod
public void setup() {
    fooSchema = AvroSchema.of(Foo.class);
    fooV2Schema = AvroSchema.of(FooV2.class);
    fooSchemaNotNull = AvroSchema.of(SchemaDefinition.builder().withAlwaysAllowNull(false).withPojo(Foo.class).build());
    fooOffsetSchema = AvroSchema.of(Foo.class);
    fooOffsetSchema.getAvroSchema().addProp(GenericAvroSchema.OFFSET_PROP, 5);
    foo = new Foo();
    foo.setField1("foo1");
    foo.setField2("bar1");
    foo.setField4(new SchemaTestUtils.Bar());
    foo.setFieldUnableNull("notNull");
    fooV2 = new FooV2();
    fooV2.setField1("foo1");
    fooV2.setField3(10);
}
Also used : SchemaTestUtils(org.apache.pulsar.client.impl.schema.SchemaTestUtils) Foo(org.apache.pulsar.client.impl.schema.SchemaTestUtils.Foo) FooV2(org.apache.pulsar.client.impl.schema.SchemaTestUtils.FooV2) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with FooV2

use of org.apache.pulsar.client.impl.schema.SchemaTestUtils.FooV2 in project incubator-pulsar by apache.

the class GenericAvroReaderTest method setup.

@BeforeMethod
public void setup() {
    fooSchema = AvroSchema.of(Foo.class);
    fooV2Schema = AvroSchema.of(FooV2.class);
    fooSchemaNotNull = AvroSchema.of(SchemaDefinition.builder().withAlwaysAllowNull(false).withPojo(Foo.class).build());
    fooOffsetSchema = AvroSchema.of(Foo.class);
    fooOffsetSchema.getAvroSchema().addProp(GenericAvroSchema.OFFSET_PROP, 5);
    foo = new Foo();
    foo.setField1("foo1");
    foo.setField2("bar1");
    foo.setField4(new SchemaTestUtils.Bar());
    foo.setFieldUnableNull("notNull");
    fooV2 = new FooV2();
    fooV2.setField1("foo1");
    fooV2.setField3(10);
}
Also used : SchemaTestUtils(org.apache.pulsar.client.impl.schema.SchemaTestUtils) Foo(org.apache.pulsar.client.impl.schema.SchemaTestUtils.Foo) FooV2(org.apache.pulsar.client.impl.schema.SchemaTestUtils.FooV2) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

SchemaTestUtils (org.apache.pulsar.client.impl.schema.SchemaTestUtils)3 Foo (org.apache.pulsar.client.impl.schema.SchemaTestUtils.Foo)3 FooV2 (org.apache.pulsar.client.impl.schema.SchemaTestUtils.FooV2)3 BeforeMethod (org.testng.annotations.BeforeMethod)3