User 6686efeff7
17-04-2009 13:47:33
UpdateHandler not updating certain smiles strings the update either
* Throws a ClassCastException or
* The update thread blocks indefinitely
the following code is apart of a unit test I wrote to test this, I will also add the the full Unit test to this thread
public void testAddSmiles1() throws Exception
{
// this succeeds
addSmiles("c1ccccc1");
}
public void testAddSmiles2() throws Exception
{
// throws a ClassCastException
addSmiles("CCCCC[C@H](OO)\\\\C=C\\\\C=C/CCCCCCCC(O)=O");
}
public void testAddSmiles3() throws Exception
{
// this test blocks
addSmiles("[H]C(\\\\C=C/CCCCCCCC(O)=O)=C1O[C@H]1C\\\\C=C/CC");
}
private void addSmiles(String smiles) throws Exception
{
assert ( SMILESRecognizer.canBeSMILES( smiles ) );
UpdateHandler handler = new UpdateHandler();
handler.init( connectionHandler, UpdateHandler.INSERT, TABLE_NAME, null);
handler.setStructure( smiles );
handler.execute();
}
JChem version 5.1.2
Java versions tested 1.4 and 1.6