Ejemplo n.º 1
0
  @Test(dataProvider = "journal")
  public void testBrowseLatestIssueFromLatestVolume(Journal journal) {
    // set journal to have a null currentIssue
    Issue originalIssue = journal.getCurrentIssue();
    journal.setCurrentIssue(null);
    dummyDataStore.update(journal);

    try {
      assertEquals(action.execute(), BaseActionSupport.SUCCESS, "Action didn't return success");
      IssueInfo issueInfo = action.getIssueInfo();
      assertNotNull(issueInfo, "action had null issue info");
      // Load up latest volume w/ dummy datastore to defeat lazy-loaded issues
      Long volumeId = journal.getVolumes().get(journal.getVolumes().size() - 1).getID();
      Volume latestVolume = dummyDataStore.get(Volume.class, volumeId);
      Issue latestIssue = latestVolume.getIssues().get(latestVolume.getIssues().size() - 1);

      assertEquals(
          issueInfo.getIssueURI(), latestIssue.getIssueUri(), "action had incorrect issue uri");
      assertEquals(
          issueInfo.getDescription(),
          latestIssue.getDescription(),
          "action had incorrect issue description");
      assertEquals(
          action.getVolumeInfo().getVolumeUri(),
          latestVolume.getVolumeUri(),
          "action had incorrect volume");
    } finally {
      // reset state
      journal.setCurrentIssue(originalIssue);
      dummyDataStore.update(journal);
    }
  }
Ejemplo n.º 2
0
 @Test(dataProvider = "journal")
 public void testBrowseCurrentIssue(Journal journal) throws Exception {
   assertEquals(action.execute(), BaseActionSupport.SUCCESS, "Action didn't return success");
   IssueInfo issueInfo = action.getIssueInfo();
   assertNotNull(issueInfo, "action had null issue info");
   assertEquals(
       issueInfo.getArticleUriList(),
       journal.getCurrentIssue().getArticleDois(),
       "action's issue had incorrect article dois");
   assertEquals(
       issueInfo.getIssueURI(),
       journal.getCurrentIssue().getIssueUri(),
       "Action's issue had incorrect issue uri");
 }
Ejemplo n.º 3
0
 @AfterMethod
 public void clearIssue() {
   action.setIssue(null);
 }