com.klarna.hiverunner.HiveShellContainer Java Examples

The following examples show how to use com.klarna.hiverunner.HiveShellContainer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HiveShellBuilder.java    From HiveRunner with Apache License 2.0 4 votes vote down vote up
public HiveShellContainer buildShell() {
    return new HiveShellTearable(hiveServerContainer, props, setupScripts, resources, scriptsUnderTest, commandShellEmulator);
}
 
Example #2
Source File: FlinkStandaloneHiveRunner.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Traverses the test class annotations. Will inject a HiveShell in the test case that envelopes the HiveServer.
 */
private HiveShellContainer createHiveServerContainer(final Class testClass, HiveServerContext context)
		throws Exception {

	final HiveServerContainer hiveServerContainer = new HiveServerContainer(context);

	HiveShellBuilder hiveShellBuilder = new HiveShellBuilder();
	HiveRunnerShim hiveRunnerShim = HiveRunnerShimLoader.load();
	hiveRunnerShim.setCommandShellEmulation(hiveShellBuilder, config);

	HiveShellField shellSetter = loadScriptsUnderTest(testClass, hiveShellBuilder);

	hiveShellBuilder.setHiveServerContainer(hiveServerContainer);

	loadAnnotatedResources(testClass, hiveShellBuilder);

	loadAnnotatedProperties(testClass, hiveShellBuilder);

	loadAnnotatedSetupScripts(testClass, hiveShellBuilder);

	// Build shell
	final HiveShellContainer shell = hiveShellBuilder.buildShell();

	// Set shell
	shellSetter.setShell(shell);

	if (shellSetter.isAutoStart()) {
		shell.start();
	}

	return shell;
}
 
Example #3
Source File: FlinkStandaloneHiveRunner.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Traverses the test class annotations. Will inject a HiveShell in the test case that envelopes the HiveServer.
 */
private HiveShellContainer createHiveServerContainer(final Class testClass, HiveServerContext context)
		throws Exception {

	final HiveServerContainer hiveServerContainer = new HiveServerContainer(context);

	HiveShellBuilder hiveShellBuilder = new HiveShellBuilder();
	HiveRunnerShim hiveRunnerShim = HiveRunnerShimLoader.load();
	hiveRunnerShim.setCommandShellEmulation(hiveShellBuilder, config);

	HiveShellField shellSetter = loadScriptsUnderTest(testClass, hiveShellBuilder);

	hiveShellBuilder.setHiveServerContainer(hiveServerContainer);

	loadAnnotatedResources(testClass, hiveShellBuilder);

	loadAnnotatedProperties(testClass, hiveShellBuilder);

	loadAnnotatedSetupScripts(testClass, hiveShellBuilder);

	// Build shell
	final HiveShellContainer shell = hiveShellBuilder.buildShell();

	// Set shell
	shellSetter.setShell(shell);

	if (shellSetter.isAutoStart()) {
		shell.start();
	}

	return shell;
}