import java.util.Iterator; // Class: TestOrderedRecLLClassAsOrderedList // // Author: Alyce Brady // // Created on Oct 6, 2006 // Modifications: // April 23, 2008, Pam Cutter. Updated to work with CS210UnorderedListADT. // October 14, 2008, Pam Cutter. Updated to work with CS210OrderedListADT. //Modifier: Nathan Sprague //Oct. 11, 2009 Edited to work with CS210ListADT F09 // // License Information: // This class is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation. // // This class is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. /** * A TestOrderedRecLLClassAsList object * tests the general list methods of the OrderedRecLL class. * * @author Pam Cutter * @version April 22, 2008 */ public class TestOrderedRecLLClassAsOrderedList extends TestAnyCS210OrderedListImplementation { /** * Constructor for TestUnorderedRecLLClass. * @param name name of test class */ public TestOrderedRecLLClassAsOrderedList(String name) { super(name); } /* * @see TestCase#setUp() */ protected void setUp() throws Exception { super.setUp(); // If there's anything that should be done before // running all tests, do it here. } /* * @see TestCase#tearDown() */ protected void tearDown() throws Exception { // If there's anything that should be done after // running all tests, do it here. super.tearDown(); } public CS210OrderedListADT makeEmptyIntegerList() { return new OrderedRecLL(); } public CS210OrderedListADT makeAListWithNoDuplicates() { CS210OrderedListADT list = new OrderedRecLL(); list.add(12); list.add(3); list.add(8); list.add(5); return list; } public CS210OrderedListADT makeAnotherListWithNoDuplicates() { CS210OrderedListADT list = new OrderedRecLL(); list.add(12); list.add(3); list.add(8); list.add(5); list.add(2); return list; } public CS210OrderedListADT makeSingleElementList() { CS210OrderedListADT list = new OrderedRecLL(); list.add(3); return list; } public CS210OrderedListADT makeListWithTwoElements() { CS210OrderedListADT list = new OrderedRecLL(); list.add(3); list.add(12); return list; } public CS210OrderedListADT makeAnotherListWithTwoElements() { CS210OrderedListADT list = new OrderedRecLL(); list.add(3); list.add(2); return list; } public CS210OrderedListADT makeAListWithDuplicates() { CS210OrderedListADT list = new OrderedRecLL(); list.add(12); list.add(3); //list.add(8); //list.add(5); list.add(3); return list; } public CS210OrderedListADT makeAnotherListWithDuplicates() { CS210OrderedListADT list = new OrderedRecLL(); list.add(12); list.add(3); list.add(8); list.add(5); list.add(8); return list; } public CS210ListADT makeAListWithNoDuplicatesInReverse() { CS210OrderedListADT list = new OrderedRecLL(); list.add(12); list.add(3); list.add(8); list.add(5); return list; } public CS210ListADT makeLongerListWithNoDuplicates() { CS210OrderedListADT list = new OrderedRecLL(); list.add(12); list.add(3); list.add(8); list.add(5); list.add(10); list.add(20); return list; } public CS210ListADT makeListWithNoDuplicatesWithoutSecondElt() { CS210OrderedListADT list = new OrderedRecLL(); list.add(12); list.add(3); list.add(8); return list; } }