/** {@inheritDoc} */ @Override public Integer getMassNumber() { logger.debug("Getting mass number: ", super.getMassNumber()); return super.getMassNumber(); }
@Test public void testConfigure_IAtom_IIsotope() throws Exception { Isotopes isofac = Isotopes.getInstance(); Atom atom = new Atom("H"); IIsotope isotope = new org.openscience.cdk.Isotope("H", 2); isofac.configure(atom, isotope); Assert.assertEquals(2, atom.getMassNumber().intValue()); }
/** * Test roundtripping of MassNumber. * @throws Exception */ @Test public void testMassNumber() throws Exception { IAtomContainer mol = new AtomContainer(); Atom atom = new Atom("C"); atom.setMassNumber(new Integer(12)); mol.addAtom(atom); Assert.assertEquals(12, atom.getMassNumber().intValue()); IAtomContainer roundTrippedMol = CMLRoundTripTool.roundTripMolecule(convertor, mol); Assert.assertEquals(1, roundTrippedMol.getAtomCount()); IAtom roundTrippedAtom = roundTrippedMol.getAtom(0); Assert.assertEquals(atom.getMassNumber(), roundTrippedAtom.getMassNumber()); }
@Test public void testConfigure_IAtom_IIsotope() throws Exception { XMLIsotopeFactory isofac = XMLIsotopeFactory.getInstance(new ChemObject().getBuilder()); Atom atom = new Atom("H"); IIsotope isotope = new org.openscience.cdk.Isotope("H", 2); isofac.configure(atom, isotope); Assert.assertEquals(2, atom.getMassNumber().intValue()); }
@Test public void testIsotope() throws Exception { IAtomContainer mol = new AtomContainer(); Atom atom = new Atom("C"); atom.setMassNumber(13); mol.addAtom(atom); IAtomContainer roundTrippedMol = CMLRoundTripTool.roundTripMolecule(convertor, mol); Assert.assertEquals(1, roundTrippedMol.getAtomCount()); IAtom roundTrippedAtom = roundTrippedMol.getAtom(0); Assert.assertEquals(atom.getMassNumber(), roundTrippedAtom.getMassNumber()); }