@Test public void testSetDonor_boolean() { boolean donor = true; IAtomType a = (IAtomType) newChemObject(); a.setFlag(CDKConstants.IS_HYDROGENBOND_DONOR, donor); Assert.assertTrue(a.getFlag(CDKConstants.IS_HYDROGENBOND_DONOR)); }
@Test public void testSetIsAromatic_boolean() { IAtomType a = (IAtomType) newChemObject(); a.setFlag(CDKConstants.ISAROMATIC, true); Assert.assertTrue(a.getFlag(CDKConstants.ISAROMATIC)); }
@Test public void testSetAcceptor_boolean() { boolean acceptor = true; IAtomType a = (IAtomType) newChemObject(); a.setFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR, acceptor); Assert.assertTrue(a.getFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR)); }
atom.setHybridization(atomType.getHybridization()); atom.setFormalNeighbourCount(atomType.getFormalNeighbourCount()); atom.setFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR, atomType.getFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR)); atom.setFlag(CDKConstants.IS_HYDROGENBOND_DONOR, atomType.getFlag(CDKConstants.IS_HYDROGENBOND_DONOR)); Object constant = atomType.getProperty(CDKConstants.CHEMICAL_GROUP_CONSTANT); if (constant != null) { atom.setProperty(CDKConstants.CHEMICAL_GROUP_CONSTANT, constant); if (atomType.getFlag(CDKConstants.ISAROMATIC)) atom.setFlag(CDKConstants.ISAROMATIC, atomType.getFlag(CDKConstants.ISAROMATIC));
@Test public void testConfigure_IAtom_IAtomType() { IAtom atom = new Atom(Elements.CARBON); IAtomType atomType = new AtomType(Elements.CARBON); atomType.setFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR, true); AtomTypeManipulator.configure(atom, atomType); Assert.assertEquals(atomType.getFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR), atom.getFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR)); }
Assert.assertEquals("S-[2];[H]{0,3}+=C.*+", atomType.getProperty(CDKConstants.SPHERICAL_MATCHER)); Assert.assertEquals(Hybridization.SP2, atomType.getHybridization()); Assert.assertTrue(atomType.getFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR)); Assert.assertEquals(5, atomType.getProperty(CDKConstants.PART_OF_RING_OF_SIZE));