Search in sources :

Example 96 with Before

use of org.junit.Before in project hadoop by apache.

the class TestMultiSchemeAuthenticationHandler method setUp.

@Before
public void setUp() throws Exception {
    krbTest.startMiniKdc();
    // create keytab
    File keytabFile = new File(KerberosTestUtils.getKeytabFile());
    String clientPrinc = KerberosTestUtils.getClientPrincipal();
    String serverPrinc = KerberosTestUtils.getServerPrincipal();
    clientPrinc = clientPrinc.substring(0, clientPrinc.lastIndexOf("@"));
    serverPrinc = serverPrinc.substring(0, serverPrinc.lastIndexOf("@"));
    krbTest.getKdc().createPrincipal(keytabFile, clientPrinc, serverPrinc);
    // configure handler
    handler = new MultiSchemeAuthenticationHandler();
    try {
        handler.init(getDefaultProperties());
    } catch (Exception e) {
        throw e;
    }
}
Also used : File(java.io.File) AuthenticationException(org.apache.hadoop.security.authentication.client.AuthenticationException) Before(org.junit.Before)

Example 97 with Before

use of org.junit.Before in project hadoop by apache.

the class ITUseMiniCluster method clusterUp.

@Before
public void clusterUp() throws IOException {
    final Configuration conf = new HdfsConfiguration();
    cluster = new MiniDFSCluster.Builder(conf).numDataNodes(3).build();
    cluster.waitActive();
}
Also used : MiniDFSCluster(org.apache.hadoop.hdfs.MiniDFSCluster) HdfsConfiguration(org.apache.hadoop.hdfs.HdfsConfiguration) Configuration(org.apache.hadoop.conf.Configuration) HdfsConfiguration(org.apache.hadoop.hdfs.HdfsConfiguration) Before(org.junit.Before)

Example 98 with Before

use of org.junit.Before in project hadoop by apache.

the class TestKerberosAuthenticationHandler method setup.

@Before
public void setup() throws Exception {
    // create keytab
    File keytabFile = new File(KerberosTestUtils.getKeytabFile());
    String clientPrincipal = KerberosTestUtils.getClientPrincipal();
    String serverPrincipal = KerberosTestUtils.getServerPrincipal();
    clientPrincipal = clientPrincipal.substring(0, clientPrincipal.lastIndexOf("@"));
    serverPrincipal = serverPrincipal.substring(0, serverPrincipal.lastIndexOf("@"));
    getKdc().createPrincipal(keytabFile, clientPrincipal, serverPrincipal);
    // handler
    handler = getNewAuthenticationHandler();
    Properties props = getDefaultProperties();
    try {
        handler.init(props);
    } catch (Exception ex) {
        handler = null;
        throw ex;
    }
}
Also used : Properties(java.util.Properties) File(java.io.File) AuthenticationException(org.apache.hadoop.security.authentication.client.AuthenticationException) ServletException(javax.servlet.ServletException) Before(org.junit.Before)

Example 99 with Before

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

the class CancelingTestBase method startCluster.

@Before
public void startCluster() throws Exception {
    verifyJvmOptions();
    Configuration config = new Configuration();
    config.setBoolean(ConfigConstants.FILESYSTEM_DEFAULT_OVERWRITE_KEY, true);
    config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 2);
    config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 4);
    config.setString(ConfigConstants.AKKA_ASK_TIMEOUT, TestingUtils.DEFAULT_AKKA_ASK_TIMEOUT());
    config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SEGMENT_SIZE_KEY, 4096);
    config.setInteger(ConfigConstants.TASK_MANAGER_NETWORK_NUM_BUFFERS_KEY, 2048);
    this.executor = new LocalFlinkMiniCluster(config, false);
    this.executor.start();
}
Also used : Configuration(org.apache.flink.configuration.Configuration) LocalFlinkMiniCluster(org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster) Before(org.junit.Before)

Example 100 with Before

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

the class AccumulatorLiveITCase method before.

@Before
public void before() throws Exception {
    system = AkkaUtils.createLocalActorSystem(new Configuration());
    Configuration config = new Configuration();
    config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 1);
    config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 1);
    config.setString(ConfigConstants.AKKA_ASK_TIMEOUT, TestingUtils.DEFAULT_AKKA_ASK_TIMEOUT());
    TestingCluster testingCluster = new TestingCluster(config, false, true);
    testingCluster.start();
    jobManagerGateway = testingCluster.getLeaderGateway(TestingUtils.TESTING_DURATION());
    taskManager = testingCluster.getTaskManagersAsJava().get(0);
    // generate test data
    for (int i = 0; i < NUM_ITERATIONS; i++) {
        inputData.add(i, String.valueOf(i + 1));
    }
    NotifyingMapper.finished = false;
}
Also used : TestingCluster(org.apache.flink.runtime.testingUtils.TestingCluster) Configuration(org.apache.flink.configuration.Configuration) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)8594 File (java.io.File)733 Properties (java.util.Properties)270 Configuration (org.apache.hadoop.conf.Configuration)266 TreeMap (java.util.TreeMap)247 ArrayList (java.util.ArrayList)228 HashMap (java.util.HashMap)162 IOException (java.io.IOException)159 URL (java.net.URL)137 Path (org.apache.hadoop.fs.Path)130 Config (com.hazelcast.config.Config)115 HazelcastInstance (com.hazelcast.core.HazelcastInstance)111 InputStream (java.io.InputStream)109 Date (java.util.Date)96 InvocationOnMock (org.mockito.invocation.InvocationOnMock)96 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)92 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)90 ByteArrayOutputStream (java.io.ByteArrayOutputStream)83 Connection (java.sql.Connection)78 Random (java.util.Random)75