Package org.openiaml.model.tests.codegen.model0_5_1

Examples of org.openiaml.model.tests.codegen.model0_5_1.RSS2_0Reader


    assertEquals(2, reader.getFeedItems().size());
    Set<String> guids = new HashSet<String>();

    {
      // first item: New Event 123
      FeedItem item = reader.getFeedItems().get(0);

      assertEquals("New Event 123", item.getTitle());
      assertEquals("This event is great, because it was loaded through RSS!", item.getDescription());

      // construct expected URL
      String expectedLink = getTestContext().getBaseUrl().toString() + newsUrl + "?generated_primary_key=";
      assertTrue("Link '" + item.getLink() + "' does not begin with '" + expectedLink + "'", item.getLink().startsWith(expectedLink));

      // need to construct the date
      assertEquals(createUTCDate(2008, 05, 03, 9, 39, 21), item.getPubDate());

      // and the GUID must be unique in this list
      assertNotNull(item.getGuid());
      assertFalse("List of GUIDs already contains '" + item.getGuid() + "': " + guids, guids.contains(item.getGuid()));
      guids.add(item.getGuid());
    }

    {
      // first item: New Event 123
      FeedItem item = reader.getFeedItems().get(1);

      assertEquals("New Event 124", item.getTitle());
      assertEquals("This event is great, because it was also loaded through RSS!", item.getDescription());

      // construct expected URL
      String expectedLink = getTestContext().getBaseUrl().toString() + newsUrl + "?generated_primary_key=";
      assertTrue("Link '" + item.getLink() + "' does not begin with '" + expectedLink + "'", item.getLink().startsWith(expectedLink));

      // need to construct the date
      assertEquals(createUTCDate(2008, 05, 03, 9, 39, 21), item.getPubDate());

      // and the GUID must be unique in this list
      assertNotNull(item.getGuid());
      assertFalse("List of GUIDs already contains '" + item.getGuid() + "': " + guids, guids.contains(item.getGuid()));
      guids.add(item.getGuid());
    }

  }
View Full Code Here

TOP

Related Classes of org.openiaml.model.tests.codegen.model0_5_1.RSS2_0Reader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.