Пример #1
0
  /** Test of setDescription method, of class BitstreamFormat. */
  @Test
  public void testSetDescription() {
    String desc = "long description stored here";
    bf.setDescription(desc);

    assertThat("testSetDescription 0", bf.getDescription(), notNullValue());
    assertThat("testSetDescription 1", bf.getDescription(), not(equalTo("")));
    assertThat("testSetDescription 2", bf.getDescription(), equalTo(desc));
  }
Пример #2
0
  /** Test of update method, of class BitstreamFormat. */
  @Test
  public void testUpdateAdmin() throws SQLException, AuthorizeException {

    new NonStrictExpectations() {
      AuthorizeManager authManager;

      {
        AuthorizeManager.isAdmin((Context) any);
        result = true;
      }
    };

    String desc = "Test description";
    bf.setDescription(desc);
    bf.update();

    BitstreamFormat b = BitstreamFormat.find(context, 5);
    assertThat("testUpdateAdmin 0", b.getDescription(), equalTo(desc));
  }