Package org.apache.ambari.server.state.action

Examples of org.apache.ambari.server.state.action.Action



  @Test
  public void testJobProgressUpdates() throws Exception {
    long currentTime = 1;
    Action job = createNewJob(1, "JobNameFoo", currentTime);
    verifyNewJob(job, currentTime);

    verifyProgressUpdate(job, ++currentTime);
    verifyProgressUpdate(job, ++currentTime);
    verifyProgressUpdate(job, ++currentTime);
View Full Code Here



  @Test
  public void testJobSuccessfulCompletion() throws Exception {
    long currentTime = 1;
    Action job = getRunningJob(1, "JobNameFoo", currentTime);
    completeJob(job, false, ++currentTime);
  }
View Full Code Here

  }

  @Test
  public void testJobFailedCompletion() throws Exception {
    long currentTime = 1;
    Action job = getRunningJob(1, "JobNameFoo", currentTime);
    completeJob(job, true, ++currentTime);
  }
View Full Code Here

  }

  @Test
  public void completeNewJob() throws Exception {
    long currentTime = 1;
    Action job = createNewJob(1, "JobNameFoo", currentTime);
    verifyNewJob(job, currentTime);
    completeJob(job, false, ++currentTime);
  }
View Full Code Here

  }

  @Test
  public void failNewJob() throws Exception {
    long currentTime = 1;
    Action job = createNewJob(1, "JobNameFoo", currentTime);
    verifyNewJob(job, currentTime);
    completeJob(job, true, ++currentTime);
  }
View Full Code Here

    completeJob(job, true, ++currentTime);
  }

  @Test
  public void reInitCompletedJob() throws Exception {
    Action job = getCompletedJob(1, "JobNameFoo", 1, false);
    ActionId jId = new ActionId(2, new ActionType("JobNameFoo"));
    ActionInitEvent e = new ActionInitEvent(jId, 100);
    job.handleEvent(e);
    Assert.assertEquals(ActionState.INIT, job.getState());
    Assert.assertEquals(100, job.getStartTime());
    Assert.assertEquals(-1, job.getLastUpdateTime());
    Assert.assertEquals(-1, job.getCompletionTime());
    Assert.assertEquals(2, job.getId().actionId);
  }
View Full Code Here

public class JobTest {

  private Action createNewJob(long id, String jobName, long startTime) {
    ActionId jId = new ActionId(id, new ActionType(jobName));
    Action job = new ActionImpl(jId, startTime);
    return job;
  }
View Full Code Here

    return job;
  }

  private Action getRunningJob(long id, String jobName, long startTime)
      throws Exception {
    Action job = createNewJob(id, jobName, startTime);
    verifyProgressUpdate(job, ++startTime);
    return job;
  }
View Full Code Here

    return job;
  }

  private Action getCompletedJob(long id, String jobName, long startTime,
      boolean failedJob) throws Exception {
    Action job = getRunningJob(1, "JobNameFoo", startTime);
    completeJob(job, failedJob, ++startTime);
    return job;
  }
View Full Code Here


  @Test
  public void testNewJob() {
    long currentTime = System.currentTimeMillis();
    Action job = createNewJob(1, "JobNameFoo", currentTime);
    verifyNewJob(job, currentTime);
  }
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.state.action.Action

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.