コード例 #1
0
  @Test
  public void testFetchLatest() {
    Date from;

    from = new GregorianCalendar(2011, 7, 22, 7, 0, 0).getTime();
    junit.framework.Assert.assertEquals(16, subject.fetch(channel, from).size());

    from = new GregorianCalendar(2011, 7, 21, 12, 50, 0).getTime();
    junit.framework.Assert.assertEquals(18, subject.fetch(channel, from).size());
  }
コード例 #2
0
  @Test
  public void testMapping() throws Exception {
    List<Article> articleList;
    Article article;

    articleList = subject.fetch(channel, new Date(0));

    junit.framework.Assert.assertEquals(false, articleList.isEmpty());

    article = articleList.get(0);

    junit.framework.Assert.assertEquals("title", article.getTitle());
    junit.framework.Assert.assertEquals("description", article.getDescription());
    junit.framework.Assert.assertEquals("http://link", article.getLink());
    junit.framework.Assert.assertEquals(
        new GregorianCalendar(2011, 7, 22, 10, 32, 26).getTime(), article.getPublished());
    junit.framework.Assert.assertEquals(
        channel.getUrl().toURI().toURL().toExternalForm(), article.getSource());
  }