Skip to content

Commit

Permalink
Unit test for ArrayIndexOutOfBoundsException occuring when trying to …
Browse files Browse the repository at this point in the history
…clone an IAtomContainer with an IBond with no IAtoms

Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Jul 22, 2010
1 parent 890d0f5 commit d71c31c
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -196,6 +196,15 @@ public abstract class AbstractAtomContainerTest extends AbstractChemObjectTest {
Assert.assertTrue(clonedMol.contains(clonedMol.getBond(0).getAtom(1)));
}

@Test public void testClone_AtomlessIBond() throws Exception {
IAtomContainer molecule = (IAtomContainer)newChemObject();
IBond bond = molecule.getBuilder().newBond();
molecule.addBond(bond);
Assert.assertEquals(bond, molecule.getBond(0));
IAtomContainer clone = (IAtomContainer)molecule.clone();
Assert.assertEquals(0, clone.getBond(0).getAtomCount());
}

@Test public void testClone_ILonePair() throws Exception {
IAtomContainer molecule = (IAtomContainer)newChemObject();
IAtom atom1 = molecule.getBuilder().newAtom("C");
Expand Down

0 comments on commit d71c31c

Please sign in to comment.