public void testList() throws Throwable {
    String result = this.executeList("admin");
    assertEquals(Action.SUCCESS, result);

    VersionFinderAction action = (VersionFinderAction) this.getAction();
    List<Long> lastVersionsId = action.getLatestVersions();
    assertEquals(1, lastVersionsId.size());
    assertEquals(3, lastVersionsId.get(0).longValue());

    ContentVersion contentVersion = action.getContentVersion(3);
    assertEquals(3, contentVersion.getId());
    assertEquals("1.0", contentVersion.getVersion());
    assertEquals(1, contentVersion.getOnlineVersion());
    assertEquals("ART1", contentVersion.getContentId());
    assertEquals("ART", contentVersion.getContentType());
    assertEquals("Articolo 3", contentVersion.getDescr());
    assertNotNull(contentVersion.getVersionDate());
    assertNotNull(contentVersion.getXml());
  }
  public void testSearch() throws Throwable {
    String result = this.executeSearch("admin", null, null);
    assertEquals(Action.SUCCESS, result);

    VersionFinderAction action = (VersionFinderAction) this.getAction();
    List<Long> lastVersionsId = action.getLatestVersions();
    assertEquals(1, lastVersionsId.size());
    assertEquals(3, lastVersionsId.get(0).longValue());

    result = this.executeSearch("admin", "No descr", null);
    assertEquals(Action.SUCCESS, result);
    lastVersionsId = ((VersionFinderAction) this.getAction()).getLatestVersions();
    assertEquals(0, lastVersionsId.size());

    result = this.executeSearch("admin", "Articolo 2", null);
    assertEquals(Action.SUCCESS, result);
    lastVersionsId = ((VersionFinderAction) this.getAction()).getLatestVersions();
    assertEquals(0, lastVersionsId.size());

    result = this.executeSearch("admin", "Articolo 3", null);
    assertEquals(Action.SUCCESS, result);
    lastVersionsId = ((VersionFinderAction) this.getAction()).getLatestVersions();
    assertEquals(1, lastVersionsId.size());
    assertEquals(3, lastVersionsId.get(0).longValue());

    result = this.executeSearch("admin", "Articolo 3", "ART");
    assertEquals(Action.SUCCESS, result);
    lastVersionsId = ((VersionFinderAction) this.getAction()).getLatestVersions();
    assertEquals(1, lastVersionsId.size());
    assertEquals(3, lastVersionsId.get(0).longValue());

    result = this.executeSearch("admin", "Articolo 3", "CNG");
    assertEquals(Action.SUCCESS, result);
    lastVersionsId = ((VersionFinderAction) this.getAction()).getLatestVersions();
    assertEquals(0, lastVersionsId.size());
  }