Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 29712 invoked from network); 13 Oct 2010 12:47:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Oct 2010 12:47:04 -0000 Received: (qmail 89604 invoked by uid 500); 13 Oct 2010 12:47:04 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 89489 invoked by uid 500); 13 Oct 2010 12:47:02 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 89482 invoked by uid 99); 13 Oct 2010 12:47:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Oct 2010 12:47:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Oct 2010 12:46:59 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4F00423889E0; Wed, 13 Oct 2010 12:46:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1022080 - /commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestCursorableLinkedList.java Date: Wed, 13 Oct 2010 12:46:02 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101013124602.4F00423889E0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Wed Oct 13 12:46:01 2010 New Revision: 1022080 URL: http://svn.apache.org/viewvc?rev=1022080&view=rev Log: Add basic tests for CursorableLinkedList Added: commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestCursorableLinkedList.java (with props) Added: commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestCursorableLinkedList.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestCursorableLinkedList.java?rev=1022080&view=auto ============================================================================== --- commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestCursorableLinkedList.java (added) +++ commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestCursorableLinkedList.java Wed Oct 13 12:46:01 2010 @@ -0,0 +1,271 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.commons.pool.impl; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class TestCursorableLinkedList { + +// @Test +// public void testHashCode() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testAddT() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testAddIntT() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testAddAllCollectionOfQextendsT() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testAddAllIntCollectionOfQextendsT() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testAddFirst() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testAddLast() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testClear() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testContains() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testContainsAll() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testCursor() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testCursorInt() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testEqualsObject() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testGet() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testGetFirst() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testGetLast() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testIndexOf() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testIsEmpty() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testIterator() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testLastIndexOf() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testListIterator() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testListIteratorInt() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testRemoveObject() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testRemoveInt() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testRemoveAll() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testRemoveFirst() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testRemoveLast() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testRetainAll() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testSet() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testSize() { +// // fail("Not yet implemented"); +// } + + @Test + public void testToArray() { + CursorableLinkedList cll = new CursorableLinkedList(); + cll.add(Integer.valueOf(1)); + cll.add(Integer.valueOf(2)); + Object[] oa; + oa = cll.toArray(); + assertEquals(cll.size(),oa.length); + assertNotNull(oa[0]); + assertEquals("java.lang.Integer",oa[0].getClass().getCanonicalName()); + } + + @Test + public void testToArrayEArray() { + CursorableLinkedList cll = new CursorableLinkedList(); + cll.add(Integer.valueOf(1)); + cll.add(Integer.valueOf(2)); + Integer[] ia; + ia = cll.toArray(new Integer[0]); + assertEquals(cll.size(),ia.length); + ia = cll.toArray(new Integer[10]); + assertEquals(10,ia.length); + assertNotNull(ia[0]); + assertNull(ia[cll.size()]); + try { + cll.toArray(new String[0]); + fail("Should have generated ArrayStoreException"); + } catch (ArrayStoreException expected){ + // expected + } + cll.toArray(new Number[0]); + try { + cll.toArray(null); + fail("Should have generated NullPointerException"); + } catch (NullPointerException expected){ + // expected + } + } + +// @Test +// public void testToString() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testSubList() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testInsertListable() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testRemoveListable() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testGetListableAt() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testRegisterCursor() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testUnregisterCursor() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testInvalidateCursors() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testBroadcastListableChanged() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testBroadcastListableRemoved() { +// // fail("Not yet implemented"); +// } +// +// @Test +// public void testBroadcastListableInserted() { +// // fail("Not yet implemented"); +// } + +} Propchange: commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestCursorableLinkedList.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestCursorableLinkedList.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision