Exemplo n.º 1
0
  private IReaction checkForXReactionFile(IChemFile chemFile, int numberOfReactions) {
    Assert.assertNotNull(chemFile);

    Assert.assertEquals(chemFile.getChemSequenceCount(), 1);
    org.openscience.cdk.interfaces.IChemSequence seq = chemFile.getChemSequence(0);
    Assert.assertNotNull(seq);

    Assert.assertEquals(seq.getChemModelCount(), 1);
    org.openscience.cdk.interfaces.IChemModel model = seq.getChemModel(0);
    Assert.assertNotNull(model);

    IReactionSet reactionSet = model.getReactionSet();
    Assert.assertNotNull(reactionSet);

    Assert.assertEquals(reactionSet.getReactionCount(), numberOfReactions);
    IReaction reaction = null;
    for (int i = 0; i < numberOfReactions; i++) {
      reaction = reactionSet.getReaction(i);
      Assert.assertNotNull(reaction);
    }
    return reaction;
  }
Exemplo n.º 2
0
  private IMolecule checkForXMoleculeFile(IChemFile chemFile, int numberOfMolecules) {
    Assert.assertNotNull(chemFile);

    Assert.assertEquals(chemFile.getChemSequenceCount(), 1);
    org.openscience.cdk.interfaces.IChemSequence seq = chemFile.getChemSequence(0);
    Assert.assertNotNull(seq);

    Assert.assertEquals(seq.getChemModelCount(), 1);
    org.openscience.cdk.interfaces.IChemModel model = seq.getChemModel(0);
    Assert.assertNotNull(model);

    org.openscience.cdk.interfaces.IMoleculeSet moleculeSet = model.getMoleculeSet();
    Assert.assertNotNull(moleculeSet);

    Assert.assertEquals(moleculeSet.getMoleculeCount(), numberOfMolecules);
    IMolecule mol = null;
    for (int i = 0; i < numberOfMolecules; i++) {
      mol = moleculeSet.getMolecule(i);
      Assert.assertNotNull(mol);
    }
    return mol;
  }