Changeset 1060 for trunk/autoquest-core-usageprofiles-test/src/test
- Timestamp:
- 02/07/13 17:57:07 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usageprofiles-test/src/test/java/de/ugoe/cs/autoquest/usageprofiles/TrieTest.java
r927 r1060 75 75 @Test(expected = java.lang.IllegalArgumentException.class) 76 76 public void testTrie_3() throws Exception { 77 new Trie<String>(null); 78 } 77 new Trie<String>((SymbolComparator<String>) null); 78 } 79 80 @Test(expected = java.lang.IllegalArgumentException.class) 81 public void testTrie_4() throws Exception { 82 new Trie<String>((Trie<String>) null); 83 } 79 84 80 85 @Test … … 240 245 assertEquals(0, result.size()); 241 246 } 247 248 @Test 249 public void testGetSequencesWithMostOccurrences_1() throws Exception { 250 Trie<String> fixture = new Trie<String>(); 251 fixture.train(sequence, 3); 252 253 List<String> expected = new ArrayList<String>(); 254 expected.add("a"); 255 256 Collection<List<String>> result = fixture.getSequencesWithMostOccurrences(1); 257 258 assertEquals(1, result.size()); 259 ListAssert.assertEquals(expected, result.iterator().next()); 260 } 261 262 @Test 263 public void testGetSequencesWithMostOccurrences_2() throws Exception { 264 Trie<String> fixture = new Trie<String>(); 265 fixture.train(sequence, 3); 266 267 Collection<List<String>> result = fixture.getSequencesWithMostOccurrences(2); 268 269 assertEquals(5, result.size()); 270 271 List<String> expected = new ArrayList<String>(); 272 expected.add("a"); 273 expected.add("b"); 274 ListAssert.assertContains((List<List<String>>) result, expected); 275 276 expected.add("r"); 277 ListAssert.assertContains((List<List<String>>) result, expected); 278 279 expected.clear(); 280 expected.add("b"); 281 expected.add("r"); 282 ListAssert.assertContains((List<List<String>>) result, expected); 283 284 expected.add("a"); 285 ListAssert.assertContains((List<List<String>>) result, expected); 286 287 expected.clear(); 288 expected.add("r"); 289 expected.add("a"); 290 ListAssert.assertContains((List<List<String>>) result, expected); 291 } 292 293 @Test 294 public void testGetSequencesWithMostOccurrences_3() throws Exception { 295 Trie<String> fixture = new Trie<String>(); 296 fixture.train(sequence, 3); 297 298 Collection<List<String>> result = fixture.getSequencesWithMostOccurrences(3); 299 300 assertEquals(2, result.size()); 301 302 List<String> expected = new ArrayList<String>(); 303 expected.add("a"); 304 expected.add("b"); 305 expected.add("r"); 306 ListAssert.assertContains((List<List<String>>) result, expected); 307 308 expected.clear(); 309 expected.add("b"); 310 expected.add("r"); 311 expected.add("a"); 312 ListAssert.assertContains((List<List<String>>) result, expected); 313 } 314 315 @Test 316 public void testGetSequencesWithMostOccurrences_4() throws Exception { 317 Trie<String> fixture = new Trie<String>(); 318 fixture.train(sequence, 3); 319 320 Collection<List<String>> result = fixture.getSequencesWithMostOccurrences(4); 321 322 assertEquals(0, result.size()); 323 } 242 324 243 325 @Test
Note: See TracChangeset
for help on using the changeset viewer.