JBoss Tools SVN: r41304 - trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-05-23 11:28:32 -0400 (Wed, 23 May 2012)
New Revision: 41304
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
Log:
new test included in test suite
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-05-23 15:28:16 UTC (rev 41303)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-05-23 15:28:32 UTC (rev 41304)
@@ -24,7 +24,7 @@
BuildingArchiveNode.class,
BuildingProjectTest.class,
BuildingArchiveTest.class,
-// CreatingArchiveTest.class,
+ CreatingArchiveTest.class,
// ModifyingArchiveTest.class,
// DeletingArchiveTest.class,
// DeployingArchiveTest.class,
12 years, 7 months
JBoss Tools SVN: r41303 - trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/dialog.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-05-23 11:28:16 -0400 (Wed, 23 May 2012)
New Revision: 41303
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/dialog/ArchiveCreationDialogBase.java
Log:
fixing the issues with Archive dialog
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/dialog/ArchiveCreationDialogBase.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/dialog/ArchiveCreationDialogBase.java 2012-05-23 15:27:30 UTC (rev 41302)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/dialog/ArchiveCreationDialogBase.java 2012-05-23 15:28:16 UTC (rev 41303)
@@ -26,6 +26,7 @@
public ArchiveCreationDialogBase() {
shell = SWTBotFactory.getBot().shell(getDialogTitle());
+ shell.activate();
bot = shell.bot();
}
@@ -67,6 +68,7 @@
public void finish() {
bot.button("Finish").click();
+ SWTBotFactory.getUtil().waitForNonIgnoredJobs();
}
public abstract String getDialogTitle();
12 years, 7 months
JBoss Tools SVN: r41302 - trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-05-23 11:27:30 -0400 (Wed, 23 May 2012)
New Revision: 41302
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java
Log:
method for figuring out some node exists in Project Archives explorer
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java 2012-05-23 15:27:05 UTC (rev 41301)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java 2012-05-23 15:27:30 UTC (rev 41302)
@@ -11,6 +11,7 @@
package org.jboss.tools.archives.ui.bot.test.explorer;
import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.archives.ui.bot.test.context.ArchiveContextMenu;
@@ -78,6 +79,18 @@
return contextTool.editPublishSettings(tree, treeItem);
}
+ public boolean itemExists(String... path) {
+ try {
+ SWTBotTreeItem ti = explorer;
+ for (String pathItem : path) {
+ ti = ti.getNode(pathItem);
+ }
+ return true;
+ } catch (WidgetNotFoundException exc) {
+ return false;
+ }
+ }
+
private SWTBot bot() {
return bot;
}
@@ -90,4 +103,5 @@
return TreeHelper.expandNode(pe.bot(), project, "Project Archives");
}
+
}
12 years, 7 months
JBoss Tools SVN: r41301 - trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-05-23 11:27:05 -0400 (Wed, 23 May 2012)
New Revision: 41301
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java
Log:
method for figuring out some node exists in Project Archives View
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java 2012-05-23 15:26:12 UTC (rev 41300)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java 2012-05-23 15:27:05 UTC (rev 41301)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.archives.ui.bot.test.view;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.archives.ui.bot.test.context.ArchiveContextMenu;
@@ -83,4 +84,13 @@
return contextTool.editPublishSettings(tree, treeItem);
}
+ public boolean itemExists(String... path) {
+ try {
+ TreeHelper.expandNode(bot, path);
+ return true;
+ } catch (WidgetNotFoundException exc) {
+ return false;
+ }
+ }
+
}
12 years, 7 months
JBoss Tools SVN: r41300 - trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-05-23 11:26:12 -0400 (Wed, 23 May 2012)
New Revision: 41300
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java
Log:
new archive bot test implemented
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java (rev 0)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java 2012-05-23 15:26:12 UTC (rev 41300)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 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.archives.ui.bot.test;
+
+import org.jboss.tools.archives.ui.bot.test.dialog.NewJarDialog;
+import org.jboss.tools.archives.ui.bot.test.explorer.ProjectArchivesExplorer;
+import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
+import org.jboss.tools.ui.bot.ext.entity.JavaProjectEntity;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class CreatingArchiveTest extends ArchivesTestBase {
+
+ private static String project1 = "pr1";
+
+ @BeforeClass
+ public static void setup() {
+ JavaProjectEntity jpe = new JavaProjectEntity();
+ jpe.setProjectName(project1);
+ eclipse.createJavaProject(jpe);
+ }
+
+ @Test
+ public void testCreatingArchivetWithView() {
+ ProjectArchivesView view = new ProjectArchivesView();
+ view.show();
+ projectExplorer.selectProject(project1);
+
+ /* creating JAR archive from project1 - standard way */
+ NewJarDialog dialog = view.createNewJarArchive(project1);
+ dialog.setArchiveName(project1 + "-standard");
+ dialog.setZipStandardArchiveType();
+ dialog.finish();
+ assertTrue(view.itemExists(project1,
+ project1 + "-standard.jar [/" + project1 + "]"));
+
+ /* creating JAR archive from project1 - no compression way */
+ dialog = view.createNewJarArchive(project1);
+ dialog.setArchiveName(project1 + "-nocompression");
+ dialog.setNoCompressionArchiveType();
+ dialog.finish();
+ assertTrue(view.itemExists(project1,
+ project1 + "-nocompression.jar [/" + project1 + "]"));
+ }
+
+ @Test
+ public void testCreatingArchiveWithExplorer() {
+ ProjectArchivesExplorer explorer = new ProjectArchivesExplorer(project1);
+
+ /* creating JAR archive from project1 - standard way */
+ NewJarDialog dialog = explorer.createNewJarArchive();
+ dialog.setArchiveName(project1 + "-standard-expl");
+ dialog.setZipStandardArchiveType();
+ dialog.finish();
+ assertTrue(explorer.itemExists(
+ project1 + "-standard-expl.jar [/" + project1 + "]"));
+
+ /* creating JAR archive from project1 - no compression way */
+ dialog = explorer.createNewJarArchive();
+ dialog.setArchiveName(project1 + "-nocompression-expl");
+ dialog.setNoCompressionArchiveType();
+ dialog.finish();
+ assertTrue(explorer.itemExists(
+ project1 + "-nocompression-expl.jar [/" + project1 + "]"));
+ }
+
+}
12 years, 7 months
JBoss Tools SVN: r41299 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/core/portforward and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-05-23 10:48:13 -0400 (Wed, 23 May 2012)
New Revision: 41299
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/AbstractServerViewerActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/TailServerLogActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/AbstractOpenShiftExplorerViewerActionProvider.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/AbstractActionProvider.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateApplicationActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateOrEditDomainActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateServerAdapterActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteApplicationActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteConnectionActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteDomainActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/EditCartridgesActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ImportApplicationActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/OpenInWebBrowserActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/RefreshElementActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowDetailsActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowEnvironmentActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowPropertiesActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/TailServerLogActionProvider.java
Log:
In progress - JBIDE-11841
Make OpenShift Explorer actions available from Server Adapter
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-05-23 14:48:13 UTC (rev 41299)
@@ -162,16 +162,16 @@
<viewerActionBinding viewerId="org.eclipse.wst.server.ui.ServersView">
<includes>
<actionExtension
- pattern="org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.tailServerLogActionProvider"/>
+ pattern="org.jboss.tools.openshift.express.internal.ui.serverviewer.actionDelegate.*"/>
</includes>
</viewerActionBinding>
</extension>
-
+
<!-- Extensions to Server View to provide 'tail' of the remote server.log file -->
<extension point="org.eclipse.ui.navigator.navigatorContent">
<actionProvider
- class="org.jboss.tools.openshift.express.internal.ui.console.TailServerLogActionProvider"
- id="org.jboss.tools.openshift.express.ui.internal.ui.console.tailServerLogActionProvider">
+ class="org.jboss.tools.openshift.express.internal.ui.serverviewer.actionDelegate.TailServerLogActionProvider"
+ id="org.jboss.tools.openshift.express.internal.ui.serverviewer.actionDelegate.tailServerLogActionProvider">
<enablement>
<and>
<instanceof
@@ -183,17 +183,6 @@
</actionProvider>
</extension>
- <extension point="org.eclipse.ui.navigator.viewer">
- <viewerContentBinding viewerId="org.eclipse.wst.server.ui.ServersView">
- </viewerContentBinding>
- <viewerActionBinding viewerId="org.eclipse.wst.server.ui.ServersView">
- <includes>
- <actionExtension
- pattern="org.jboss.tools.openshift.express.ui.internal.ui.console.tailServerLogActionProvider"/>
- </includes>
- </viewerActionBinding>
- </extension>
-
<extension
point="org.eclipse.ui.console.consolePageParticipants">
<consolePageParticipant
@@ -358,7 +347,7 @@
<enablement>
<and>
<instanceof
- value=" org.jboss.tools.openshift.express.internal.core.console.UserDelegate">
+ value="org.jboss.tools.openshift.express.internal.core.console.UserDelegate">
</instanceof>
</and>
</enablement>
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -1,8 +1,8 @@
package org.jboss.tools.openshift.express.internal.core.portforward;
-import org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.AbstractActionProvider;
+import org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.AbstractOpenShiftExplorerViewerActionProvider;
-public class ApplicationPortForwardingActionProvider extends AbstractActionProvider {
+public class ApplicationPortForwardingActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public ApplicationPortForwardingActionProvider() {
super(new ApplicationPortForwardingAction(), "group.showIn");
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -1,42 +0,0 @@
-package org.jboss.tools.openshift.express.internal.ui.console;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.navigator.ICommonViewerSite;
-import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.CommonActionProviderUtils;
-import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
-import org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.AbstractActionProvider;
-
-public class TailServerLogActionProvider extends AbstractActionProvider {
-
- public TailServerLogActionProvider() {
- super(new TailServerLogAction(), "group.showIn");
- }
-
- @Override
- public void fillContextMenu(IMenuManager menu) {
- if (action != null && action.isEnabled()) {
- Object sel = getSelection();
- if( sel instanceof IServer ) {
- IServer server = (IServer)sel;
- if (ExpressServerUtils.isOpenShiftRuntime(server) || ExpressServerUtils.isInOpenshiftBehaviourMode(server)) {
- CommonActionProviderUtils.addToShowInQuickSubMenu(action, menu, actionExtensionSite);
- }
- }
- }
- }
-
- protected Object getSelection() {
- ICommonViewerSite site = actionExtensionSite.getViewSite();
- IStructuredSelection selection = null;
- if (site instanceof ICommonViewerWorkbenchSite) {
- ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
- selection = (IStructuredSelection) wsSite.getSelectionProvider().getSelection();
- Object first = selection.getFirstElement();
- return first;
- }
- return null;
- }
-}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/AbstractServerViewerActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/AbstractServerViewerActionProvider.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/AbstractServerViewerActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * 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.openshift.express.internal.ui.serverviewer.actionDelegate;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+import org.jboss.tools.openshift.express.internal.ui.action.AbstractAction;
+
+/**
+ * @author Xavier Coulon
+ */
+public abstract class AbstractServerViewerActionProvider extends CommonActionProvider {
+
+ protected final AbstractAction action;
+
+ protected ICommonActionExtensionSite actionExtensionSite;
+
+ public AbstractServerViewerActionProvider(AbstractAction action) {
+ this.action = action;
+ }
+
+ public void init(ICommonActionExtensionSite actionExtensionSite) {
+ super.init(actionExtensionSite);
+ this.actionExtensionSite = actionExtensionSite;
+ ICommonViewerSite site = actionExtensionSite.getViewSite();
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ action.setViewer(actionExtensionSite.getStructuredViewer());
+ action.setSelection(actionExtensionSite.getStructuredViewer().getSelection());
+ actionExtensionSite.getStructuredViewer().addSelectionChangedListener(action);
+ }
+ }
+
+ @Override
+ public void fillContextMenu(IMenuManager menu) {
+ Object sel = getSelection();
+ if (sel instanceof IServer) {
+ IServer server = (IServer) sel;
+ if (ExpressServerUtils.isOpenShiftRuntime(server) || ExpressServerUtils.isInOpenshiftBehaviourMode(server)) {
+ action.validate();
+ if (action != null/* && action.isEnabled() */) {
+ MenuManager openshiftMenu = new MenuManager("Openshift...",
+ "org.jboss.tools.openshift.express.serverviewer.menu");
+ openshiftMenu.add(action);
+ menu.add(openshiftMenu);
+ }
+ }
+ }
+ }
+
+ protected Object getSelection() {
+ ICommonViewerSite site = actionExtensionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider().getSelection();
+ Object first = selection.getFirstElement();
+ return first;
+ }
+ return null;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/AbstractServerViewerActionProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/TailServerLogActionProvider.java (from rev 41272, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/TailServerLogActionProvider.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/TailServerLogActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -0,0 +1,11 @@
+package org.jboss.tools.openshift.express.internal.ui.serverviewer.actionDelegate;
+
+import org.jboss.tools.openshift.express.internal.ui.console.TailServerLogAction;
+
+public class TailServerLogActionProvider extends AbstractServerViewerActionProvider {
+
+ public TailServerLogActionProvider() {
+ super(new TailServerLogAction());
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/serverviewer/actionDelegate/TailServerLogActionProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/AbstractActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/AbstractActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/AbstractActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * 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.openshift.express.internal.ui.viewer.actionProvider;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonViewerSite;
-import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
-import org.jboss.tools.openshift.express.internal.ui.action.AbstractAction;
-
-/**
- * @author Xavier Coulon
- */
-public abstract class AbstractActionProvider extends CommonActionProvider {
-
- protected final AbstractAction action;
-
- protected ICommonActionExtensionSite actionExtensionSite;
-
- private final String group;
-
- public AbstractActionProvider(AbstractAction action, String group) {
- this.action = action;
- this.group = group;
- }
-
- public void init(ICommonActionExtensionSite actionExtensionSite) {
- super.init(actionExtensionSite);
- this.actionExtensionSite = actionExtensionSite;
- ICommonViewerSite site = actionExtensionSite.getViewSite();
- if (site instanceof ICommonViewerWorkbenchSite) {
- action.setViewer(actionExtensionSite.getStructuredViewer());
- action.setSelection(actionExtensionSite.getStructuredViewer().getSelection());
- actionExtensionSite.getStructuredViewer().addSelectionChangedListener(action);
- }
- }
-
- @Override
- public void fillContextMenu(IMenuManager menu) {
- action.validate();
- if (action != null/* && action.isEnabled()*/) {
- menu.appendToGroup(group, action);
- }
- }
-
-}
\ No newline at end of file
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/AbstractOpenShiftExplorerViewerActionProvider.java (from rev 41272, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/AbstractActionProvider.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/AbstractOpenShiftExplorerViewerActionProvider.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/AbstractOpenShiftExplorerViewerActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * 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.openshift.express.internal.ui.viewer.actionProvider;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.jboss.tools.openshift.express.internal.ui.action.AbstractAction;
+
+/**
+ * @author Xavier Coulon
+ */
+public abstract class AbstractOpenShiftExplorerViewerActionProvider extends CommonActionProvider {
+
+ protected final AbstractAction action;
+
+ protected ICommonActionExtensionSite actionExtensionSite;
+
+ private final String group;
+
+ public AbstractOpenShiftExplorerViewerActionProvider(AbstractAction action, String group) {
+ this.action = action;
+ this.group = group;
+ }
+
+ public void init(ICommonActionExtensionSite actionExtensionSite) {
+ super.init(actionExtensionSite);
+ this.actionExtensionSite = actionExtensionSite;
+ ICommonViewerSite site = actionExtensionSite.getViewSite();
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ action.setViewer(actionExtensionSite.getStructuredViewer());
+ action.setSelection(actionExtensionSite.getStructuredViewer().getSelection());
+ actionExtensionSite.getStructuredViewer().addSelectionChangedListener(action);
+ }
+ }
+
+ @Override
+ public void fillContextMenu(IMenuManager menu) {
+ action.validate();
+ if (action != null/* && action.isEnabled()*/) {
+ menu.appendToGroup(group, action);
+ }
+ }
+
+}
\ No newline at end of file
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateApplicationActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateApplicationActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateApplicationActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -16,7 +16,7 @@
/**
* @author Xavier Coulon
*/
-public class CreateApplicationActionProvider extends AbstractActionProvider {
+public class CreateApplicationActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public CreateApplicationActionProvider() {
super(new CreateApplicationAction(), "group.edition");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateOrEditDomainActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateOrEditDomainActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateOrEditDomainActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class CreateOrEditDomainActionProvider extends AbstractActionProvider {
+public class CreateOrEditDomainActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public CreateOrEditDomainActionProvider() {
super(new CreateOrEditDomainAction(), "group.edition");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateServerAdapterActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateServerAdapterActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/CreateServerAdapterActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class CreateServerAdapterActionProvider extends AbstractActionProvider {
+public class CreateServerAdapterActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public CreateServerAdapterActionProvider() {
super(new CreateServerAdapterAction(), "group.server");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteApplicationActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteApplicationActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteApplicationActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class DeleteApplicationActionProvider extends AbstractActionProvider {
+public class DeleteApplicationActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public DeleteApplicationActionProvider() {
super(new DeleteApplicationAction(), "group.edition");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteConnectionActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteConnectionActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteConnectionActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -17,7 +17,7 @@
/**
* @author Rob Stryker
*/
-public class DeleteConnectionActionProvider extends AbstractActionProvider {
+public class DeleteConnectionActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteDomainActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteDomainActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/DeleteDomainActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -12,7 +12,7 @@
import org.jboss.tools.openshift.express.internal.ui.action.DeleteDomainAction;
-public class DeleteDomainActionProvider extends AbstractActionProvider {
+public class DeleteDomainActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public DeleteDomainActionProvider() {
super(new DeleteDomainAction(), "group.edition");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/EditCartridgesActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/EditCartridgesActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/EditCartridgesActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class EditCartridgesActionProvider extends AbstractActionProvider {
+public class EditCartridgesActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public EditCartridgesActionProvider() {
super(new EditCartridgesAction(), "group.edition");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ImportApplicationActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ImportApplicationActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ImportApplicationActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class ImportApplicationActionProvider extends AbstractActionProvider {
+public class ImportApplicationActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public ImportApplicationActionProvider() {
super(new ImportApplicationAction(), "group.server");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/OpenInWebBrowserActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/OpenInWebBrowserActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/OpenInWebBrowserActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class OpenInWebBrowserActionProvider extends AbstractActionProvider {
+public class OpenInWebBrowserActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public OpenInWebBrowserActionProvider() {
super(new OpenInWebBrowserAction(), "group.showIn");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/RefreshElementActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/RefreshElementActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/RefreshElementActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class RefreshElementActionProvider extends AbstractActionProvider {
+public class RefreshElementActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public RefreshElementActionProvider() {
super(new RefreshElementAction(), "group.properties");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowDetailsActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowDetailsActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowDetailsActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class ShowDetailsActionProvider extends AbstractActionProvider {
+public class ShowDetailsActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public ShowDetailsActionProvider() {
super(new ShowDetailsAction(), "group.properties");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowEnvironmentActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowEnvironmentActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowEnvironmentActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class ShowEnvironmentActionProvider extends AbstractActionProvider {
+public class ShowEnvironmentActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public ShowEnvironmentActionProvider() {
super(new ShowEnvironmentAction(), "group.properties");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowPropertiesActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowPropertiesActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowPropertiesActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class ShowPropertiesActionProvider extends AbstractActionProvider {
+public class ShowPropertiesActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public ShowPropertiesActionProvider() {
super(new ShowPropertiesAction(), "group.properties");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/TailServerLogActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/TailServerLogActionProvider.java 2012-05-23 14:23:03 UTC (rev 41298)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/TailServerLogActionProvider.java 2012-05-23 14:48:13 UTC (rev 41299)
@@ -15,7 +15,7 @@
/**
* @author Xavier Coulon
*/
-public class TailServerLogActionProvider extends AbstractActionProvider {
+public class TailServerLogActionProvider extends AbstractOpenShiftExplorerViewerActionProvider {
public TailServerLogActionProvider() {
super(new TailServerLogAction(), "group.showIn");
12 years, 7 months
JBoss Tools SVN: r41298 - trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-05-23 10:23:03 -0400 (Wed, 23 May 2012)
New Revision: 41298
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/NativeSkin.java
Log:
https://issues.jboss.org/browse/JBIDE-11966 : BrowserSim: taskbar icon is not shown on Ubuntu with Unity shell
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java 2012-05-23 14:22:12 UTC (rev 41297)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java 2012-05-23 14:23:03 UTC (rev 41298)
@@ -257,7 +257,6 @@
currentOrientationIndex = AppleIPhone3Skin.VERTICAL;
setWidgetsBounds(currentOrientationIndex);
- shell.open();
}
public void setAddressBarVisible(boolean visible) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/NativeSkin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/NativeSkin.java 2012-05-23 14:22:12 UTC (rev 41297)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/NativeSkin.java 2012-05-23 14:23:03 UTC (rev 41298)
@@ -118,8 +118,6 @@
progressBar.setLayoutData(data);
addControlListeners();
-
- shell.open();
}
private void addControlListeners() {
12 years, 7 months
JBoss Tools SVN: r41297 - in trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test: dialog/preferences and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-05-23 10:22:12 -0400 (Wed, 23 May 2012)
New Revision: 41297
Added:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/RuntimeDetectionTestCase.java
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/RuntimeDuplications.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/ServerWithSeam.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/PreferencesDialog.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/CheckSeamRuntimeTemplate.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/DetectRuntimeTemplate.java
Log:
Refactoring.
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/RuntimeDuplications.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/RuntimeDuplications.java 2012-05-23 13:47:41 UTC (rev 41296)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/RuntimeDuplications.java 2012-05-23 14:22:12 UTC (rev 41297)
@@ -10,12 +10,9 @@
import org.apache.commons.io.FileUtils;
import org.jboss.tools.runtime.as.ui.bot.test.RuntimeProperties;
import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap5.DetectEAP5;
-import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.RuntimeDetectionPreferencesDialog;
-import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SeamPreferencesDialog;
import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SearchingForRuntimesDialog;
-import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.ServerRuntimesPreferencesDialog;
import org.jboss.tools.runtime.as.ui.bot.test.entity.Runtime;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.runtime.as.ui.bot.test.template.RuntimeDetectionTestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -26,7 +23,7 @@
* @author Lucia Jelinkova
*
*/
-public class RuntimeDuplications extends SWTTestExt {
+public class RuntimeDuplications extends RuntimeDetectionTestCase {
private File tmpServerPath;
@@ -34,14 +31,8 @@
private File tmpServerBPath;
- private RuntimeDetectionPreferencesDialog runtimeDetectionPreferences;
-
private SearchingForRuntimesDialog searchingForRuntimesDialog;
- private SeamPreferencesDialog seamPreferences = new SeamPreferencesDialog();
-
- private ServerRuntimesPreferencesDialog serverRuntimesPreferences = new ServerRuntimesPreferencesDialog();
-
@Before
public void prepareServers() throws IOException{
File tmpDir = FileUtils.getTempDirectory();
@@ -56,13 +47,13 @@
@Test
public void duplicateRuntimes(){
- searchRuntimePath();
+ searchingForRuntimesDialog = addPath(tmpServerPath.getAbsolutePath());
assertFoundRuntimesNumber(4);
assertSeamRuntimesNumber(2);
assertServerRuntimesNumber(2);
- searchRuntimePath();
+ searchFirstPath();
assertFoundRuntimesNumber(0);
}
@@ -70,42 +61,15 @@
public void deleteServers() throws IOException{
FileUtils.deleteDirectory(tmpServerPath);
- runtimeDetectionPreferences.open();
- runtimeDetectionPreferences.removePath(RuntimeProperties.getInstance().getRuntimePath(DetectEAP5.SERVER_ID));
- runtimeDetectionPreferences.ok();
-
- seamPreferences.open();
- seamPreferences.removeAllRuntimes();
- seamPreferences.ok();
-
- serverRuntimesPreferences.open();
- serverRuntimesPreferences.removeAllRuntimes();
- serverRuntimesPreferences.ok();
+ removeAllPaths();
+ removeAllSeamRuntimes();
+ removeAllServerRuntimes();
}
- private void searchRuntimePath() {
- runtimeDetectionPreferences = new RuntimeDetectionPreferencesDialog();
- runtimeDetectionPreferences.open();
- runtimeDetectionPreferences.addPath(tmpServerPath.getAbsolutePath());
- searchingForRuntimesDialog = runtimeDetectionPreferences.search();
- }
-
private void assertFoundRuntimesNumber(int expected) {
List<Runtime> runtimes = searchingForRuntimesDialog.getRuntimes();
assertThat(runtimes.size(), is(expected));
searchingForRuntimesDialog.ok();
runtimeDetectionPreferences.ok();
}
-
- private void assertSeamRuntimesNumber(int expected) {
- seamPreferences.open();
- assertThat(seamPreferences.getRuntimes().size(), is(expected));
- seamPreferences.ok();
- }
-
- private void assertServerRuntimesNumber(int expected) {
- serverRuntimesPreferences.open();
- assertThat(serverRuntimesPreferences.getRuntimes().size(), is(expected));
- serverRuntimesPreferences.ok();
- }
}
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/ServerWithSeam.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/ServerWithSeam.java 2012-05-23 13:47:41 UTC (rev 41296)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/ServerWithSeam.java 2012-05-23 14:22:12 UTC (rev 41297)
@@ -1,15 +1,9 @@
package org.jboss.tools.runtime.as.ui.bot.test.detector;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-
import org.jboss.tools.runtime.as.ui.bot.test.RuntimeProperties;
import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap5.DetectEAP5;
-import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.RuntimeDetectionPreferencesDialog;
-import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SeamPreferencesDialog;
import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SearchingForRuntimesDialog;
-import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.ServerRuntimesPreferencesDialog;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.runtime.as.ui.bot.test.template.RuntimeDetectionTestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -21,22 +15,13 @@
* @author Lucia Jelinkova
*
*/
-public class ServerWithSeam extends SWTTestExt {
+public class ServerWithSeam extends RuntimeDetectionTestCase {
- private RuntimeDetectionPreferencesDialog runtimeDetectionPreferences;
-
private SearchingForRuntimesDialog searchingForRuntimesDialog;
- private SeamPreferencesDialog seamPreferences = new SeamPreferencesDialog();
-
- private ServerRuntimesPreferencesDialog serverRuntimesPreferences = new ServerRuntimesPreferencesDialog();
-
@Before
public void search(){
- runtimeDetectionPreferences = new RuntimeDetectionPreferencesDialog();
- runtimeDetectionPreferences.open();
- runtimeDetectionPreferences.addPath(RuntimeProperties.getInstance().getRuntimePath(DetectEAP5.SERVER_ID));
- searchingForRuntimesDialog = runtimeDetectionPreferences.search();
+ searchingForRuntimesDialog = addPath(RuntimeProperties.getInstance().getRuntimePath(DetectEAP5.SERVER_ID));
}
@Test
@@ -67,17 +52,9 @@
@After
public void cleanup(){
- runtimeDetectionPreferences.open();
- runtimeDetectionPreferences.removePath(RuntimeProperties.getInstance().getRuntimePath(DetectEAP5.SERVER_ID));
- runtimeDetectionPreferences.ok();
-
- seamPreferences.open();
- seamPreferences.removeAllRuntimes();
- seamPreferences.ok();
-
- serverRuntimesPreferences.open();
- serverRuntimesPreferences.removeAllRuntimes();
- serverRuntimesPreferences.ok();
+ removeAllPaths();
+ removeAllSeamRuntimes();
+ removeAllServerRuntimes();
}
private void deselectRuntime(String name) {
@@ -86,21 +63,8 @@
runtimeDetectionPreferences.ok();
}
- private void assertSeamRuntimesNumber(int expected) {
- seamPreferences.open();
- assertThat(seamPreferences.getRuntimes().size(), is(expected));
- seamPreferences.ok();
- }
-
- private void assertServerRuntimesNumber(int expected) {
- serverRuntimesPreferences.open();
- assertThat(serverRuntimesPreferences.getRuntimes().size(), is(expected));
- serverRuntimesPreferences.ok();
- }
-
private void addAllDetectedRuntimes() {
- runtimeDetectionPreferences.open();
- searchingForRuntimesDialog = runtimeDetectionPreferences.search();
+ searchFirstPath();
searchingForRuntimesDialog.ok();
runtimeDetectionPreferences.ok();
}
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/PreferencesDialog.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/PreferencesDialog.java 2012-05-23 13:47:41 UTC (rev 41296)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/PreferencesDialog.java 2012-05-23 14:22:12 UTC (rev 41297)
@@ -1,5 +1,7 @@
package org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.Preference;
import org.jboss.tools.ui.bot.ext.gen.IPreference;
@@ -7,6 +9,13 @@
public class PreferencesDialog {
protected void open(String... path){
+ SWTBotExt bot = SWTBotFactory.getBot();
+ try {
+ bot.shell("Preferences");
+ ok();
+ } catch (WidgetNotFoundException e){
+ // ok
+ }
IPreference preference = Preference.create(path);
SWTBotFactory.getOpen().preferenceOpen(preference);
}
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java 2012-05-23 13:47:41 UTC (rev 41296)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java 2012-05-23 14:22:12 UTC (rev 41297)
@@ -7,6 +7,7 @@
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.waits.ICondition;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.jboss.tools.runtime.core.model.RuntimePath;
import org.jboss.tools.runtime.ui.RuntimeUIActivator;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
@@ -16,13 +17,6 @@
public class RuntimeDetectionPreferencesDialog extends PreferencesDialog{
public void open(){
- SWTBotExt bot = SWTBotFactory.getBot();
- try {
- bot.shell("Preferences");
- ok();
- } catch (WidgetNotFoundException e){
- // ok
- }
open("JBoss Tools", "JBoss Tools Runtime Detection");
}
@@ -47,6 +41,16 @@
SWTBotFactory.getBot().button("Remove").click();
}
+ public void removeAllPaths(){
+ SWTBot bot = SWTBotFactory.getBot();
+ SWTBotTable table = bot.table();
+
+ for (int i = 0; i < table.rowCount(); i++){
+ table.click(0, 0);
+ bot.button("Remove").click();
+ }
+ }
+
public SearchingForRuntimesDialog search(){
SWTBotFactory.getBot().button("Search...").click();
SWTBot bot = SWTBotFactory.getBot().shell("Searching for runtimes...").bot();
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/CheckSeamRuntimeTemplate.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/CheckSeamRuntimeTemplate.java 2012-05-23 13:47:41 UTC (rev 41296)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/CheckSeamRuntimeTemplate.java 2012-05-23 14:22:12 UTC (rev 41297)
@@ -3,17 +3,13 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
-import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SeamPreferencesDialog;
import org.jboss.tools.runtime.as.ui.bot.test.entity.Runtime;
import org.jboss.tools.runtime.as.ui.bot.test.matcher.RuntimeMatcher;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.junit.After;
import org.junit.Test;
-public abstract class CheckSeamRuntimeTemplate extends SWTTestExt {
+public abstract class CheckSeamRuntimeTemplate extends RuntimeDetectionTestCase {
- private SeamPreferencesDialog seamPreferences = new SeamPreferencesDialog();
-
protected abstract Runtime getExpectedRuntime();
@Test
@@ -26,7 +22,6 @@
@After
public void cleanup(){
- seamPreferences.removeAllRuntimes();
- seamPreferences.ok();
+ removeAllSeamRuntimes();
}
}
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/DetectRuntimeTemplate.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/DetectRuntimeTemplate.java 2012-05-23 13:47:41 UTC (rev 41296)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/DetectRuntimeTemplate.java 2012-05-23 14:22:12 UTC (rev 41297)
@@ -7,11 +7,9 @@
import java.util.List;
import org.jboss.tools.runtime.as.ui.bot.test.RuntimeProperties;
-import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.RuntimeDetectionPreferencesDialog;
import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SearchingForRuntimesDialog;
import org.jboss.tools.runtime.as.ui.bot.test.entity.Runtime;
import org.jboss.tools.runtime.as.ui.bot.test.matcher.RuntimeMatcher;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.junit.After;
import org.junit.Test;
@@ -22,10 +20,8 @@
* @author Lucia Jelinkova
*
*/
-public abstract class DetectRuntimeTemplate extends SWTTestExt {
+public abstract class DetectRuntimeTemplate extends RuntimeDetectionTestCase {
- private RuntimeDetectionPreferencesDialog preferences;
-
private SearchingForRuntimesDialog searchingForRuntimesDialog;
protected abstract String getPathID();
@@ -34,10 +30,7 @@
@Test
public void detectRuntime(){
- preferences = new RuntimeDetectionPreferencesDialog();
- preferences.open();
- preferences.addPath(RuntimeProperties.getInstance().getRuntimePath(getPathID()));
- searchingForRuntimesDialog = preferences.search();
+ searchingForRuntimesDialog = addPath(RuntimeProperties.getInstance().getRuntimePath(getPathID()));
List<Runtime> runtimes = searchingForRuntimesDialog.getRuntimes();
@@ -50,7 +43,7 @@
@After
public void closePreferences(){
searchingForRuntimesDialog.ok();
- preferences.removePath(RuntimeProperties.getInstance().getRuntimePath(getPathID()));
- preferences.ok();
+ runtimeDetectionPreferences.removeAllPaths();
+ runtimeDetectionPreferences.ok();
}
}
Added: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/RuntimeDetectionTestCase.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/RuntimeDetectionTestCase.java (rev 0)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/RuntimeDetectionTestCase.java 2012-05-23 14:22:12 UTC (rev 41297)
@@ -0,0 +1,68 @@
+package org.jboss.tools.runtime.as.ui.bot.test.template;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.RuntimeDetectionPreferencesDialog;
+import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SeamPreferencesDialog;
+import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SearchingForRuntimesDialog;
+import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.ServerRuntimesPreferencesDialog;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+
+/**
+ * Provides useful methods that can be used by its descendants.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public abstract class RuntimeDetectionTestCase extends SWTTestExt {
+
+ protected RuntimeDetectionPreferencesDialog runtimeDetectionPreferences = new RuntimeDetectionPreferencesDialog();
+
+ protected SeamPreferencesDialog seamPreferences = new SeamPreferencesDialog();
+
+ protected ServerRuntimesPreferencesDialog serverRuntimesPreferences = new ServerRuntimesPreferencesDialog();
+
+ protected SearchingForRuntimesDialog addPath(String path){
+ runtimeDetectionPreferences = new RuntimeDetectionPreferencesDialog();
+ runtimeDetectionPreferences.open();
+ runtimeDetectionPreferences.addPath(path);
+ return runtimeDetectionPreferences.search();
+ }
+
+ protected SearchingForRuntimesDialog searchFirstPath(){
+ runtimeDetectionPreferences = new RuntimeDetectionPreferencesDialog();
+ runtimeDetectionPreferences.open();
+ return runtimeDetectionPreferences.search();
+ }
+
+ protected void removeAllPaths(){
+ runtimeDetectionPreferences.open();
+ runtimeDetectionPreferences.removeAllPaths();
+ runtimeDetectionPreferences.ok();
+ }
+
+ protected void removeAllSeamRuntimes(){
+ seamPreferences.open();
+ seamPreferences.removeAllRuntimes();
+ seamPreferences.ok();
+ }
+
+ protected void removeAllServerRuntimes(){
+ serverRuntimesPreferences.open();
+ serverRuntimesPreferences.removeAllRuntimes();
+ serverRuntimesPreferences.ok();
+ }
+
+ protected void assertSeamRuntimesNumber(int expected) {
+ seamPreferences.open();
+ assertThat(seamPreferences.getRuntimes().size(), is(expected));
+ seamPreferences.ok();
+ }
+
+ protected void assertServerRuntimesNumber(int expected) {
+ serverRuntimesPreferences.open();
+ assertThat(serverRuntimesPreferences.getRuntimes().size(), is(expected));
+ serverRuntimesPreferences.ok();
+ }
+}
12 years, 7 months
JBoss Tools SVN: r41296 - in trunk/archives/tests/org.jboss.tools.archives.ui.bot.test: src/org/jboss/tools/archives/ui/bot/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-05-23 09:47:41 -0400 (Wed, 23 May 2012)
New Revision: 41296
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveNode.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingProjectTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ViewIsPresentTest.java
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
Log:
new archives bot tests added
Property changes on: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test
___________________________________________________________________
Added: svn:ignore
+ *
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-05-23 13:46:09 UTC (rev 41295)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-05-23 13:47:41 UTC (rev 41296)
@@ -20,7 +20,14 @@
*/
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({
- ExampleTest.class
+ ViewIsPresentTest.class,
+ BuildingArchiveNode.class,
+ BuildingProjectTest.class,
+ BuildingArchiveTest.class,
+// CreatingArchiveTest.class,
+// ModifyingArchiveTest.class,
+// DeletingArchiveTest.class,
+// DeployingArchiveTest.class,
})
public class ArchivesAllBotTests {
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java (rev 0)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java 2012-05-23 13:47:41 UTC (rev 41296)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 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.archives.ui.bot.test;
+
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.helper.ImportHelper;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+@Require(clearProjects = true, perspective = "Java",
+ server = @Server(state = ServerState.NotRunning,
+ version = "6.0", operator = ">="))
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ ArchivesAllBotTests.class })
+public class ArchivesTestBase extends SWTTestExt {
+
+ protected static void importProject(String projectName) {
+
+ String location = "/resources/prj/" + projectName;
+
+ importProject(projectName, location, projectName);
+ }
+
+ protected static void importProject(String projectName,
+ String projectLocation, String dir) {
+
+ ImportHelper.importProject(projectLocation, dir, Activator.PLUGIN_ID);
+
+ eclipse.addConfiguredRuntimeIntoProject(projectName,
+ configuredState.getServer().name);
+ }
+
+ protected static void importProjectWithoutRuntime(String projectName) {
+
+ String location = "/resources/prj/" + projectName;
+
+ importProjectWithoutRuntime(projectName, location, projectName);
+ }
+
+ protected static void importProjectWithoutRuntime(String projectName,
+ String projectLocation, String dir) {
+
+ ImportHelper.importProject(projectLocation, dir, Activator.PLUGIN_ID);
+
+ }
+
+}
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveNode.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveNode.java (rev 0)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveNode.java 2012-05-23 13:47:41 UTC (rev 41296)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 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.archives.ui.bot.test;
+
+import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class BuildingArchiveNode extends ArchivesTestBase {
+
+ private static String projectName = "pr2";
+ private String archiveName = projectName + ".jar [/" + projectName + "]";
+
+ @BeforeClass
+ public static void setup() {
+ importProjectWithoutRuntime(projectName);
+ }
+
+ @Test
+ public void testBuildingArchiveNode() {
+ ProjectArchivesView view = new ProjectArchivesView();
+ view.show();
+ projectExplorer.selectProject(projectName);
+ view.buildArchiveNode(projectName, archiveName);
+ }
+
+}
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveTest.java (rev 0)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveTest.java 2012-05-23 13:47:41 UTC (rev 41296)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 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.archives.ui.bot.test;
+
+import org.jboss.tools.archives.ui.bot.test.explorer.ProjectArchivesExplorer;
+import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class BuildingArchiveTest extends ArchivesTestBase{
+
+ private static String projectName = "pr2";
+ private String archiveName = projectName + ".jar [/" + projectName + "]";
+
+ @BeforeClass
+ public static void setup() {
+ importProjectWithoutRuntime(projectName);
+ }
+
+ @Test
+ public void testBuildingArchiveWithView() {
+ ProjectArchivesView view = new ProjectArchivesView();
+ view.show();
+ projectExplorer.selectProject(projectName);
+ view.buildArchiveFull(projectName, archiveName);
+ }
+
+ @Test
+ public void testBuildingArchiveWithExplorer() {
+ ProjectArchivesExplorer explorer =
+ new ProjectArchivesExplorer(projectName);
+ explorer.buildArchiveFull(archiveName);
+ }
+
+}
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingProjectTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingProjectTest.java (rev 0)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingProjectTest.java 2012-05-23 13:47:41 UTC (rev 41296)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 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.archives.ui.bot.test;
+
+import org.jboss.tools.archives.ui.bot.test.explorer.ProjectArchivesExplorer;
+import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class BuildingProjectTest extends ArchivesTestBase {
+
+ private static String projectName = "pr1";
+
+ @BeforeClass
+ public static void setup() {
+ importProjectWithoutRuntime(projectName);
+ }
+
+ @Test
+ public void testBuildingProjectWithView() {
+ ProjectArchivesView view = new ProjectArchivesView();
+ view.show();
+ projectExplorer.selectProject(projectName);
+ view.buildProjectFull(projectName);
+ }
+
+ @Test
+ public void testBuildingProjectWithExplorer() {
+ ProjectArchivesExplorer explorer =
+ new ProjectArchivesExplorer(projectName);
+ explorer.buildProjectFull();
+ }
+
+}
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ViewIsPresentTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ViewIsPresentTest.java (rev 0)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ViewIsPresentTest.java 2012-05-23 13:47:41 UTC (rev 41296)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 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.archives.ui.bot.test;
+
+import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class ViewIsPresentTest extends ArchivesTestBase {
+
+ @Test
+ public void testArchivesViewIsPresent() {
+ ProjectArchivesView view = new ProjectArchivesView();
+ view.show();
+ assertTrue("Project Archives view is not active.",
+ bot.activeView().getTitle().equals(IDELabel.View.PROJECT_ARCHIVES));
+ }
+
+}
12 years, 7 months
JBoss Tools SVN: r41295 - in trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test: explorer and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-05-23 09:46:09 -0400 (Wed, 23 May 2012)
New Revision: 41295
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java
Log:
class simulating Project Archives explorer added
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java (rev 0)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java 2012-05-23 13:46:09 UTC (rev 41295)
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 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.archives.ui.bot.test.explorer;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.archives.ui.bot.test.context.ArchiveContextMenu;
+import org.jboss.tools.archives.ui.bot.test.dialog.ArchivePublishSettingsDialog;
+import org.jboss.tools.archives.ui.bot.test.dialog.EditArchiveDialog;
+import org.jboss.tools.archives.ui.bot.test.dialog.NewJarDialog;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.helper.TreeHelper;
+import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class ProjectArchivesExplorer {
+
+ private ArchiveContextMenu contextTool = null;
+ private SWTBotTreeItem explorer = null;
+ private SWTBot bot = null;
+
+ public ProjectArchivesExplorer(String project) {
+ contextTool = new ArchiveContextMenu();
+ explorer = openExplorer(project);
+ explorer.expand();
+ }
+
+ public NewJarDialog createNewJarArchive() {
+ SWTBotTree tree = this.bot().tree();
+ return contextTool.createNewJarArchive(tree, explorer);
+ }
+
+ public void buildProjectFull() {
+ SWTBotTree tree = this.bot().tree();
+ contextTool.buildProjectFull(tree, explorer);
+ }
+
+ public void buildArchiveFull(String archive) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = explorer.getNode(archive);
+ contextTool.buildArchiveFull(tree, treeItem);
+ }
+
+ public EditArchiveDialog editArchive(String archive) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = explorer.getNode(archive);
+ return contextTool.editArchive(tree, treeItem);
+ }
+
+ public void deleteArchive(String archive) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = explorer.getNode(archive);
+ contextTool.deleteArchive(tree, treeItem);
+ }
+
+ public ArchivePublishSettingsDialog publishToServer(String archive) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = explorer.getNode(archive);
+ return contextTool.publishToServer(tree, treeItem);
+ }
+
+ public ArchivePublishSettingsDialog editPublishSettings(String archive) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = explorer.getNode(archive);
+ return contextTool.editPublishSettings(tree, treeItem);
+ }
+
+ private SWTBot bot() {
+ return bot;
+ }
+
+ private SWTBotTreeItem openExplorer(String project) {
+ ProjectExplorer pe = SWTBotFactory.getProjectexplorer();
+ pe.show();
+ bot = pe.bot();
+ pe.selectProject(project);
+ return TreeHelper.expandNode(pe.bot(), project, "Project Archives");
+ }
+
+}
12 years, 7 months