Ejemplo n.º 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));
  }
Ejemplo n.º 2
0
  /** Test of create method, of class BitstreamFormat. */
  @Test
  public void testCreateAdmin() throws SQLException, AuthorizeException {
    new NonStrictExpectations() {
      AuthorizeManager authManager;

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

    BitstreamFormat found = BitstreamFormat.create(context);
    assertThat("testCreate 0", found, notNullValue());
    assertThat("testCreate 1", found.getDescription(), nullValue());
    assertThat("testCreate 2", found.getMIMEType(), nullValue());
    assertThat("testCreate 3", found.getSupportLevel(), equalTo(-1));
    assertFalse("testCreate 4", found.isInternal());
  }
Ejemplo n.º 3
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));
  }
Ejemplo n.º 4
0
 /** Test of getDescription method, of class BitstreamFormat. */
 @Test
 public void testGetDescription() {
   assertThat("getDescription 0", bf.getDescription(), notNullValue());
   assertThat("getDescription 1", bf.getDescription(), not(equalTo("")));
   assertThat("getDescription 2", bf.getDescription(), equalTo("Extensible Markup Language"));
 }