private final Document document;
public AbstruseGooseComicFilterTest() throws IOException {
- document = loadDocument("/comics/abstrusegoose.html", "http://abstrusegoose.com/");
- }
-
- private Document loadDocument(String resourceName, String baseUri) throws IOException {
- InputStream inputStream = getClass().getResourceAsStream(resourceName);
- Document document = Jsoup.parse(inputStream, "UTF-8", baseUri);
- return document;
+ document = ComicLoader.loadDocument("abstruse-goose.html", "http://abstrusegoose.com/");
}
@Test
public void extractsComicTitleCorrectly() {
Optional<String> title = abstruseGooseComicFilter.extractTitle(document);
- assertThat(title, is(of("Bizarro")));
+ assertThat(title, is(of("The Sudokomic Game")));
}
@Test
public void extractComicImagesCorrectly() {
List<String> images = abstruseGooseComicFilter.extractImageUrls(document);
- assertThat(images, contains("http://abstrusegoose.com/strips/bizero.png"));
+ assertThat(images, contains("http://abstrusegoose.com/strips/another_fun_game_is_comic_tac_toe.png"));
}
@Test
public void extractImageCommentsCorrectly() {
List<String> comments = abstruseGooseComicFilter.extractImageComments(document);
- assertThat(comments, contains("In the additive group of the integers, bizarro zero is... well... zero."));
+ assertThat(comments, contains("This is the best I could do on short notice."));
}
}
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8" />
- <meta name="Description" content="Strip cartoon about math, science, and geek culture." />
- <title>Abstruse Goose | Bizarro</title>
- <link rel="stylesheet" href="styles/main.css" />
- <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="feed.xml" />
- <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="atomfeed.xml" />
- <link rel="shortcut icon" href="images/favicon.ico" />
-
- <script>
- document.createElement(footer);
- document.createElement(header);
- document.createElement(nav);
- document.createElement(section);
- </script>
- </head>
-<body>\r
-\r
- <header>\r
- <table>\r
- <tr>\r
- <td>\r
- <a href="http://abstrusegoose.com/"><img src="http://abstrusegoose.com/images/AGlogo.PNG"></a>\r
- </td>\r
- <td>\r
- <script type="text/javascript"><!--\r
- google_ad_client = "ca-pub-0580318607844761";\r
- /* 468x60, created 6/26/08 */\r
- google_ad_slot = "7038958302";\r
- google_ad_width = 468;\r
- google_ad_height = 60;\r
- //-->\r
- </script>\r
- <script type="text/javascript"\r
- src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
- </script>\r
- </td>\r
- </tr>\r
- </table>\r
-\r
- <div id="menu_top"></div>\r
-\r
- </header>\r
- <section>\r
- <p><a href="http://abstrusegoose.com/1">«« First</a> <a href="http://abstrusegoose.com/544">« Previous</a> | <a href="http://abstrusegoose.com/pseudorandom.php" >Random</a> | Next » Current »»</p> <h1 class="storytitle"><a href="http://abstrusegoose.com/545">Bizarro</a></h1><br>\r
- <img src="http://abstrusegoose.com/strips/bizero.png" alt="bizero" width="744" height="567" title="In the additive group of the integers, bizarro zero is... well... zero."/> <div id="blog_text"></div>\r
- <p><a href="http://abstrusegoose.com/1">«« First</a> <a href="http://abstrusegoose.com/544">« Previous</a> | <a href="http://abstrusegoose.com/pseudorandom.php" >Random</a> | Next » Current »»</p> </section>\r
- <footer>\r
- <nav>\r
- <a href="http://abstrusegoose.com">HOME</a> \r
- <a href="http://abstrusegoose.com/archive">ARCHIVE</a> \r
- <a href="http://abstrusegoose.com/feedthegoose">FEED THE GOOSE</a> \r
- <a href="http://www.cafepress.com/abstrusegoose">STORE</a>\r
- </nav>\r
-\r
- <script type="text/javascript"><!--\r
- google_ad_client = "ca-pub-0580318607844761";\r
- /* 728x90, created 6/26/08 */\r
- google_ad_slot = "7299138344";\r
- google_ad_width = 728;\r
- google_ad_height = 90;\r
- //-->\r
- </script>\r
- <script type="text/javascript"\r
- src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
- </script>\r
-\r
- <div id="melikes">\r
- <p><b>melikes</b></p>\r
- <a href="http://brownsharpie.courtneygibbons.org">Brown Sharpie</a> \r
- <a href="http://www.explosm.net/comics/new">Cy&H</a> \r
- <a href="http://www.exocomics.com">EXTRAORDINARY</a> \r
- <a href="http://pbfcomics.com">PBF</a> \r
- <a href="http://popstrip.com">popstrip</a> \r
- <a href="http://spikedmath.com">spiked math</a> \r
- <a href="http://www.xkcd.com">xkcd</a>\r
- </div>\r
-\r
- <div class="creativecommons">\r
-\r
- <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/us/"><img alt="Creative Commons License" style="border-width:0" src="http://creativecommons.org/images/public/somerights20.png"/></a> <img src="images/designation.PNG">\r
-\r
- <br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/us/">Creative Commons Attribution-Noncommercial 3.0 United States License</a>.\r
-\r
- </div>\r
-\r
- <div class="credit">\r
- <p><br />A webcomic......... that is all.</p>\r
- </div>\r
-\r
- <div class="privacy">\r
- <p><a href="http://abstrusegoose.com/about">about</a> \r
- <a href="http://abstrusegoose.com/faq">faq</a> \r
- <a href="http://abstrusegoose.com/privacy">privacy</a></p>\r
- </div>\r
-\r
- </footer>\r
-</body>\r
-</html>\r
-<!-- cached with Cache Goose -->
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="Description" content="Strip cartoon about math, science, and geek culture." />
+ <title>Abstruse Goose | The Sudokomic Game</title>
+ <link rel="stylesheet" href="styles/main.css" />
+ <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="feed.xml" />
+ <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="atomfeed.xml" />
+ <link rel="shortcut icon" href="images/favicon.ico" />
+
+ <script>
+ document.createElement(footer);
+ document.createElement(header);
+ document.createElement(nav);
+ document.createElement(section);
+ </script>
+ </head>
+<body>\r
+\r
+ <header>\r
+ <table>\r
+ <tr>\r
+ <td>\r
+ <a href="http://abstrusegoose.com/"><img src="http://abstrusegoose.com/images/AGlogo.PNG"></a>\r
+ </td>\r
+ <td>\r
+ <script type="text/javascript"><!--\r
+ google_ad_client = "ca-pub-0580318607844761";\r
+ /* 468x60, created 6/26/08 */\r
+ google_ad_slot = "7038958302";\r
+ google_ad_width = 468;\r
+ google_ad_height = 60;\r
+ //-->\r
+ </script>\r
+ <script type="text/javascript"\r
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+ </script>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+\r
+ <div id="menu_top"></div>\r
+\r
+ </header>\r
+ <section>\r
+ <p><a href="http://abstrusegoose.com/1">«« First</a> <a href="http://abstrusegoose.com/572">« Previous</a> | <a href="http://abstrusegoose.com/pseudorandom.php" >Random</a> | Next » Current »»</p> <h1 class="storytitle"><a href="http://abstrusegoose.com/575">The Sudokomic Game</a></h1><br>\r
+ <img src="http://abstrusegoose.com/strips/another_fun_game_is_comic_tac_toe.png" alt="another_fun_game_is_comic_tac_toe" width="743" height="634" title="This is the best I could do on short notice."/> <div id="blog_text"></div>\r
+ <p><a href="http://abstrusegoose.com/1">«« First</a> <a href="http://abstrusegoose.com/572">« Previous</a> | <a href="http://abstrusegoose.com/pseudorandom.php" >Random</a> | Next » Current »»</p> </section>\r
+ <footer>\r
+ <nav>\r
+ <a href="http://abstrusegoose.com">HOME</a> \r
+ <a href="http://abstrusegoose.com/archive">ARCHIVE</a> \r
+ <a href="http://abstrusegoose.com/feedthegoose">FEED THE GOOSE</a> \r
+ <a href="http://www.cafepress.com/abstrusegoose">STORE</a>\r
+ </nav>\r
+\r
+ <script type="text/javascript"><!--\r
+ google_ad_client = "ca-pub-0580318607844761";\r
+ /* 728x90, created 6/26/08 */\r
+ google_ad_slot = "7299138344";\r
+ google_ad_width = 728;\r
+ google_ad_height = 90;\r
+ //-->\r
+ </script>\r
+ <script type="text/javascript"\r
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+ </script>\r
+\r
+ <div id="melikes">\r
+ <p><b>melikes</b></p>\r
+ <a href="http://brownsharpie.courtneygibbons.org">Brown Sharpie</a> \r
+ <a href="http://www.explosm.net/comics/new">Cy&H</a> \r
+ <a href="http://www.exocomics.com">EXTRAORDINARY</a> \r
+ <a href="http://pbfcomics.com">PBF</a> \r
+ <a href="http://popstrip.com">popstrip</a> \r
+ <a href="http://spikedmath.com">spiked math</a> \r
+ <a href="http://www.xkcd.com">xkcd</a>\r
+ </div>\r
+\r
+ <div class="creativecommons">\r
+\r
+ <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/us/"><img alt="Creative Commons License" style="border-width:0" src="http://creativecommons.org/images/public/somerights20.png"/></a> <img src="images/designation.PNG">\r
+\r
+ <br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/us/">Creative Commons Attribution-Noncommercial 3.0 United States License</a>.\r
+\r
+ </div>\r
+\r
+ <div class="credit">\r
+ <p><br />A webcomic......... that is all.</p>\r
+ </div>\r
+\r
+ <div class="privacy">\r
+ <p><a href="http://abstrusegoose.com/about">about</a> \r
+ <a href="http://abstrusegoose.com/faq">faq</a> \r
+ <a href="http://abstrusegoose.com/privacy">privacy</a></p>\r
+ </div>\r
+\r
+ </footer>\r
+</body>\r
+</html>\r
+<!-- cached with Cache Goose -->
\ No newline at end of file