Search in sources :

Example 1 with SchemaRegistryTestConfiguration

use of com.hortonworks.registries.schemaregistry.avro.conf.SchemaRegistryTestConfiguration 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();
}
Also used : SchemaRegistryTestServerClientWrapper(com.hortonworks.registries.schemaregistry.avro.helper.SchemaRegistryTestServerClientWrapper) SchemaRegistryTestConfiguration(com.hortonworks.registries.schemaregistry.avro.conf.SchemaRegistryTestConfiguration) Before(org.junit.Before)

Example 2 with SchemaRegistryTestConfiguration

use of com.hortonworks.registries.schemaregistry.avro.conf.SchemaRegistryTestConfiguration in project registry by hortonworks.

the class LocalRegistryServerHATest method startZooKeeper.

@Before
public void startZooKeeper() throws Exception {
    testingServer = new TestingServer(true);
    File serverYAMLFile = new File(SCHEMA_REGISTRY_TEST_CONFIGURATION.getServerYAMLPath());
    String fileContent = FileUtils.readFileToString(serverYAMLFile, "UTF-8");
    File registryConfigFile = File.createTempFile("ha-", ".yaml");
    registryConfigFile.deleteOnExit();
    try (FileWriter writer = new FileWriter(registryConfigFile)) {
        IOUtils.write(fileContent.replace("__zk_connect_url__", testingServer.getConnectString()), writer);
    }
    SchemaRegistryTestConfiguration testConfiguration = new SchemaRegistryTestConfiguration(registryConfigFile.getAbsolutePath(), SCHEMA_REGISTRY_TEST_CONFIGURATION.getClientYAMLPath());
    List<SchemaRegistryTestServerClientWrapper> schemaRegistryServers = new ArrayList<>();
    for (int i = 1; i < 4; i++) {
        SchemaRegistryTestServerClientWrapper server = new SchemaRegistryTestServerClientWrapper(testConfiguration);
        schemaRegistryServers.add(server);
        server.startTestServer();
    }
    registryServers = Collections.unmodifiableList(schemaRegistryServers);
}
Also used : TestingServer(org.apache.curator.test.TestingServer) SchemaRegistryTestServerClientWrapper(com.hortonworks.registries.schemaregistry.avro.helper.SchemaRegistryTestServerClientWrapper) SchemaRegistryTestConfiguration(com.hortonworks.registries.schemaregistry.avro.conf.SchemaRegistryTestConfiguration) FileWriter(java.io.FileWriter) ArrayList(java.util.ArrayList) File(java.io.File) Before(org.junit.Before)

Aggregations

SchemaRegistryTestConfiguration (com.hortonworks.registries.schemaregistry.avro.conf.SchemaRegistryTestConfiguration)2 SchemaRegistryTestServerClientWrapper (com.hortonworks.registries.schemaregistry.avro.helper.SchemaRegistryTestServerClientWrapper)2 Before (org.junit.Before)2 File (java.io.File)1 FileWriter (java.io.FileWriter)1 ArrayList (java.util.ArrayList)1 TestingServer (org.apache.curator.test.TestingServer)1