use of org.apache.hive.ptest.execution.context.ExecutionContext in project hive by apache.
the class TestTestConfiguration method testGettersSetters.
@Test
public void testGettersSetters() throws Exception {
Context ctx = Context.fromInputStream(Resources.getResource("test-configuration.properties").openStream());
ExecutionContextConfiguration execConf = ExecutionContextConfiguration.withContext(ctx);
TestConfiguration conf = TestConfiguration.withContext(ctx, LOG);
Set<Host> expectedHosts = Sets.newHashSet(new Host("localhost", "hiveptest", new String[] { "/home/hiveptest" }, 2));
ExecutionContext executionContext = execConf.getExecutionContextProvider().createExecutionContext();
Assert.assertEquals(expectedHosts, executionContext.getHosts());
Assert.assertEquals("/tmp/hive-ptest-units/working/dir", execConf.getWorkingDirectory());
Assert.assertEquals("/etc/hiveptest/conf", execConf.getProfileDirectory());
Assert.assertEquals("/tmp/hive-ptest-units/working/dir/logs", execConf.getGlobalLogDirectory());
Assert.assertEquals("/home/brock/.ssh/id_rsa", executionContext.getPrivateKey());
Assert.assertEquals("git://github.com/apache/hive.git", conf.getRepository());
Assert.assertEquals("apache-github", conf.getRepositoryName());
Assert.assertEquals("trunk", conf.getBranch());
Assert.assertEquals("/tmp/hive-ptest-units/working/dir/working", executionContext.getLocalWorkingDirectory());
Assert.assertEquals("-Dtest.continue.on.failure=true -Dtest.silent=false", conf.getAntArgs());
Assert.assertEquals("hadoop-1,hadoop-2", conf.getAdditionalProfiles());
Assert.assertNotNull(conf.toString());
Assert.assertEquals("", conf.getPatch());
conf.setPatch("Patch");
Assert.assertEquals("Patch", conf.getPatch());
conf.setRepository("Repository");
Assert.assertEquals("Repository", conf.getRepository());
conf.setRepositoryName("RepositoryName");
Assert.assertEquals("RepositoryName", conf.getRepositoryName());
conf.setBranch("Branch");
Assert.assertEquals("Branch", conf.getBranch());
conf.setAntArgs("AntArgs");
Assert.assertEquals("AntArgs", conf.getAntArgs());
}
Aggregations