コード例 #1
0
  public void testItFindsTwoRingsInNapthaleneWhenMaxRingSizeSetToSix() {
    finder.setMaximumRingSize(6);
    Molecule naphthalene = Molecules.createNaphthalene();
    Collection rings = finder.findRings(naphthalene);

    assertEquals(2, rings.size());
  }
コード例 #2
0
  public void testItRespectsMaxRingSize() throws Exception {
    finder.setMaximumRingSize(15);
    Molecule brevetoxin = MoleculeKit.readMolfile(brevetoxinMolfile);
    Collection<List<Atom>> rings = finder.findRings(brevetoxin);
    int maxRingSize = 0;

    for (List<Atom> ring : rings) {
      if (ring.size() > maxRingSize) {
        maxRingSize = ring.size();
      }
    }

    assertEquals(15, maxRingSize - 1);
  }
コード例 #3
0
  public void testItShouldFind28RingsInCubane() {
    Molecule cubane = Molecules.createCubane();
    Collection rings = finder.findRings(cubane);

    assertEquals(28, rings.size());
  }
コード例 #4
0
  public void testItShouldFindThreeRingsInNaphthalene() {
    Molecule naphthalene = Molecules.createNaphthalene();
    Collection rings = finder.findRings(naphthalene);

    assertEquals(3, rings.size());
  }
コード例 #5
0
  public void testItShoudFindOneRingInBenzene() {
    Molecule benzene = Molecules.createBenzene();
    Collection<List<Atom>> rings = finder.findRings(benzene);

    assertEquals(1, rings.size());
  }