JBoss Tools SVN: r35381 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core: validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-05 13:07:37 -0400 (Wed, 05 Oct 2011)
New Revision: 35381
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties
Log:
JBIDE-9834
https://issues.jboss.org/browse/JBIDE-9834
Validation for configuring abstract types and types without bean constructors is added.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java 2011-10-05 17:02:22 UTC (rev 35380)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java 2011-10-05 17:07:37 UTC (rev 35381)
@@ -31,6 +31,7 @@
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
+import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.cdi.seam.config.core.definition.ConfigTypeDefinition;
@@ -237,6 +238,20 @@
}
}
}
+ List<TypeDefinition> ds = def.getTypeDefinitions();
+ for (TypeDefinition d: ds) {
+ if(!d.hasBeanConstructor()) {
+ ConfigTypeDefinition cd = (ConfigTypeDefinition)d;
+ SAXNode n = cd.getConfig().getNode();
+ if(d.isAbstract()) {
+ String message = NLS.bind(SeamConfigValidationMessages.TYPE_IS_ABSTRACT, cd.getParametedType().getSimpleName());
+ validator.addError(message, CDISeamConfigPreferences.ABSTRACT_TYPE_IS_CONFIGURED_AS_BEAN, new TextSourceReference(def.getFileObject(), file, n), file);
+ } else {
+ String message = NLS.bind(SeamConfigValidationMessages.NO_BEAN_CONSTRUCTOR, cd.getParametedType().getSimpleName());
+ validator.addError(message, CDISeamConfigPreferences.BEAN_CONSTRUCTOR_IS_MISSING, new TextSourceReference(def.getFileObject(), file, n), file);
+ }
+ }
+ }
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java 2011-10-05 17:02:22 UTC (rev 35380)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java 2011-10-05 17:07:37 UTC (rev 35381)
@@ -17,6 +17,8 @@
public static final String ANNOTATION_EXPECTED = INSTANCE.createSeverityOption("annotationExpected");
public static final String INLINE_BEAN_TYPE_MISMATCH = INSTANCE.createSeverityOption("inlineBeanTypeMismatch");
+ public static final String ABSTRACT_TYPE_IS_CONFIGURED_AS_BEAN = INSTANCE.createSeverityOption("abstractTypeIsConfiguredAsBean");
+ public static final String BEAN_CONSTRUCTOR_IS_MISSING = INSTANCE.createSeverityOption("beanConstructorIsMissing");
public static CDISeamConfigPreferences getInstance() {
return INSTANCE;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java 2011-10-05 17:02:22 UTC (rev 35380)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java 2011-10-05 17:07:37 UTC (rev 35381)
@@ -12,6 +12,8 @@
public static String UNRESOLVED_CONSTRUCTOR;
public static String ANNOTATION_EXPECTED;
public static String INLINE_BEAN_TYPE_MISMATCH;
+ public static String TYPE_IS_ABSTRACT;
+ public static String NO_BEAN_CONSTRUCTOR;
static {
NLS.initializeMessages(BUNDLE_NAME, SeamConfigValidationMessages.class);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties 2011-10-05 17:02:22 UTC (rev 35380)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties 2011-10-05 17:07:37 UTC (rev 35381)
@@ -3,4 +3,6 @@
UNRESOLVED_METHOD=Cannot resolve method in node {0}.
UNRESOLVED_CONSTRUCTOR=Cannot resolve constructor in type node {0}.
ANNOTATION_EXPECTED=Annotation types are only allowed here.
-INLINE_BEAN_TYPE_MISMATCH=Type mismatch: cannot convert from {0} to {1}
\ No newline at end of file
+INLINE_BEAN_TYPE_MISMATCH=Type mismatch: cannot convert from {0} to {1}.
+TYPE_IS_ABSTRACT=Abstract type {0} cannot be configured as a bean.
+NO_BEAN_CONSTRUCTOR=No bean constructor found for type {0}.
\ No newline at end of file
13 years, 3 months
JBoss Tools SVN: r35380 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-05 13:02:22 -0400 (Wed, 05 Oct 2011)
New Revision: 35380
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/DataBindingUtils.java
Log:
[JBIDE-9805] improved button enablement binding util
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/DataBindingUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/DataBindingUtils.java 2011-10-05 17:01:06 UTC (rev 35379)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/DataBindingUtils.java 2011-10-05 17:02:22 UTC (rev 35380)
@@ -23,7 +23,7 @@
import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.common.ui.CommonUIMessages;
@@ -44,13 +44,18 @@
* @param dbc
* the data binding context to use when binding
*/
- public static void bindButtonEnablementToValidationStatus(final Button button,
+ public static void bindEnablementToValidationStatus(final Control control,
DataBindingContext dbc, Binding... bindings) {
+ bindEnablementToValidationStatus(control, dbc, IStatus.ERROR, bindings);
+ }
+
+ public static void bindEnablementToValidationStatus(final Control control,
+ DataBindingContext dbc, int severity, Binding... bindings) {
dbc.bindValue(
- WidgetProperties.enabled().observe(button),
+ WidgetProperties.enabled().observe(control),
createAggregateValidationStatus(dbc, bindings),
new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER),
- new UpdateValueStrategy().setConverter(new Status2BooleanConverter(IStatus.ERROR)));
+ new UpdateValueStrategy().setConverter(new Status2BooleanConverter(severity)));
}
/**
@@ -68,16 +73,21 @@
DataBindingContext dbc, Binding... bindings) {
AggregateValidationStatus aggregatedValidationStatus;
if (bindings.length == 0) {
- aggregatedValidationStatus = new AggregateValidationStatus(dbc, AggregateValidationStatus.MAX_SEVERITY);
+ aggregatedValidationStatus =
+ new AggregateValidationStatus(
+ dbc, AggregateValidationStatus.MAX_SEVERITY);
} else {
- aggregatedValidationStatus = new AggregateValidationStatus(
- toObservableCollection(bindings), AggregateValidationStatus.MAX_SEVERITY);
+ aggregatedValidationStatus =
+ new AggregateValidationStatus(
+ toObservableCollection(bindings),
+ AggregateValidationStatus.MAX_SEVERITY);
}
return aggregatedValidationStatus;
}
/**
- * Returns an observable collection for a given array of validation status providers.
+ * Returns an observable collection for a given array of validation status
+ * providers.
*
* @param observableValue
* the array of observable values
13 years, 3 months
JBoss Tools SVN: r35379 - in trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: common and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-05 13:01:06 -0400 (Wed, 05 Oct 2011)
New Revision: 35379
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsDialog.java
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftImages.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/ImageRepository.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenshiftWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
Log:
[JBIDE-9793] added Application Details
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftImages.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftImages.java 2011-10-05 17:00:32 UTC (rev 35378)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftImages.java 2011-10-05 17:01:06 UTC (rev 35379)
@@ -11,6 +11,7 @@
package org.jboss.tools.openshift.express.internal.ui;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
import org.jboss.tools.openshift.express.internal.ui.common.ImageRepository;
public class OpenshiftImages {
@@ -23,4 +24,5 @@
public static final ImageDescriptor OPENSHIFT_LOGO_DARK = repo.create("openshift-logo-dark.png"); //$NON-NLS-1$
public static final ImageDescriptor OPENSHIFT_LOGO_WHITE = repo.create("openshift-logo-white.png"); //$NON-NLS-1$
public static final ImageDescriptor OPENSHIFT_LOGO_WHITE_MEDIUM = repo.create("openshift-logo-white-medium.png"); //$NON-NLS-1$
+ public static final Image OPENSHIFT_LOGO_WHITE_MEDIUM_IMG = repo.getImage("openshift-logo-white-medium.png"); //$NON-NLS-1$
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/ImageRepository.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/ImageRepository.java 2011-10-05 17:00:32 UTC (rev 35378)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/ImageRepository.java 2011-10-05 17:01:06 UTC (rev 35379)
@@ -19,6 +19,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator;
public class ImageRepository {
@@ -75,4 +76,8 @@
return null;
}
}
+
+ public Image getImage(String name) {
+ return imageRegistry.get(name);
+ }
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenshiftWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenshiftWizardPage.java 2011-10-05 17:00:32 UTC (rev 35378)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenshiftWizardPage.java 2011-10-05 17:01:06 UTC (rev 35379)
@@ -14,12 +14,15 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.IPageChangedListener;
import org.eclipse.jface.dialogs.PageChangedEvent;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
import org.jboss.tools.common.ui.databinding.ParametrizableWizardPageSupport;
import org.jboss.tools.openshift.express.internal.ui.OpenshiftImages;
@@ -45,16 +48,12 @@
IStatus.ERROR | IStatus.INFO | IStatus.WARNING | IStatus.CANCEL, this,
dbc);
Composite container = new Composite(parent, SWT.NONE);
+ GridLayoutFactory.fillDefaults().margins(6,6).applyTo(container);
+ Composite child = new Composite(container, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(child);
setControl(container);
initPageChangedListener();
-
- // container.addListener(SWT.Show, new Listener() {
- // @Override
- // public void handleEvent(Event event) {
- // onPageVisible(dbc);
- // }
- // });
- doCreateControls(container, dbc);
+ doCreateControls(child, dbc);
}
protected void initPageChangedListener() {
Added: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsDialog.java (rev 0)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsDialog.java 2011-10-05 17:01:06 UTC (rev 35379)
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * 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.wizard;
+
+import java.util.concurrent.Callable;
+
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.utils.RFC822DateUtils;
+import org.jboss.tools.openshift.express.internal.ui.OpenshiftImages;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationDetailsDialog extends TitleAreaDialog {
+
+ private IApplication application;
+
+ public ApplicationDetailsDialog(IApplication application, Shell parentShell) {
+ super(parentShell);
+ this.application = application;
+ setTitleImage(OpenshiftImages.OPENSHIFT_LOGO_WHITE_MEDIUM_IMG);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ parent.getShell().setText("Application Details");
+ setTitle(NLS.bind("Application {0}", application.getName()));
+
+ Composite container = new Composite(parent, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container);
+ GridLayoutFactory.fillDefaults().numColumns(2).margins(6, 6).applyTo(container);
+
+ Label separator = new Label(container, SWT.HORIZONTAL | SWT.SEPARATOR);
+ GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(separator);
+
+ createDetails("Name", application.getName(), container);
+ createDetails("Type", application.getCartridge().getName(), container);
+ createDetails("Creation Time", new ErrorMessageCallable<String>("Creation Time") {
+
+ @Override
+ public String call() throws Exception {
+ return RFC822DateUtils.getString(application.getCreationTime());
+ }
+ }.get(), container);
+ createDetails("UUID", new ErrorMessageCallable<String>("UUID") {
+
+ @Override
+ public String call() throws Exception {
+ return application.getUUID();
+ }
+ }.get(), container);
+ createDetails("Git URL", new ErrorMessageCallable<String>("Git URL") {
+
+ @Override
+ public String call() throws Exception {
+ return application.getGitUri();
+ }
+ }.get(), container);
+ createDetails("Public URL", new ErrorMessageCallable<String>("Public URL") {
+
+ @Override
+ public String call() throws Exception {
+ return application.getApplicationUrl();
+ }
+ }.get(), container);
+
+ return container;
+ }
+
+ private void createDetails(String name, String value, Composite container) {
+ Label label = new Label(container, SWT.None);
+ label.setText(name);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(label);
+ Text text = new Text(container, SWT.BORDER);
+ text.setEditable(false);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(text);
+ text.setText(value);
+ }
+
+
+ private abstract class ErrorMessageCallable<T> implements Callable<T> {
+
+ private String fieldName;
+
+ public ErrorMessageCallable(String fieldName) {
+ this.fieldName = fieldName;
+ }
+
+ public T get() {
+ try {
+ return call();
+ } catch (Exception e) {
+ setErrorMessage(NLS.bind("Could not get {0}: {1}", fieldName, e.getMessage()));
+ return null;
+ }
+ }
+
+ @Override
+ public abstract T call() throws Exception;
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsDialog.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-05 17:00:32 UTC (rev 35378)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-05 17:01:06 UTC (rev 35379)
@@ -74,17 +74,19 @@
@Override
protected void doCreateControls(Composite container, DataBindingContext dbc) {
- GridLayoutFactory.fillDefaults().numColumns(3).margins(10, 10).spacing(4, 4).applyTo(container);
+ GridLayoutFactory.fillDefaults().numColumns(3).applyTo(container);
Group group = new Group(container, SWT.BORDER);
- group.setText("Available applications");
- GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).span(3, 1).applyTo(group);
+ group.setText("Available Applications");
+ GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).hint(400, 160).span(3, 1)
+ .applyTo(group);
FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
fillLayout.marginHeight = 6;
fillLayout.marginWidth = 6;
group.setLayout(fillLayout);
- this.viewer = createApplicationTable(group);
+ Composite tableContainer = new Composite(group, SWT.NONE);
+ this.viewer = createTable(tableContainer);
viewer.addDoubleClickListener(onApplicationDoubleClick());
Binding selectedApplicationBinding = dbc.bindValue(
@@ -112,11 +114,18 @@
Button deleteButton = new Button(container, SWT.PUSH);
deleteButton.setText("&Delete");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(80, 30).applyTo(deleteButton);
- DataBindingUtils.bindButtonEnablementToValidationStatus(deleteButton, dbc, selectedApplicationBinding);
+ DataBindingUtils.bindEnablementToValidationStatus(deleteButton, dbc, selectedApplicationBinding);
deleteButton.addSelectionListener(onDelete(dbc));
+
+ Button detailsButton = new Button(container, SWT.PUSH);
+ detailsButton.setText("De&tails");
+ GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).hint(80, 30).applyTo(detailsButton);
+ DataBindingUtils.bindEnablementToValidationStatus(detailsButton, dbc, IStatus.INFO, selectedApplicationBinding);
+ detailsButton.addSelectionListener(onDetails(dbc));
+
}
- protected IDoubleClickListener onApplicationDoubleClick() {
+ private IDoubleClickListener onApplicationDoubleClick() {
return new IDoubleClickListener() {
@Override
@@ -140,23 +149,9 @@
};
}
- protected SelectionAdapter onNew(DataBindingContext dbc) {
- return new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- Shell shell = getContainer().getShell();
- if (WizardUtils.openWizardDialog(new NewApplicationDialog(model.getUser()), shell)
- == Dialog.OK) {
- viewer.refresh();
- }
- }
- };
- }
-
- protected TableViewer createApplicationTable(Group group) {
- Composite tableContainer = new Composite(group, SWT.NONE);
+ protected TableViewer createTable(Composite tableContainer) {
Table table = new Table(tableContainer, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL);
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(table);
table.setLinesVisible(true);
table.setHeaderVisible(true);
TableColumnLayout tableLayout = new TableColumnLayout();
@@ -172,6 +167,14 @@
cell.setText(application.getName());
}
}, viewer, tableLayout);
+ createTableColumn("Type", 1, new CellLabelProvider() {
+
+ @Override
+ public void update(ViewerCell cell) {
+ IApplication application = (IApplication) cell.getElement();
+ cell.setText(application.getCartridge().getName());
+ }
+ }, viewer, tableLayout);
createTableColumn("URL", 3, new CellLabelProvider() {
@Override
@@ -210,6 +213,31 @@
};
}
+ private SelectionAdapter onNew(DataBindingContext dbc) {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Shell shell = getContainer().getShell();
+ if (WizardUtils.openWizardDialog(new NewApplicationDialog(model.getUser()), shell)
+ == Dialog.OK) {
+ viewer.refresh();
+ }
+ }
+ };
+ }
+
+ private SelectionAdapter onDetails(DataBindingContext dbc) {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Shell shell = getContainer().getShell();
+ new ApplicationDetailsDialog(model.getSelectedApplication(), shell).open();
+ }
+ };
+ }
+
@Override
protected void onPageActivated(DataBindingContext dbc) {
try {
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-10-05 17:00:32 UTC (rev 35378)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-10-05 17:01:06 UTC (rev 35379)
@@ -97,17 +97,17 @@
Binding passwordBinding = DataBindingUtils.bindMandatoryTextField(
passwordText, "Password", CredentialsWizardPageModel.PROPERTY_PASSWORD, model, dbc);
- Label spacerLabel = new Label(container, SWT.None);
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1).applyTo(spacerLabel);
-
// Label credentialsValidatyLabel = new Label(container, SWT.None);
// GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).hint(64,
// 64).applyTo(credentialsValidatyLabel);
+ Label spacerLabel = new Label(container, SWT.None);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(spacerLabel);
+
this.validateButton = new Button(container, SWT.NONE);
validateButton.setText("&Validate");
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).indent(0, 10).hint(100, 30).applyTo(validateButton);
- DataBindingUtils.bindButtonEnablementToValidationStatus(
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1).indent(0, 10).hint(100, 30).applyTo(validateButton);
+ DataBindingUtils.bindEnablementToValidationStatus(
validateButton,
dbc,
rhLoginBining, passwordBinding);
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2011-10-05 17:00:32 UTC (rev 35378)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2011-10-05 17:01:06 UTC (rev 35379)
@@ -54,7 +54,8 @@
protected String initRhLogin() {
String rhLogin = null;
rhLogin = rhLoginPreferenceValue.get();
- if (rhLogin == null) {
+ if (rhLogin == null
+ || rhLogin.length() == 0) {
rhLogin = getUserConfiguration();
}
return rhLogin;
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-10-05 17:00:32 UTC (rev 35378)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-10-05 17:01:06 UTC (rev 35379)
@@ -68,7 +68,7 @@
}
protected void doCreateControls(Composite container, DataBindingContext dbc) {
- GridLayoutFactory.fillDefaults().numColumns(3).margins(10, 10).applyTo(container);
+ GridLayoutFactory.fillDefaults().numColumns(3).applyTo(container);
Label namespaceLabel = new Label(container, SWT.NONE);
namespaceLabel.setText("&Domain name");
@@ -98,7 +98,7 @@
GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).span(2, 1).indent(0, 10).hint(160, 34)
.applyTo(createButton);
createButton.addSelectionListener(onCreate(dbc));
- DataBindingUtils.bindButtonEnablementToValidationStatus(createButton, dbc);
+ DataBindingUtils.bindEnablementToValidationStatus(createButton, dbc);
dbc.bindValue(
new WritableValue(null, IDomain.class)
13 years, 3 months
JBoss Tools SVN: r35378 - in trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test: utils and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-05 13:00:32 -0400 (Wed, 05 Oct 2011)
New Revision: 35378
Modified:
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserTest.java
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationAsserts.java
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationInfoAsserts.java
Log:
[JBIDE-9793] moved RHC822DateUtils to visible package
Modified: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserTest.java 2011-10-05 17:00:12 UTC (rev 35377)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserTest.java 2011-10-05 17:00:32 UTC (rev 35378)
@@ -29,13 +29,13 @@
import org.jboss.tools.openshift.express.client.ISSHPublicKey;
import org.jboss.tools.openshift.express.client.OpenshiftException;
import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.client.utils.RFC822DateUtils;
import org.jboss.tools.openshift.express.internal.client.ApplicationInfo;
import org.jboss.tools.openshift.express.internal.client.InternalUser;
import org.jboss.tools.openshift.express.internal.client.UserInfo;
import org.jboss.tools.openshift.express.internal.client.test.fakes.CartridgeResponseFake;
import org.jboss.tools.openshift.express.internal.client.test.fakes.NoopOpenshiftServiceFake;
import org.jboss.tools.openshift.express.internal.client.test.fakes.UserInfoResponseFake;
-import org.jboss.tools.openshift.express.internal.client.utils.RFC822DateUtils;
import org.junit.Before;
import org.junit.Test;
Modified: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationAsserts.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationAsserts.java 2011-10-05 17:00:12 UTC (rev 35377)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationAsserts.java 2011-10-05 17:00:32 UTC (rev 35378)
@@ -24,8 +24,8 @@
import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.utils.RFC822DateUtils;
import org.jboss.tools.openshift.express.internal.client.Application;
-import org.jboss.tools.openshift.express.internal.client.utils.RFC822DateUtils;
/**
* @author André Dietisheim
Modified: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationInfoAsserts.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationInfoAsserts.java 2011-10-05 17:00:12 UTC (rev 35377)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationInfoAsserts.java 2011-10-05 17:00:32 UTC (rev 35378)
@@ -20,8 +20,8 @@
import javax.xml.datatype.DatatypeConfigurationException;
import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.utils.RFC822DateUtils;
import org.jboss.tools.openshift.express.internal.client.ApplicationInfo;
-import org.jboss.tools.openshift.express.internal.client.utils.RFC822DateUtils;
/**
* @author André Dietisheim
13 years, 3 months
JBoss Tools SVN: r35377 - in trunk/as/plugins/org.jboss.tools.openshift.express.client: src/org/jboss/tools/openshift/express/client and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-05 13:00:12 -0400 (Wed, 05 Oct 2011)
New Revision: 35377
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client/utils/
trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client/utils/RFC822DateUtils.java
Removed:
trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/internal/client/utils/RFC822DateUtils.java
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/internal/client/response/unmarshalling/AbstractOpenshiftJsonResponseUnmarshaller.java
Log:
[JBIDE-9793] moved RHC822DateUtils to visible package
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF 2011-10-05 16:37:27 UTC (rev 35376)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF 2011-10-05 17:00:12 UTC (rev 35377)
@@ -13,6 +13,7 @@
.
Export-Package: org.jboss.dmr;x-friends:="org.jboss.ide.eclipse.as.openshift.test",
org.jboss.tools.openshift.express.client,
+ org.jboss.tools.openshift.express.client.utils,
org.jboss.tools.openshift.express.internal.client;x-friends:="org.jboss.ide.eclipse.as.openshift.test",
org.jboss.tools.openshift.express.internal.client.request;x-friends:="org.jboss.ide.eclipse.as.openshift.test",
org.jboss.tools.openshift.express.internal.client.request.marshalling;x-friends:="org.jboss.ide.eclipse.as.openshift.test",
Copied: trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client/utils/RFC822DateUtils.java (from rev 35354, trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/internal/client/utils/RFC822DateUtils.java)
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client/utils/RFC822DateUtils.java (rev 0)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client/utils/RFC822DateUtils.java 2011-10-05 17:00:12 UTC (rev 35377)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.client.utils;
+
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+
+/**
+ * @author André Dietisheim
+ */
+public class RFC822DateUtils {
+
+ public static Date getDate(String rfc822DateString) throws DatatypeConfigurationException {
+ // SimpleDateFormat can't handle RFC822 (-04:00 instead of GMT-04:00)
+ // date formats
+ //
+ // SimpleDateFormat dateFormat = new
+ // SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
+ // return dateFormat.parse(propertyNode.asString());
+ GregorianCalendar calendar =
+ DatatypeFactory.newInstance().newXMLGregorianCalendar(rfc822DateString).toGregorianCalendar();
+ return calendar.getTime();
+ }
+
+ public static String getString(Date date) throws DatatypeConfigurationException {
+ GregorianCalendar calendar = (GregorianCalendar) GregorianCalendar.getInstance();
+ return DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar).toXMLFormat();
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/client/utils/RFC822DateUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/internal/client/response/unmarshalling/AbstractOpenshiftJsonResponseUnmarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/internal/client/response/unmarshalling/AbstractOpenshiftJsonResponseUnmarshaller.java 2011-10-05 16:37:27 UTC (rev 35376)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/internal/client/response/unmarshalling/AbstractOpenshiftJsonResponseUnmarshaller.java 2011-10-05 17:00:12 UTC (rev 35377)
@@ -17,9 +17,9 @@
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;
import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.utils.RFC822DateUtils;
import org.jboss.tools.openshift.express.internal.client.IOpenshiftJsonConstants;
import org.jboss.tools.openshift.express.internal.client.response.OpenshiftResponse;
-import org.jboss.tools.openshift.express.internal.client.utils.RFC822DateUtils;
/**
* @author André Dietisheim
Deleted: trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/internal/client/utils/RFC822DateUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/internal/client/utils/RFC822DateUtils.java 2011-10-05 16:37:27 UTC (rev 35376)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.client/src/org/jboss/tools/openshift/express/internal/client/utils/RFC822DateUtils.java 2011-10-05 17:00:12 UTC (rev 35377)
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.client.utils;
-
-import java.util.Date;
-import java.util.GregorianCalendar;
-
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
-
-/**
- * @author André Dietisheim
- */
-public class RFC822DateUtils {
-
- public static Date getDate(String rfc822DateString) throws DatatypeConfigurationException {
- // SimpleDateFormat can't handle RFC822 (-04:00 instead of GMT-04:00)
- // date formats
- //
- // SimpleDateFormat dateFormat = new
- // SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
- // return dateFormat.parse(propertyNode.asString());
- GregorianCalendar calendar =
- DatatypeFactory.newInstance().newXMLGregorianCalendar(rfc822DateString).toGregorianCalendar();
- return calendar.getTime();
- }
-
- public static String getString(Date date) throws DatatypeConfigurationException {
- GregorianCalendar calendar = (GregorianCalendar) GregorianCalendar.getInstance();
- return DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar).toXMLFormat();
- }
-}
13 years, 3 months
JBoss Tools SVN: r35376 - branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-10-05 12:37:27 -0400 (Wed, 05 Oct 2011)
New Revision: 35376
Modified:
branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java
branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java
Log:
JBIDE-9750
Modified: branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java
===================================================================
--- branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java 2011-10-05 16:35:04 UTC (rev 35375)
+++ branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java 2011-10-05 16:37:27 UTC (rev 35376)
@@ -331,6 +331,9 @@
serverNameText.removeModifyListener(serverNameTextListener);
serverPortText.removeModifyListener(serverPortTextListener);
serverDeployerText.removeModifyListener(serverDeployerTextListener);
+ useCredentialsButton.removeSelectionListener(useCredentialsButtonSelectionListener);
+ userNameText.removeModifyListener(userNameTextListener);
+ passwordText.removeModifyListener(passwordTextListener);
}
private void updateControls() {
@@ -454,15 +457,30 @@
serverPortText.addModifyListener(serverPortTextListener);
serverDeployerText.addModifyListener(serverDeployerTextListener);
useCredentialsButton.addSelectionListener(useCredentialsButtonSelectionListener);
+ userNameText.addModifyListener(userNameTextListener);
+ passwordText.addModifyListener(passwordTextListener);
}
private SelectionListener useCredentialsButtonSelectionListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
userNameText.setEnabled(useCredentialsButton.getSelection());
passwordText.setEnabled(useCredentialsButton.getSelection());
+ deploymentInfo.setUseCredentials(useCredentialsButton.getSelection());
}
};
+ private ModifyListener userNameTextListener = new ModifyListener() {
+ public void modifyText(ModifyEvent event) {
+ deploymentInfo.setUserName(userNameText.getText());
+ }
+ };
+
+ private ModifyListener passwordTextListener = new ModifyListener() {
+ public void modifyText(ModifyEvent event) {
+ deploymentInfo.setPassword(passwordText.getText());
+ }
+ };
+
private ModifyListener serverNameTextListener = new ModifyListener() {
public void modifyText(ModifyEvent event) {
deploymentInfo.setServerName(serverNameText.getText());
Modified: branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java
===================================================================
--- branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java 2011-10-05 16:35:04 UTC (rev 35375)
+++ branches/jbosstools-3.2.x/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java 2011-10-05 16:37:27 UTC (rev 35376)
@@ -13,6 +13,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.jbpm.gd.common.util.Base64Converter;
+import org.jbpm.gd.jpdl.Logger;
import org.jbpm.gd.jpdl.editor.JpdlEditor;
public class ProcessArchiveDeployer {
@@ -44,7 +45,7 @@
if (url == null) return false;
URLConnection connection = openConnection(url);
if (connection == null) return false;
- connection.setDoOutput(true);
+ prepareConnection(connection);
String response = receiveData(connection);
if (response == null) {
return false;
@@ -146,8 +147,14 @@
showFileNotFoundException();
return null;
} catch (IOException e) {
- showReceiveDataException();
- return null;
+ if (e.getMessage().contains("401")) {
+ showNotAuthorizedException();
+ return null;
+ } else {
+ Logger.logError("Unexpected IOException", e);
+ showReceiveDataException();
+ return null;
+ }
}
}
@@ -177,6 +184,18 @@
dialog.open();
}
+ private void showNotAuthorizedException() {
+ MessageDialog dialog = new MessageDialog(
+ jpdlEditor.getSite().getShell(),
+ "Authorization Failed",
+ null,
+ "The used credentials are not allowed to establish a connection to the server.",
+ SWT.ICON_ERROR,
+ new String[] { "OK" },
+ 0);
+ dialog.open();
+ }
+
private void showFileNotFoundException() {
MessageDialog dialog = new MessageDialog(
jpdlEditor.getSite().getShell(),
13 years, 3 months
JBoss Tools SVN: r35375 - trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-10-05 12:35:04 -0400 (Wed, 05 Oct 2011)
New Revision: 35375
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java
Log:
JBIDE-9750
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java 2011-10-05 14:16:11 UTC (rev 35374)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/DeploymentForm.java 2011-10-05 16:35:04 UTC (rev 35375)
@@ -331,6 +331,9 @@
serverNameText.removeModifyListener(serverNameTextListener);
serverPortText.removeModifyListener(serverPortTextListener);
serverDeployerText.removeModifyListener(serverDeployerTextListener);
+ useCredentialsButton.removeSelectionListener(useCredentialsButtonSelectionListener);
+ userNameText.removeModifyListener(userNameTextListener);
+ passwordText.removeModifyListener(passwordTextListener);
}
private void updateControls() {
@@ -454,15 +457,30 @@
serverPortText.addModifyListener(serverPortTextListener);
serverDeployerText.addModifyListener(serverDeployerTextListener);
useCredentialsButton.addSelectionListener(useCredentialsButtonSelectionListener);
+ userNameText.addModifyListener(userNameTextListener);
+ passwordText.addModifyListener(passwordTextListener);
}
private SelectionListener useCredentialsButtonSelectionListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
userNameText.setEnabled(useCredentialsButton.getSelection());
passwordText.setEnabled(useCredentialsButton.getSelection());
+ deploymentInfo.setUseCredentials(useCredentialsButton.getSelection());
}
};
+ private ModifyListener userNameTextListener = new ModifyListener() {
+ public void modifyText(ModifyEvent event) {
+ deploymentInfo.setUserName(userNameText.getText());
+ }
+ };
+
+ private ModifyListener passwordTextListener = new ModifyListener() {
+ public void modifyText(ModifyEvent event) {
+ deploymentInfo.setPassword(passwordText.getText());
+ }
+ };
+
private ModifyListener serverNameTextListener = new ModifyListener() {
public void modifyText(ModifyEvent event) {
deploymentInfo.setServerName(serverNameText.getText());
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java 2011-10-05 14:16:11 UTC (rev 35374)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/deployment/ProcessArchiveDeployer.java 2011-10-05 16:35:04 UTC (rev 35375)
@@ -13,6 +13,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.jbpm.gd.common.util.Base64Converter;
+import org.jbpm.gd.jpdl.Logger;
import org.jbpm.gd.jpdl.editor.JpdlEditor;
public class ProcessArchiveDeployer {
@@ -44,7 +45,7 @@
if (url == null) return false;
URLConnection connection = openConnection(url);
if (connection == null) return false;
- connection.setDoOutput(true);
+ prepareConnection(connection);
String response = receiveData(connection);
if (response == null) {
return false;
@@ -146,8 +147,14 @@
showFileNotFoundException();
return null;
} catch (IOException e) {
- showReceiveDataException();
- return null;
+ if (e.getMessage().contains("401")) {
+ showNotAuthorizedException();
+ return null;
+ } else {
+ Logger.logError("Unexpected IOException", e);
+ showReceiveDataException();
+ return null;
+ }
}
}
@@ -177,6 +184,18 @@
dialog.open();
}
+ private void showNotAuthorizedException() {
+ MessageDialog dialog = new MessageDialog(
+ jpdlEditor.getSite().getShell(),
+ "Authorization Failed",
+ null,
+ "The used credentials are not allowed to establish a connection to the server.",
+ SWT.ICON_ERROR,
+ new String[] { "OK" },
+ 0);
+ dialog.open();
+ }
+
private void showFileNotFoundException() {
MessageDialog dialog = new MessageDialog(
jpdlEditor.getSite().getShell(),
13 years, 3 months
JBoss Tools SVN: r35374 - trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-05 10:16:11 -0400 (Wed, 05 Oct 2011)
New Revision: 35374
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.xml
Log:
[JBIDE-9845] corrected publishing method
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.xml 2011-10-05 14:14:01 UTC (rev 35373)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.xml 2011-10-05 14:16:11 UTC (rev 35374)
@@ -36,7 +36,7 @@
<behaviour
behaviourDelegate="org.jboss.ide.eclipse.as.egit.core.EgitBehaviourDelegate"
name="%EGitMethodName"
- publishMethod="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
+ publishMethod="org.jboss.ide.eclipse.as.egit.core.EgitPublishMethod"
serverTypes="%ServerTypesJBoss7"
typeId="egit">
</behaviour>
13 years, 3 months
JBoss Tools SVN: r35373 - in trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-05 10:14:01 -0400 (Wed, 05 Oct 2011)
New Revision: 35373
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.properties
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublishMethod.java
Log:
[JBIDE-9845] added extension
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/META-INF/MANIFEST.MF 2011-10-05 14:13:40 UTC (rev 35372)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/META-INF/MANIFEST.MF 2011-10-05 14:14:01 UTC (rev 35373)
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: EGit Integration Core
+Bundle-Name: Bundle-Name
Bundle-SymbolicName: org.jboss.ide.eclipse.as.egit.core;singleton:=true
Bundle-Version: 2.3.0.qualifier
Bundle-Activator: org.jboss.ide.eclipse.as.egit.core.internal.EGitCoreActivator
@@ -15,7 +15,7 @@
org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Vendor: JBoss by Red Hat
+Bundle-Vendor: Bundle-Vendor
Export-Package: org.jboss.ide.eclipse.as.egit.core,
org.jboss.ide.eclipse.as.egit.core.internal;x-friends:="org.jboss.ide.eclipse.as.egit.test",
org.jboss.ide.eclipse.as.egit.core.module
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.properties (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.properties 2011-10-05 14:14:01 UTC (rev 35373)
@@ -0,0 +1,4 @@
+Bundle-Vendor = JBoss by Red Hat
+Bundle-Name = JBossAS RSE Tools
+ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
+EGitMethodName=EGit Deployment
\ No newline at end of file
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.xml 2011-10-05 14:13:40 UTC (rev 35372)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/plugin.xml 2011-10-05 14:14:01 UTC (rev 35373)
@@ -31,4 +31,14 @@
</publishMethod>
</extension>
-->
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+ behaviourDelegate="org.jboss.ide.eclipse.as.egit.core.EgitBehaviourDelegate"
+ name="%EGitMethodName"
+ publishMethod="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
+ serverTypes="%ServerTypesJBoss7"
+ typeId="egit">
+ </behaviour>
+ </extension>
</plugin>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java 2011-10-05 14:13:40 UTC (rev 35372)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java 2011-10-05 14:14:01 UTC (rev 35373)
@@ -77,7 +77,7 @@
null,
getFormattedUser(userConfig.getAuthorName(), userConfig.getAuthorEmail()),
getFormattedUser(userConfig.getCommitterName(), userConfig.getCommitterEmail()),
- "Initial commit");
+ "Push from JBoss Tools Server adapt er " + System.currentTimeMillis());
op.setCommitAll(true);
op.setRepository(repository);
op.execute(monitor);
@@ -132,6 +132,8 @@
repository.toString(), remote));
}
createPushOperation(remoteConfig, repository).run(monitor);
+ } catch (CoreException e) {
+ throw e;
} catch (Exception e) {
throw new CoreException(createStatus(e, "Could not push repo {0}", repository.toString()));
}
@@ -400,9 +402,9 @@
private static IStatus createStatus(Exception e, String message, String... arguments) throws CoreException {
IStatus status = null;
if (e == null) {
- new Status(IStatus.ERROR, EGitCoreActivator.PLUGIN_ID, NLS.bind(message, arguments));
+ status = new Status(IStatus.ERROR, EGitCoreActivator.PLUGIN_ID, NLS.bind(message, arguments));
} else {
- new Status(IStatus.ERROR, EGitCoreActivator.PLUGIN_ID, NLS.bind(message, arguments), e);
+ status = new Status(IStatus.ERROR, EGitCoreActivator.PLUGIN_ID, NLS.bind(message, arguments), e);
}
return status;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublishMethod.java 2011-10-05 14:13:40 UTC (rev 35372)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublishMethod.java 2011-10-05 14:14:01 UTC (rev 35373)
@@ -11,10 +11,6 @@
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
public class EgitPublishMethod implements IJBossServerPublishMethod {
-// @Override
-// public IJBossServerPublishMethodType getPublishMethodType() {
-// return ExtensionManager.getDefault().getPublishMethod(getPublishMethodId());
-// }
public String getPublishMethodId() {
return EgitBehaviourDelegate.ID;
13 years, 3 months
JBoss Tools SVN: r35372 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test: openon and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-10-05 10:13:40 -0400 (Wed, 05 Oct 2011)
New Revision: 35372
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java
Log:
CDI OpenOn test operates on beans.xml
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java 2011-10-05 14:03:03 UTC (rev 35371)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java 2011-10-05 14:13:40 UTC (rev 35372)
@@ -58,7 +58,7 @@
public class BeansEditorTest extends SWTTestExt {
private static final String descPath = "WebContent/WEB-INF/beans.xml";
- private static final String project = "CDIProject";
+ private static final String project = "CDIProject1";
private static final Logger LOGGER = Logger.getLogger(BeansEditorTest.class.getName());
@BeforeClass
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java 2011-10-05 14:03:03 UTC (rev 35371)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java 2011-10-05 14:13:40 UTC (rev 35372)
@@ -1,18 +1,13 @@
package org.jboss.tools.cdi.bot.test.openon;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
+import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIBase;
import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIUtil;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.SWTJBTExt;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.Timing;
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.types.ViewType;
-import org.jboss.tools.ui.bot.ext.view.ProblemsView;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -23,64 +18,84 @@
* Test operates on hyperlinks-openons
*
* @author Jaroslav Jankovic
+ *
+ *
+ * TO DO
+ *
+ * - OpenOn for Disposer/Produce and for injection point works
+ * - Classes indication for Open Injected Class works
+ *
+ *
*/
@Require(perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({ CDIAllBotTests.class })
-public class CDIOpenOnTest extends SWTTestExt {
-
- //private static final Logger LOGGER = Logger.getLogger(CDIQuickFixTest.class.getName());
- private static final String PROJECT_NAME = "CDIProject";
+public class CDIOpenOnTest extends CDIBase {
+
+ // private static final Logger LOGGER =
+ // Logger.getLogger(CDIQuickFixTest.class.getName());
+ private static final String PROJECT_NAME = "CDIProject3";
private static final String PACKAGE_NAME = "org.cdi.test";
-
-
+
@BeforeClass
public static void setup() {
- eclipse.showView(ViewType.PROJECT_EXPLORER);
- CDIUtil.createAndCheckCDIProject(bot, util, projectExplorer, PROJECT_NAME);
+ eclipse.showView(ViewType.PROJECT_EXPLORER);
}
-
+
@After
public void waitForJobs() {
util.waitForNonIgnoredJobs();
}
-
+
@Test
- public void testInjectHyperlink() {
- CDIUtil.bean(PACKAGE_NAME, "Animal", true, false, false, false, null,
- null, null, null).finish();
- bot.sleep(Timing.time1S());
- util.waitForNonIgnoredJobs();
+ public void testCreateProject() {
+ createAndCheckCDIProject(bot, util, projectExplorer, PROJECT_NAME);
+ }
+
+ @Test
+ public void testInjectOpenOn() {
+
+ createComponent(CDICOMPONENT.BEAN, "Animal", PACKAGE_NAME, null);
+
+ createComponent(CDICOMPONENT.BEAN, "BrokenFarm", PACKAGE_NAME, null);
+
+ CDIUtil.copyResourceToClass(getEd(), CDIOpenOnTest.class
+ .getResourceAsStream("/resources/cdi/BrokenFarm.java.cdi"),
+ false);
+ openOn("@Inject", "BrokenFarm.java", true);
+ assertTrue("ERROR: redirected to " + getEd().getTitle(), getEd()
+ .getTitle().equals("Animal.java"));
+ }
+
+ @Test
+ public void testBeansXMLClassesOpenOn() {
+
+ // https://issues.jboss.org/browse/JBIDE-7025
+ createComponent(CDICOMPONENT.BEANSXML, null, PROJECT_NAME + "/WebContent/WEB-INF", null);
- CDIUtil.bean(PACKAGE_NAME, "BrokenFarm", true, false, false, false, null,
- null, null, null).finish();
- util.waitForNonIgnoredJobs();
- SWTBotEditor ed = bot.activeEditor();
- CDIUtil.copyResourceToClass(ed, CDIOpenOnTest.class
- .getResourceAsStream("/resources/cdi/BrokenFarm.java.cdi"), false);
+ createComponent(CDICOMPONENT.DECORATOR, "D1", PACKAGE_NAME, "java.util.Set");
+ bot.editorByTitle("beans.xml").show();
+ bot.cTabItem("Source").activate();
+ openOn(PACKAGE_NAME + ".D1", "beans.xml", false);
+ //assertTrue(bot.activeEditor().getTitle(), bot.activeEditor().getTitle().equals("D1.java"));
- SWTBotTreeItem warningNode = ProblemsView.getWarningsNode(bot);
- assertNull("Warnings node should be empty.", warningNode);
- String openOnString = "@Inject";
- ed = SWTJBTExt.selectTextInSourcePane(bot, "BrokenFarm.java", openOnString, 1, openOnString.length()-1);
- ed.setFocus();
- bot.menu("Navigate").menu("Open Hyperlink").click();
- bot.activeShell().bot().table(0).click(1, 0);
- bot.sleep(Timing.time1S());
- ed = bot.activeEditor();
- assertTrue("ERROR: redirected to " + ed.getTitle(), ed.getTitle().equals("Animal.java"));
+ createComponent(CDICOMPONENT.INTERCEPTOR, "Interceptor1", PACKAGE_NAME, null);
+ bot.editorByTitle("beans.xml").show();
+ openOn(PACKAGE_NAME + ".Interceptor1", "beans.xml", false);
+ //assertTrue("ERROR: redirected to " + getEd(), getEd().getTitle().equals("Interceptor1.java"));
}
-
- /*
- * TO DO
- *
- * - https://issues.jboss.org/browse/JBIDE-8202
- * - https://issues.jboss.org/browse/JBIDE-8692
- * - OpenOn for Disposer/Produce and for injection point works
- * - Classes indication for Open Injected Class works
- * - OpenOn works in beans.xml => https://jira.jboss.org/browse/JBIDE-7025
- *
- *
- */
+
+ @Test
+ public void testResourceOpenOn() {
+
+ // https://issues.jboss.org/browse/JBIDE-8202
+ }
+
+ @Test
+ public void testGenericOpenOn() {
+
+ // https://issues.jboss.org/browse/JBIDE-8692
+ }
+
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java 2011-10-05 14:03:03 UTC (rev 35371)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java 2011-10-05 14:13:40 UTC (rev 35372)
@@ -1,12 +1,11 @@
package org.jboss.tools.cdi.bot.test.quickfix;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
+import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIBase;
import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIUtil;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
@@ -28,18 +27,12 @@
@Require(perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({ CDIAllBotTests.class })
-public class CDIQuickFixTest extends SWTTestExt {
+public class CDIQuickFixTest extends CDIBase {
- private static final String PROJECT_NAME = "CDIProject";
+ private static final String PROJECT_NAME = "CDIProject2";
private static final String PACKAGE_NAME = "org.cdi.test";
private static SWTBotTreeItem[] problemsTrees;
- private static final String LINE_SEPARATOR = System.getProperty("line.separator");
- private enum PROBLEM_TYPE {WARNINGS, ERRORS}
- private enum ANNOTATIONS {SERIALIZABLE, TARGET, RETENTION, NAMED, TYPED, DISPOSES, OBSERVES, INTERCEPTOR,
- SPECIALIZES, DECORATOR, NONBINDING}
- private enum CDICOMPONENT {STEREOSCOPE, QUALIFIER, SCOPE, BEAN, ANNOTATION, INTERBINDING, INTERCEPTOR}
- private SWTBotEclipseEditor ed;
-
+ private static final String LINE_SEPARATOR = System.getProperty("line.separator");
/*
* init method "setup()" shows a project explorer view as default,
@@ -49,8 +42,7 @@
@BeforeClass
public static void setup() {
eclipse.showView(ViewType.PROJECT_EXPLORER);
- CDIUtil.disableFolding(bot, util);
- CDIUtil.createAndCheckCDIProject(bot, util, projectExplorer,PROJECT_NAME);
+ CDIUtil.disableFolding(bot, util);
}
/*
@@ -63,20 +55,27 @@
}
@Test
+ public void testCreateProject() {
+ createAndCheckCDIProject(bot, util, projectExplorer,PROJECT_NAME);
+ }
+
+ @Test
public void testSerializableQF() {
+
+
String className = "B1";
- createComponent(CDICOMPONENT.BEAN, className);
+ createComponent(CDICOMPONENT.BEAN, className, PACKAGE_NAME, null);
- //
+ // https://issues.jboss.org/browse/JBIDE-8550
checkSerializableAnnotation(CDICOMPONENT.BEAN, className);
}
@Test
public void testMultipleBeansQF() {
String className = "BrokenFarm";
- createComponent(CDICOMPONENT.BEAN, className);
+ createComponent(CDICOMPONENT.BEAN, className, PACKAGE_NAME, null);
- //
+ // https://issues.jboss.org/browse/JBIDE-7635
checkMultipleBeans(CDICOMPONENT.BEAN, className);
}
@@ -196,47 +195,20 @@
* method edits default Target form because of "one space inconsistency"
*/
private void prepareCdiComponent(CDICOMPONENT component, String name) {
- createComponent(component, name);
+ createComponent(component, name, PACKAGE_NAME, null);
switch (component) {
case QUALIFIER:
- CDIUtil.replaceInEditor(ed, bot, "@Target({ TYPE, METHOD, PARAMETER, FIELD })",
+ CDIUtil.replaceInEditor(getEd(), bot, "@Target({ TYPE, METHOD, PARAMETER, FIELD })",
"@Target({TYPE, METHOD, PARAMETER, FIELD})");
break;
case STEREOSCOPE:
case SCOPE:
- CDIUtil.replaceInEditor(ed, bot, "@Target({ TYPE, METHOD, FIELD })",
+ CDIUtil.replaceInEditor(getEd(), bot, "@Target({ TYPE, METHOD, FIELD })",
"@Target({TYPE, METHOD, FIELD})");
break;
}
}
- private void createComponent(CDICOMPONENT component, String name) {
- switch (component) {
- case STEREOSCOPE:
- CDIUtil.stereotype(PACKAGE_NAME, name, null, null, false, false, false,
- false).finish();
- break;
- case QUALIFIER:
- CDIUtil.qualifier(PACKAGE_NAME, name, false, false).finish();
- break;
- case SCOPE:
- CDIUtil.scope(PACKAGE_NAME, name, false, false, true, false).finish();
- break;
- case BEAN:
- CDIUtil.bean(PACKAGE_NAME, name, true, false, false, false, null,
- null, null, null).finish();
- break;
- case INTERBINDING:
- CDIUtil.binding(PACKAGE_NAME, name, null, true, false).finish();
- break;
- case ANNOTATION:
-
- }
- util.waitForNonIgnoredJobs();
- ed = bot.activeEditor().toTextEditor();
- }
-
-
/*
****************************************************************
*
@@ -247,19 +219,19 @@
*/
private void prepareSerializableAnnotation() {
- CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ CDIUtil.copyResourceToClass(getEd(), CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/B1.java.cdi"), false);
}
private void prepareMultipleBeans(String className) {
- createComponent(CDICOMPONENT.BEAN, "Animal");
- createComponent(CDICOMPONENT.BEAN, "Dog");
- CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ createComponent(CDICOMPONENT.BEAN, "Animal", PACKAGE_NAME, null);
+ createComponent(CDICOMPONENT.BEAN, "Dog", PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/Dog.java.cdi"), false);
- createComponent(CDICOMPONENT.QUALIFIER, "Q1");
+ createComponent(CDICOMPONENT.QUALIFIER, "Q1", PACKAGE_NAME, null);
bot.editorByTitle(className + ".java").show();
- ed = bot.activeEditor().toTextEditor();
- CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ setEd(bot.activeEditor().toTextEditor());
+ CDIUtil.copyResourceToClass(getEd(), CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/BrokenFarm.java.cdi"),
false);
@@ -268,83 +240,83 @@
private void prepareNamedAnnotation(CDICOMPONENT comp,
String className, boolean add) {
if (comp == CDICOMPONENT.BEAN) {
- CDIUtil.insertInEditor(ed, bot, 1, 0, "import javax.inject.Named;" + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 3, 0, "@Named" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 1, 0, "import javax.inject.Named;" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 3, 0, "@Named" + LINE_SEPARATOR);
if (add) {
- CDIUtil.insertInEditor(ed, bot, 2, 0, "import javax.decorator.Decorator;" + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 4, 0, "@Decorator" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 2, 0, "import javax.decorator.Decorator;" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 4, 0, "@Decorator" + LINE_SEPARATOR);
} else {
- CDIUtil.replaceInEditor(ed, bot, "import javax.decorator.Decorator;",
+ CDIUtil.replaceInEditor(getEd(), bot, "import javax.decorator.Decorator;",
"import javax.interceptor.Interceptor;");
- CDIUtil.replaceInEditor(ed, bot, "@Decorator", "@Interceptor");
+ CDIUtil.replaceInEditor(getEd(), bot, "@Decorator", "@Interceptor");
}
} else {
if (add) {
- CDIUtil.insertInEditor(ed, bot, ed.getLineCount()-4, 0, "@Named(\"Name\")" + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 6 , 0, "import javax.inject.Named;" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, getEd().getLineCount()-4, 0, "@Named(\"Name\")" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 6 , 0, "import javax.inject.Named;" + LINE_SEPARATOR);
} else {
- CDIUtil.replaceInEditor(ed, bot, "@Named", "");
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot, "@Named", "");
+ CDIUtil.replaceInEditor(getEd(), bot,
"import javax.inject.Named;", "");
}
}
}
private void prepareTypedAnnotation() {
- CDIUtil.insertInEditor(ed, bot, ed.getLineCount()-4 , 0, "@Typed" + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 6 , 0, "import javax.enterprise.inject.Typed;" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, getEd().getLineCount()-4 , 0, "@Typed" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 6 , 0, "import javax.enterprise.inject.Typed;" + LINE_SEPARATOR);
}
private void prepareInjectAnnot() {
- CDIUtil.insertInEditor(ed, bot, 3 , 1, "@Inject" + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 1 , 0, "import javax.inject.Inject;" + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 6 , 15, "String aaa");
+ CDIUtil.insertInEditor(getEd(), bot, 3 , 1, "@Inject" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 1 , 0, "import javax.inject.Inject;" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 6 , 15, "String aaa");
}
private void prepareProducer() {
- CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ CDIUtil.copyResourceToClass(getEd(), CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/MyBean.java.cdi"), false);
}
private void prepareObserverDisposer() {
prepareProducer();
- CDIUtil.replaceInEditor(ed, bot, "@Produces", "@Inject");
- CDIUtil.replaceInEditor(ed, bot, "import javax.enterprise.inject.Produces;", "");
- CDIUtil.replaceInEditor(ed, bot, "String produceString", "void method");
- CDIUtil.replaceInEditor(ed, bot, "return \"test\";", "");
+ CDIUtil.replaceInEditor(getEd(), bot, "@Produces", "@Inject");
+ CDIUtil.replaceInEditor(getEd(), bot, "import javax.enterprise.inject.Produces;", "");
+ CDIUtil.replaceInEditor(getEd(), bot, "String produceString", "void method");
+ CDIUtil.replaceInEditor(getEd(), bot, "return \"test\";", "");
}
private void prepareObserWithDisposParam() {
prepareProducer();
- CDIUtil.replaceInEditor(ed, bot, "import javax.inject.Inject;", "import javax.enterprise.event.Observes;" +
+ CDIUtil.replaceInEditor(getEd(), bot, "import javax.inject.Inject;", "import javax.enterprise.event.Observes;" +
LINE_SEPARATOR + "import javax.enterprise.inject.Disposes;" + LINE_SEPARATOR);
- CDIUtil.replaceInEditor(ed, bot, "@Inject", "");
- CDIUtil.replaceInEditor(ed, bot, "MyBean(String aaa)",
+ CDIUtil.replaceInEditor(getEd(), bot, "@Inject", "");
+ CDIUtil.replaceInEditor(getEd(), bot, "MyBean(String aaa)",
"void method(@Observes String param1, @Disposes String param2)");
}
private void prepareCheckSessionBean(String replacement) {
if (replacement.equals("@Decorator")) {
- CDIUtil.insertInEditor(ed, bot, 3, 0, "import javax.decorator.Decorator;" + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 4, 0, "import javax.ejb.Stateless;" + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 5, 0, "@Decorator" + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 6, 0, "@Stateless" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 3, 0, "import javax.decorator.Decorator;" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 4, 0, "import javax.ejb.Stateless;" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 5, 0, "@Decorator" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 6, 0, "@Stateless" + LINE_SEPARATOR);
} else {
- CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ CDIUtil.copyResourceToClass(getEd(), CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/MyBean2.java.cdi"), false);
}
}
private void prepareDisposesAnnot() {
- CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ CDIUtil.copyResourceToClass(getEd(), CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/InterDecor.java.cdi"), false);
}
private void prepareComponentsForSpecializeAnnotation(String testBeanName) {
- createComponent(CDICOMPONENT.BEAN, "AnyBean");
- createComponent(CDICOMPONENT.INTERBINDING, "AnyBinding");
- createComponent(CDICOMPONENT.BEAN, testBeanName);
- CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ createComponent(CDICOMPONENT.BEAN, "AnyBean", PACKAGE_NAME, null);
+ createComponent(CDICOMPONENT.INTERBINDING, "AnyBinding", PACKAGE_NAME, null);
+ createComponent(CDICOMPONENT.BEAN, testBeanName, PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/TestBean.java.cdi"), false);
}
@@ -380,29 +352,29 @@
switch (comp) {
case STEREOSCOPE:
case SCOPE:
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"@Target({TYPE, METHOD, FIELD})", replacement);
break;
case QUALIFIER:
if (replacement.equals("")) {
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"@Target({TYPE, METHOD, FIELD, PARAMETER})", replacement);
} else {
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"@Target({TYPE, METHOD, PARAMETER, FIELD})", replacement);
}
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"import static java.lang.annotation.ElementType.PARAMETER;", "");
break;
}
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"import static java.lang.annotation.ElementType.METHOD;", "");
if (replacement.equals("")) {
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"import java.lang.annotation.Target;", "");
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"import static java.lang.annotation.ElementType.TYPE;", "");
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"import static java.lang.annotation.ElementType.FIELD;", "");
}
checkQuickFix(ANNOTATIONS.TARGET, comp, className, replacement);
@@ -415,21 +387,21 @@
private void checkRetentionAnnotWithAddon(CDICOMPONENT comp, String className,
String replacement) {
- CDIUtil.replaceInEditor(ed, bot, "@Retention(RUNTIME)", replacement);
+ CDIUtil.replaceInEditor(getEd(), bot, "@Retention(RUNTIME)", replacement);
if (replacement.equals("@Retention(CLASS)")) {
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"import static java.lang.annotation.RetentionPolicy.RUNTIME;",
"import static java.lang.annotation.RetentionPolicy.CLASS;");
} else {
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"import static java.lang.annotation.RetentionPolicy.RUNTIME;",
"");
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"import java.lang.annotation.Retention;", "");
}
checkQuickFix(ANNOTATIONS.RETENTION, comp, className, replacement);
if (replacement.equals("@Retention(CLASS)")) {
- CDIUtil.replaceInEditor(ed, bot,
+ CDIUtil.replaceInEditor(getEd(), bot,
"import static java.lang.annotation.RetentionPolicy.CLASS;","");
}
}
@@ -472,17 +444,17 @@
private void checkConstructorWithAddon(CDICOMPONENT comp,
String className, String replacement) {
- CDIUtil.insertInEditor(ed, bot, 6, 15, replacement + " ");
+ CDIUtil.insertInEditor(getEd(), bot, 6, 15, replacement + " ");
dispObserCompletion(comp, className, replacement);
}
private void checkProducerMethod(CDICOMPONENT comp, ANNOTATIONS annonType, String className) {
if (className.equals("InterDecor")) {
prepareProducer();
- CDIUtil.replaceInEditor(ed, bot, "MyBean", "InterDecor");
+ CDIUtil.replaceInEditor(getEd(), bot, "MyBean", "InterDecor");
checkProducerWithAddon(comp, annonType, className, "@Interceptor");
prepareProducer();
- CDIUtil.replaceInEditor(ed, bot, "MyBean", "InterDecor");
+ CDIUtil.replaceInEditor(getEd(), bot, "MyBean", "InterDecor");
checkProducerWithAddon(comp, annonType, className, "@Decorator");
} else {
prepareProducer();
@@ -498,12 +470,12 @@
String importAnnot = replacement.equals("@Interceptor")?
"import javax.interceptor.Interceptor;":
"import javax.decorator.Decorator;";
- CDIUtil.insertInEditor(ed, bot, 3, 0, annot + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 1, 0, importAnnot + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 3, 0, annot + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 1, 0, importAnnot + LINE_SEPARATOR);
checkQuickFix(replacement.equals("@Interceptor")?ANNOTATIONS.INTERCEPTOR:
ANNOTATIONS.DECORATOR, comp, className, replacement);
} else {
- CDIUtil.insertInEditor(ed, bot, 11, 29, replacement + " ");
+ CDIUtil.insertInEditor(getEd(), bot, 11, 29, replacement + " ");
dispObserCompletion(comp, className, replacement);
}
}
@@ -516,7 +488,7 @@
private void checkObserverDisposerWithAddon(CDICOMPONENT comp,
String className, String replacement) {
- CDIUtil.insertInEditor(ed, bot, 10, 20, replacement + " ");
+ CDIUtil.insertInEditor(getEd(), bot, 10, 20, replacement + " ");
dispObserCompletion(comp, className, replacement);
}
@@ -529,8 +501,8 @@
private void checkObserWithDisposParamWithAddon(CDICOMPONENT comp,
String className, String replacement) {
if (replacement.equals("@Observes")) {
- CDIUtil.insertInEditor(ed, bot, 3, 0, "import javax.enterprise.inject.Disposes;");
- CDIUtil.insertInEditor(ed, bot, 6, 46, "@Disposes ");
+ CDIUtil.insertInEditor(getEd(), bot, 3, 0, "import javax.enterprise.inject.Disposes;");
+ CDIUtil.insertInEditor(getEd(), bot, 6, 46, "@Disposes ");
}
checkQuickFix(replacement.equals("@Disposes")?ANNOTATIONS.DISPOSES:ANNOTATIONS.OBSERVES,
CDICOMPONENT.BEAN, className, "");
@@ -549,7 +521,7 @@
}
private void dispObserCompletion(CDICOMPONENT comp, String className, String replacement) {
- CDIUtil.insertInEditor(ed, bot, 2 , 0, "import javax.enterprise." +
+ CDIUtil.insertInEditor(getEd(), bot, 2 , 0, "import javax.enterprise." +
(replacement.contains("Disposes")?"inject.":"event.") +
(replacement.substring(1) + ";" + LINE_SEPARATOR));
ANNOTATIONS annonType = (replacement.equals("@Disposes")?ANNOTATIONS.DISPOSES:ANNOTATIONS.OBSERVES);
@@ -567,30 +539,30 @@
String annot = replacement;
String importAnnot = "import javax." + replacement.substring(1).toLowerCase()
+ "." + replacement.substring(1) + ";";
- CDIUtil.insertInEditor(ed, bot, 2, 0, annot + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 1, 0, importAnnot + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 2, 0, annot + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 1, 0, importAnnot + LINE_SEPARATOR);
checkQuickFix(ANNOTATIONS.DECORATOR, comp, className, replacement);
}
private void checkObserveAnnotation(CDICOMPONENT comp, String className) {
checkObserveAnnotWithAddon(comp, className, "@Decorator");
checkObserveAnnotWithAddon(comp, className, "@Interceptor");
- CDIUtil.replaceInEditor(ed, bot, "@Interceptor", "");
- CDIUtil.replaceInEditor(ed, bot, "import javax.interceptor.Interceptor;", "");
+ CDIUtil.replaceInEditor(getEd(), bot, "@Interceptor", "");
+ CDIUtil.replaceInEditor(getEd(), bot, "import javax.interceptor.Interceptor;", "");
}
private void checkObserveAnnotWithAddon(CDICOMPONENT comp, String className,
String replacement) {
prepareDisposesAnnot();
- CDIUtil.replaceInEditor(ed, bot, "@Disposes", "@Observes");
- CDIUtil.replaceInEditor(ed, bot, "import javax.enterprise.inject.Disposes;",
+ CDIUtil.replaceInEditor(getEd(), bot, "@Disposes", "@Observes");
+ CDIUtil.replaceInEditor(getEd(), bot, "import javax.enterprise.inject.Disposes;",
"import javax.enterprise.event.Observes;");
- CDIUtil.replaceInEditor(ed, bot, "dispose", "observe");
+ CDIUtil.replaceInEditor(getEd(), bot, "dispose", "observe");
String annot = replacement;
String importAnnot = "import javax." + replacement.substring(1).toLowerCase()
+ "." + replacement.substring(1) + ";";
- CDIUtil.insertInEditor(ed, bot, 2, 0, annot + LINE_SEPARATOR);
- CDIUtil.insertInEditor(ed, bot, 1, 0, importAnnot + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 2, 0, annot + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, 1, 0, importAnnot + LINE_SEPARATOR);
checkQuickFix(ANNOTATIONS.DECORATOR, comp, className, replacement);
}
@@ -598,14 +570,14 @@
prepareComponentsForSpecializeAnnotation(className);
checkSpecializeAnnotWithAddon(comp, className, "@Interceptor");
checkSpecializeAnnotWithAddon(comp, className, "@Decorator");
- CDIUtil.copyResourceToClass(ed,
+ CDIUtil.copyResourceToClass(getEd(),
CDIQuickFixTest.class.getResourceAsStream("/resources/cdi/TestBean3.java.cdi"), false);
}
private void checkSpecializeAnnotWithAddon(CDICOMPONENT comp, String className,
String replacement) {
if (replacement.equals("@Decorator")) {
- CDIUtil.copyResourceToClass(ed,
+ CDIUtil.copyResourceToClass(getEd(),
CDIQuickFixTest.class.getResourceAsStream("/resources/cdi/TestBean2.java.cdi"), false);
}
checkQuickFix(ANNOTATIONS.SPECIALIZES, comp, className, replacement);
@@ -623,8 +595,7 @@
boolean interceptorCreated = projectExplorer.isFilePresent(PROJECT_NAME,
"Java Resources", "src", PACKAGE_NAME, className + ".java");
if (!interceptorCreated) {
- CDIUtil.binding(PACKAGE_NAME, className, null, false, false).finish();
- ed = bot.activeEditor().toTextEditor();
+ createComponent(CDICOMPONENT.INTERBINDING, className, PACKAGE_NAME, null);
}
}
@@ -632,13 +603,13 @@
boolean annotationCreated = projectExplorer.isFilePresent(PROJECT_NAME,
"Java Resources", "src", PACKAGE_NAME, "AAnnotation.java");
if (!annotationCreated) {
- CDIUtil.annotation(open, util, PACKAGE_NAME, "AAnnotation");
- bot.editorByTitle(className + ".java").show();
- ed = bot.activeEditor().toTextEditor();
- }
- CDIUtil.insertInEditor(ed, bot, ed.getLineCount()-3, 1, "AAnnotation annotValue();" + LINE_SEPARATOR);
+ createComponent(null, "AAnnotation", PACKAGE_NAME, null);
+ }
+ bot.editorByTitle(className + ".java").show();
+ setEd(bot.activeEditor().toTextEditor());
+ CDIUtil.insertInEditor(getEd(), bot, getEd().getLineCount()-3, 1, "AAnnotation annotValue();" + LINE_SEPARATOR);
}else {
- CDIUtil.insertInEditor(ed, bot, ed.getLineCount()-3, 1, "String[] array();" + LINE_SEPARATOR);
+ CDIUtil.insertInEditor(getEd(), bot, getEd().getLineCount()-3, 1, "String[] array();" + LINE_SEPARATOR);
}
checkQuickFix(ANNOTATIONS.NONBINDING, comp, className, replacement);
}
@@ -701,13 +672,13 @@
+ PROJECT_NAME, className, "CDI Problem");
} else {
if (className.equals("InterDecor.java")) {
- if (ed.toTextEditor().getText().contains("produceString")) {
+ if (getEd().toTextEditor().getText().contains("produceString")) {
problemsContains = "Producer cannot be declared in";
}
- if (ed.toTextEditor().getText().contains("disposeMethod")) {
+ if (getEd().toTextEditor().getText().contains("disposeMethod")) {
problemsContains = "has a method annotated @Disposes";
}
- if (ed.toTextEditor().getText().contains("observeMethod")) {
+ if (getEd().toTextEditor().getText().contains("observeMethod")) {
problemsContains = "have a method with a parameter annotated @Observes";
}
}
@@ -777,7 +748,7 @@
bot.sleep(Timing.time1S());
util.waitForNonIgnoredJobs();
- String code = ed.toTextEditor().getText();
+ String code = getEd().toTextEditor().getText();
assertTrue(code.contains("@Inject @Q1 private Animal animal;"));
code = bot.editorByTitle(qualifBean + ".java").toTextEditor().getText();
assertTrue(code.contains("@Q1"));
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java 2011-10-05 14:13:40 UTC (rev 35372)
@@ -0,0 +1,139 @@
+package org.jboss.tools.cdi.bot.test.uiutils.actions;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.DynamicWebProjectWizard;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
+
+public class CDIBase extends SWTTestExt {
+
+ public enum CDICOMPONENT {
+ STEREOSCOPE, QUALIFIER, SCOPE, BEAN, INTERBINDING, DECORATOR, INTERCEPTOR, ANNLITERAL, BEANSXML
+ }
+ public enum ANNOTATIONS {SERIALIZABLE, TARGET, RETENTION, NAMED, TYPED, DISPOSES, OBSERVES, INTERCEPTOR,
+ SPECIALIZES, DECORATOR, NONBINDING}
+ public enum PROBLEM_TYPE {WARNINGS, ERRORS}
+
+ private SWTBotEclipseEditor ed;
+
+ public SWTBotEclipseEditor getEd() {
+ return ed;
+ }
+
+ public void setEd(SWTBotEclipseEditor ed) {
+ this.ed = ed;
+ }
+
+ public void createComponent(CDICOMPONENT component, String name,
+ String packageName, String necessaryParam) {
+ if (component == null) {
+ CDIUtil.annotation(open, util, packageName, name);
+ } else {
+ createCDIComponent(component, name, packageName, necessaryParam);
+ }
+ util.waitForNonIgnoredJobs();
+ setEd(bot.activeEditor().toTextEditor());
+ }
+
+ private void createCDIComponent(CDICOMPONENT component, String name,
+ String packageName, String necessaryParam) {
+ switch (component) {
+ case STEREOSCOPE:
+ CDIUtil.stereotype(packageName, name, null, null, false, false, false,
+ false).finish();
+ break;
+ case QUALIFIER:
+ CDIUtil.qualifier(packageName, name, false, false).finish();
+ break;
+ case SCOPE:
+ CDIUtil.scope(packageName, name, false, false, true, false).finish();
+ break;
+ case BEAN:
+ CDIUtil.bean(packageName, name, true, false, false, false, null, null,
+ null, null).finish();
+ break;
+ case INTERCEPTOR:
+ CDIUtil.interceptor(packageName, name, null, null, null, false).finish();
+ break;
+ case DECORATOR:
+ CDIUtil.decorator(packageName, name, necessaryParam, null, true, false, false, false)
+ .finish();
+ break;
+ case ANNLITERAL:
+ CDIUtil.annLiteral(packageName, name, true, false, false, false, null).finish();
+ break;
+ case INTERBINDING:
+ CDIUtil.binding(packageName, name, null, true, false).finish();
+ break;
+ case BEANSXML:
+ CDIUtil.beansXML(packageName).finish();
+ break;
+ }
+
+ }
+
+ public void createAndCheckCDIProject(SWTBotExt bot, SWTUtilExt util,
+ ProjectExplorer projectExplorer, String projectName) {
+ createCDIProject(util, projectName);
+ projectExplorer.selectProject(projectName);
+ SWTBotTree tree = projectExplorer.bot().tree();
+ SWTBotTreeItem item = tree.getTreeItem(projectName);
+ item.expand();
+ addCDISupport(tree, item, bot, util);
+ }
+
+ public void createCDIProject(SWTUtilExt util, String projectName) {
+ new NewFileWizardAction().run()
+ .selectTemplate("Web", "Dynamic Web Project").next();
+ new DynamicWebProjectWizard().setProjectName(projectName).finish();
+ util.waitForNonIgnoredJobs();
+ }
+
+ public void addCDISupport(final SWTBotTree tree, SWTBotTreeItem item,
+ SWTBotExt bot, SWTUtilExt util) {
+ CDIUtil.nodeContextMenu(tree, item, "Configure",
+ "Add CDI (Context and Dependency Injection) support...")
+ .click();
+ bot.activeShell().bot().button("OK").click();
+ bot.sleep(Timing.time2S());
+ util.waitForNonIgnoredJobs();
+ }
+
+ public void openOn(String openOnString, String titleName, boolean moreOptions) {
+ SWTBotEditor ed = bot.editorByTitle(titleName);
+ ed.show();
+ ed.setFocus();
+ int offset = openOnString.contains("@")?1:0;
+ setEd(SWTJBTExt.selectTextInSourcePane(bot, titleName,
+ openOnString, offset, openOnString.length() - offset));
+ if (moreOptions) {
+ SWTBotMenu navigateMenu = bot.menu("Navigate");
+ bot.sleep(TIME_500MS);
+ navigateMenu.menu("Open Hyperlink").click();
+ bot.sleep(TIME_500MS);
+ SWTBotTable table = bot.activeShell().bot().table(0);
+ for (int i = 0; i < table.rowCount(); i++) {
+ if (table.getTableItem(i).getText().contains(openOnString)) {
+ table.click(i, 0);
+ break;
+ }
+ }
+ } else {
+ getEd().setFocus();
+ bot.sleep(TIME_500MS);
+ //KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_F3);
+ }
+ bot.sleep(Timing.time1S());
+ setEd(bot.activeEditor().toTextEditor());
+ }
+
+}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java 2011-10-05 14:03:03 UTC (rev 35371)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java 2011-10-05 14:13:40 UTC (rev 35372)
@@ -8,62 +8,33 @@
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.Result;
-import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizard;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardType;
-import org.jboss.tools.cdi.bot.test.uiutils.wizards.DynamicWebProjectWizard;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTOpenExt;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.JavaAnnotation;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
public class CDIUtil {
-
-
- public static void createAndCheckCDIProject(SWTBotExt bot, SWTUtilExt util, ProjectExplorer projectExplorer, String projectName) {
- createCDIProject(util, projectName);
- projectExplorer.selectProject(projectName);
- SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem item = tree.getTreeItem(projectName);
- item.expand();
- CDIUtil.addCDISupport(tree, item, bot, util);
- }
- public static void createCDIProject(SWTUtilExt util, String projectName) {
- new NewFileWizardAction().run()
- .selectTemplate("Web", "Dynamic Web Project").next();
- new DynamicWebProjectWizard().setProjectName(projectName).finish();
- util.waitForNonIgnoredJobs();
- }
-
- public static void addCDISupport(final SWTBotTree tree, SWTBotTreeItem item, SWTBotExt bot, SWTUtilExt util) {
- nodeContextMenu(tree, item,
- "Configure","Add CDI (Context and Dependency Injection) support...").click();
- bot.activeShell().bot().button("OK").click();
- bot.sleep(Timing.time2S());
- util.waitForNonIgnoredJobs();
- }
-
public static void openQuickFix(SWTBotTreeItem item, SWTBotExt bot) {
nodeContextMenu(bot.tree(), item, "Quick Fix").click();
}
-
- public static void resolveQuickFix(SWTBotTreeItem item, SWTBotExt bot, SWTUtilExt util) {
+
+ public static void resolveQuickFix(SWTBotTreeItem item, SWTBotExt bot,
+ SWTUtilExt util) {
openQuickFix(item, bot);
bot.activeShell().bot().button("Finish").click();
bot.sleep(Timing.time2S());
util.waitForNonIgnoredJobs();
}
-
+
public static void copyResourceToClass(SWTBotEditor classEdit,
InputStream resource, boolean closeEdit) {
SWTBotEclipseEditor st = classEdit.toTextEditor();
@@ -71,33 +42,39 @@
String code = readStream(resource);
st.setText(code);
classEdit.save();
- if (closeEdit) classEdit.close();
+ if (closeEdit)
+ classEdit.close();
}
-
- public static void replaceInEditor(SWTBotEclipseEditor ed, SWTBotExt bot, String target, String replacement) {
+
+ public static void replaceInEditor(SWTBotEclipseEditor ed, SWTBotExt bot,
+ String target, String replacement) {
ed.selectRange(0, 0, ed.getText().length());
- ed.setText(ed.getText().replace(target +
- (replacement.equals("")?System.getProperty("line.separator"):""),
- replacement));
+ ed.setText(ed.getText().replace(
+ target
+ + (replacement.equals("") ? System
+ .getProperty("line.separator") : ""),
+ replacement));
bot.sleep(Timing.time1S());
ed.save();
}
-
- public static void insertInEditor(SWTBotEclipseEditor ed, SWTBotExt bot, int line, int row, String insertText) {
- ed.toTextEditor().insertText(line , row, insertText);
+
+ public static void insertInEditor(SWTBotEclipseEditor ed, SWTBotExt bot,
+ int line, int row, String insertText) {
+ ed.toTextEditor().insertText(line, row, insertText);
bot.sleep(Timing.time1S());
ed.save();
}
-
+
public static void disableFolding(SWTBotExt bot, SWTUtilExt util) {
editFolding(bot, util, false);
}
-
+
public static void enableFolding(SWTBotExt bot, SWTUtilExt util) {
editFolding(bot, util, true);
}
-
- public static void editFolding(SWTBotExt bot, SWTUtilExt util, boolean select) {
+
+ public static void editFolding(SWTBotExt bot, SWTUtilExt util,
+ boolean select) {
bot.menu("Window").menu("Preferences").click();
bot.shell("Preferences").activate();
SWTBotTreeItem item = bot.tree(0).expandNode("Java", "Editor");
@@ -112,7 +89,7 @@
bot.sleep(Timing.time2S());
util.waitForNonIgnoredJobs();
}
-
+
public static SWTBotMenu nodeContextMenu(final SWTBotTree tree,
SWTBotTreeItem item, final String... menu) {
assert menu.length > 0;
@@ -129,12 +106,11 @@
}
});
}
-
- public static CDIWizard qualifier(String pkg, String name, boolean inherited,
- boolean comments) {
+
+ public static CDIWizard qualifier(String pkg, String name,
+ boolean inherited, boolean comments) {
return create(CDIWizardType.QUALIFIER, pkg, name, inherited, comments);
}
-
public static CDIWizard scope(String pkg, String name, boolean inherited,
boolean comments, boolean normalScope, boolean passivating) {
@@ -143,7 +119,6 @@
w = w.setNormalScope(normalScope);
return normalScope ? w.setPassivating(passivating) : w;
}
-
public static CDIWizard binding(String pkg, String name, String target,
boolean inherited, boolean comments) {
@@ -151,7 +126,6 @@
inherited, comments);
return target != null ? w.setTarget(target) : w;
}
-
public static CDIWizard stereotype(String pkg, String name, String scope,
String target, boolean inherited, boolean named,
@@ -163,18 +137,18 @@
}
return target != null ? w.setTarget(target) : w;
}
-
- public static CDIWizard decorator(String pkg, String name, String intf, String fieldName,
- boolean isPublic, boolean isAbstract, boolean isFinal, boolean comments) {
+ public static CDIWizard decorator(String pkg, String name, String intf,
+ String fieldName, boolean isPublic, boolean isAbstract,
+ boolean isFinal, boolean comments) {
CDIWizard w = create(CDIWizardType.DECORATOR, pkg, name, comments);
- w = w.addInterface(intf).setPublic(isPublic).setFinal(isFinal).setAbstract(isAbstract);
+ w = w.addInterface(intf).setPublic(isPublic).setFinal(isFinal)
+ .setAbstract(isAbstract);
return fieldName != null ? w.setFieldName(fieldName) : w;
}
-
-
- public static CDIWizard interceptor(String pkg, String name, String ibinding,
- String superclass, String method, boolean comments) {
+
+ public static CDIWizard interceptor(String pkg, String name,
+ String ibinding, String superclass, String method, boolean comments) {
CDIWizard w = create(CDIWizardType.INTERCEPTOR, pkg, name, comments);
if (superclass != null) {
w = w.setSuperclass(superclass);
@@ -187,10 +161,10 @@
}
return w;
}
-
- public static CDIWizard bean(String pkg, String name, boolean isPublic, boolean isAbstract,
- boolean isFinal, boolean comments, String named,
- String interfaces, String scope, String qualifier) {
+
+ public static CDIWizard bean(String pkg, String name, boolean isPublic,
+ boolean isAbstract, boolean isFinal, boolean comments,
+ String named, String interfaces, String scope, String qualifier) {
CDIWizard w = create(CDIWizardType.BEAN, pkg, name, comments);
if (named != null) {
w.setNamed(true);
@@ -210,38 +184,47 @@
}
return w;
}
-
- public static void annotation(SWTOpenExt open, SWTUtilExt util, String pkg, String name) {
+
+ public static void annotation(SWTOpenExt open, SWTUtilExt util, String pkg,
+ String name) {
SWTBot openWizard = open.newObject(JavaAnnotation.LABEL);
openWizard.textWithLabel("Name:").setText(name);
openWizard.textWithLabel("Package:").setText(pkg);
- openWizard.button("Finish").click();
+ openWizard.button("Finish").click();
util.waitForNonIgnoredJobs();
}
-
- public static CDIWizard annLiteral(String pkg, String name, boolean isPublic, boolean isAbstract,
- boolean isFinal, boolean comments, String qualifier) {
- assert qualifier != null && !"".equals(qualifier.trim()) : "Qualifier has to be set";
- CDIWizard w = create(CDIWizardType.ANNOTATION_LITERAL, pkg, name, comments);
- return w.setPublic(isPublic).setFinal(isFinal).setAbstract(isAbstract).addQualifier(qualifier);
+
+ public static CDIWizard annLiteral(String pkg, String name,
+ boolean isPublic, boolean isAbstract, boolean isFinal,
+ boolean comments, String qualifier) {
+ assert qualifier != null && !"".equals(qualifier.trim()) : "Qualifier has to be set";
+ CDIWizard w = create(CDIWizardType.ANNOTATION_LITERAL, pkg, name,
+ comments);
+ return w.setPublic(isPublic).setFinal(isFinal).setAbstract(isAbstract)
+ .addQualifier(qualifier);
}
-
- private static CDIWizard create(CDIWizardType type, String pkg, String name,
+
+ public static CDIWizard beansXML(String pkg) {
+ CDIWizard w = new NewCDIFileWizard(CDIWizardType.BEANS_XML).run();
+ w.setSourceFolder(pkg);
+ return w;
+ }
+
+ public static CDIWizard create(CDIWizardType type, String pkg, String name,
boolean inherited, boolean comments) {
return create(type, pkg, name, comments).setInherited(inherited);
}
- private static CDIWizard create(CDIWizardType type, String pkg, String name, boolean comments) {
+ public static CDIWizard create(CDIWizardType type, String pkg, String name,
+ boolean comments) {
CDIWizard p = new NewCDIFileWizard(type).run();
return p.setPackage(pkg).setName(name).setGenerateComments(comments);
}
-
- private static String readStream(InputStream is) {
+
+ public static String readStream(InputStream is) {
// we don't care about performance in tests too much, so this should be
// OK
return new Scanner(is).useDelimiter("\\A").next();
}
-
-
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java 2011-10-05 14:03:03 UTC (rev 35371)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java 2011-10-05 14:13:40 UTC (rev 35372)
@@ -14,23 +14,16 @@
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
-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.cdi.bot.test.CDIAllBotTests;
+import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIBase;
import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIUtil;
import org.jboss.tools.cdi.bot.test.uiutils.actions.NewCDIFileWizard;
-import org.jboss.tools.cdi.bot.test.uiutils.actions.NewFileWizardAction;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizard;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardType;
-import org.jboss.tools.cdi.bot.test.uiutils.wizards.DynamicWebProjectWizard;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
-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.types.ViewType;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -39,9 +32,9 @@
@Require(perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({ CDIAllBotTests.class })
-public class CdiATWizardTest extends SWTTestExt {
+public class CdiATWizardTest extends CDIBase {
- private static final String PROJECT_NAME = "CDIProject";
+ private static final String PROJECT_NAME = "CDIProject1";
private static final Logger L = Logger.getLogger(CdiATWizardTest.class.getName());
@After
@@ -51,18 +44,7 @@
@Test
public void createProject() {
- new NewFileWizardAction().run()
- .selectTemplate("Web", "Dynamic Web Project").next();
- new DynamicWebProjectWizard().setProjectName(PROJECT_NAME).finish();
- util.waitForNonIgnoredJobs();
- SWTBot v = eclipse.showView(ViewType.PROJECT_EXPLORER);
- SWTBotTree tree = v.tree();
- tree.setFocus();
- assertTrue("Project " + PROJECT_NAME + " was not created properly.",
- SWTEclipseExt.treeContainsItemWithLabel(tree, PROJECT_NAME));
- SWTBotTreeItem t = tree.getTreeItem(PROJECT_NAME);
- t.expand();
- CDIUtil.addCDISupport(tree, t, bot, util);
+ createAndCheckCDIProject(bot, util, projectExplorer, PROJECT_NAME);
}
@Test
13 years, 3 months