Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ca Atom type test case added

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information...
commit 517dd0c4072f6a6d3a7f5b8be141b6c699a433c5 1 parent b91943a
Syed Asad Rahman asad authored committed
Showing with 41 additions and 0 deletions.
  1. +41 −0 src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
41 src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
View
@@ -1731,6 +1731,47 @@ public void test_Hg_2() throws Exception {
expectedTypes = new String[]{"Al.3plus"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}
+
+ @Test
+ public void fix_Ca_2() throws Exception {
+ String molName = "Ca_2";
+ IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
+ IMolecule mol = builder.newInstance(IMolecule.class);
+ IAtom a1 = builder.newInstance(IAtom.class, "Ca");
+ a1.setFormalCharge(0);
+ mol.addAtom(a1);
+ IAtom a2 = builder.newInstance(IAtom.class, "C");
+ a2.setFormalCharge(0);
+ mol.addAtom(a2);
+ IAtom a3 = builder.newInstance(IAtom.class, "C");
+ a3.setFormalCharge(0);
+ mol.addAtom(a3);
+ IBond b1 = builder.newInstance(IBond.class, a1, a2, IBond.Order.SINGLE);
+ mol.addBond(b1);
+ IBond b2 = builder.newInstance(IBond.class, a1, a3, IBond.Order.SINGLE);
+ mol.addBond(b2);
+
+ String[] expectedTypes = {"Ca.2", "C.sp3", "C.sp3"};
+ assertAtomTypes(testedAtomTypes, expectedTypes, mol);
+ }
+
+ @Test
+ public void fix_Ca_1() throws Exception {
+ String molName1 = "Ca_1";
+ IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
+ IMolecule mol = builder.newInstance(IMolecule.class);
+ IAtom a1 = builder.newInstance(IAtom.class, "Ca");
+ a1.setFormalCharge(0);
+ mol.addAtom(a1);
+ IAtom a2 = builder.newInstance(IAtom.class, "C");
+ a2.setFormalCharge(0);
+ mol.addAtom(a2);
+ IBond b1 = builder.newInstance(IBond.class, a1, a2, IBond.Order.DOUBLE);
+ mol.addBond(b1);
+
+ String[] expectedTypes1 = {"Ca.1", "C.sp2"};
+ assertAtomTypes(testedAtomTypes, expectedTypes1, mol);
+ }
@Test public void testCyclopentadienyl() throws Exception {
IAtomContainer cp = new Molecule();
Please sign in to comment.
Something went wrong with that request. Please try again.