assertTrue(good_deployment.getExport().isEnabled());
assertEquals(good_deployment.getExport().getTarget(), ServerExportEnum.CUSTOM);
assertEquals(good_deployment.getExport().getExportconnectorclass(),
"org.voltdb.exportclient.NoOpTestExportClient");
ConnectorProperty prop = catconn.getConfig().get(ExportDataProcessor.EXPORT_TO_TYPE);
assertEquals(prop.getValue(), "org.voltdb.exportclient.NoOpTestExportClient");
// This is to test previous deployment with builtin export functionality.
final File tmpBuiltin = VoltProjectBuilder.writeStringToTempFile(withBuiltinFileExport);
DeploymentType builtin_deployment = CatalogUtil.getDeployment(new FileInputStream(tmpBuiltin));
Catalog cat3 = compiler.compileCatalogFromDDL(x);
crc = CatalogUtil.compileDeployment(cat3, builtin_deployment, true, false);
assertTrue("Deployment file failed to parse", crc != -1);
db = cat3.getClusters().get("cluster").getDatabases().get("database");
catconn = db.getConnectors().get("0");
assertNotNull(catconn);
assertTrue(builtin_deployment.getExport().isEnabled());
assertEquals(builtin_deployment.getExport().getTarget(), ServerExportEnum.FILE);
prop = catconn.getConfig().get(ExportDataProcessor.EXPORT_TO_TYPE);
assertEquals(prop.getValue(), "org.voltdb.exportclient.ExportToFileClient");
//Check kafka option.
final File tmpKafkaBuiltin = VoltProjectBuilder.writeStringToTempFile(withBuiltinKafkaExport);
DeploymentType builtin_kafkadeployment = CatalogUtil.getDeployment(new FileInputStream(tmpKafkaBuiltin));
Catalog cat4 = compiler.compileCatalogFromDDL(x);
crc = CatalogUtil.compileDeployment(cat4, builtin_kafkadeployment, true, false);
assertTrue("Deployment file failed to parse", crc != -1);
db = cat4.getClusters().get("cluster").getDatabases().get("database");
catconn = db.getConnectors().get("0");
assertNotNull(catconn);
assertTrue(builtin_kafkadeployment.getExport().isEnabled());
assertEquals(builtin_kafkadeployment.getExport().getTarget(), ServerExportEnum.KAFKA);
prop = catconn.getConfig().get(ExportDataProcessor.EXPORT_TO_TYPE);
assertEquals(prop.getValue(), "org.voltdb.exportclient.KafkaExportClient");
// Check RabbitMQ option
final File tmpRabbitMQBuiltin = VoltProjectBuilder.writeStringToTempFile(withBuiltinRabbitMQExport);
DeploymentType builtin_rabbitmqdeployment = CatalogUtil.getDeployment(new FileInputStream(tmpRabbitMQBuiltin));
Catalog cat5 = compiler.compileCatalogFromDDL(x);
crc = CatalogUtil.compileDeployment(cat5, builtin_rabbitmqdeployment, true, false);
assertTrue("Deployment file failed to parse", crc != -1);
db = cat5.getClusters().get("cluster").getDatabases().get("database");
catconn = db.getConnectors().get("0");
assertNotNull(catconn);
assertTrue(builtin_rabbitmqdeployment.getExport().isEnabled());
assertEquals(ServerExportEnum.RABBITMQ, builtin_rabbitmqdeployment.getExport().getTarget());
prop = catconn.getConfig().get(ExportDataProcessor.EXPORT_TO_TYPE);
assertEquals("org.voltdb.exportclient.RabbitMQExportClient", prop.getValue());
}