Skip to content

Commit

Permalink
SMSD Test cases updated as per new code Signed-off-by: Syed Asad Rahm…
Browse files Browse the repository at this point in the history
…an <s9asad@gmail.com>

Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information
asad authored and rajarshi committed Jun 26, 2010
1 parent 3266460 commit 8f3c70a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Expand Up @@ -94,6 +94,7 @@ public void testCDKMCS() throws Exception {

@Test
public void testMCSPlus() throws Exception {
//TO DO fix me this error
SMSD ebimcs = new SMSD(Algorithm.MCSPlus, false);
ebimcs.init(Cyclohexane, Benzene, true);
ebimcs.setChemFilters(true, true, true);
Expand Down Expand Up @@ -169,7 +170,7 @@ public void testCyclopropaneNotASubgraphOfIsoButane() throws Exception {
Assert.assertEquals(false, comparison.isSubgraph());
Assert.assertEquals(new Double(0.75), new Double(comparison.getTanimotoSimilarity()));
Assert.assertEquals(3, comparison.getFirstMapping().size());
Assert.assertEquals(18, comparison.getAllMapping().size());
Assert.assertEquals(6, comparison.getAllMapping().size());

This comment has been minimized.

Copy link
@egonw

egonw Jun 26, 2010

Member

You really need to document what is happening here... was this a bug? This is one serious API change... what happened here? Details, please.

}

@Test
Expand Down
6 changes: 3 additions & 3 deletions src/test/org/openscience/cdk/smsd/SMSDBondSensitiveTest.java
Expand Up @@ -134,7 +134,7 @@ public void testMCSPlus() throws Exception {
SMSD ebimcs = new SMSD(Algorithm.MCSPlus, true);
ebimcs.init(Cyclohexane, Benzene, true);
ebimcs.setChemFilters(true, true, true);
Assert.assertEquals(true, ebimcs.isSubgraph());
Assert.assertEquals(false, ebimcs.isSubgraph());
}

@Test
Expand All @@ -153,7 +153,7 @@ public void testSMSD() throws Exception {
SMSD ebimcs = new SMSD(Algorithm.DEFAULT, true);
ebimcs.init(Cyclohexane, Benzene, true);
ebimcs.setChemFilters(true, true, true);
Assert.assertEquals(6, ebimcs.getFirstMapping().size());
Assert.assertEquals(1, ebimcs.getFirstMapping().size());

SMSD ebimcs1 = new SMSD(Algorithm.DEFAULT, true);
ebimcs1.init(Benzene, Napthalene, true);
Expand Down Expand Up @@ -196,7 +196,7 @@ public void testSMSDBondSensitive() throws Exception {
ebimcs3.setChemFilters(true, true, true);
BondType bondType = BondType.getInstance();
System.out.println(bondType.isBondSensitive());
Assert.assertEquals(6, ebimcs3.getFirstAtomMapping().size());
Assert.assertEquals(1, ebimcs3.getFirstAtomMapping().size());

SMSD ebimcs4 = new SMSD(Algorithm.CDKMCS, true);
ebimcs4.init(Benzene, Napthalene, true);
Expand Down
Expand Up @@ -64,9 +64,9 @@ public void testSearchMCS() throws InvalidSmilesException {
target.addAtomContainer(target1);
FragmentMatcher instance = new FragmentMatcher(source, target, true);
instance.searchMCS();
Assert.assertEquals(2, instance.getAllAtomMapping().size());
Assert.assertEquals(1, instance.getAllAtomMapping().size());
Assert.assertEquals(7, instance.getFirstAtomMapping().size());
Assert.assertEquals(2, instance.getAllMapping().size());
Assert.assertEquals(1, instance.getAllMapping().size());
Assert.assertEquals(7, instance.getFirstMapping().size());
}

Expand All @@ -89,7 +89,7 @@ public void testGetAllAtomMapping() throws InvalidSmilesException {
target.addAtomContainer(target1);
FragmentMatcher instance = new FragmentMatcher(source, target, true);
instance.searchMCS();
Assert.assertEquals(2, instance.getAllAtomMapping().size());
Assert.assertEquals(1, instance.getAllAtomMapping().size());
}

/**
Expand All @@ -111,7 +111,7 @@ public void testGetAllMapping() throws InvalidSmilesException {
target.addAtomContainer(target1);
FragmentMatcher instance = new FragmentMatcher(source, target, true);
instance.searchMCS();
Assert.assertEquals(2, instance.getAllMapping().size());
Assert.assertEquals(1, instance.getAllMapping().size());
}

/**
Expand Down
Expand Up @@ -85,7 +85,7 @@ public void testSortResultsByStereoAndBondMatch() throws Exception {
SMSD smsd1 = new SMSD(Algorithm.DEFAULT, false);
smsd1.init(queryac, target, true);
smsd1.setChemFilters(true, false, false);
assertEquals(1, smsd1.getAllAtomMapping().size());
assertEquals(3, smsd1.getAllAtomMapping().size());
}

/**
Expand All @@ -103,7 +103,7 @@ public void testSortResultsByFragments() throws InvalidSmilesException, CDKExcep
SMSD smsd = new SMSD(Algorithm.DEFAULT, false);
smsd.init(queryac, target, true);
smsd.setChemFilters(false, false, false);
assertEquals(6, smsd.getAllAtomMapping().size());
assertEquals(4, smsd.getAllAtomMapping().size());

SMSD smsd1 = new SMSD(Algorithm.DEFAULT, false);
smsd1.init(queryac, target, true);
Expand All @@ -125,7 +125,7 @@ public void testSortResultsByEnergies() throws Exception {
SMSD smsd = new SMSD(Algorithm.DEFAULT, false);
smsd.init(queryac, target, true);
smsd.setChemFilters(false, false, false);
assertEquals(6, smsd.getAllAtomMapping().size());
assertEquals(4, smsd.getAllAtomMapping().size());

SMSD smsd1 = new SMSD(Algorithm.DEFAULT, false);
smsd1.init(queryac, target, true);
Expand Down

0 comments on commit 8f3c70a

Please sign in to comment.