Skip to content

Commit

Permalink
Added a missing test, and updated a test for the getBitFingerprint me…
Browse files Browse the repository at this point in the history
…thod

Change-Id: Ia55fc14ab78ae1c66f6d288997a46230652d29a1

Signed-off-by: jonalv <jonathan.alvarsson@gmail.com>
  • Loading branch information
egonw committed Aug 2, 2012
1 parent 56caf17 commit 47e2f1d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Expand Up @@ -61,7 +61,7 @@ public SignatureFingerprinter(int depth) {
this.signatureDepth = depth;
}

@TestMethod("testUnsupportedMethod")
@TestMethod("testBitFingerprint")
public IBitFingerprint getBitFingerprint(IAtomContainer atomContainer) throws CDKException {
return new IntArrayFingerprint(getRawFingerprint(atomContainer));
}
Expand All @@ -88,6 +88,7 @@ public int getSize() {
}

@Override
@TestMethod("testCountFingerprint")
public ICountFingerprint getCountFingerprint(IAtomContainer container)
throws CDKException {
return new IntArrayCountFingerprint(getRawFingerprint(container));
Expand Down
Expand Up @@ -59,11 +59,23 @@ public void testFingerprint() throws Exception {
}
}

@Test(expected=UnsupportedOperationException.class)
public void testUnsupportedMethod() throws Exception {
@Test
public void testBitFingerprint() throws Exception {
SignatureFingerprinter fingerprinter = new SignatureFingerprinter(0);
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IAtomContainer mol = sp.parseSmiles("O(NC)CC");
IBitFingerprint bitFP = fingerprinter.getBitFingerprint(mol);
Assert.assertNotNull(bitFP);
Assert.assertNotSame(0, bitFP.size());
}

@Test
public void testCountFingerprint() throws Exception {
SignatureFingerprinter fingerprinter = new SignatureFingerprinter(0);
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IAtomContainer mol = sp.parseSmiles("O(NC)CC");
fingerprinter.getBitFingerprint(mol);
ICountFingerprint bitFP = fingerprinter.getCountFingerprint(mol);
Assert.assertNotNull(bitFP);
Assert.assertNotSame(0, bitFP.size());
}
}

0 comments on commit 47e2f1d

Please sign in to comment.