Пример #1
0
  /** Test of findAll method, of class BitstreamFormat. */
  @Test
  public void testFindAll() throws SQLException {

    BitstreamFormat[] found = BitstreamFormat.findAll(context);
    assertThat("testFindAll 0", found, notNullValue());

    // check pos 0 is Unknown
    assertThat("testFindAll 1", found[0].getShortDescription(), equalTo("Unknown"));
    assertFalse("testFindAll 2", found[0].isInternal());
    assertThat("testFindAll 3", found[0].getSupportLevel(), equalTo(0));

    boolean added = false;
    for (BitstreamFormat bsf : found) {
      if (bsf.equals(bf)) {
        added = true;
      }
    }
    assertTrue("testFindAll 4", added);
  }
Пример #2
0
  /** Test of getSupportLevel method, of class BitstreamFormat. */
  @Test
  public void testGetSupportLevel() throws SQLException {

    assertTrue("testGetSupportLevel 0", bf.getSupportLevel() >= 0);
    assertTrue("testGetSupportLevel 1", bf.getSupportLevel() <= 2);

    assertTrue("testGetSupportLevel 2", bunknown.getSupportLevel() >= 0);
    assertTrue("testGetSupportLevel 3", bunknown.getSupportLevel() <= 2);

    BitstreamFormat[] found = BitstreamFormat.findAll(context);
    int i = 0;
    for (BitstreamFormat b : found) {
      i++;
      assertTrue(
          "testGetSupportLevel " + i + " (" + b.getMIMEType() + ")", b.getSupportLevel() >= 0);
      i++;
      assertTrue(
          "testGetSupportLevel " + i + " (" + b.getMIMEType() + ")", b.getSupportLevel() <= 2);
    }
  }