From: <sh...@us...> - 2009-07-29 15:46:41
|
Revision: 14687 http://cdk.svn.sourceforge.net/cdk/?rev=14687&view=rev Author: shk3 Date: 2009-07-29 15:46:30 +0000 (Wed, 29 Jul 2009) Log Message: ----------- started a automated gui testing Modified Paths: -------------- jchempaint/trunk/.classpath jchempaint/trunk/src/main/org/openscience/jchempaint/JChemPaintMenuHelper.java jchempaint/trunk/src/main/org/openscience/jchempaint/action/CreateSmilesAction.java jchempaint/trunk/src/main/org/openscience/jchempaint/dialog/TextViewDialog.java Added Paths: ----------- jchempaint/trunk/lib/fest-assert-1.1.jar jchempaint/trunk/lib/fest-reflect-1.1.jar jchempaint/trunk/lib/fest-swing-1.2a2.jar jchempaint/trunk/lib/fest-util-1.1.jar jchempaint/trunk/lib/testng-5.10-jdk15.jar jchempaint/trunk/src/test/org/ jchempaint/trunk/src/test/org/openscience/ jchempaint/trunk/src/test/org/openscience/jchempaint/ jchempaint/trunk/src/test/org/openscience/jchempaint/JCPEditorAppletTest.java Property Changed: ---------------- jchempaint/trunk/ Property changes on: jchempaint/trunk ___________________________________________________________________ Modified: svn:ignore - bin dist ant.properties build + bin dist ant.properties build test-output Modified: jchempaint/trunk/.classpath =================================================================== --- jchempaint/trunk/.classpath 2009-07-22 16:17:28 UTC (rev 14686) +++ jchempaint/trunk/.classpath 2009-07-29 15:46:30 UTC (rev 14687) @@ -1,11 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry excluding="org/openscience/jchempaint/TestEditor.java|org/openscience/jchempaint/TestRenderer.java" kind="src" path="src/main"/> + <classpathentry kind="src" path="src/test"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="lib" path="lib/commons-cli.jar"/> <classpathentry kind="lib" path="lib/jfontchooser.jar"/> <classpathentry kind="lib" path="po/classes"/> - <classpathentry combineaccessrules="false" kind="src" path="/org.openscience.cdk"/> + <classpathentry kind="lib" path="lib/fest-swing-1.2a2.jar"/> + <classpathentry kind="lib" path="lib/testng-5.10-jdk15.jar"/> + <classpathentry kind="lib" path="lib/fest-util-1.1.jar"/> + <classpathentry kind="lib" path="lib/fest-assert-1.1.jar"/> + <classpathentry kind="lib" path="lib/fest-reflect-1.1.jar"/> + <classpathentry combineaccessrules="false" kind="src" path="/jchempaint-primary"/> <classpathentry kind="output" path="bin"/> </classpath> Added: jchempaint/trunk/lib/fest-assert-1.1.jar =================================================================== (Binary files differ) Property changes on: jchempaint/trunk/lib/fest-assert-1.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: jchempaint/trunk/lib/fest-reflect-1.1.jar =================================================================== (Binary files differ) Property changes on: jchempaint/trunk/lib/fest-reflect-1.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: jchempaint/trunk/lib/fest-swing-1.2a2.jar =================================================================== (Binary files differ) Property changes on: jchempaint/trunk/lib/fest-swing-1.2a2.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: jchempaint/trunk/lib/fest-util-1.1.jar =================================================================== (Binary files differ) Property changes on: jchempaint/trunk/lib/fest-util-1.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: jchempaint/trunk/lib/testng-5.10-jdk15.jar =================================================================== (Binary files differ) Property changes on: jchempaint/trunk/lib/testng-5.10-jdk15.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/JChemPaintMenuHelper.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/JChemPaintMenuHelper.java 2009-07-22 16:17:28 UTC (rev 14686) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/JChemPaintMenuHelper.java 2009-07-29 15:46:30 UTC (rev 14687) @@ -74,6 +74,7 @@ protected JComponent createMenu(JChemPaintPanel jcpPanel, String key, boolean isPopup, String guiString) { logger.debug("Creating menu: ", key); JMenu menu = new JMenu(JCPMenuTextMaker.getInstance(jcpPanel.getGuistring()).getText(key)); + menu.setName(key); return createMenu(jcpPanel, key, isPopup, guiString, menu); } @@ -147,6 +148,7 @@ else { mi = new JMenuItem(translation); } + mi.setName(cmd); logger.debug("Created new menu item..."); String astr = JCPPropertyHandler.getInstance().getResourceString(cmd + JCPAction.actionSuffix); if (astr == null) { Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/action/CreateSmilesAction.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/action/CreateSmilesAction.java 2009-07-22 16:17:28 UTC (rev 14686) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/action/CreateSmilesAction.java 2009-07-29 15:46:30 UTC (rev 14687) @@ -66,6 +66,7 @@ if (dialog == null) { dialog = new TextViewDialog(frame, "SMILES", null, false, 40, 2); + dialog.setName("smilestextdialog"); } String smiles = ""; String chiralsmiles =""; Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/dialog/TextViewDialog.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/dialog/TextViewDialog.java 2009-07-22 16:17:28 UTC (rev 14686) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/dialog/TextViewDialog.java 2009-07-29 15:46:30 UTC (rev 14687) @@ -93,6 +93,7 @@ super(fr, title, true); textArea = new JTextArea(width,height); textArea.setEditable(false); + textArea.setName("textviewdialogtextarea"); if (wrap) { textArea.setLineWrap(wrap); textArea.setWrapStyleWord(true); Added: jchempaint/trunk/src/test/org/openscience/jchempaint/JCPEditorAppletTest.java =================================================================== --- jchempaint/trunk/src/test/org/openscience/jchempaint/JCPEditorAppletTest.java (rev 0) +++ jchempaint/trunk/src/test/org/openscience/jchempaint/JCPEditorAppletTest.java 2009-07-29 15:46:30 UTC (rev 14687) @@ -0,0 +1,41 @@ +package org.openscience.jchempaint; + +import java.util.HashMap; +import java.util.Map; + +import org.fest.swing.applet.AppletViewer; +import org.fest.swing.fixture.FrameFixture; +import org.fest.swing.launcher.AppletLauncher; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openscience.jchempaint.applet.JChemPaintEditorApplet; + +public class JCPEditorAppletTest { + private static AppletViewer viewer; + private static FrameFixture applet; + + + @BeforeClass public static void setUp() { + Map<String, String> parameters = new HashMap<String, String>(); + parameters.put("smiles", "CCCCCCCC"); + viewer = AppletLauncher.applet(new JChemPaintEditorApplet()) + .withParameters(parameters) + .start(); + applet = new FrameFixture(viewer); + applet.show(); + } + + @Test public void testReportSmiles() { + applet.menuItem("createSMILES").click(); + String text = applet.dialog("smilestextdialog").textBox("textviewdialogtextarea").text(); + Assert.assertTrue(text.indexOf("CCCCCCCC")>-1); + Assert.assertTrue(text.indexOf("[H]C([H])([H])C([H])([H])C([H])([H])C([H])([H])C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H]")>-1); + } + + @AfterClass public static void tearDown() { + viewer.unloadApplet(); + applet.cleanUp(); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |