Package com.carrotsearch.ant.tasks.junit4.balancers

Examples of com.carrotsearch.ant.tasks.junit4.balancers.SuiteHint


  }

  private void check(byte[] bytes) throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    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);
    Assert.assertTrue(
        "Exp: " + Arrays.toString(bytes) + "\n" +
        "was: " + Arrays.toString(baos.toByteArray()),
        Arrays.equals(bytes, baos.toByteArray()));
  }
View Full Code Here


    System.setErr(new PrintStream(new BufferedOutputStream(new ChunkedStream() {
      @Override
      public void write(byte[] b, int off, int len) throws IOException {
        synchronized (lock) {
          serializer.serialize(new AppendStdErrEvent(b, off, len));
        }
      }
    })));
  }
View Full Code Here

    System.setErr(new PrintStream(new BufferedOutputStream(new ChunkedStream() {
      @Override
      public void write(byte[] b, int off, int len) throws IOException {
        synchronized (lock) {
          serializer.serialize(new AppendStdErrEvent(b, off, len));
        }
      }
    })));
  }
View Full Code Here

    stderr = System.err;
    System.setOut(new PrintStream(new BufferedOutputStream(new ChunkedStream() {
      @Override
      public void write(byte[] b, int off, int len) throws IOException {
        synchronized (lock) {
          serializer.serialize(new AppendStdOutEvent(b, off, len));
        }
      }
    })));

    System.setErr(new PrintStream(new BufferedOutputStream(new ChunkedStream() {
View Full Code Here

    stderr = System.err;
    System.setOut(new PrintStream(new BufferedOutputStream(new ChunkedStream() {
      @Override
      public void write(byte[] b, int off, int len) throws IOException {
        synchronized (lock) {
          serializer.serialize(new AppendStdOutEvent(b, off, len));
        }
      }
    })));

    System.setErr(new PrintStream(new BufferedOutputStream(new ChunkedStream() {
View Full Code Here

    Serializer serializer = null;
    try {
      // Pick the communication channel.
      final BootstrapEvent.EventChannelType channel = establishCommunicationChannel();
      new Serializer(System.out)
        .serialize(new BootstrapEvent(channel))
        .flush();

      final int bufferSize = 16 * 1024;
      switch (channel) {
        case STDERR:
View Full Code Here

    Serializer serializer = null;
    try {
      // Pick the communication channel.
      final BootstrapEvent.EventChannelType channel = establishCommunicationChannel();
      new Serializer(System.out)
        .serialize(new BootstrapEvent(channel))
        .flush();

      final int bufferSize = 16 * 1024;
      switch (channel) {
        case STDERR:
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

   * 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

TOP

Related Classes of com.carrotsearch.ant.tasks.junit4.balancers.SuiteHint

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.