JBoss Tools SVN: r43159 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal: jpa2 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2012-08-22 07:56:52 -0400 (Wed, 22 Aug 2012)
New Revision: 43159
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePropertiesResourceModel.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePropertiesResourceModelProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/messages.properties
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java
Log:
https://issues.jboss.org/browse/JBIDE-12454
Revalidate JpaProject on hibernate.properties change
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformProvider.java 2012-08-22 11:04:57 UTC (rev 43158)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformProvider.java 2012-08-22 11:56:52 UTC (rev 43159)
@@ -106,7 +106,8 @@
JavaResourceModelProvider.instance(),
JarResourceModelProvider.instance(),
PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance()
+ OrmResourceModelProvider.instance(),
+ HibernatePropertiesResourceModelProvider.instance()
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java 2012-08-22 11:04:57 UTC (rev 43158)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java 2012-08-22 11:56:52 UTC (rev 43159)
@@ -14,11 +14,20 @@
import java.util.List;
import java.util.Properties;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jpt.common.core.JptCommonCorePlugin;
import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
+import org.eclipse.jpt.common.core.utility.command.JobCommand;
import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
import org.eclipse.jpt.jpa.core.JpaFile;
@@ -27,6 +36,7 @@
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
import org.eclipse.jpt.jpa.core.internal.AbstractJpaProject;
+import org.eclipse.wst.validation.ValidationFramework;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.hibernate.cfg.Configuration;
@@ -34,6 +44,7 @@
import org.hibernate.cfg.NamingStrategy;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.properties.HibernatePropertiesConstants;
import org.hibernate.eclipse.nature.HibernateNature;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
@@ -49,9 +60,12 @@
public class HibernateJpaProject extends AbstractJpaProject {
private Boolean cachedNamingStrategyEnable;
+
+ private final JobCommand revalidateCommand;
public HibernateJpaProject(JpaProject.Config config){
super(config);
+ revalidateCommand = new RevalidateProjectCommand();
}
public ConsoleConfiguration getDefaultConsoleConfiguration(){
@@ -234,7 +248,36 @@
}
};
}
+
+ @Override
+ protected boolean synchronizeJpaFiles(IFile file, int deltaKind) {
+ boolean result = super.synchronizeJpaFiles(file, deltaKind);
+ ConsoleConfiguration cc = getDefaultConsoleConfiguration();
+ if (cc != null){
+ ConsoleConfigurationPreferences preferences = cc.getPreferences();
+ if (file.getLocation().toFile().equals(preferences.getPropertyFile())){
+ switch (deltaKind) {
+ case IResourceDelta.ADDED :
+ case IResourceDelta.REMOVED :
+ case IResourceDelta.CHANGED :
+ stateChanged();
+ revalidate();
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * I don't know what I do incorrectly but JpaProject isn't validated on the stateChanged().
+ * This command is a temporary solution.
+ *
+ */
+ protected void revalidate() {
+ getManager().execute(revalidateCommand, org.jboss.tools.hibernate.jpt.core.internal.Messages.HibernateJpaProject_Update_Hibernate_properties, this);
+ }
+
@Override
protected void validate(List<IMessage> messages, IReporter reporter) {
super.validate(messages, reporter);
@@ -262,5 +305,18 @@
}
return null;
}
+
+ class RevalidateProjectCommand implements JobCommand {
+ public IStatus execute(IProgressMonitor monitor) {
+ try {
+ ValidationFramework.getDefault().validate(new IProject[]{HibernateJpaProject.this.getProject()},
+ false, true, new NullProgressMonitor());
+ return Status.OK_STATUS;
+ } catch (CoreException e) {
+ return new Status(Status.ERROR, HibernateJptPlugin.ID, e.getMessage(), e);
+ }
+ }
+ }
+
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java 2012-08-22 11:04:57 UTC (rev 43158)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java 2012-08-22 11:56:52 UTC (rev 43159)
@@ -22,8 +22,10 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.JpaProjectManager;
import org.hibernate.console.ConsoleConfiguration;
@@ -41,6 +43,11 @@
public static final String ID = "org.jboss.tools.hibernate.jpt.core"; //$NON-NLS-1$
private static HibernateJptPlugin inst = null;
+
+ private static String JAVA_PROPERTIES_CONTENT_TYPE_NAME = "org.eclipse.jdt.core.javaProperties"; //$NON-NLS-1$
+
+ public static IContentType JAVA_PROPERTIES_CONTENT_TYPE = Platform.getContentTypeManager()
+ .getContentType(JAVA_PROPERTIES_CONTENT_TYPE_NAME);
public static HibernateJptPlugin getDefault() {
return inst;
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePropertiesResourceModel.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePropertiesResourceModel.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePropertiesResourceModel.java 2012-08-22 11:56:52 UTC (rev 43159)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jpt.common.core.JptResourceModel;
+import org.eclipse.jpt.common.core.JptResourceModelListener;
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.jpa.core.JpaProject;
+
+/**
+ *
+ * @author Dmitry Geraskov (geraskov(a)gmail.com)
+ *
+ */
+public class HibernatePropertiesResourceModel implements JptResourceModel {
+
+ protected final JpaProject project;
+
+ protected final IFile file;
+
+ public HibernatePropertiesResourceModel(JpaProject project, IFile file){
+ this.project = project;
+ this.file = file;
+ }
+
+ public JptResourceType getResourceType() {
+ return new JptResourceType(HibernateJptPlugin.JAVA_PROPERTIES_CONTENT_TYPE);
+ }
+
+ public IFile getFile() {
+ return file;
+ }
+
+ // ********** JptResourceModel implementation **********
+
+ public void addResourceModelListener(JptResourceModelListener listener) {
+ //do nothing for now
+ }
+
+ public void removeResourceModelListener(JptResourceModelListener listener) {
+ //do nothing for now
+ }
+
+
+
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePropertiesResourceModelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePropertiesResourceModelProvider.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePropertiesResourceModelProvider.java 2012-08-22 11:56:52 UTC (rev 43159)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jpt.jpa.core.JpaProject;
+import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
+
+/**
+ *
+ * @author Dmitry Geraskov (geraskov(a)gmail.com)
+ *
+ */
+public class HibernatePropertiesResourceModelProvider implements
+ JpaResourceModelProvider {
+
+ // singleton
+ private static final JpaResourceModelProvider INSTANCE = new HibernatePropertiesResourceModelProvider();
+
+ /**
+ * Return the singleton.
+ */
+ public static JpaResourceModelProvider instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure single instance.
+ */
+ private HibernatePropertiesResourceModelProvider() {
+ super();
+ }
+
+ public IContentType getContentType() {
+ return HibernateJptPlugin.JAVA_PROPERTIES_CONTENT_TYPE;
+ }
+
+ public HibernatePropertiesResourceModel buildResourceModel(
+ JpaProject jpaProject, IFile file) {
+ return new HibernatePropertiesResourceModel(jpaProject, file);
+ }
+
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/Messages.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/Messages.java 2012-08-22 11:56:52 UTC (rev 43159)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ * @author Dmitry Geraskov (geraskov(a)gmail.com)
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.hibernate.jpt.core.internal.messages"; //$NON-NLS-1$
+ public static String HibernateJpaProject_Update_Hibernate_properties;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java 2012-08-22 11:04:57 UTC (rev 43158)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java 2012-08-22 11:56:52 UTC (rev 43159)
@@ -36,6 +36,7 @@
import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaElementCollectionMappingDefinition2_0;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddedMappingDefinition2_0;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaOneToManyMappingDefinition2_0;
+import org.jboss.tools.hibernate.jpt.core.internal.HibernatePropertiesResourceModelProvider;
import org.jboss.tools.hibernate.jpt.core.internal.JavaPackageInfoResourceModelProviderPatched;
import org.jboss.tools.hibernate.jpt.core.internal.context.definition.HibernateJavaBasicMappingDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.context.definition.HibernateJavaEntityDefinition;
@@ -110,7 +111,8 @@
JavaResourceModelProvider.instance(),
JarResourceModelProvider.instance(),
PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance()
+ OrmResourceModelProvider.instance(),
+ HibernatePropertiesResourceModelProvider.instance()
};
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/messages.properties (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/messages.properties 2012-08-22 11:56:52 UTC (rev 43159)
@@ -0,0 +1 @@
+HibernateJpaProject_Update_Hibernate_properties=Update Hibernate properties
12 years, 4 months
JBoss Tools SVN: r43158 - branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-22 07:04:57 -0400 (Wed, 22 Aug 2012)
New Revision: 43158
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java
Log:
Tried to split the keystrokes.
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java 2012-08-22 10:59:12 UTC (rev 43157)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java 2012-08-22 11:04:57 UTC (rev 43158)
@@ -24,6 +24,7 @@
public void perform() {
performInnerTask(new FileContextMenuSelectingTask(workspaceFile, "Mark as Deployable"));
// for the confirmation dialog select OK (the dialog is native and normal swtbot functions do now work)
- KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.RIGHT, Keystrokes.CR, Keystrokes.LF);
+ KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.RIGHT);
+ KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.CR, Keystrokes.LF);
}
}
12 years, 4 months
JBoss Tools SVN: r43156 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view.
by jbosstools-commits@lists.jboss.org
Author: rhopp
Date: 2012-08-22 06:23:12 -0400 (Wed, 22 Aug 2012)
New Revision: 43156
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
Log:
Removed unnecessary waiting in ExplorerBase when deleting project
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2012-08-22 10:12:31 UTC (rev 43155)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2012-08-22 10:23:12 UTC (rev 43156)
@@ -76,7 +76,7 @@
}
open.finish(shell.bot(),IDELabel.Button.OK);
util.waitForNonIgnoredJobs();
- util.waitForAll(Timing.time30S());
+ //util.waitForAll(Timing.time30S()); rhopp. Removed unnecessary waiting.
}
/**
* deletes all projects from workspace
12 years, 4 months
JBoss Tools SVN: r43155 - in trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test: context and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-08-22 06:12:31 -0400 (Wed, 22 Aug 2012)
New Revision: 43155
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java
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/view/ProjectArchivesView.java
Log:
test for deleting archives via keyboard delete shortcut implemented
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java 2012-08-22 10:10:01 UTC (rev 43154)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java 2012-08-22 10:12:31 UTC (rev 43155)
@@ -22,16 +22,16 @@
*/
public class DeletingArchiveTest extends ArchivesTestBase {
- private static String project = "pr3";
- private final String ARCHIVE_NAME_1 =
- project + "a.jar";
- private final String ARCHIVE_NAME_2 =
- project + "b.jar";
- private final String PATH_SUFFIX = " [/" + project + "]";
- private final String PATH_ARCHIVE_1 =
- ARCHIVE_NAME_1 + PATH_SUFFIX;
- private final String PATH_ARCHIVE_2 =
- ARCHIVE_NAME_2 + PATH_SUFFIX;
+ private static String project = "pr4";
+ private static final String ARCHIVE_NAME_AA =
+ project + "aa.jar";
+ private static final String ARCHIVE_NAME_AB =
+ project + "ab.jar";
+ private static final String ARCHIVE_NAME_BA =
+ project + "ba.jar";
+ private static final String ARCHIVE_NAME_BB =
+ project + "bb.jar";
+ private static final String PATH_SUFFIX = " [/" + project + "]";
@BeforeClass
public static void setup() {
@@ -44,11 +44,17 @@
/* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
- /* delete archive in view */
- view.deleteArchive(project, PATH_ARCHIVE_1);
+ /* delete archive in view with context menu */
+ view.deleteArchive(true, project, ARCHIVE_NAME_AA + PATH_SUFFIX);
/* test archive was deleted */
- assertItemNotExistsInView(view, project, PATH_ARCHIVE_1);
+ assertItemNotExistsInView(view, project, ARCHIVE_NAME_AA + PATH_SUFFIX);
+
+ /* delete archive in view with keyboard shortcut */
+ view.deleteArchive(false, project, ARCHIVE_NAME_AB + PATH_SUFFIX);
+
+ /* test archive was deleted */
+ assertItemNotExistsInView(view, project, ARCHIVE_NAME_AB + PATH_SUFFIX);
}
@Test
@@ -57,11 +63,17 @@
/* prepare explorer for testing */
ProjectArchivesExplorer explorer = explorerForProject(project);
- /* delete archive in explorer */
- explorer.deleteArchive(PATH_ARCHIVE_2);
+ /* delete archive in explorer with context menu*/
+ explorer.deleteArchive(true, ARCHIVE_NAME_BA + PATH_SUFFIX);
/* test archive was deleted */
- assertItemNotExistsInExplorer(explorer, PATH_ARCHIVE_2);
+ assertItemNotExistsInExplorer(explorer, ARCHIVE_NAME_BA + PATH_SUFFIX);
+
+ /* delete archive in explorer with keyboard shortcut */
+ explorer.deleteArchive(false, ARCHIVE_NAME_BB + PATH_SUFFIX);
+
+ /* test archive was deleted */
+ assertItemNotExistsInExplorer(explorer, ARCHIVE_NAME_BB + PATH_SUFFIX);
}
}
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java 2012-08-22 10:10:01 UTC (rev 43154)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java 2012-08-22 10:12:31 UTC (rev 43155)
@@ -11,6 +11,7 @@
package org.jboss.tools.archives.ui.bot.test.context;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -94,11 +95,17 @@
}
public void deleteArchive(SWTBotTree tree,
- SWTBotTreeItem item) {
- ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
- SWTBotMenu menu = new SWTBotMenu(ContextMenuHelper.
+ SWTBotTreeItem item, boolean withContextMenu) {
+ if (withContextMenu) {
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
+ SWTBotMenu menu = new SWTBotMenu(ContextMenuHelper.
getContextMenu(tree, "Delete Archive", false));
- menu.click();
+ menu.click();
+ } else {
+ item.select();
+ item.pressShortcut(Keystrokes.DELETE);
+ }
+
handleDeleteDialog();
SWTBotFactory.getUtil().waitForNonIgnoredJobs();
}
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-08-22 10:10:01 UTC (rev 43154)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/explorer/ProjectArchivesExplorer.java 2012-08-22 10:12:31 UTC (rev 43155)
@@ -82,10 +82,10 @@
return contextTool.editArchive(tree, treeItem);
}
- public void deleteArchive(String archive) {
+ public void deleteArchive(boolean withContextMenu, String archive) {
SWTBotTree tree = this.bot().tree();
SWTBotTreeItem treeItem = explorer.getNode(archive);
- contextTool.deleteArchive(tree, treeItem);
+ contextTool.deleteArchive(tree, treeItem, withContextMenu);
}
public ArchivePublishSettingsDialog publishToServer(
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-08-22 10:10:01 UTC (rev 43154)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java 2012-08-22 10:12:31 UTC (rev 43155)
@@ -91,10 +91,10 @@
return contextTool.editArchive(tree, treeItem);
}
- public void deleteArchive(String... pathToArchive) {
+ public void deleteArchive(boolean withContextMenu, String... pathToArchive) {
SWTBotTree tree = this.bot().tree();
SWTBotTreeItem treeItem = TreeHelper.expandNode(this.bot(), pathToArchive);
- contextTool.deleteArchive(tree, treeItem);
+ contextTool.deleteArchive(tree, treeItem, withContextMenu);
}
public ArchivePublishSettingsDialog publishToServer(boolean returnDialog,
12 years, 4 months
JBoss Tools SVN: r43154 - trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-08-22 06:10:01 -0400 (Wed, 22 Aug 2012)
New Revision: 43154
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/META-INF/MANIFEST.MF
Log:
update ui.bot.ext bundler version in manifest
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/META-INF/MANIFEST.MF 2012-08-22 10:06:54 UTC (rev 43153)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/META-INF/MANIFEST.MF 2012-08-22 10:10:01 UTC (rev 43154)
@@ -13,7 +13,7 @@
org.junit4;bundle-version="4.8.1",
org.apache.log4j;bundle-version="1.2.15",
org.eclipse.ui;bundle-version="3.6.0",
- org.jboss.tools.ui.bot.ext;bundle-version="3.2.0",
+ org.jboss.tools.ui.bot.ext;bundle-version="3.4.0",
org.eclipse.core.resources;bundle-version="3.6.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
12 years, 4 months
JBoss Tools SVN: r43153 - in trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj: pr4 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-08-22 06:06:54 -0400 (Wed, 22 Aug 2012)
New Revision: 43153
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/.classpath
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/.packages
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/.project
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/.settings/
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/bin/
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4aa.jar
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4ab.jar
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4ba.jar
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4bb.jar
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/src/
Log:
new test project for archives bot tests added
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/.classpath
===================================================================
(Binary files differ)
Property changes on: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/.classpath
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/.packages
===================================================================
(Binary files differ)
Property changes on: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/.packages
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/.project
===================================================================
(Binary files differ)
Property changes on: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/.project
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4aa.jar
===================================================================
(Binary files differ)
Property changes on: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4aa.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4ab.jar
===================================================================
(Binary files differ)
Property changes on: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4ab.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4ba.jar
===================================================================
(Binary files differ)
Property changes on: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4ba.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4bb.jar
===================================================================
(Binary files differ)
Property changes on: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/resources/prj/pr4/pr4bb.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
12 years, 4 months
JBoss Tools SVN: r43152 - in branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test: src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: psuchy
Date: 2012-08-22 06:05:42 -0400 (Wed, 22 Aug 2012)
New Revision: 43152
Modified:
branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/pom.xml
branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java
Log:
Modified: branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/pom.xml
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java
===================================================================
--- branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java 2012-08-22 09:41:56 UTC (rev 43151)
+++ branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java 2012-08-22 10:05:42 UTC (rev 43152)
@@ -49,6 +49,7 @@
e.printStackTrace();
}
robot.keyPress(KeyEvent.VK_RIGHT);
+ robot.keyRelease(KeyEvent.VK_ENTER);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
//KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.RIGHT, Keystrokes.CR, Keystrokes.LF);
12 years, 4 months
JBoss Tools SVN: r43151 - in branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test: src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: psuchy
Date: 2012-08-22 05:41:56 -0400 (Wed, 22 Aug 2012)
New Revision: 43151
Modified:
branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/pom.xml
branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java
Log:
Modified: branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/pom.xml
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java
===================================================================
--- branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java 2012-08-22 09:11:13 UTC (rev 43150)
+++ branches/jbosstools-3.3.x/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java 2012-08-22 09:41:56 UTC (rev 43151)
@@ -1,5 +1,8 @@
package org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences;
+import java.awt.AWTException;
+import java.awt.Robot;
+import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.List;
@@ -39,7 +42,16 @@
for (int i = 0; i < runtimesNumber; i++){
table.click(0, 0);
bot.button("Remove").click();
- KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.RIGHT, Keystrokes.CR, Keystrokes.LF);
+ Robot robot = null;
+ try {
+ robot = new Robot();
+ } catch (AWTException e) {
+ e.printStackTrace();
+ }
+ robot.keyPress(KeyEvent.VK_RIGHT);
+ robot.keyPress(KeyEvent.VK_ENTER);
+ robot.keyRelease(KeyEvent.VK_ENTER);
+ //KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.RIGHT, Keystrokes.CR, Keystrokes.LF);
bot.shell("Preferences").activate();
}
}
12 years, 4 months
JBoss Tools SVN: r43150 - in trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test: context and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-08-22 05:11:13 -0400 (Wed, 22 Aug 2012)
New Revision: 43150
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchiveViewReSwitchingTest.java
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/context/ArchiveContextMenu.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java
Log:
fixing archive bot tests
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchiveViewReSwitchingTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchiveViewReSwitchingTest.java 2012-08-22 08:53:19 UTC (rev 43149)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchiveViewReSwitchingTest.java 2012-08-22 09:11:13 UTC (rev 43150)
@@ -33,7 +33,7 @@
/* show all tested views */
console.show();
servers.show();
- errors .show();
+ errors.show();
/* create test project */
JavaProjectEntity project = new JavaProjectEntity();
Modified: 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 2012-08-22 08:53:19 UTC (rev 43149)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java 2012-08-22 09:11:13 UTC (rev 43150)
@@ -75,8 +75,8 @@
server.collapse();
server.expand();
boolean found = false;
- for (SWTBotTreeItem ti : server.getItems()) {
- if (ti.getText().contains(archive)) {
+ for (String node : server.getNodes()) {
+ if (node.contains(archive)) {
found = true;
break;
}
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java 2012-08-22 08:53:19 UTC (rev 43149)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/context/ArchiveContextMenu.java 2012-08-22 09:11:13 UTC (rev 43150)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.archives.ui.bot.test.context;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -19,8 +20,10 @@
import org.jboss.tools.archives.ui.bot.test.dialog.FolderCreatingDialog;
import org.jboss.tools.archives.ui.bot.test.dialog.NewJarDialog;
import org.jboss.tools.archives.ui.bot.test.dialog.UserLibrariesFilesetDialog;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
/**
*
@@ -96,6 +99,7 @@
SWTBotMenu menu = new SWTBotMenu(ContextMenuHelper.
getContextMenu(tree, "Delete Archive", false));
menu.click();
+ handleDeleteDialog();
SWTBotFactory.getUtil().waitForNonIgnoredJobs();
}
@@ -121,4 +125,15 @@
return new ArchivePublishSettingsDialog();
}
+ private void handleDeleteDialog() {
+ SWTBotExt bot = SWTBotFactory.getBot();
+ try {
+ bot.waitForShell(IDELabel.Shell.DELETE_NODE);
+ bot.shell(IDELabel.Shell.DELETE_NODE)
+ .bot().button(IDELabel.Button.YES).click();
+ } catch (WidgetNotFoundException exc) {
+ //do nothing here
+ }
+ }
+
}
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-08-22 08:53:19 UTC (rev 43149)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java 2012-08-22 09:11:13 UTC (rev 43150)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.archives.ui.bot.test.view;
+import java.util.List;
+
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton;
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;
@@ -42,7 +45,8 @@
public void buildArchiveNode(String... path) {
open.selectTreeNode(this.bot(), path);
- show().toolbarButton(IDELabel.ArchivesView.BUTTON_BUILD_ARCHIVE_NODE).click();
+ show();
+ toolbarButton(IDELabel.ArchivesView.BUTTON_BUILD_ARCHIVE_NODE).click();
}
public NewJarDialog createNewJarArchive(String project) {
@@ -109,11 +113,22 @@
public boolean itemExists(String... path) {
try {
this.bot().tree(0).getTreeItem(path[0]).collapse();
- TreeHelper.expandNode(bot, path);
+ TreeHelper.expandNode(bot(), path);
return true;
} catch (WidgetNotFoundException exc) {
return false;
}
}
+ private SWTBotToolbarButton toolbarButton(String toolbarToolTip) {
+ List<SWTBotToolbarButton> toolbarButtons = getToolbarButtons();
+ for (SWTBotToolbarButton button : toolbarButtons) {
+ if (button.isEnabled() && button.getToolTipText().equals(toolbarToolTip)) {
+ return button;
+ }
+ }
+ throw new WidgetNotFoundException("Toolbar button '" + toolbarToolTip + "' was not " +
+ "found or enabled");
+ }
+
}
12 years, 4 months