コード例 #1
0
 /**
  * Execute phase as simulation mode.
  *
  * @throws Exception if failed
  */
 @Test
 public void phase_sim() throws Exception {
   ProfileBuilder prf = new ProfileBuilder(folder.getRoot());
   prf.setInvalid();
   ExecutionTask task = prf.task();
   task.setRuntimeContext(RuntimeContext.DEFAULT.mode(ExecutionMode.SIMULATION));
   task.executePhase("batch", "testing", "f1", ExecutionPhase.MAIN);
 }
コード例 #2
0
  /**
   * Execute phase but will be skipped.
   *
   * @throws Exception if failed
   */
  @Test
  public void phase_sskip() throws Exception {
    ProfileBuilder prf = new ProfileBuilder(folder.getRoot());
    ExecutionTask task = prf.task();
    task.getSkipFlows().add("testing");
    task.executePhase("batch", "testing", "f-setup", ExecutionPhase.SETUP);

    List<Record> results = SerialExecutionTracker.get(prf.trackingId);
    assertThat(results, is(Collections.<Record>emptyList()));
  }
コード例 #3
0
  /**
   * Execute setup phase.
   *
   * @throws Exception if failed
   */
  @Test
  public void phase_setup() throws Exception {
    ProfileBuilder prf = new ProfileBuilder(folder.getRoot());
    ExecutionTask task = prf.task();
    task.executePhase("batch", "testing", "f-setup", ExecutionPhase.SETUP);

    List<Record> results = SerialExecutionTracker.get(prf.trackingId);
    verifyPhaseOrder(results);

    assertThat(results.size(), is(2));
    List<Record> records = phase(results, "testing", ExecutionPhase.SETUP);
    assertThat(records, is(results));
  }
コード例 #4
0
  /**
   * Execute main phase.
   *
   * @throws Exception if failed
   */
  @Test
  public void phase_main() throws Exception {
    ProfileBuilder prf = new ProfileBuilder(folder.getRoot());
    ExecutionTask task = prf.task();
    task.executePhase("batch", "testing", "f1", ExecutionPhase.MAIN);

    List<Record> results = SerialExecutionTracker.get(prf.trackingId);
    verifyPhaseOrder(results);

    assertThat(results.size(), is(4));
    assertThat(id(results), is(set("a", "b", "c", "d")));
    checkScriptHappensBefore(results, "a", "b");
    checkScriptHappensBefore(results, "a", "c");
    checkScriptHappensBefore(results, "b", "d");
    checkScriptHappensBefore(results, "c", "d");

    List<Record> records = phase(results, "testing", ExecutionPhase.MAIN);
    assertThat(records, is(results));
  }