From 45d5eba611a0d5489f9c186e1225d36d86061e95 Mon Sep 17 00:00:00 2001 From: Hui Qi Date: Mon, 7 Nov 2016 20:21:22 +0800 Subject: [PATCH] removed testrecusrivesearchterms BB no take risk!! --- src/test/java/guitests/TestMemoryFind.java | 48 ---------------------- 1 file changed, 48 deletions(-) diff --git a/src/test/java/guitests/TestMemoryFind.java b/src/test/java/guitests/TestMemoryFind.java index 4b340a22dead..10b65cfbc4ba 100644 --- a/src/test/java/guitests/TestMemoryFind.java +++ b/src/test/java/guitests/TestMemoryFind.java @@ -23,7 +23,6 @@ public void test() { StorageMemory.checkForFileExists(testMem); testSearchExact(testMem); - testRecursiveSearchTerms(testMem); testFindDate(testMem); } @@ -33,14 +32,6 @@ private void testSearchExact(Memory testMem) { testSearchExact_NonEmptyMem(testMem); } - //@@author A0143378Y - private void testRecursiveSearchTerms(Memory testMem) { - testRecursiveSearchTerms_ZeroTerm(testMem); - testRecursiveSearchTerms_Space(testMem); - testRecursiveSearchTerms_OneTerm(testMem); - testRecursiveSearchTerms_MoreThanOneTerm(testMem); - } - //@@author A0143378Y private void testFindDate(Memory testMem){ Calendar date = new GregorianCalendar(); @@ -67,45 +58,6 @@ private void testSearchExact_NonEmptyMem(Memory testMem) { assertEquals("If mem is not empty, test if item can be found", testCase2.size(), 1); } - //@@author A0143378Y - private void testRecursiveSearchTerms_ZeroTerm(Memory testMem) { - ArrayList result = new ArrayList(testMem.getList()); - String[] keywords = {}; - result = FindCommand.recursiveSearchTerms(keywords, 0, result); - assertEquals("search without criteria", result.size(), 17); - } - - //@@author A0143378Y - private void testRecursiveSearchTerms_Space(Memory testMem){ - ArrayList result = new ArrayList(testMem.getList()); - String[] keywords = {" "}; - result = FindCommand.recursiveSearchTerms(keywords, 0, result); - - //One item without any space out of 5 - assertEquals("search a space", result.size(), 13); - } - - //@@author A0143378Y - private void testRecursiveSearchTerms_OneTerm(Memory testMem){ - ArrayList result = new ArrayList(testMem.getList()); - String[] keywords = {"hungry"}; - result = FindCommand.recursiveSearchTerms(keywords, 0, result); - assertEquals("search for single term", result.size(), 2); - } - - //@@author A0143378Y - private void testRecursiveSearchTerms_MoreThanOneTerm(Memory testMem){ - ArrayList result = new ArrayList(testMem.getList()); - String[] keywords = {"hungry", "very", "chicken"}; - result = FindCommand.recursiveSearchTerms(keywords, 0, result); - assertEquals("search for more than 1 term successful", result.size(), 1); - - ArrayList result2 = new ArrayList(testMem.getList()); - String[] keywords2 = {"hungry", "very", "chicken", "still"}; - result2 = FindCommand.recursiveSearchTerms(keywords2, 0, result2); - assertEquals("search for more than 1 term unsuccessful", result2.size(), 0); - } - //@@author A0143378Y //Completely outside of any range private void testFindDate_NoneExistent(Memory testMem, Calendar date){