Author: dmaliarevich
Date: 2011-08-10 13:10:11 -0400 (Wed, 10 Aug 2011)
New Revision: 33774
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE9445Test_DuplicateSourceMenu.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
https://issues.jboss.org/browse/JBIDE-9445 , SWTBot test was added.
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 2011-08-10
16:23:15 UTC (rev 33773)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-08-10
17:10:11 UTC (rev 33774)
@@ -71,6 +71,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.tags.TreeTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.VirtualEarthTagTest;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4556Test;
+import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE9445Test_DuplicateSourceMenu;
import org.jboss.tools.vpe.ui.bot.test.palette.CancelTagLibDefenitionTest;
import org.jboss.tools.vpe.ui.bot.test.palette.ImportTagsFromTLDFileTest;
import org.jboss.tools.vpe.ui.bot.test.palette.ManagePaletteGroupsTest;
@@ -176,6 +177,7 @@
suite.addTestSuite(OpenOnTest.class);
suite.addTestSuite(XhtmlFilePerformanceTest.class);
suite.addTestSuite(MarkersTest.class);
+ suite.addTestSuite(JBIDE9445Test_DuplicateSourceMenu.class);
return new TestSetup(suite);
}
}
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE9445Test_DuplicateSourceMenu.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE9445Test_DuplicateSourceMenu.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE9445Test_DuplicateSourceMenu.java 2011-08-10
17:10:11 UTC (rev 33774)
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.jbide;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+
+public class JBIDE9445Test_DuplicateSourceMenu extends VPEAutoTestCase {
+
+ public JBIDE9445Test_DuplicateSourceMenu() {
+ super();
+ }
+
+ public void testDuplicateMenus() {
+ /*
+ * Open the default jsp page
+ */
+ SWTBotEditor editor = SWTTestExt.packageExplorer.openFile(JBT_TEST_PROJECT_NAME,
+ "WebContent", "pages", TEST_PAGE); //$NON-NLS-1$ //$NON-NLS-2$
+ editor.setFocus();
+ /*
+ * When focus is on the editor --
+ * only one 'Source' menu should be available
+ */
+ assertTrue(bot.menu("Source", 0).isVisible()); //$NON-NLS-1$
+ try {
+ assertFalse("Second 'Source' menu is enabled, but shouldn't be",
//$NON-NLS-1$
+ bot.menu("Source", 1).isEnabled()); //$NON-NLS-1$
+ } catch (Exception e) { }
+ /*
+ * Set focus to the PackageExplorer
+ */
+ openPackageExplorer();
+ /*
+ * After focus moved to Package Explorer --
+ * still only one menu should be visible
+ */
+ assertTrue(bot.menu("Source", 0).isEnabled()); //$NON-NLS-1$
+ try {
+ assertFalse("Second 'Source' menu is enabled, but shouldn't be",
//$NON-NLS-1$
+ bot.menu("Source", 1).isEnabled()); //$NON-NLS-1$
+ } catch (Exception e) { }
+ }
+
+ @Override
+ protected void closeUnuseDialogs() { }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+}