SharedStopwordResource extends BaleenResource { public Collection<String> getStopwords() { return stopwords; }  Collection<String> getStopwords(); Collection<String> getStopwords(StopwordList list); Collection<String> getStopwords(File list); Collection<String> getStopwords(String configuration);  }
@Test public void testDefault() throws IOException { assertTrue(ssr.getStopwords().contains("the")); assertTrue(ssr.getStopwords(StopwordList.DEFAULT).contains("the")); }
@Test public void testSmart() throws IOException { assertTrue(ssr.getStopwords(StopwordList.SMART).contains("the")); }
@Test public void testFox() throws IOException { assertTrue(ssr.getStopwords(StopwordList.FOX).contains("the")); }
@Test public void testRanksNl() throws IOException { assertTrue(ssr.getStopwords(StopwordList.RANKS_NL).contains("the")); }
@Test public void testLong() throws IOException { assertTrue(ssr.getStopwords(StopwordList.LONG).contains("the")); }
@Test public void testMySql() throws IOException { assertTrue(ssr.getStopwords(StopwordList.MYSQL).contains("the")); }
@Test public void testCustom() throws IOException { Collection<String> words = ssr.getStopwords(new File(getClass().getResource("exampleStoplist.txt").getPath())); assertTrue(words.contains("the")); assertFalse(words.contains("comment")); assertTrue(words.contains("test")); }
@Test public void testBadCustom() throws IOException { try { ssr.getStopwords(new File("missing.txt")); fail("Expected exception not thrown"); } catch (IOException ioe) { } }