Skip to content

Commit

Permalink
Add test cases for AbstractQueueDecorator
Browse files Browse the repository at this point in the history
  • Loading branch information
dota17 committed Nov 11, 2019
1 parent 631dc57 commit 0071efb
Showing 1 changed file with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,29 @@
*/
package org.apache.commons.collections4.queue;

import junit.framework.Test;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.collection.AbstractCollectionTest;

import java.util.*;


public class AbstractQueueDecoratorTest<E> extends AbstractCollectionTest<E> {
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Collection;
import java.util.Queue;
import java.util.NoSuchElementException;

/**
* Test cases for AbstractQueueDecorator.
*
* @since 4.5
*/
public class TAbstractQueueDecoratorTest<E> extends AbstractCollectionTest<E> {
/**
* JUnit constructor.
*
* @param testName the test class name
*/
public AbstractQueueDecoratorTest(String testName) {
public TAbstractQueueDecoratorTest(String testName) {
super(testName);
}
public static Test suite() {
return BulkTest.makeSuite(AbstractQueueDecoratorTest.class);
}

@Override
public Collection<E> makeConfirmedCollection() {
final ArrayList<E> list = new ArrayList<>();
Expand Down Expand Up @@ -72,15 +76,12 @@ public Queue<E> getCollection() {
}

/**
* Tests {@link Queue#offer(Object)}.
* Tests {@link AbstractQueueDecorator#offer(Object)}.
*/
public void testAbstractQueueDecoratorOffer() {
if (!isAddSupported()) {
return;
}

System.out.println("zhaopengliangdddddddddddddddddddddddd");
System.exit(1);
final E[] elements = getFullElements();
for (final E element : elements) {
resetEmpty();
Expand All @@ -106,7 +107,7 @@ public void testAbstractQueueDecoratorOffer() {
}

/**
* Tests {@link Queue#poll()}.
* Tests {@link AbstractQueueDecorator#poll()}.
*/
public void testAbstractQueueDecoratorPoll() {
if (!isRemoveSupported()) {
Expand All @@ -133,7 +134,7 @@ public void testAbstractQueueDecoratorPoll() {
}

/**
* Tests {@link Queue#peek()}.
* Tests {@link AbstractQueueDecorator#peek()}.
*/
public void testAbstractQueueDecoratorPeek() {
if (!isRemoveSupported()) {
Expand Down Expand Up @@ -168,7 +169,7 @@ public void testAbstractQueueDecoratorPeek() {
}

/**
* Tests {@link Queue#remove()}.
* Tests {@link AbstractQueueDecorator#remove()}.
*/
public void testAbstractQueueDecoratorRemove() {
if (!isRemoveSupported()) {
Expand Down

0 comments on commit 0071efb

Please sign in to comment.