use of ambit2.core.groups.DataGroup in project ambit-mirror by ideaconsult.
the class MDLV2000ReaderExtendedTest method testRGroup.
@Test
public void testRGroup() throws Exception {
IChemObject mol = readSGroup("rgroup.mol");
Assert.assertNotNull(mol);
Assert.assertTrue(mol instanceof SuppleAtomContainer);
SuppleAtomContainer sca = (SuppleAtomContainer) mol;
sca.setFiltered(false);
Assert.assertEquals(18, sca.getBondCount());
Assert.assertEquals(19 + 2, sca.getAtomCount());
List<ISGroup> superatom = getGroup(sca);
Assert.assertNotNull(superatom);
Assert.assertEquals(2, superatom.size());
int sru = 0;
int dat = 0;
for (int i = 0; i < superatom.size(); i++) {
if (superatom.get(i) instanceof StructureRepeatingUnit) {
Assert.assertEquals("3,5-7", superatom.get(i).getSubscript());
sru++;
} else if (superatom.get(i) instanceof DataGroup) {
dat++;
Assert.assertNotNull(((DataGroup) superatom.get(i)).getMulticenter());
}
}
Assert.assertEquals(1, sru);
Assert.assertEquals(1, dat);
sca.setFiltered(true);
verify((IAtomContainer) mol, superatom, true, 19, 18, true);
verify((IAtomContainer) mol, superatom, false, 19, 18, true);
}
Aggregations