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