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;
}
}
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();
}
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;
}
}
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();
}
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;
}
Aggregations