use of org.junit.BeforeClass in project camel by apache.
the class ElasticsearchClusterBaseTest method cleanUpOnce.
@BeforeClass
public static void cleanUpOnce() throws Exception {
deleteDirectory("target/testcluster/");
clusterName = "es-cl-run-" + System.currentTimeMillis();
// create runner instance
runner = new ElasticsearchClusterRunner();
// create ES nodes
runner.onBuild(new ElasticsearchClusterRunner.Builder() {
@Override
public void build(final int number, final Builder settingsBuilder) {
settingsBuilder.put("http.cors.enabled", true);
settingsBuilder.put("http.cors.allow-origin", "*");
}
}).build(newConfigs().clusterName("testCluster").numOfNode(3).basePath("target/testcluster/").useLogger());
// wait for green status
runner.ensureGreen();
client = runner.client();
}
use of org.junit.BeforeClass in project camel by apache.
the class EndpointConfigurationTest method createContext.
@BeforeClass
public static void createContext() throws Exception {
context = new DefaultCamelContext();
Component component = new ConfiguredComponent();
context.addComponent(MAPPED_SCHEME, component);
// so that TypeConverters are available
context.start();
}
use of org.junit.BeforeClass in project camel by apache.
the class JcloudsSpringBlobstoreTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
BlobStore blobStore = ContextBuilder.newBuilder("transient").credentials("id", "credential").buildView(BlobStoreContext.class).getBlobStore();
blobStore.createContainerInLocation(null, "foo");
blobStore.createContainerInLocation(null, "bar");
}
use of org.junit.BeforeClass in project camel by apache.
the class KafkaProducerFullTest method before.
@BeforeClass
public static void before() {
Properties stringsProps = new Properties();
stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:" + getKafkaPort());
stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.GROUP_ID_CONFIG, "DemoConsumer");
stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true");
stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "1000");
stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "30000");
stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
stringsProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
stringsConsumerConn = new KafkaConsumer<String, String>(stringsProps);
Properties bytesProps = new Properties();
bytesProps.putAll(stringsProps);
bytesProps.put("group.id", GROUP_BYTES);
bytesProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArrayDeserializer");
bytesProps.put(org.apache.kafka.clients.consumer.ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArrayDeserializer");
bytesConsumerConn = new KafkaConsumer<byte[], byte[]>(bytesProps);
}
use of org.junit.BeforeClass in project flink by apache.
the class ReduceOnEdgesWithExceptionITCase method setupCluster.
@BeforeClass
public static void setupCluster() {
try {
Configuration config = new Configuration();
config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, PARALLELISM);
cluster = new LocalFlinkMiniCluster(config, false);
cluster.start();
} catch (Exception e) {
e.printStackTrace();
fail("Error starting test cluster: " + e.getMessage());
}
}
Aggregations