Examples of SlaveInfo


Examples of com.carrotsearch.ant.tasks.junit4.SlaveInfo

    isStatusShown(TestStatus.ERROR);
    if (!isStatusShown(status)) {
      return;
    }

    SlaveInfo slave = result.getSlave();
    Description description = result.getDescription();
    List<FailureMirror> failures = result.getFailures();

    StringBuilder line = new StringBuilder();
    line.append(Strings.padEnd(statusNames.get(status), 8, ' '));
    line.append(formatTime(timeMillis));
    if (slave.slaves > 1) {
      final int digits = 1 + (int) Math.floor(Math.log10(slave.slaves));
      line.append(String.format(" S%-" + digits + "d", slave.id));
    }   
    line.append(" | ");

    String className = description.getClassName();
    if (className != null) {
      String [] components = className.split("[\\.]");
      className = components[components.length - 1];
      line.append(className);
      if (description.getMethodName() != null) {
        line.append(".").append(description.getMethodName());
      } else {
        line.append(" (suite)");
      }
    } else {
      if (description.getMethodName() != null) {
        line.append(description.getMethodName());
      }
    }
    line.append("\n");

    if (showThrowable && !failures.isEmpty()) {
      StringWriter sw = new StringWriter();
      PrefixedWriter pos = new PrefixedWriter(indent, sw);
      int count = 0;
      for (FailureMirror fm : failures) {
        count++;
        try {
          final String details =
              (showStackTraces && !fm.isAssumptionViolation())
              ? fm.getTrace()
              : fm.getThrowableString();

          pos.write(String.format(Locale.ENGLISH,
              "Throwable #%d: %s",
              count, details));
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }

      if (sw.getBuffer().length() > 0) {
        line.append(sw.toString());
        line.append("\n");
      }
    }

    if (showOutputStream || showErrorStream) {
      StringWriter sw = new StringWriter();
      Writer stdout = new PrefixedWriter(stdoutIndent, new LineBufferWriter(sw));
      Writer stderr = new PrefixedWriter(stderrIndent, new LineBufferWriter(sw));
      slave.decodeStreams(result.getEventStream(), stdout, stderr);
     
      if (sw.getBuffer().length() > 0) {
        line.append(sw.toString());
        line.append("\n");
      }
View Full Code Here

Examples of com.carrotsearch.ant.tasks.junit4.SlaveInfo

    return suite;
  }

  public JsonArray serializeEvents(AggregatedSuiteResultEvent e, JsonSerializationContext context) {
    final JsonArray output = new JsonArray();
    final SlaveInfo slave = e.getSlave();
    int lineBuffer = 160;
    final StringWriter out = new StringWriter();
    final StringWriter err = new StringWriter();
    WriterOutputStream stdout = new WriterOutputStream(out, slave.getCharset(), lineBuffer, false);
    WriterOutputStream stderr = new WriterOutputStream(err, slave.getCharset(), lineBuffer, false);
    for (IEvent evt : e.getEventStream()) {
      try {
        JsonObject marker;
        switch (evt.getType()) {
          case SUITE_FAILURE:
View Full Code Here

Examples of com.carrotsearch.ant.tasks.junit4.SlaveInfo

    return suite;
  }

  public JsonArray serializeEvents(AggregatedSuiteResultEvent e, JsonSerializationContext context) {
    final JsonArray output = new JsonArray();
    final SlaveInfo slave = e.getSlave();
    int lineBuffer = 160;
    final StringWriter out = new StringWriter();
    final StringWriter err = new StringWriter();
    WriterOutputStream stdout = new WriterOutputStream(out, slave.getCharset(), lineBuffer, false);
    WriterOutputStream stderr = new WriterOutputStream(err, slave.getCharset(), lineBuffer, false);
    for (IEvent evt : e.getEventStream()) {
      try {
        JsonObject marker;
        switch (evt.getType()) {
          case SUITE_FAILURE:
View Full Code Here

Examples of com.carrotsearch.ant.tasks.junit4.SlaveInfo

    isStatusShown(TestStatus.ERROR);
    if (!isStatusShown(status)) {
      return;
    }

    SlaveInfo slave = result.getSlave();
    Description description = result.getDescription();
    List<FailureMirror> failures = result.getFailures();

    StringBuilder line = new StringBuilder();
    line.append(Strings.padEnd(statusNames.get(status), 8, ' '));
    line.append(formatTime(timeMillis));
    if (slave.slaves > 1) {
      final int digits = 1 + (int) Math.floor(Math.log10(slave.slaves));
      line.append(String.format(" S%-" + digits + "d", slave.id));
    }   
    line.append(" | ");

    String className = description.getClassName();
    if (className != null) {
      String [] components = className.split("[\\.]");
      className = components[components.length - 1];
      line.append(className);
      if (description.getMethodName() != null) {
        line.append(".").append(description.getMethodName());
      } else {
        line.append(" (suite)");
      }
    } else {
      if (description.getMethodName() != null) {
        line.append(description.getMethodName());
      }
    }
    line.append("\n");

    if (showThrowable && !failures.isEmpty()) {
      StringWriter sw = new StringWriter();
      PrefixedWriter pos = new PrefixedWriter(indent, sw);
      int count = 0;
      for (FailureMirror fm : failures) {
        count++;
        try {
          final String details =
              (showStackTraces && !fm.isAssumptionViolation())
              ? fm.getTrace()
              : fm.getThrowableString();

          pos.write(String.format(Locale.ENGLISH,
              "Throwable #%d: %s",
              count, details));
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }

      if (sw.getBuffer().length() > 0) {
        line.append(sw.toString());
        line.append("\n");
      }
    }

    if (showOutputStream || showErrorStream) {
      StringWriter sw = new StringWriter();
      Writer stdout = new PrefixedWriter(stdoutIndent, new LineBufferWriter(sw));
      Writer stderr = new PrefixedWriter(stderrIndent, new LineBufferWriter(sw));
      slave.decodeStreams(result.getEventStream(), stdout, stderr);
     
      if (sw.getBuffer().length() > 0) {
        line.append(sw.toString());
        line.append("\n");
      }
View Full Code Here

Examples of com.carrotsearch.ant.tasks.junit4.SlaveInfo

    return suite;
  }

  public JsonArray serializeOutputStreams(AggregatedSuiteResultEvent e) {
    final JsonArray output = new JsonArray();
    final SlaveInfo slave = e.getSlave();
    int lineBuffer = 160;
    final StringWriter out = new StringWriter();
    final StringWriter err = new StringWriter();
    WriterOutputStream stdout = new WriterOutputStream(out, slave.getCharset(), lineBuffer, false);
    WriterOutputStream stderr = new WriterOutputStream(err, slave.getCharset(), lineBuffer, false);
    for (IEvent evt : e.getEventStream()) {
      try {
        switch (evt.getType()) {
          case TEST_STARTED:
          case TEST_FINISHED:
View Full Code Here

Examples of org.neo4j.management.SlaveInfo

                    lastTransactions.put( tx.first(), tx.other() );
                }
                txInfo.add( new SlaveTransaction( context.getEventIdentifier(), lastTransactions ) );
            }
            ConnectionInformation connection = db.getBroker().getConnectionInformation( machineId );
            return new SlaveInfo( connection.getJMXServiceURL().toString(),
                    connection.getInstanceId(), machineId, false,
                    connection.getLastCommitedTransactionId(),
                    txInfo.toArray( new SlaveTransaction[txInfo.size()] ) );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.