Esempio n. 1
0
  public void testFetchObsolete() throws IOException, StructureException {

    cache.setUseMmCif(false); // TODO Remove after implementing obsolete mmcif fetching
    cache.setAutoFetch(true);
    cache.setFetchCurrent(false);
    cache.setFetchFileEvenIfObsolete(true);

    Structure s;

    // OBSOLETE PDB; should throw an exception
    s = cache.getStructure("1CMW");
    assertEquals("Failed to get OBSOLETE file 1CMW.", "1CMW", s.getPDBCode());

    s = cache.getStructure("1HHB");
    assertEquals("Failed to get OBSOLETE file 1HHB.", "1HHB", s.getPDBCode());
    System.err.println(
        "Please ignore the previous four errors. They are expected for this ancient PDB.");
  }
Esempio n. 2
0
  public void testFetchCurrent() throws IOException, StructureException {

    cache.setUseMmCif(false); // TODO Remove after implementing obsolete mmcif fetching
    cache.setAutoFetch(true);
    cache.setFetchCurrent(true);
    cache.setFetchFileEvenIfObsolete(false);

    Structure s;
    try {
      // OBSOLETE PDB; should throw an exception
      s = cache.getStructure("1CMW");
      fail("1CMW has no current structure. Should have thrown an error");
    } catch (IOException e) {
      // expected
      System.err.println("Please ignore previous exceptions. They are expected.");
    } catch (StructureException e) {
      // expected
      System.err.println("Please ignore previous exceptions. They are expected.");
    }

    s = cache.getStructure("1HHB");
    assertEquals("Failed to get the current ID for 1HHB.", "4HHB", s.getPDBCode());
  }