Package com.carrotsearch.ant.tasks.junit4

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


   * Establish communication channel based on the JVM type.
   */
  private static EventChannelType establishCommunicationChannel() {
    String vmName = System.getProperty("java.vm.name");
    // Default event channel: stderr. stdout is used for vm crash info.
    EventChannelType eventChannel = EventChannelType.STDERR;
    if (vmName != null) {
      // These use stderr in case of jvm crash.
      if (vmName.contains("JRockit")) {
        return BootstrapEvent.EventChannelType.STDOUT;
      } else if (vmName.contains("J9")) {
View Full Code Here


   * Establish communication channel based on the JVM type.
   */
  private static EventChannelType establishCommunicationChannel() {
    String vmName = System.getProperty("java.vm.name");
    // Default event channel: stderr. stdout is used for vm crash info.
    EventChannelType eventChannel = EventChannelType.STDERR;
    if (vmName != null) {
      // These use stderr in case of jvm crash.
      if (vmName.contains("JRockit")) {
        return BootstrapEvent.EventChannelType.STDOUT;
      } else if (vmName.contains("J9")) {
View Full Code Here

    Serializer s = new Serializer(baos);
    s.serialize(new AppendStdErrEvent(bytes, 0, bytes.length));
    s.flush();
    s.close();

    Deserializer deserializer = new Deserializer(new ByteArrayInputStream(baos.toByteArray()),
        Thread.currentThread().getContextClassLoader());
    IEvent deserialize = deserializer.deserialize();
   
    Assert.assertTrue(deserialize instanceof AppendStdErrEvent);
    AppendStdErrEvent e = ((AppendStdErrEvent) deserialize);
    baos.reset();
    e.copyTo(baos);
View Full Code Here

        if (peek == JsonToken.END_DOCUMENT) {
          return;
        }
 
        input.beginArray();
        EventType type = EventType.valueOf(input.nextString());
        switch (type) {
          case APPEND_STDERR:
            ((IStreamEvent) gson.fromJson(input, type.eventClass)).copyTo(syserr);
            break;
 
View Full Code Here

      .registerTypeAdapter(byte[].class, new JsonByteArrayAdapter())
      .create();
   
    while (true) {
      reader.beginArray();
      EventType type = EventType.valueOf(reader.nextString());
      IStreamEvent evt;
      switch (type) {
        case APPEND_STDERR:
        case APPEND_STDOUT:
          evt = (IStreamEvent) gson.fromJson(reader, type.eventClass);
View Full Code Here

        if (peek == JsonToken.END_DOCUMENT) {
          return;
        }
 
        input.beginArray();
        EventType type = EventType.valueOf(input.nextString());
        switch (type) {
          case APPEND_STDERR:
            ((IStreamEvent) gson.fromJson(input, type.eventClass)).copyTo(syserr);
            break;
 
View Full Code Here

      .registerTypeAdapter(byte[].class, new JsonByteArrayAdapter())
      .create();
   
    while (true) {
      reader.beginArray();
      EventType type = EventType.valueOf(reader.nextString());
      IStreamEvent evt;
      switch (type) {
        case APPEND_STDERR:
        case APPEND_STDOUT:
          evt = (IStreamEvent) gson.fromJson(reader, type.eventClass);
View Full Code Here

    s.flush();
    s.close();

    Deserializer deserializer = new Deserializer(new ByteArrayInputStream(baos.toByteArray()),
        Thread.currentThread().getContextClassLoader());
    IEvent deserialize = deserializer.deserialize();
   
    Assert.assertTrue(deserialize instanceof AppendStdErrEvent);
    AppendStdErrEvent e = ((AppendStdErrEvent) deserialize);
    baos.reset();
    e.copyTo(baos);
View Full Code Here

      .create();
   
    while (true) {
      reader.beginArray();
      EventType type = EventType.valueOf(reader.nextString());
      IStreamEvent evt;
      switch (type) {
        case APPEND_STDERR:
        case APPEND_STDOUT:
          evt = (IStreamEvent) gson.fromJson(reader, type.eventClass);
          evt.copyTo(System.out);
          break;
        default:
          System.out.println("\n\n## " + type);
          reader.skipValue();
      }
View Full Code Here

      .create();
   
    while (true) {
      reader.beginArray();
      EventType type = EventType.valueOf(reader.nextString());
      IStreamEvent evt;
      switch (type) {
        case APPEND_STDERR:
        case APPEND_STDOUT:
          evt = (IStreamEvent) gson.fromJson(reader, type.eventClass);
          System.out.write(evt.getChunk());
          break;
        default:
          System.out.println("\n\n## " + type);
          reader.skipValue();
      }
View Full Code Here

TOP

Related Classes of com.carrotsearch.ant.tasks.junit4.DecodeEventStream

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.