@@ -0,0 +1,1789 @@
+package sortingalgorithms;%0A%0A/**%0A *  A simple class for running tests on sorting algorithms.%0A *  %0A *  @author  Joel Abrahamsson%0A *  @version %25G%25%0A */%0Apublic class SortTester%0A%7B%0A  /**%0A   *  Returns the SortingAlgorithm associated with the given name.%0A   *%0A   *  @param name name of algorithm%0A   *  @return     the SortingAlgorithm associated with the name%0A   */%0A  private static SortingAlgorithm getSortingAlgorithm(String name)%0A  %7B%0A    switch (name)%0A    %7B%0A      case %22combsort%22:%0A        return CombSort.sorter;%0A      case %22shellsort%22:%0A        return ShellSort.sorter;%0A      default:%0A        System.err.println(%22The sorting algorithm you entered is not implemented!%22);%0A        return null;%0A    %7D%0A  %7D%0A%0A  /**%0A   *  Prints help text.%0A   */%0A  private static void printHelpText()%0A  %7B%0A    System.out.println(%22Usage:%5Cn%22 +%0A                       %22java sortingalgorithms.SortTester ALGORITHM ARRAY_LENGTH TEST_COUNT%5Cn%22 +%0A                       %22%5CtALGORITHM - The algorithm to test%5Cn%22 +%0A                       %22%5CtARRAY_LENGTH - Length of arrays%5Cn%22 +%0A                       %22%5CtTEST_COUNT - Number of tests to perform%22);%0A  %7D%0A%0A  public static void main(String%5B%5D args)%0A  %7B%0A    if (args.length %3E 2)%0A    %7B%0A      SortingAlgorithm algorithm = getSortingAlgorithm(args%5B0%5D.toLowerCase());%0A%0A      if (algorithm != null)%0A      %7B%0A        try%0A        %7B%0A          int length = Integer.parseInt(args%5B1%5D),%0A              n      = Integer.parseInt(args%5B2%5D);%0A%0A          TestResult%5B%5D results = SortingTest.tester.test(algorithm, length, n);%0A          for (TestResult result : results)%0A            System.out.println(result);%0A        %7D%0A        catch (NumberFormatException e)%0A        %7B%0A          System.err.println(e.getMessage());%0A          e.printStackTrace();%0A        %7D%0A      %7D%0A    %7D%0A    else%0A      printHelpText();%0A  %7D%0A%7D%0A

Create simple program for running the test on different sorting algorithms