Esempio n. 1
0
 @Test(expected = IllegalArgumentException.class)
 public void testSetNamespace2() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", null);
   wikiLink.setNamespace(null);
   assertEquals(
       "wikiLink.getNamespace()", Namespace.namespace(Namespace.FILE_ID), wikiLink.getNamespace());
 }
Esempio n. 2
0
 @Test
 public void testSetNamespace() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", null);
   wikiLink.setNamespace(Namespace.namespace(Namespace.FILE_ID));
   assertEquals(
       "wikiLink.getNamespace()", Namespace.namespace(Namespace.FILE_ID), wikiLink.getNamespace());
 }
Esempio n. 3
0
 @Test
 public void testConstructor() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", null);
   assertNull("wikiLink.getQuery()", wikiLink.getQuery());
   assertNull("wikiLink.getSection()", wikiLink.getSection());
   assertNull("wikiLink.getText()", wikiLink.getText());
   assertNull("wikiLink.getArticle()", wikiLink.getArticle());
   assertEquals(
       "wikiLink.getNamespace()", Namespace.namespace(Namespace.MAIN_ID), wikiLink.getNamespace());
   assertNull("wikiLink.getDestination()", wikiLink.getDestination());
   assertFalse("wikiLink.getColon()", wikiLink.getColon());
 }
Esempio n. 4
0
 @Test
 public void testParseWikiLink() throws Throwable {
   WikiLink result = LinkUtil.parseWikiLink("en", "testLinkUtilRaw");
   assertEquals("result.getArticle()", "testLinkUtilRaw", result.getArticle());
 }
Esempio n. 5
0
 @Test
 public void testParseWikiLink1() throws Throwable {
   WikiLink result = LinkUtil.parseWikiLink(null, "");
   assertNull("result.getArticle()", result.getArticle());
 }
Esempio n. 6
0
 @Test
 public void testSetSection() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", null);
   wikiLink.setSection("testWikiLinkSection");
   assertEquals("wikiLink.getSection()", "testWikiLinkSection", wikiLink.getSection());
 }
Esempio n. 7
0
 @Test
 public void testSetDestination() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", "testWikiLinkDestination");
   assertEquals("wikiLink.getDestination()", "testWikiLinkDestination", wikiLink.getDestination());
 }
Esempio n. 8
0
 @Test
 public void testSetColon() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", null);
   wikiLink.setColon(true);
   assertTrue("wikiLink.getColon()", wikiLink.getColon());
 }
Esempio n. 9
0
 @Test
 public void testSetArticle() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", null);
   wikiLink.setArticle("testWikiLinkArticle");
   assertEquals("wikiLink.getArticle()", "testWikiLinkArticle", wikiLink.getArticle());
 }