Package com.carrotsearch.ant.tasks.junit4.events.json

Examples of com.carrotsearch.ant.tasks.junit4.events.json.JsonAnnotationAdapter


      int moveToCommon = (int) (slaveSuites.size() * dynamicAssignmentRatio);
      if (moveToCommon > 0) {
        List<String> sublist =
            slaveSuites.subList(slaveSuites.size() - moveToCommon, slaveSuites.size());
        for (String suiteName : sublist) {
          stealingQueueWithHints.add(new SuiteHint(suiteName, allCosts.get(suiteName).estimatedCost));
        }
        sublist.clear();
      }
    }
   
View Full Code Here


      if (moveToCommon > 0) {
        final List<Assignment> movedToCommon =
            assignments.subList(assignments.size() - moveToCommon, assignments.size());
        for (Assignment a : movedToCommon) {
          stealingQueueWithHints.add(new SuiteHint(a.suiteName, a.estimatedCost));
        }
        movedToCommon.clear();
      }

      final ArrayList<String> slaveSuites = (si.testSuites = Lists.newArrayList());
View Full Code Here

      if (moveToCommon > 0) {
        final List<Assignment> movedToCommon =
            assignments.subList(assignments.size() - moveToCommon, assignments.size());
        for (Assignment a : movedToCommon) {
          stealingQueueWithHints.add(new SuiteHint(a.suiteName, a.estimatedCost));
        }
        movedToCommon.clear();
      }

      final ArrayList<String> slaveSuites = (si.testSuites = Lists.newArrayList());
View Full Code Here

  }

  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

TOP

Related Classes of com.carrotsearch.ant.tasks.junit4.events.json.JsonAnnotationAdapter

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.