From 27d815812eb4103d8463d42dc293cf5f04f06cbc Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 12 Dec 2022 23:43:42 +0100 Subject: [PATCH] Add `SortServer` test --- .../main/java/ch/nuth/zhaw/exbox/SortServer.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/src/main/java/ch/nuth/zhaw/exbox/SortServer.java b/app/src/main/java/ch/nuth/zhaw/exbox/SortServer.java index cbd45b5..bbaede8 100644 --- a/app/src/main/java/ch/nuth/zhaw/exbox/SortServer.java +++ b/app/src/main/java/ch/nuth/zhaw/exbox/SortServer.java @@ -195,4 +195,20 @@ public class SortServer implements CommandExecutor { return arg + " " + ex.getMessage(); } } + + public static void main(String[] args) { + SortServer sorter = new SortServer(); + String sort; + sort = "BUBBLE RANDOM 10000"; System.out.println(sorter.execute(sort)); + sort = "SELECTION RANDOM 10000"; System.out.println(sorter.execute(sort)); + sort = "INSERTION RANDOM 10000"; System.out.println(sorter.execute(sort)); + sort = "QUICKERSORT RANDOM 10000 100"; System.out.println(sorter.execute(sort)); + sort = "STREAM RANDOM 10000"; System.out.println(sorter.execute(sort)); + + sort = "BUBBLE ASC 10000"; System.out.println(sorter.execute(sort)); + sort = "SELECTION ASC 10000"; System.out.println(sorter.execute(sort)); + sort = "INSERTION ASC 10000"; System.out.println(sorter.execute(sort)); + sort = "QUICKERSORT ASC 10000 100"; System.out.println(sorter.execute(sort)); + sort = "STREAM ASC 10000"; System.out.println(sorter.execute(sort)); + } }