Search in sources :

Example 86 with BeforeClass

use of org.junit.BeforeClass in project flink by apache.

the class MiscellaneousIssuesITCase method startCluster.

@BeforeClass
public static void startCluster() {
    try {
        Configuration config = new Configuration();
        config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 2);
        config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 3);
        config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, 12);
        cluster = new LocalFlinkMiniCluster(config, false);
        cluster.start();
    } catch (Exception e) {
        e.printStackTrace();
        fail("Failed to start test cluster: " + e.getMessage());
    }
}
Also used : Configuration(org.apache.flink.configuration.Configuration) ProgramInvocationException(org.apache.flink.client.program.ProgramInvocationException) LocalFlinkMiniCluster(org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster) BeforeClass(org.junit.BeforeClass)

Example 87 with BeforeClass

use of org.junit.BeforeClass in project flink by apache.

the class AbstractQueryableStateITCase method setup.

@BeforeClass
public static void setup() {
    try {
        Configuration config = new Configuration();
        config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, 4);
        config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, NUM_TMS);
        config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, NUM_SLOTS_PER_TM);
        config.setInteger(QueryableStateOptions.CLIENT_NETWORK_THREADS, 1);
        config.setBoolean(QueryableStateOptions.SERVER_ENABLE, true);
        config.setInteger(QueryableStateOptions.SERVER_NETWORK_THREADS, 1);
        cluster = new TestingCluster(config, false);
        cluster.start(true);
        TEST_ACTOR_SYSTEM = AkkaUtils.createDefaultActorSystem();
    } catch (Exception e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
}
Also used : TestingCluster(org.apache.flink.runtime.testingUtils.TestingCluster) Configuration(org.apache.flink.configuration.Configuration) BeforeClass(org.junit.BeforeClass)

Example 88 with BeforeClass

use of org.junit.BeforeClass in project flink by apache.

the class BlobClientSslTest method startNonSSLServer.

/**
	 * Starts the SSL disabled BLOB server.
	 */
@BeforeClass
public static void startNonSSLServer() {
    try {
        Configuration config = new Configuration();
        config.setBoolean(ConfigConstants.SECURITY_SSL_ENABLED, true);
        config.setBoolean(ConfigConstants.BLOB_SERVICE_SSL_ENABLED, false);
        config.setString(ConfigConstants.SECURITY_SSL_KEYSTORE, "src/test/resources/local127.keystore");
        config.setString(ConfigConstants.SECURITY_SSL_KEYSTORE_PASSWORD, "password");
        config.setString(ConfigConstants.SECURITY_SSL_KEY_PASSWORD, "password");
        BLOB_SERVER = new BlobServer(config);
    } catch (IOException e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
    clientConfig = new Configuration();
    clientConfig.setBoolean(ConfigConstants.SECURITY_SSL_ENABLED, true);
    clientConfig.setBoolean(ConfigConstants.BLOB_SERVICE_SSL_ENABLED, false);
    clientConfig.setString(ConfigConstants.SECURITY_SSL_TRUSTSTORE, "src/test/resources/local127.truststore");
    clientConfig.setString(ConfigConstants.SECURITY_SSL_TRUSTSTORE_PASSWORD, "password");
}
Also used : Configuration(org.apache.flink.configuration.Configuration) IOException(java.io.IOException) BeforeClass(org.junit.BeforeClass)

Example 89 with BeforeClass

use of org.junit.BeforeClass in project flink by apache.

the class BlobClientTest method startServer.

/**
	 * Starts the BLOB server.
	 */
@BeforeClass
public static void startServer() {
    try {
        blobServiceConfig = new Configuration();
        BLOB_SERVER = new BlobServer(blobServiceConfig);
    } catch (IOException e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
}
Also used : Configuration(org.apache.flink.configuration.Configuration) IOException(java.io.IOException) BeforeClass(org.junit.BeforeClass)

Example 90 with BeforeClass

use of org.junit.BeforeClass in project flink by apache.

the class StreamFaultToleranceTestBase method startCluster.

@BeforeClass
public static void startCluster() {
    try {
        Configuration config = new Configuration();
        config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, NUM_TASK_MANAGERS);
        config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, NUM_TASK_SLOTS);
        config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, 12);
        cluster = new LocalFlinkMiniCluster(config, false);
        cluster.start();
    } catch (Exception e) {
        e.printStackTrace();
        fail("Failed to start 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)2813 File (java.io.File)388 Configuration (org.apache.hadoop.conf.Configuration)287 IOException (java.io.IOException)128 Connection (java.sql.Connection)126 Properties (java.util.Properties)108 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 HiveConf (org.apache.hadoop.hive.conf.HiveConf)86 MockProvisioning (com.zimbra.cs.account.MockProvisioning)77 Path (org.apache.hadoop.fs.Path)75 URI (java.net.URI)73 HashMap (java.util.HashMap)70 URL (java.net.URL)63 SqlSession (org.apache.ibatis.session.SqlSession)62 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)61 Injector (com.google.inject.Injector)57 CConfiguration (co.cask.cdap.common.conf.CConfiguration)56