use of com.hortonworks.registries.schemaregistry.avro.helper.SchemaRegistryTestServerClientWrapper in project registry by hortonworks.
the class AvroSchemaRegistryClientTest method beforeParam.
@CustomParameterizedRunner.BeforeParam
public static void beforeParam(SchemaRegistryTestProfileType schemaRegistryTestProfileType) throws Exception {
SCHEMA_REGISTRY_TEST_SERVER_CLIENT_WRAPPER = new SchemaRegistryTestServerClientWrapper(schemaRegistryTestProfileType);
SCHEMA_REGISTRY_TEST_SERVER_CLIENT_WRAPPER.startTestServer();
SCHEMA_REGISTRY_CLIENT = SCHEMA_REGISTRY_TEST_SERVER_CLIENT_WRAPPER.getClient(false);
SCHEMA_REGISTRY_CLIENT_CONF = SCHEMA_REGISTRY_TEST_SERVER_CLIENT_WRAPPER.exportClientConf();
}
use of com.hortonworks.registries.schemaregistry.avro.helper.SchemaRegistryTestServerClientWrapper in project registry by hortonworks.
the class KafkaAvroSerDesTest method beforeParam.
@CustomParameterizedRunner.BeforeParam
public static void beforeParam(SchemaRegistryTestProfileType schemaRegistryTestProfileType) throws Exception {
SCHEMA_REGISTRY_TEST_SERVER_CLIENT_WRAPPER = new SchemaRegistryTestServerClientWrapper(schemaRegistryTestProfileType);
SCHEMA_REGISTRY_TEST_SERVER_CLIENT_WRAPPER.startTestServer();
}
use of com.hortonworks.registries.schemaregistry.avro.helper.SchemaRegistryTestServerClientWrapper in project registry by hortonworks.
the class LocalRegistryServerHATest method testHASanity.
@Test
public void testHASanity() throws Exception {
SchemaRegistryTestServerClientWrapper followerServer = followerSchemaRegistryServer();
SchemaRegistryClient schemaRegistryClient = followerServer.getClient();
// registering schema metadata on follower, this should have been redirected to leader.
String schemaName = "foo";
SchemaMetadata schemaMetadata = new SchemaMetadata.Builder(schemaName).type("avro").build();
Long schemaId = schemaRegistryClient.registerSchemaMetadata(schemaMetadata);
Assert.assertNotNull(schemaId);
// registering a new schema on follower, this should have been redirected to leader.
String schema1 = IOUtils.toString(LocalRegistryServerTest.class.getResourceAsStream("/schema-1.avsc"), "UTF-8");
SchemaIdVersion v1 = schemaRegistryClient.addSchemaVersion(schemaName, new SchemaVersion(schema1, "Initial version of the schema"));
// retrieve schema on leader as the schema data is stored in memory in leader. this data does not exist on
// followers as the storage is inmemory.
SchemaRegistryTestServerClientWrapper leaderServer = leaderSchemaRegistryServer();
int leaderPort = leaderServer.getLocalPort();
SchemaRegistryClient leaderClient = leaderServer.getClient();
SchemaMetadataInfo schemaMetadataInfo = leaderClient.getSchemaMetadataInfo(schemaName);
Assert.assertEquals(schemaMetadata, schemaMetadataInfo.getSchemaMetadata());
// stop the leader server
leaderServer.stopTestServer();
// get the new leader server and run operations.
SchemaRegistryTestServerClientWrapper newLeaderServer = leaderSchemaRegistryServer();
Assert.assertNotEquals(leaderPort, newLeaderServer.getLocalPort());
leaderClient = newLeaderServer.getClient();
String receivedSchema = leaderClient.getSchemaVersionInfo(new SchemaVersionKey(schemaName, v1.getVersion())).getSchemaText();
Assert.assertEquals(schema1, receivedSchema);
}
use of com.hortonworks.registries.schemaregistry.avro.helper.SchemaRegistryTestServerClientWrapper in project registry by hortonworks.
the class KafkaAvroSerDesWithKafkaServerTest method beforeParam.
@CustomParameterizedRunner.BeforeParam
public static void beforeParam(SchemaRegistryTestProfileType schemaRegistryTestProfileType) throws Exception {
SCHEMA_REGISTRY_TEST_SERVER_CLIENT_WRAPPER = new SchemaRegistryTestServerClientWrapper(schemaRegistryTestProfileType);
SCHEMA_REGISTRY_TEST_SERVER_CLIENT_WRAPPER.startTestServer();
CLUSTER = new EmbeddedKafkaCluster(1);
CLUSTER.start();
}
use of com.hortonworks.registries.schemaregistry.avro.helper.SchemaRegistryTestServerClientWrapper in project registry by hortonworks.
the class CustomStateTransitionTest method startUp.
@Before
public void startUp() throws Exception {
String serverYAMLPath = CustomStateTransitionTest.class.getClassLoader().getResource("registry-lifecycle-test-example.yaml").getPath();
String clientYAMLPath = CustomStateTransitionTest.class.getClassLoader().getResource("registry-lifecycle-client.yaml").getPath();
schemaRegistryTestServerClientWrapper = new SchemaRegistryTestServerClientWrapper(new SchemaRegistryTestConfiguration(serverYAMLPath, clientYAMLPath));
schemaRegistryTestServerClientWrapper.startTestServer();
schemaRegistryClient = schemaRegistryTestServerClientWrapper.getClient();
}
Aggregations