Skip to content

Commit

Permalink
Additional testing, based on bond order information, now possible
Browse files Browse the repository at this point in the history
Change-Id: I5585560edab76b3e96434698c786ef9919be18a7
Signed-off-by: John May <john.wilkinsonmay@gmail.com>
  • Loading branch information
egonw committed Oct 7, 2012
1 parent 001f488 commit 8e00a75
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/org/openscience/cdk/atomtype/AbstractAtomTypeTest.java
Expand Up @@ -36,7 +36,9 @@
import org.openscience.cdk.interfaces.IAtomType;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IBond.Order;
import org.openscience.cdk.tools.manipulator.AtomTypeManipulator;
import org.openscience.cdk.tools.manipulator.BondManipulator;

/**
* Helper class that all atom type matcher test classes must implement.
Expand Down Expand Up @@ -144,6 +146,15 @@ private void assertConsistentProperties(IAtomContainer mol, IAtom atom, IAtomTyp
connectionCount > matched.getFormalNeighbourCount()
);
}
if (matched.getMaxBondOrder() != null) {
Order expectedMax = matched.getMaxBondOrder();
Order maxBondOrder = BondManipulator.getMaximumBondOrder(connections);
Assert.assertTrue(
"The highest bond order exceeds the maximum for the atom type",
BondManipulator.isHigherOrder(expectedMax, maxBondOrder) |
expectedMax == maxBondOrder
);
}
}

public void assertAtomType(Map<String, Integer> testedAtomTypes, String expectedID, IAtomType foundAtomType) {
Expand Down

0 comments on commit 8e00a75

Please sign in to comment.