Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added unit test to see if descriptor specifications refer to existing…

… BODO entries

Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information...
commit 7c33f88375c7e3bf31c3007445900e8e219769aa 1 parent 0ffd85b
@egonw egonw authored rajarshi committed
View
19 src/test/org/openscience/cdk/qsar/descriptors/molecular/MolecularDescriptorTest.java
@@ -26,14 +26,17 @@
import org.junit.Ignore;
import org.junit.Test;
import org.openscience.cdk.DefaultChemObjectBuilder;
+import org.openscience.cdk.dict.Dictionary;
+import org.openscience.cdk.dict.DictionaryDatabase;
+import org.openscience.cdk.dict.Entry;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomType;
import org.openscience.cdk.interfaces.IBond;
-import org.openscience.cdk.interfaces.IMolecule;
-import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IBond.Order;
+import org.openscience.cdk.interfaces.IChemObjectBuilder;
+import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.qsar.DescriptorValue;
import org.openscience.cdk.qsar.IMolecularDescriptor;
import org.openscience.cdk.qsar.descriptors.DescriptorTest;
@@ -55,6 +58,9 @@
protected IMolecularDescriptor descriptor;
+ private static DictionaryDatabase dictDB = new DictionaryDatabase();
+ private static Dictionary dict = dictDB.getDictionary("descriptor-algorithms");
+
public MolecularDescriptorTest() {}
public void setDescriptor(Class descriptorClass) throws Exception {
@@ -68,6 +74,15 @@ public void setDescriptor(Class descriptorClass) throws Exception {
super.setDescriptor(descriptorClass);
}
+ @Test
+ public void testDescriptorIdentifierExistsInOntology() {
+ Entry ontologyEntry = dict.getEntry(
+ descriptor.getSpecification().getSpecificationReference()
+ .substring(dict.getNS().length()).toLowerCase()
+ );
+ Assert.assertNotNull(ontologyEntry);
+ }
+
@Test
public void testCalculate_IAtomContainer() {
IAtomContainer mol = null;
Please sign in to comment.
Something went wrong with that request. Please try again.