Exemple #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());
 }
Exemple #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());
 }
Exemple #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());
 }
Exemple #4
0
 @Test
 public void testParseWikiLink() throws Throwable {
   WikiLink result = LinkUtil.parseWikiLink("en", "testLinkUtilRaw");
   assertEquals("result.getArticle()", "testLinkUtilRaw", result.getArticle());
 }
Exemple #5
0
 @Test
 public void testParseWikiLink1() throws Throwable {
   WikiLink result = LinkUtil.parseWikiLink(null, "");
   assertNull("result.getArticle()", result.getArticle());
 }
Exemple #6
0
 @Test
 public void testSetSection() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", null);
   wikiLink.setSection("testWikiLinkSection");
   assertEquals("wikiLink.getSection()", "testWikiLinkSection", wikiLink.getSection());
 }
Exemple #7
0
 @Test
 public void testSetDestination() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", "testWikiLinkDestination");
   assertEquals("wikiLink.getDestination()", "testWikiLinkDestination", wikiLink.getDestination());
 }
Exemple #8
0
 @Test
 public void testSetColon() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", null);
   wikiLink.setColon(true);
   assertTrue("wikiLink.getColon()", wikiLink.getColon());
 }
Exemple #9
0
 @Test
 public void testSetArticle() throws Throwable {
   WikiLink wikiLink = new WikiLink("/wiki", "en", null);
   wikiLink.setArticle("testWikiLinkArticle");
   assertEquals("wikiLink.getArticle()", "testWikiLinkArticle", wikiLink.getArticle());
 }