Author: vpakan(a)redhat.com
Date: 2010-11-12 04:51:18 -0500 (Fri, 12 Nov 2010)
New Revision: 26494
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java
Log:
Added Min Max Panes Test
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-11-12
09:41:44 UTC (rev 26493)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-11-12
09:51:18 UTC (rev 26494)
@@ -551,7 +551,7 @@
public static final String BOLD_TOOLBAR_BUTTON_LABEL = "Bold";
public static final String ITALIC_TOOLBAR_BUTTON_LABEL = "Italic";
public static final String UNDERLINE_TOOLBAR_BUTTON_LABEL = "Underline";
-
+
}
public static class JBossToolsPalette{
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-11-12
09:41:44 UTC (rev 26493)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-11-12
09:51:18 UTC (rev 26494)
@@ -7,6 +7,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.BlockCommentTest;
import org.jboss.tools.vpe.ui.bot.test.editor.EditingActionsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.InsertActionsTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.MinMaxPanesTest;
import org.jboss.tools.vpe.ui.bot.test.editor.TextEditingActionsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.ToggleCommentTest;
import org.jboss.tools.vpe.ui.bot.test.editor.VerificationOfNameSpacesTest;
@@ -78,6 +79,7 @@
suite.addTestSuite(PromptForTagAttributesDuringTagInsertTest.class);
suite.addTestSuite(IncludedTagLibsTest.class);
suite.addTestSuite(SubstitutedELExressionsTest.class);
+ suite.addTestSuite(MinMaxPanesTest.class);
return new TestSetup(suite);
}
}
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java 2010-11-12
09:51:18 UTC (rev 26494)
@@ -0,0 +1,136 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor;
+
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
+
+import java.awt.event.KeyEvent;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.Result;
+import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.editor.xpl.CustomSashForm;
+import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
+/**
+ * Tests Minimize and maximize panes functionality
+ * @author vlado pakan
+ *
+ */
+public class MinMaxPanesTest extends VPEEditorTestCase {
+
+ private SWTBotExt botExt = null;
+
+ private static final String TEST_TEXT = "test text";
+
+ private static final String PAGE_TEXT = "<%@ taglib
uri=\"http://java.sun.com/jsf/html\" prefix=\"h\" %>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " <h:inputText/>" +
+ " </body>\n" +
+ "</html>";
+
+ private static final String TEST_PAGE_NAME = "MinMaxPanesTest.jsp";
+
+ private SWTBotEclipseEditor jspTextEditor;
+ private SWTBotWebBrowser webBrowser;
+
+ public MinMaxPanesTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+
+ public void testMinMaxPanes(){
+ botExt.swtBotEditorExtByTitle(MinMaxPanesTest.TEST_PAGE_NAME)
+ .selectPage(IDELabel.VisualPageEditor.VISUAL_SOURCE_TAB_LABEL);
+ final CustomSashForm csf = botExt.widgets(widgetOfType(CustomSashForm.class)).get(0);
+ // Maximize Visual Pane
+ int sashWeight = UIThreadRunnable.syncExec(new Result<Integer>() {
+ @Override
+ public Integer run() {
+ csf.maxUp();
+ return csf.getWeights()[0];
+ }
+ });
+ assertTrue("Height of Source Pane has to be 0 but is " + sashWeight, 0 ==
sashWeight);
+ // Maximize Source Pane
+ sashWeight = UIThreadRunnable.syncExec(new Result<Integer>() {
+ @Override
+ public Integer run() {
+ csf.maxDown();
+ return csf.getWeights()[1];
+ }
+ });
+ assertTrue("Height of Visual Pane has to be 0 but is " + sashWeight, 0 ==
sashWeight);
+ // Make changes to Page Source and Restore Sash position check for changes reflected
in Visual Pane
+ jspTextEditor.insertText(4, 0, " <h:outputText value=\""
+ + MinMaxPanesTest.TEST_TEXT + "\" />\n");
+ jspTextEditor.save();
+ UIThreadRunnable.syncExec(new VoidResult() {
+ @Override
+ public void run() {
+ csf.upClicked();
+ }
+ });
+ assertVisualEditorContains(webBrowser, "INPUT", null, null,
MinMaxPanesTest.TEST_PAGE_NAME);
+ // Make changes to Visual Page and Restore Sash position check for changes reflected
in Source Pane
+ UIThreadRunnable.syncExec(new VoidResult() {
+ @Override
+ public void run() {
+ csf.maxUp();
+ }
+ });
+ jspTextEditor.selectRange(4,18,0);
+ webBrowser.setFocus();
+ KeyboardHelper.typeKeyCodeUsingAWTRepeately(KeyEvent.VK_RIGHT, 1);
+ String insertTestString = "xxinsertedyy";
+ KeyboardHelper.typeBasicStringUsingAWT(insertTestString);
+ jspTextEditor.save();
+ UIThreadRunnable.syncExec(new VoidResult() {
+ @Override
+ public void run() {
+ csf.downClicked();
+ }
+ });
+ assertSourceEditorContains(jspTextEditor.getText(), insertTestString,
MinMaxPanesTest.TEST_PAGE_NAME);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ eclipse.maximizeActiveShell();
+ createJspPage(MinMaxPanesTest.TEST_PAGE_NAME);
+ jspTextEditor = botExt.editorByTitle(MinMaxPanesTest.TEST_PAGE_NAME).toTextEditor();
+ jspTextEditor.setText(MinMaxPanesTest.PAGE_TEXT);
+ jspTextEditor.save();
+ webBrowser = new SWTBotWebBrowser(MinMaxPanesTest.TEST_PAGE_NAME,botExt);
+ }
+ @Override
+ protected void tearDown() throws Exception {
+ jspTextEditor.close();
+ super.tearDown();
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java 2010-11-12
09:41:44 UTC (rev 26493)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java 2010-11-12
09:51:18 UTC (rev 26494)
@@ -26,7 +26,7 @@
private SWTBot optionsDialogBot = null;
private SWTBot editELReferenceDialogBot = null;
- public void testIncludedTagLibs(){
+ public void testSubstitutedELExressions(){
openPage();
bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
optionsDialogBot = bot.shell(IDELabel.Shell.PAGE_DESIGN_OPTIONS).activate().bot();