Exemplo n.º 1
0
  /**
   * Test.
   *
   * @throws Exception a
   */
  @Test
  public final void deleteWikiMW1x16() throws Exception {

    bot = BotFactory.getMediaWikiBot(Version.MW1_16, true);
    assertTrue("Wrong Wiki Version " + bot.getVersion(), Version.MW1_16.equals(bot.getVersion()));

    prepare(bot);
    delete(bot);
    test(bot);
  }
Exemplo n.º 2
0
 @Ignore
 @Test
 public void deleteAll() throws Exception {
   Version[] all = {Version.MW1_15, Version.MW1_16};
   for (Version v : all) {
     MediaWikiBot bot = BotFactory.getMediaWikiBot(v, true);
     AllPageTitles aPages = new AllPageTitles(bot, MediaWiki.NS_MAIN);
     for (String string : aPages) {
       System.out.println(string);
     }
   }
 }
Exemplo n.º 3
0
  /** Test get siteinfo on Wikipedia DE. */
  @Test
  public final void siteInfoWikipediaDe() {
    // GIVEN
    String liveUrl = getWikipediaDeUrl();
    MediaWikiBot wikiBot = BotFactory.newWikimediaBot(liveUrl, getClass());

    // WHEN
    Siteinfo siteinfo = wikiBot.getSiteinfo();

    // THEN
    assertEquals(Version.DEVELOPMENT, siteinfo.getVersion());
  }
Exemplo n.º 4
0
  @Test
  public final void siteInfoLastVersion() {
    // GIVEN
    String liveUrl = "http://www.mediawiki.org/w/api.php";
    assumeReachable(liveUrl);
    String versionInfoTemplate = "Template:MW stable release number";
    MediaWikiBot bot = BotFactory.newWikimediaBot(liveUrl, getClass());

    // WHEN
    Article a = new Article(bot, versionInfoTemplate);

    // THEN
    Version latestVersion = Version.getLatest();
    assertTrue(
        a.getText() + " should contains " + latestVersion.getNumber(),
        a.getText().contains(latestVersion.getNumber()));
  }