Package org.apache.hive.ptest.execution.context

Examples of org.apache.hive.ptest.execution.context.ExecutionContext


    executionContextConfiguration = mock(ExecutionContextConfiguration.class);
    executionContextProvider = mock(ExecutionContextProvider.class);
    ptest = mock(PTest.class);
    Set<Host> hosts = Sets.newHashSet();
    String baseDirPath = baseDir.getRoot().getAbsolutePath();
    executionContext = new ExecutionContext(executionContextProvider, hosts, baseDirPath, PRIVATE_KEY);
    profileProperties = new File(baseDirPath, PROFILE + ".properties");
    when(executionContextConfiguration.getProfileDirectory()).thenReturn(baseDirPath);
    when(executionContextConfiguration.getGlobalLogDirectory()).thenReturn(baseDirPath);
    when(executionContextProvider.createExecutionContext()).thenReturn(executionContext);
    Assert.assertTrue(profileProperties.toString(), profileProperties.createNewFile());
View Full Code Here


    ExecutionContextConfiguration execConf = ExecutionContextConfiguration.fromInputStream(
        Resources.getResource("test-configuration.properties").openStream());
    TestConfiguration conf = TestConfiguration.fromInputStream(
        Resources.getResource("test-configuration.properties").openStream(), 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.assertNotNull(conf.toString());

    Assert.assertEquals("", conf.getPatch());
    conf.setPatch("Patch");
View Full Code Here

  }
  private ExecutionContext createExceutionContext()
      throws ServiceNotAvailableException, InterruptedException, CreateHostsFailedException {
    long start = System.currentTimeMillis();
    LOG.info("Attempting to create a new execution context");
    ExecutionContext result = mExecutionContextProvider.createExecutionContext();
    long elapsedTime = System.currentTimeMillis() - start;
    LOG.info("Context Creation time: " + TimeUnit.SECONDS.
        convert(elapsedTime, TimeUnit.MILLISECONDS) + " seconds");
    return result;
  }
View Full Code Here

      }
      antArgs += "-" + ANT_ARG + Joiner.on(" -" + ANT_ARG).join(supplementalAntArgs);
      conf.setAntArgs(antArgs);
    }
    ExecutionContextProvider executionContextProvider = null;
    ExecutionContext executionContext = null;
    int exitCode = 0;
    try {
      executionContextProvider = executionContextConfiguration
          .getExecutionContextProvider();
      executionContext = executionContextProvider.createExecutionContext();
      LocalCommandFactory localCommandFactory = new LocalCommandFactory(LOG);
      PTest ptest = new PTest(conf, executionContext, buildTag, logDir,
          localCommandFactory, new SSHCommandExecutor(LOG, localCommandFactory, conf.getSshOpts()),
          new RSyncCommandExecutor(LOG, 10, localCommandFactory), LOG);
      exitCode = ptest.run();
    } finally {
      if(executionContext != null) {
        executionContext.terminate();
      }
      if(executionContextProvider != null) {
        executionContextProvider.close();
      }
    }
View Full Code Here

  }
  private ExecutionContext createExceutionContext()
      throws ServiceNotAvailableException, InterruptedException, CreateHostsFailedException {
    long start = System.currentTimeMillis();
    LOG.info("Attempting to create a new execution context");
    ExecutionContext result = mExecutionContextProvider.createExecutionContext();
    long elapsedTime = System.currentTimeMillis() - start;
    LOG.info("Context Creation time: " + TimeUnit.SECONDS.
        convert(elapsedTime, TimeUnit.MILLISECONDS) + " seconds");
    return result;
  }
View Full Code Here

          }
          antArgs += "-" + ANT_ARG + Joiner.on(" -" + ANT_ARG).join(supplementalAntArgs);
          conf.setAntArgs(antArgs);
        }
        ExecutionContextProvider executionContextProvider = null;
        ExecutionContext executionContext = null;
        int exitCode = 0;
        try {
          executionContextProvider = executionContextConfiguration
              .getExecutionContextProvider();
          executionContext = executionContextProvider.createExecutionContext();
          PTest ptest = new PTest(conf, executionContext, buildTag, logDir,
              new LocalCommandFactory(LOG), new SSHCommandExecutor(LOG),
              new RSyncCommandExecutor(LOG), LOG);
          exitCode = ptest.run();
        } finally {
          if(executionContext != null) {
            executionContext.terminate();
          }
          if(executionContextProvider != null) {
            executionContextProvider.close();
          }
        }
View Full Code Here

TOP

Related Classes of org.apache.hive.ptest.execution.context.ExecutionContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.