java.util.concurrent.ConcurrentLinkedDeque#addAll ( )源码实例Demo

下面列出了java.util.concurrent.ConcurrentLinkedDeque#addAll ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-jdk9   文件: ConcurrentLinkedDequeTest.java
/**
 * addAll(null) throws NPE
 */
public void testAddAll1() {
    ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
    try {
        q.addAll(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码2 项目: openjdk-jdk9   文件: ConcurrentLinkedDequeTest.java
/**
 * addAll(this) throws IAE
 */
public void testAddAllSelf() {
    ConcurrentLinkedDeque q = populatedDeque(SIZE);
    try {
        q.addAll(q);
        shouldThrow();
    } catch (IllegalArgumentException success) {}
}
 
源代码3 项目: openjdk-jdk9   文件: ConcurrentLinkedDequeTest.java
/**
 * addAll of a collection with null elements throws NPE
 */
public void testAddAll2() {
    ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
    try {
        q.addAll(Arrays.asList(new Integer[SIZE]));
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码4 项目: openjdk-jdk9   文件: ConcurrentLinkedDequeTest.java
/**
 * addAll of a collection with any null elements throws NPE after
 * possibly adding some elements
 */
public void testAddAll3() {
    ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
    Integer[] ints = new Integer[SIZE];
    for (int i = 0; i < SIZE - 1; ++i)
        ints[i] = new Integer(i);
    try {
        q.addAll(Arrays.asList(ints));
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码5 项目: j2objc   文件: ConcurrentLinkedDequeTest.java
/**
 * addAll(null) throws NPE
 */
public void testAddAll1() {
    ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
    try {
        q.addAll(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码6 项目: j2objc   文件: ConcurrentLinkedDequeTest.java
/**
 * addAll(this) throws IAE
 */
public void testAddAllSelf() {
    ConcurrentLinkedDeque q = populatedDeque(SIZE);
    try {
        q.addAll(q);
        shouldThrow();
    } catch (IllegalArgumentException success) {}
}
 
源代码7 项目: j2objc   文件: ConcurrentLinkedDequeTest.java
/**
 * addAll of a collection with null elements throws NPE
 */
public void testAddAll2() {
    ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
    try {
        q.addAll(Arrays.asList(new Integer[SIZE]));
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码8 项目: j2objc   文件: ConcurrentLinkedDequeTest.java
/**
 * addAll of a collection with any null elements throws NPE after
 * possibly adding some elements
 */
public void testAddAll3() {
    ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
    Integer[] ints = new Integer[SIZE];
    for (int i = 0; i < SIZE - 1; ++i)
        ints[i] = new Integer(i);
    try {
        q.addAll(Arrays.asList(ints));
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
private void onSuccess(ProducerJob job, List<String[]> results, LinkedBlockingDeque<String[]> responseQueue,
    ConcurrentLinkedDeque<ProducerJob> pagesToRetry) {
  int size = results.size();
  if (size == GoogleWebmasterClient.API_ROW_LIMIT) {
    List<? extends ProducerJob> granularJobs = job.partitionJobs();
    if (granularJobs.isEmpty()) {
      //The job is not divisible
      //TODO: 99.99% cases we are good. But what if it happens, what can we do?
      log.warn(String.format(
          "There might be more query data for your job %s. Currently, downloading more than the Google API limit '%d' is not supported.",
          job, GoogleWebmasterClient.API_ROW_LIMIT));
    } else {
      log.info(String.format("Partition current job %s", job));
      pagesToRetry.addAll(granularJobs);
      return;
    }
  }

  log.debug(String.format("Finished %s. Current Queue size: %d. Record size: %d.", job, responseQueue.size(), size));
  try {
    for (String[] r : results) {
      responseQueue.put(r);
    }
  } catch (InterruptedException e) {
    log.error(e.getMessage());
    throw new RuntimeException(e);
  }
}
 
源代码10 项目: eagle   文件: DedupEntity.java
public ConcurrentLinkedDeque<DedupValue> getDedupValuesInConcurrentLinkedDeque() {
    ConcurrentLinkedDeque<DedupValue> result = new ConcurrentLinkedDeque<DedupValue>();
    result.addAll(this.getDedupValues());
    return result;
}