Search in sources :

Example 11 with BeforeClass

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();
}
Also used : ElasticsearchClusterRunner(org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner) Builder(org.elasticsearch.common.settings.Settings.Builder) BeforeClass(org.junit.BeforeClass)

Example 12 with BeforeClass

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();
}
Also used : Component(org.apache.camel.Component) BeforeClass(org.junit.BeforeClass)

Example 13 with BeforeClass

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");
}
Also used : BlobStoreContext(org.jclouds.blobstore.BlobStoreContext) BlobStore(org.jclouds.blobstore.BlobStore) BeforeClass(org.junit.BeforeClass)

Example 14 with BeforeClass

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);
}
Also used : Properties(java.util.Properties) BeforeClass(org.junit.BeforeClass)

Example 15 with BeforeClass

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());
    }
}
Also used : Configuration(org.apache.flink.configuration.Configuration) LocalFlinkMiniCluster(org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster) BeforeClass(org.junit.BeforeClass)

Aggregations

BeforeClass (org.junit.BeforeClass)2454 File (java.io.File)331 Configuration (org.apache.hadoop.conf.Configuration)275 Connection (java.sql.Connection)111 IOException (java.io.IOException)109 Properties (java.util.Properties)100 Reader (java.io.Reader)99 SqlSessionFactoryBuilder (org.apache.ibatis.session.SqlSessionFactoryBuilder)98 Provisioning (com.zimbra.cs.account.Provisioning)93 ScriptRunner (org.apache.ibatis.jdbc.ScriptRunner)91 MockProvisioning (com.zimbra.cs.account.MockProvisioning)77 URI (java.net.URI)73 HiveConf (org.apache.hadoop.hive.conf.HiveConf)73 Path (org.apache.hadoop.fs.Path)70 SqlSession (org.apache.ibatis.session.SqlSession)62 HashMap (java.util.HashMap)58 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)58 Injector (com.google.inject.Injector)57 CConfiguration (co.cask.cdap.common.conf.CConfiguration)56 DeploymentInfo (io.undertow.servlet.api.DeploymentInfo)55