/*
 * Copyright (C) 2008  Nathan Fiedler
 *
 * This program 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, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * $Id$
 */

package org.burstsort4j;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 * Unit tests for the Burstsort class.
 *
 * @author nfiedler
 */
public class BurstsortTest {

    public BurstsortTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    @Test
    public void testSort() {
        String[] strings = new String[] {
            "bat", "barn", "bark", "by", "byte", "bytes",
            "wane", "way", "while"
        };
        Burstsort.sort(strings);
        fail("Test not implemented!");
    }
}

@@ -725,16 +725,97 @@
 ort4j;%0A%0A
+import java.io.IOException;%0Aimport java.util.Collections;%0Aimport java.util.List;%0A
 import o
@@ -831,16 +831,16 @@
 Before;%0A
-
 import o
@@ -1017,16 +1017,54 @@
 rtTest %7B
+%0A    private static List%3CString%3E data;
 %0A%0A    pu
@@ -1165,16 +1165,147 @@
 ption %7B%0A
+        try %7B%0A            data = Tests.loadData();%0A        %7D catch (IOException ioe) %7B%0A            fail(ioe.toString());%0A        %7D%0A
     %7D%0A%0A 
@@ -1337,24 +1337,59 @@
 d setUp() %7B%0A
+        Collections.shuffle(data);%0A
     %7D%0A%0A    @
@@ -1434,144 +1434,165 @@
     
-String%5B%5D strings = new String%5B%5D %7B%0A            %22bat%22, %22barn%22, %22bark%22, %22by%22, %22byte%22, %22bytes%22,%0A            %22wane%22, %22way%22, %22while%22%0A        %7D
+// TODO: use all fo the list items instead of just 100%0A        List%3CString%3E list = data.subList(0, 100);%0A        String%5B%5D arr = list.toArray(new String%5B100%5D)
 ;%0A  
@@ -1616,15 +1616,11 @@
 ort(
-strings
+arr
 );%0A 
@@ -1631,37 +1631,119 @@
    f
-ail(%22Test not implemented!%22);
+or (int ii = 1; ii %3C arr.length; ii++) %7B%0A            assertTrue(arr%5Bii - 1%5D.compareTo(arr%5Bii%5D) %3C= 0);%0A        %7D
 %0A   

Add a real unit tests for burstsort to check correctness.