Author: fbricon
Date: 2011-11-16 05:26:39 -0500 (Wed, 16 Nov 2011)
New Revision: 36362
Added:
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/JBossPerspectiveTest.java
Modified:
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenAllBotTests.java
Log:
JBIDE-10146 : add "Maven Project" to the "New" menu of the JBoss
Perspective
Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF 2011-11-16
02:59:25 UTC (rev 36361)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF 2011-11-16
10:26:39 UTC (rev 36362)
@@ -38,7 +38,8 @@
org.eclipse.jst.jee.web,
org.eclipse.m2e.lifecyclemapping.defaults;bundle-version="[1.0,1.1)",
org.eclipse.m2e.launching;bundle-version="[1.0,1.1)",
- org.eclipse.m2e.tests.common;bundle-version="[1.0.0,1.1.0)"
+ org.eclipse.m2e.tests.common;bundle-version="[1.0.0,1.1.0)",
+ org.jboss.tools.common.ui;bundle-version="3.3.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Eclipse-RegisterBuddy: org.apache.log4j
Added:
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/JBossPerspectiveTest.java
===================================================================
---
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/JBossPerspectiveTest.java
(rev 0)
+++
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/JBossPerspectiveTest.java 2011-11-16
10:26:39 UTC (rev 36362)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.maven.ui.bot.test;
+
+import junit.framework.TestCase;
+
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.ui.WorkbenchException;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Alexey Kazakov
+ * @author Fred Bricon
+ *
+ */
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class JBossPerspectiveTest extends TestCase {
+
+ /**
+ * Tests JBoss perspective has Maven stuff
+ * See
https://issues.jboss.org/browse/JBIDE-10146
+ */
+ @Test
+ public void testJBossPerspective() throws WorkbenchException {
+ SWTWorkbenchBot bot = new SWTWorkbenchBot();
+ bot.viewByTitle("Welcome").close();
+ bot.menu("Window").menu("Open
Perspective").menu("Other...").click();
+ SWTBotShell shell = bot.shell("Open Perspective");
+ shell.activate();
+ bot.table().select("JBoss");
+ bot.button("OK").click();
+ SWTBotMenu menu = bot.menu("New");
+ assertNotNull("Maven Project Menu not found", menu.menu("Maven
Project"));
+
+ /*
+ same test in pure junit
+ IWorkbenchPage page =
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage(JBossPerspectiveFactory.PERSPECTIVE_ID,
null);
+ assertNotNull(page);
+ List<String> shortcuts = Arrays.asList(page.getNewWizardShortcuts());
+ String mavenWizardId = "org.eclipse.m2e.core.wizards.Maven2ProjectWizard";
+ assertTrue("Have not found "+ mavenWizardId +" in " +
JBossPerspectiveFactory.PERSPECTIVE_ID, shortcuts.contains(mavenWizardId));
+ */
+ }
+}
\ No newline at end of file
Modified:
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenAllBotTests.java
===================================================================
---
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenAllBotTests.java 2011-11-16
02:59:25 UTC (rev 36361)
+++
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenAllBotTests.java 2011-11-16
10:26:39 UTC (rev 36362)
@@ -21,6 +21,7 @@
@Suite.SuiteClasses({
//MavenProfileSelectionTest.class, FIXME enable tests for profiles
+ JBossPerspectiveTest.class,
CreateMavenizedSeamProjectTest.class,
})
@RunWith(Suite.class)