Exemplo n.º 1
0
  @Override
  protected void doHadoopWork() throws BuildException {
    Tuple tuple = ContextManager.getCurrentTuple();
    if (tuple == null) {
      throw new BuildException(
          this.getTaskName()
              + " should be put inside task container which provides tuple to execution context");
    }

    try {
      if (tuple.getType(fieldNumber) != DataType.TUPLE
          || !(tuple.get(fieldNumber) instanceof Tuple)) {
        throw new BuildException("Tuple field " + fieldNumber + " doesn't represent a Tuple");
      }

      ContextManager.setCurrentTupleContext((Tuple) tuple.get(fieldNumber));

      try {
        for (Task task : tasks) {
          task.perform();
        }
      } finally {
        ContextManager.resetCurrentTupleContext();
      }
    } catch (ExecException e) {
      throw new BuildException("Failed to check type of tuple field " + fieldNumber, e);
    }
  }
 @After
 public void tearDown() {
   try {
     server0.terminate();
     Task task0 =
         createTask(
             "task0",
             org.jboss.jbossts.qa.Utils.RemoveServerIORStore.class,
             Task.TaskType.EXPECT_PASS_FAIL,
             480);
     task0.perform("$(1)");
   } finally {
     super.tearDown();
   }
 }
Exemplo n.º 3
0
  @Override
  public void doWork() throws BuildException {
    Object[] array = (Object[]) this.getReference(arrayRef);

    for (Object obj : array) {
      if (property != null) {
        this.setPropertyThreadSafe(property, obj == null ? null : obj.toString());
      }

      if (reference != null) {
        this.setReference(reference, obj);
      }

      for (Task task : tasks) {
        task.perform();
      }
    }
  }
Exemplo n.º 4
0
  @Override
  public void doWork() throws BuildException {
    DescribeVpnGatewaysRequest request = new DescribeVpnGatewaysRequest();

    if (gatewayIds != null) {
      request.setVpnGatewayIds(CollectionsHelper.asList(gatewayIds));
    }

    if (filters != null) {
      request.setFilters(filters);
    }

    DescribeVpnGatewaysResult result = getEc2Client().describeVpnGateways(request);

    for (VpnGateway gateway : result.getVpnGateways()) {
      this.setPropertyThreadSafe(property, gateway.toString());

      for (Task task : tasks) {
        task.perform();
      }
    }
  }