Skip to content

Commit

Permalink
Test cases for MCS updated
Browse files Browse the repository at this point in the history
Signed-off-by: Syed Asad Rahman <s9asad@gmail.com>
Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information
asad authored and rajarshi committed May 20, 2010
1 parent c4d3bf9 commit 15fa35a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 36 deletions.
39 changes: 3 additions & 36 deletions src/test/org/openscience/cdk/smsd/SMSDTest.java
Expand Up @@ -80,7 +80,6 @@ public void tearDown() {

/**
* Test of init method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -99,7 +98,6 @@ public void testInit_3args_1() throws CDKException {

/**
* Test of init method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand Down Expand Up @@ -140,7 +138,6 @@ public void testSearchMCS() throws CDKException {

/**
* Test of set method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand Down Expand Up @@ -203,7 +200,6 @@ public void testSet_String_String() throws CDKException, IOException {

/**
* Test of set method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -223,7 +219,6 @@ public void testSet_MolHandler_MolHandler() throws CDKException {

/**
* Test of getAllAtomMapping method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -243,7 +238,6 @@ public void testGetAllAtomMapping() throws CDKException {

/**
* Test of getAllMapping method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -263,7 +257,6 @@ public void testGetAllMapping() throws CDKException {

/**
* Test of getFirstAtomMapping method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -283,7 +276,6 @@ public void testGetFirstAtomMapping() throws CDKException {

/**
* Test of getFirstMapping method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -303,7 +295,6 @@ public void testGetFirstMapping() throws CDKException {

/**
* Test of setChemFilters method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -321,7 +312,6 @@ public void testSetChemFilters() throws CDKException {

/**
* Test of getFragmentSize method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -340,7 +330,6 @@ public void testGetFragmentSize() throws CDKException {

/**
* Test of getStereoScore method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -359,7 +348,6 @@ public void testGetStereoScore() throws CDKException {

/**
* Test of getEnergyScore method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -378,7 +366,6 @@ public void testGetEnergyScore() throws CDKException {

/**
* Test of getReactantMolecule method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -397,7 +384,6 @@ public void testGetReactantMolecule() throws CDKException {

/**
* Test of getProductMolecule method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand Down Expand Up @@ -435,7 +421,6 @@ public void testGetTanimotoSimilarity() throws Exception {

/**
* Test of isStereoMisMatch method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand All @@ -453,7 +438,6 @@ public void testIsStereoMisMatch() throws CDKException {

/**
* Test of isSubgraph method, of class SMSD.
* @throws InvalidSmilesException
* @throws CDKException
*/
@Test
Expand Down Expand Up @@ -545,33 +529,16 @@ public void testQueryAtomContainerSubstructure() throws CDKException {
Assert.assertTrue(foundMatches);
}

@Test
public void testQueryAtomContainerTurbo() throws CDKException {
SMSD smsd = new SMSD(Algorithm.TURBOMCS, true);
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IAtomContainer query = sp.parseSmiles("CC");
IAtomContainer target = sp.parseSmiles("C1CCC12CCCC2");

smsd.init(query, target, false);
boolean foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);

IQueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query);
smsd.init(queryContainer, target, false);
foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);
}

@Test
public void testQueryAtomSingle() throws CDKException {
SMSD smsd = new SMSD(Algorithm.DEFAULT, true);
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IAtomContainer query = sp.parseSmiles("C");
IAtomContainer target = sp.parseSmiles("CC");
IAtomContainer query = sp.parseSmiles("CC");
IAtomContainer target = sp.parseSmiles("C1CCC12CCCC2");

smsd.init(query, target, false);
boolean foundMatches = smsd.isSubgraph();
Assert.assertEquals(1, smsd.getFirstMapping().size());
Assert.assertEquals(18, smsd.getAllAtomMapping().size());
Assert.assertTrue(foundMatches);

IQueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query);
Expand Down
20 changes: 20 additions & 0 deletions src/test/org/openscience/cdk/smsd/interfaces/AbstractMCSTest.java
Expand Up @@ -357,5 +357,25 @@ public Map<IAtom, IAtom> getFirstAtomMapping() {
public Map<Integer, Integer> getFirstMapping() {
return null;
}

@Override
public double getBondSensitiveTimeOut() {
throw new UnsupportedOperationException("Not supported yet.");
}

@Override
public void setBondSensitiveTimeOut(double bondSensitiveTimeOut) {
throw new UnsupportedOperationException("Not supported yet.");
}

@Override
public double getBondInSensitiveTimeOut() {
throw new UnsupportedOperationException("Not supported yet.");
}

@Override
public void setBondInSensitiveTimeOut(double bondInSensitiveTimeOut) {
throw new UnsupportedOperationException("Not supported yet.");
}
}
}

0 comments on commit 15fa35a

Please sign in to comment.