Add additional test for null passed to constructor
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131032 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4658bffcb6
commit
76fb648c5c
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestBoundedFifoBuffer.java,v 1.4 2003/02/19 20:33:11 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestBoundedFifoBuffer.java,v 1.5 2003/04/26 15:12:28 scolebourne Exp $
|
||||||
* $Revision: 1.4 $
|
|
||||||
* $Date: 2003/02/19 20:33:11 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -65,8 +62,11 @@ import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test cases for BoundedFifoBuffer.
|
* Test cases for BoundedFifoBuffer.
|
||||||
|
*
|
||||||
|
* @author Paul Jack
|
||||||
*/
|
*/
|
||||||
public class TestBoundedFifoBuffer extends TestCollection {
|
public class TestBoundedFifoBuffer extends TestCollection {
|
||||||
|
|
||||||
|
@ -87,8 +87,6 @@ public class TestBoundedFifoBuffer extends TestCollection {
|
||||||
return new BoundedFifoBuffer(100);
|
return new BoundedFifoBuffer(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an empty ArrayList.
|
* Returns an empty ArrayList.
|
||||||
*
|
*
|
||||||
|
@ -98,7 +96,6 @@ public class TestBoundedFifoBuffer extends TestCollection {
|
||||||
return new ArrayList();
|
return new ArrayList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a full ArrayList.
|
* Returns a full ArrayList.
|
||||||
*
|
*
|
||||||
|
@ -110,7 +107,6 @@ public class TestBoundedFifoBuffer extends TestCollection {
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overridden because BoundedFifoBuffer doesn't support null elements.
|
* Overridden because BoundedFifoBuffer doesn't support null elements.
|
||||||
*
|
*
|
||||||
|
@ -120,14 +116,12 @@ public class TestBoundedFifoBuffer extends TestCollection {
|
||||||
return getFullNonNullElements();
|
return getFullNonNullElements();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overridden, because BoundedFifoBuffer's iterators aren't fail-fast.
|
* Overridden, because BoundedFifoBuffer's iterators aren't fail-fast.
|
||||||
*/
|
*/
|
||||||
public void testCollectionIteratorFailFast() {
|
public void testCollectionIteratorFailFast() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs through the regular verifications, but also verifies that
|
* Runs through the regular verifications, but also verifies that
|
||||||
* the buffer contains the same elements in the same sequence as the
|
* the buffer contains the same elements in the same sequence as the
|
||||||
|
@ -189,4 +183,16 @@ public class TestBoundedFifoBuffer extends TestCollection {
|
||||||
}
|
}
|
||||||
fail();
|
fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests that the constructor correctly throws an exception.
|
||||||
|
*/
|
||||||
|
public void testConstructorException3() {
|
||||||
|
try {
|
||||||
|
new BoundedFifoBuffer(null);
|
||||||
|
} catch (NullPointerException ex) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fail();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue