From: Stefan K. <sh...@us...> - 2005-11-30 17:31:42
|
Update of /cvsroot/cdk/cdk/src/org/openscience/cdk/test/tools/manipulator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10267/src/org/openscience/cdk/test/tools/manipulator Modified Files: ManipulatorsTests.java Added Files: SetOfAtomContainersManipulatorTest.java Log Message: added a test --- NEW FILE: SetOfAtomContainersManipulatorTest.java --- /* $RCSfile: SetOfAtomContainersManipulatorTest.java,v $ * $Author: shk3 $ * $Date: 2005/11/30 17:31:34 $ * $Revision: 1.1 $ * * Copyright (C) 2003-2005 The Chemistry Development Kit (CDK) project * * Contact: cdk...@li... * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ package org.openscience.cdk.test.tools.manipulator; import junit.framework.Test; import junit.framework.TestSuite; import org.openscience.cdk.Atom; import org.openscience.cdk.AtomContainer; import org.openscience.cdk.Bond; import org.openscience.cdk.SetOfAtomContainers; import org.openscience.cdk.SetOfMolecules; import org.openscience.cdk.test.CDKTestCase; import org.openscience.cdk.tools.manipulator.SetOfAtomContainersManipulator; /** * @cdk.module test * * @author Kai Hartmann * @cdk.created 2004-02-20 */ public class SetOfAtomContainersManipulatorTest extends CDKTestCase { SetOfMolecules som = new SetOfMolecules(); public SetOfAtomContainersManipulatorTest(String name) { super(name); } public static Test suite() { TestSuite suite = new TestSuite(SetOfAtomContainersManipulatorTest.class); return suite; } public void testRemoveAtomAndConnectedElectronContainers() { AtomContainer ac=new AtomContainer(); ac.addAtom(new Atom("C")); // 1 ac.addAtom(new Atom("C")); // 2 ac.addAtom(new Atom("C")); // 3 ac.addBond(new Bond(ac.getAtomAt(0),ac.getAtomAt(1),1)); ac.addBond(new Bond(ac.getAtomAt(1),ac.getAtomAt(2),1)); SetOfAtomContainers soac=new SetOfAtomContainers(); soac.addAtomContainer(ac); SetOfAtomContainersManipulator.removeAtomAndConnectedElectronContainers(soac,ac.getAtomAt(1)); assertEquals(2, soac.getAtomContainerCount(), 0.000001); } } Index: ManipulatorsTests.java =================================================================== RCS file: /cvsroot/cdk/cdk/src/org/openscience/cdk/test/tools/manipulator/ManipulatorsTests.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ManipulatorsTests.java 22 Oct 2005 16:26:36 -0000 1.4 +++ ManipulatorsTests.java 30 Nov 2005 17:31:34 -0000 1.5 @@ -39,6 +39,7 @@ suite.addTest(ReactionManipulatorTest.suite()); suite.addTest(SetOfMoleculesManipulatorTest.suite()); suite.addTest(AtomContainerManipulatorTest.suite()); + suite.addTest(SetOfAtomContainersManipulatorTest.suite()); return suite; } |