private HiveShellContainer createHiveServerContainer ( final List < ? extends Script > scripts , final Object testCase , TemporaryFolder baseDir ) throws IOException { HiveServerContext context = new StandaloneHiveServerContext ( baseDir , config ) ; final HiveServerContainer hiveTestHarness = new HiveServerContainer ( context ) ; HiveShellBuilder hiveShellBuilder = new HiveShellBuilder ( ) ; hiveShellBuilder . setCommandShellEmulation ( config . getCommandShellEmulator ( ) ) ; HiveShellField shellSetter = loadScriptUnderTest ( testCase , hiveShellBuilder ) ; if ( scripts != null ) { hiveShellBuilder . overrideScriptsUnderTest ( scripts ) ; } hiveShellBuilder . setHiveServerContainer ( hiveTestHarness ) ; loadAnnotatedResources ( testCase , hiveShellBuilder ) ; loadAnnotatedProperties ( testCase , hiveShellBuilder ) ; loadAnnotatedSetupScripts ( testCase , hiveShellBuilder ) ; // Build shell final HiveShellContainer shell = hiveShellBuilder . buildShell ( ) ; // Set shell shellSetter . setShell ( shell ) ; if ( shellSetter . isAutoStart ( ) ) { shell . start ( ) ; } return shell ; }
Traverses the test case annotations . Will inject a HiveShell in the test case that envelopes the HiveServer .