This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
forked from JChemPaint/jchempaint
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
catch exactly what's thrown below ControllerHub.generateNewCoords; ad…
…d test for JChemPaint#165 = CDK1269
- Loading branch information
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.openscience.jchempaint; | ||
|
||
import org.fest.swing.fixture.JPanelFixture; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.openscience.cdk.interfaces.IAtom; | ||
import org.openscience.cdk.interfaces.IAtomContainer; | ||
|
||
/** | ||
* @author Ralf Stephan <[email protected]> | ||
* | ||
* Tests chiral SMILES input with following cleanup. | ||
* See also #165. | ||
*/ | ||
public class CDK1269Test extends AbstractAppletTest { | ||
|
||
@Test public void testCDK1269() { | ||
JPanelFixture jcppanel=applet.panel("appletframe"); | ||
JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target; | ||
try { | ||
jcpApplet.setSmiles("O=C(O)[C@H](N)C"); // L-alanine | ||
panel.get2DHub().updateView(); | ||
applet.panel("renderpanel").robot.waitForIdle(); | ||
panel.get2DHub().cleanup(); | ||
panel.get2DHub().updateView(); | ||
applet.panel("renderpanel").robot.waitForIdle(); | ||
} catch (Throwable e) { | ||
Assert.fail(); | ||
} | ||
/* | ||
int atomCount=0, bondCount=0, implicitHCount=0; | ||
for(IAtomContainer atc : panel.getChemModel().getMoleculeSet().atomContainers()) { | ||
for (IAtom a : atc.atoms()) | ||
implicitHCount += a.getImplicitHydrogenCount(); | ||
atomCount+=atc.getAtomCount(); | ||
bondCount+=atc.getBondCount(); | ||
} | ||
Assert.assertEquals(7, atomCount); | ||
Assert.assertEquals(6, bondCount); | ||
Assert.assertEquals(6, implicitHCount);*/ | ||
} | ||
|
||
} |