コード例 #1
0
 @Test
 public void testConfigureUnsetProperties() {
   IAtom atom = new NNAtom(Elements.CARBON);
   IAtomType atomType = new NNAtomType(Elements.CARBON);
   atomType.setExactMass(12.0);
   AtomTypeManipulator.configureUnsetProperties(atom, atomType);
   Assert.assertEquals(12.0, atom.getExactMass(), 0.1);
 }
コード例 #2
0
  @Test
  public void testIsotopicMass() throws Exception {
    String cmlString =
        "<molecule><atomArray><atom id='a1' elementType=\"C\"><scalar dataType=\"xsd:float\" dictRef=\"cdk:isotopicMass\">12.0</scalar></atom></atomArray></molecule>";

    IChemFile chemFile = parseCMLString(cmlString);
    IMolecule mol = checkForSingleMoleculeFile(chemFile);

    Assert.assertEquals(1, mol.getAtomCount());
    IAtom atom = mol.getAtom(0);
    Assert.assertEquals("C", atom.getSymbol());
    Assert.assertEquals(12.0, atom.getExactMass().doubleValue(), 0.01);
  }