JBoss Tools SVN: r33083 - in trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui: internal/profiles and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-07-20 16:15:07 -0400 (Wed, 20 Jul 2011)
New Revision: 33083
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties
Log:
JBIDE-8969 : changed the selected profiles widget foreground color to grey, added a tooltip to indicate read-only-ness
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java 2011-07-20 20:11:49 UTC (rev 33082)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java 2011-07-20 20:15:07 UTC (rev 33083)
@@ -73,6 +73,7 @@
public static String SelectProfilesDialog_Profile_id_header;
public static String SelectProfilesDialog_Profile_source_header;
public static String SelectProfilesDialog_Project_has_no_available_profiles;
+ public static String SelectProfilesDialog_Read_Only_profiles;
public static String SelectProfilesDialog_Select_active_profiles_for_selected_projects;
public static String SelectProfilesDialog_Select_Maven_profiles;
public static String SelectProfilesDialog_Select_the_active_Maven_profiles;
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-20 20:11:49 UTC (rev 33082)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-20 20:15:07 UTC (rev 33083)
@@ -132,7 +132,7 @@
profilesText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
profilesText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
profilesText.setEditable(false);
- profilesText.setToolTipText("Active profiles area is read-only");
+ profilesText.setToolTipText(Messages.SelectProfilesDialog_Read_Only_profiles);
updateProfilesText();
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties 2011-07-20 20:11:49 UTC (rev 33082)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties 2011-07-20 20:15:07 UTC (rev 33083)
@@ -52,6 +52,7 @@
SelectProfilesDialog_Profile_id_header=Profile id
SelectProfilesDialog_Profile_source_header=Source
SelectProfilesDialog_Project_has_no_available_profiles=Project {0} has no available profiles
+SelectProfilesDialog_Read_Only_profiles=Active profiles area is read-only
SelectProfilesDialog_Select_active_profiles_for_selected_projects=Select the active Maven profiles for selected projects. Right-click to (de)activate a profile.
SelectProfilesDialog_Select_Maven_profiles=Select Maven profiles
SelectProfilesDialog_Select_the_active_Maven_profiles=Select the active Maven profiles for project {0}. Right-click to (de)activate a profile.
14 years, 5 months
JBoss Tools SVN: r33082 - trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-07-20 16:11:49 -0400 (Wed, 20 Jul 2011)
New Revision: 33082
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
Log:
JBIDE-8969 : changed the selected profiles widget foreground color to grey, added a tooltip to indicate read-only-ness
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-20 20:05:45 UTC (rev 33081)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-20 20:11:49 UTC (rev 33082)
@@ -130,8 +130,9 @@
profilesText = new Text(container, SWT.BORDER);
profilesText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- profilesText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ profilesText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
profilesText.setEditable(false);
+ profilesText.setToolTipText("Active profiles area is read-only");
updateProfilesText();
}
14 years, 5 months
JBoss Tools SVN: r33081 - trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-07-20 16:05:45 -0400 (Wed, 20 Jul 2011)
New Revision: 33081
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
Log:
JBIDE-8969 : changed the selected profiles widget from Label to Text, to handle selection of a big number of profiles.
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-20 19:38:53 UTC (rev 33080)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-20 20:05:45 UTC (rev 33081)
@@ -50,6 +50,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
import org.jboss.tools.maven.core.profiles.ProfileState;
import org.jboss.tools.maven.ui.Messages;
@@ -62,8 +63,8 @@
private CheckboxTableViewer profileTableViewer;
private Button offlineModeBtn;
private Button forceUpdateBtn;
- private ITextViewer profilesTextViewer;
- private Label profilesText;
+ //private ITextViewer profilesTextViewer;
+ private Text profilesText;
private boolean offlineMode ;
private boolean forceUpdate;
@@ -127,9 +128,10 @@
profilesLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
profilesLabel.setText(NLS.bind(Messages.SelectProfilesDialog_Active_Profiles_for_Project, facade.getProject().getName()));
- profilesText = new Label(container, SWT.BORDER);
+ profilesText = new Text(container, SWT.BORDER);
profilesText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
profilesText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ profilesText.setEditable(false);
updateProfilesText();
}
14 years, 5 months
JBoss Tools SVN: r33080 - in trunk/maven/plugins: org.jboss.tools.maven.ui/META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-07-20 15:38:53 -0400 (Wed, 20 Jul 2011)
New Revision: 33080
Added:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileUtil.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/profiles/IProfileManager.java
trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ActiveProfilesContentProvider.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelection.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelectionHandler.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties
Log:
JBIDE-8969 : added a text box displaying the selected profiles. Fixed a few logic issues
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/profiles/IProfileManager.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/profiles/IProfileManager.java 2011-07-20 19:36:21 UTC (rev 33079)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/profiles/IProfileManager.java 2011-07-20 19:38:53 UTC (rev 33080)
@@ -2,7 +2,6 @@
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.apache.maven.model.Profile;
import org.eclipse.core.runtime.CoreException;
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF 2011-07-20 19:36:21 UTC (rev 33079)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF 2011-07-20 19:38:53 UTC (rev 33080)
@@ -13,7 +13,8 @@
org.eclipse.core.resources,
org.jboss.tools.maven.core,
org.eclipse.m2e.core.ui;bundle-version="[1.0.0,1.1.0)",
- org.eclipse.ui.ide
+ org.eclipse.ui.ide,
+ org.eclipse.jface.text
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java 2011-07-20 19:36:21 UTC (rev 33079)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java 2011-07-20 19:38:53 UTC (rev 33080)
@@ -58,16 +58,22 @@
public static String SelectProfilesDialog_autoactivated;
public static String SelectProfilesDialog_Activate_menu;
+ public static String SelectProfilesDialog_Active_Profiles_for_Project;
public static String SelectProfilesDialog_Available_profiles;
+ public static String SelectProfilesDialog_Common_profiles;
public static String SelectProfilesDialog_deactivated;
public static String SelectProfilesDialog_Deactivate_menu;
public static String SelectProfilesDialog_DeselectAll;
public static String SelectProfilesDialog_Force_update;
public static String SelectProfilesDialog_Maven_profile_selection;
+ public static String SelectProfilesDialog_Move_Down;
+ public static String SelectProfilesDialog_Move_Up;
+ public static String SelectProfilesDialog_No_Common_Profiles;
public static String SelectProfilesDialog_Offline;
public static String SelectProfilesDialog_Profile_id_header;
public static String SelectProfilesDialog_Profile_source_header;
public static String SelectProfilesDialog_Project_has_no_available_profiles;
+ public static String SelectProfilesDialog_Select_active_profiles_for_selected_projects;
public static String SelectProfilesDialog_Select_Maven_profiles;
public static String SelectProfilesDialog_Select_the_active_Maven_profiles;
public static String SelectProfilesDialog_SelectAll;
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ActiveProfilesContentProvider.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ActiveProfilesContentProvider.java 2011-07-20 19:36:21 UTC (rev 33079)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ActiveProfilesContentProvider.java 2011-07-20 19:38:53 UTC (rev 33080)
@@ -5,7 +5,6 @@
import org.apache.maven.model.Profile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.m2e.core.MavenPlugin;
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelection.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelection.java 2011-07-20 19:36:21 UTC (rev 33079)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelection.java 2011-07-20 19:38:53 UTC (rev 33080)
@@ -48,4 +48,12 @@
public void setSource(String source) {
this.source = source;
}
+
+ public String toMavenString() {
+ String s = id;
+ if (ProfileState.Disabled == activationState) {
+ s = "!"+id;
+ }
+ return s;
+ }
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelectionHandler.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelectionHandler.java 2011-07-20 19:36:21 UTC (rev 33079)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelectionHandler.java 2011-07-20 19:38:53 UTC (rev 33080)
@@ -58,7 +58,7 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
final Set<IMavenProjectFacade> facades = getSelectedMavenProjects(event);
- if (!facades.isEmpty() ) {
+ if (facades != null && !facades.isEmpty() ) {
System.out.print("Select projects "+facades);
@@ -74,6 +74,7 @@
final SelectProfilesDialog dialog = new SelectProfilesDialog(window.getShell(),
facades,
sharedProfiles);
+ //dialog.setBlockOnOpen(false); doesn't work
if(dialog.open() == Window.OK) {
WorkspaceJob job = new WorkspaceJob(Messages.ProfileManager_Updating_maven_profiles) {
@@ -252,7 +253,7 @@
}
Set<IMavenProjectFacade> facades = new HashSet<IMavenProjectFacade>();
for (IProject p : projects) {
- if (p != null && p.hasNature(IMavenConstants.NATURE_ID)) {
+ if (p != null && p.isAccessible() && p.hasNature(IMavenConstants.NATURE_ID)) {
IMavenProjectFacade facade =MavenPlugin.getMavenProjectRegistry().getProject(p);
if (facade.getMavenProject() == null) {
System.err.println(facade.getProject() + " facade has no MavenProject!!!");
Added: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileUtil.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileUtil.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileUtil.java 2011-07-20 19:38:53 UTC (rev 33080)
@@ -0,0 +1,27 @@
+package org.jboss.tools.maven.ui.internal.profiles;
+
+import java.util.Collection;
+
+public class ProfileUtil {
+
+ private ProfileUtil(){}
+
+ private static final String COMMA = ", ";
+
+ public static String toString(Collection<ProfileSelection> profiles) {
+ StringBuilder sb = new StringBuilder();
+ if(profiles != null && !profiles.isEmpty()) {
+ boolean addComma = false;
+ for (ProfileSelection ps : profiles) {
+ if (Boolean.TRUE.equals(ps.getSelected())) {
+ if (addComma) {
+ sb.append(COMMA);
+ }
+ sb.append(ps.toMavenString());
+ addComma = true;
+ }
+ }
+ }
+ return sb.toString();
+ }
+}
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-20 19:36:21 UTC (rev 33079)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-20 19:38:53 UTC (rev 33080)
@@ -10,7 +10,6 @@
************************************************************************************/
package org.jboss.tools.maven.ui.internal.profiles;
-import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -20,16 +19,16 @@
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableColorProvider;
import org.eclipse.jface.viewers.ITableFontProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.osgi.util.NLS;
@@ -63,7 +62,9 @@
private CheckboxTableViewer profileTableViewer;
private Button offlineModeBtn;
private Button forceUpdateBtn;
-
+ private ITextViewer profilesTextViewer;
+ private Label profilesText;
+
private boolean offlineMode ;
private boolean forceUpdate;
@@ -71,9 +72,18 @@
Set<IMavenProjectFacade> facades;
IMavenProjectFacade facade;
+
+
+
+
+ final Action activationAction = new ChangeProfileStateAction(ProfileState.Active);
+
+ final Action deActivationAction = new ChangeProfileStateAction(ProfileState.Disabled);
+
public SelectProfilesDialog(Shell parentShell, Set<IMavenProjectFacade> facades,
List<ProfileSelection> sharedProfiles) {
super(parentShell);
+ setShellStyle(super.getShellStyle() | SWT.RESIZE | SWT.MODELESS);
offlineMode = MavenPlugin.getMavenConfiguration().isOffline();
this.facades = facades;
if(facades.size() == 1){
@@ -88,18 +98,13 @@
shell.setText(Messages.SelectProfilesDialog_Select_Maven_profiles);
}
- /**
- * Make the dialog resizeable
- */
- protected int getShellStyle() {
- return super.getShellStyle() | SWT.RESIZE;
- }
+
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
-
+ container.setEnabled(true);
GridLayout layout = new GridLayout(2, false);
layout.marginLeft = 12;
container.setLayout(layout);
@@ -108,7 +113,7 @@
setTitle(Messages.SelectProfilesDialog_Maven_profile_selection);
String text;
if (facade == null) {
- text = "Select the active profiles for selected projects";
+ text = Messages.SelectProfilesDialog_Select_active_profiles_for_selected_projects;
} else {
text = NLS.bind(
Messages.SelectProfilesDialog_Select_the_active_Maven_profiles,
@@ -116,18 +121,30 @@
}
setMessage(text);
+ if (facade != null) {
+
+ Label profilesLabel = new Label(container, SWT.NONE);
+ profilesLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ profilesLabel.setText(NLS.bind(Messages.SelectProfilesDialog_Active_Profiles_for_Project, facade.getProject().getName()));
+
+ profilesText = new Label(container, SWT.BORDER);
+ profilesText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ profilesText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ updateProfilesText();
+ }
+
boolean hasProfiles = !sharedProfiles.isEmpty();
Label lblAvailable = new Label(container, SWT.NONE);
String textLabel;
if (hasProfiles) {
if (facade == null) {
- textLabel = "Common profiles for selected projects";
+ textLabel = Messages.SelectProfilesDialog_Common_profiles;
} else {
textLabel = Messages.SelectProfilesDialog_Available_profiles;
}
} else {
if (facade == null) {
- textLabel = "There are no common profiles for the selected projects";
+ textLabel = Messages.SelectProfilesDialog_No_Common_Profiles;
} else {
textLabel =
NLS.bind(Messages.SelectProfilesDialog_Project_has_no_available_profiles, facade.getProject().getName());
@@ -140,11 +157,12 @@
if (hasProfiles) {
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 4);
- gd.heightHint = 150;
+ gd.heightHint = 200;
gd.widthHint = 500;
profileTableViewer = CheckboxTableViewer.newCheckList(container, SWT.BORDER);
Table table = profileTableViewer.getTable();
+ table.setFocus();
table.setLayoutData(gd);
table.setLinesVisible(true);
table.setHeaderVisible(true);
@@ -152,32 +170,14 @@
TableColumn profileColumn = new TableColumn(table, SWT.NONE);
profileColumn.setText(Messages.SelectProfilesDialog_Profile_id_header);
profileColumn.setWidth(350);
-
+
TableColumn sourceColumn = new TableColumn(table, SWT.NONE);
sourceColumn.setText(Messages.SelectProfilesDialog_Profile_source_header);
sourceColumn.setWidth(120);
+
- profileTableViewer
- .setContentProvider(new IStructuredContentProvider() {
+ profileTableViewer.setContentProvider(ArrayContentProvider.getInstance());
- public void inputChanged(Viewer viewer,
- Object oldInput, Object newInput) {
- // nothing to do
- }
-
- public void dispose() {
- // nothing to do
- }
-
- @SuppressWarnings("rawtypes")
- public Object[] getElements(Object input) {
- if (input instanceof Collection) {
- return ((Collection) input).toArray();
- }
- return null;
- }
- });
-
profileTableViewer.setLabelProvider(new ProfileLabelProvider(parent
.getFont()));
@@ -190,9 +190,13 @@
profileTableViewer.setGrayed(profile, false);
}
profile.setSelected(profileTableViewer.getChecked(profile));
- if (profile.getActivationState() == null) {
+ if (Boolean.FALSE.equals(profile.getSelected())
+ || profile.getActivationState() == null) {
profile.setActivationState(ProfileState.Active);
}
+
+ updateProfilesText();
+ profileTableViewer.refresh();
}
});
@@ -201,18 +205,23 @@
addSelectionButton(container, Messages.SelectProfilesDialog_SelectAll, true);
addSelectionButton(container, Messages.SelectProfilesDialog_DeselectAll, false);
-
+
offlineModeBtn = addCheckButton(container, Messages.SelectProfilesDialog_Offline, offlineMode);
forceUpdateBtn = addCheckButton(container, Messages.SelectProfilesDialog_Force_update, forceUpdate);
createMenu();
-
}
return area;
}
+ private void updateProfilesText() {
+ if (profilesText != null) {
+ profilesText.setText(ProfileUtil.toString(sharedProfiles));
+ }
+ }
+
private Button addCheckButton(Composite container, String label, boolean selected) {
Button checkBtn = new Button(container, SWT.CHECK);
checkBtn.setText(label);
@@ -224,7 +233,7 @@
private Button addSelectionButton(Composite container, String label, final boolean ischecked) {
Button button = new Button(container, SWT.NONE);
- button.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
+ button.setLayoutData(new GridData(SWT.FILL, SWT.UP,
false, false, 1, 1));
button.setText(label);
button.addSelectionListener(new SelectionListener() {
@@ -235,9 +244,10 @@
profile.setSelected(profileTableViewer.getChecked(profile));
if (profile.getActivationState() == null) {
- profile.setActivationState(ProfileState.Active);
+ profile.setActivationState(ProfileState.Active);
}
}
+ updateProfilesText();
}
public void widgetDefaultSelected(SelectionEvent e) {
@@ -259,8 +269,6 @@
@Override
protected void okPressed() {
if (profileTableViewer != null) {
- //Object[] obj = profileTableViewer.getCheckedElements();
- //for (int i = 0; i < obj.length; i++) {}
offlineMode = offlineModeBtn.getSelection();
forceUpdate = forceUpdateBtn.getSelection();
}
@@ -286,45 +294,13 @@
}
}
- final Action activationAction = new Action("") { //$NON-NLS-1$
- @Override
- public void run() {
- IStructuredSelection selection = (IStructuredSelection) profileTableViewer
- .getSelection();
- if (!selection.isEmpty()) {
- final ProfileSelection entry = (ProfileSelection) selection.getFirstElement();
- entry.setActivationState(ProfileState.Active);
- profileTableViewer.setChecked(entry, true);
- profileTableViewer.setGrayed(entry, false);
- profileTableViewer.refresh();
- }
- super.run();
- }
- };
- final Action deActivationAction = new Action("") { //$NON-NLS-1$
- @Override
- public void run() {
- IStructuredSelection selection = (IStructuredSelection) profileTableViewer
- .getSelection();
- if (!selection.isEmpty()) {
- final ProfileSelection entry = (ProfileSelection) selection.getFirstElement();
- entry.setActivationState(ProfileState.Disabled);
- profileTableViewer.setChecked(entry, true);
- profileTableViewer.setGrayed(entry, false);
- profileTableViewer.refresh();
- }
- super.run();
- }
- };
-
-
public void menuAboutToShow(IMenuManager manager) {
IStructuredSelection selection = (IStructuredSelection) profileTableViewer
.getSelection();
if (!selection.isEmpty()) {
final ProfileSelection entry = (ProfileSelection) selection.getFirstElement();
- String text = "";
+ String text = ""; //$NON-NLS-1$
ProfileState state = entry.getActivationState();
if ( state == null || state.equals(ProfileState.Disabled)) {
text = Messages.SelectProfilesDialog_Activate_menu;
@@ -347,6 +323,146 @@
return forceUpdate;
}
+
+ /* TODO add content assist to the profiles input text
+ private ITextViewer createTextInput(Composite container) {
+ ITextViewer textViewer = new TextViewer(container, SWT.BORDER | SWT.FILL);
+ textViewer.setDocument(new Document());
+ final ContentAssistant contentAssistant = new ContentAssistant();
+ contentAssistant.enableAutoActivation(true);
+ contentAssistant.setAutoActivationDelay(100);
+ contentAssistant.enableAutoInsert(true);
+ contentAssistant.setContentAssistProcessor(new ProfileContentAssistProcessor(sharedProfiles),
+ IDocument.DEFAULT_CONTENT_TYPE);
+
+ textViewer.getTextWidget().addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if ( (e.character == ' ') && ((e.stateMask & SWT.CTRL) != 0) ) {
+ contentAssistant.showPossibleCompletions();
+ }
+ }
+ });
+
+
+ contentAssistant.install(textViewer );
+ return textViewer;
+ }
+
+ private final class ProfileContentAssistProcessor implements
+ IContentAssistProcessor {
+
+ private List<String> profileIds;
+
+ public ProfileContentAssistProcessor(
+ List<ProfileSelection> possibleProfiles) {
+ assert possibleProfiles != null;
+ profileIds = new ArrayList<String>(possibleProfiles.size());
+ for (ProfileSelection ps : possibleProfiles) {
+ profileIds.add(ps.getId());
+ }
+ }
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ return null;
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ return null;
+ }
+
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ return new char[]{','};
+ }
+
+ public IContextInformation[] computeContextInformation(ITextViewer viewer,
+ int offset) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int documentOffset) {
+ IDocument document = viewer.getDocument();
+ int currOffset = documentOffset -1;
+ ICompletionProposal[] proposals = null;
+ try {
+ String currentWord = getCurrentWord(document, currOffset);
+ System.err.println(currOffset + " - Current word "+currentWord); //$NON-NLS-1$
+
+ int currentWordLength = currentWord.length();
+ List<ICompletionProposal> suggestions = new ArrayList<ICompletionProposal>(profileIds.size());
+ for (String id : profileIds) {
+ if (!id.startsWith(currentWord)) {
+ continue;
+ }
+
+ ICompletionProposal proposal = new CompletionProposal(id,
+ documentOffset - currentWordLength,
+ currentWordLength,
+ id.length());
+
+ suggestions.add(proposal);
+ }
+ if (!suggestions.isEmpty()) {
+ proposals = new ICompletionProposal[suggestions.size()];
+ suggestions.toArray(proposals);
+ }
+ } catch (BadLocationException e) {
+ System.err.println(e);
+ }
+ return proposals;
+ }
+
+
+ private String getCurrentWord(IDocument document, int currOffset)
+ throws BadLocationException {
+ StringBuilder currWord = new StringBuilder();
+ char currChar;
+
+ while (currOffset > -1
+ && !Character.isWhitespace(currChar = document
+ .getChar(currOffset))
+ && ',' != currChar) {
+ currWord.insert(0, currChar);
+ currOffset--;
+ }
+ return currWord.toString();
+ }
+ }
+ */
+
+ private class ChangeProfileStateAction extends Action {
+
+ private final ProfileState state;
+
+ public ChangeProfileStateAction(ProfileState state) {
+ this.state = state;
+ }
+
+ @Override
+ public void run() {
+ IStructuredSelection selection = (IStructuredSelection) profileTableViewer
+ .getSelection();
+ if (!selection.isEmpty()) {
+ final ProfileSelection entry = (ProfileSelection) selection.getFirstElement();
+ entry.setActivationState(state);
+ profileTableViewer.setChecked(entry, true);
+ profileTableViewer.setGrayed(entry, false);
+ if (ProfileState.Disabled.equals(state)) {
+ entry.setSelected(true);
+ }
+ updateProfilesText();
+ profileTableViewer.refresh();
+ }
+ super.run();
+ }
+ }
+
private class ProfileLabelProvider extends LabelProvider implements
ITableLabelProvider, ITableFontProvider, ITableColorProvider {
@@ -397,7 +513,7 @@
text.append(entry.getId());
ProfileState state = entry.getActivationState();
- if (state == ProfileState.Disabled) {
+ if (Boolean.TRUE.equals(entry.getSelected()) && state == ProfileState.Disabled) {
text.append(Messages.SelectProfilesDialog_deactivated);
} else if (Boolean.TRUE.equals(entry.getAutoActive())) {
text.append(Messages.SelectProfilesDialog_autoactivated);
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties 2011-07-20 19:36:21 UTC (rev 33079)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties 2011-07-20 19:38:53 UTC (rev 33080)
@@ -36,17 +36,23 @@
ConfiguratorPreferencePage_When_importing_Maven_projects_configure_the_following=When importing Maven projects configure the following:
ProfileManager_Updating_maven_profiles=Updating maven profiles
SelectProfilesDialog_Activate_menu=Activate {0}
+SelectProfilesDialog_Active_Profiles_for_Project=Active profiles for {0} :
SelectProfilesDialog_autoactivated=\ (auto activated)
SelectProfilesDialog_Available_profiles=Available profiles
+SelectProfilesDialog_Common_profiles=Common profiles for selected projects
SelectProfilesDialog_Deactivate_menu=Deactivate {0}
SelectProfilesDialog_deactivated=\ (deactivated)
SelectProfilesDialog_DeselectAll=Deselect all
SelectProfilesDialog_Force_update=Force update
SelectProfilesDialog_Maven_profile_selection=Maven Profile selection
+SelectProfilesDialog_Move_Down=Move Down
+SelectProfilesDialog_Move_Up=Move Up
+SelectProfilesDialog_No_Common_Profiles=There are no common profiles for the selected projects.
SelectProfilesDialog_Offline=Offline
SelectProfilesDialog_Profile_id_header=Profile id
SelectProfilesDialog_Profile_source_header=Source
SelectProfilesDialog_Project_has_no_available_profiles=Project {0} has no available profiles
+SelectProfilesDialog_Select_active_profiles_for_selected_projects=Select the active Maven profiles for selected projects. Right-click to (de)activate a profile.
SelectProfilesDialog_Select_Maven_profiles=Select Maven profiles
SelectProfilesDialog_Select_the_active_Maven_profiles=Select the active Maven profiles for project {0}. Right-click to (de)activate a profile.
SelectProfilesDialog_SelectAll=Select All
14 years, 5 months
JBoss Tools SVN: r33079 - in trunk/maven/tests/org.jboss.tools.maven.ui.bot.test: META-INF and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-07-20 15:36:21 -0400 (Wed, 20 Jul 2011)
New Revision: 33079
Added:
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/plugin_customization.ini
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/projects/
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/projects/simple-jar/
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/projects/simple-jar/pom.xml
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/AbstractMavenSWTBotTest.java
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenProfileSelectionTest.java
Modified:
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/Activator.java
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/CreateMavenizedSeamProjectTest.java
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenAllBotTests.java
Log:
JBIDE-8969 : tried (and failed) to add UI tests for the profile selection; Added dependency to m2e test framework in the process, to improve the "waiting workspace jobs to finish working" flow and allow us to import existing maven projects.
Property changes on: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ target
buildlog.latest.txt
bin
build
screenshots
Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF 2011-07-20 19:06:13 UTC (rev 33078)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF 2011-07-20 19:36:21 UTC (rev 33079)
@@ -37,7 +37,8 @@
org.eclipse.jst.jee.ui,
org.eclipse.jst.jee.web,
org.eclipse.m2e.lifecyclemapping.defaults;bundle-version="[1.0,1.1)",
- org.eclipse.m2e.launching;bundle-version="[1.0,1.1)"
+ org.eclipse.m2e.launching;bundle-version="[1.0,1.1)",
+ org.eclipse.m2e.tests.common;bundle-version="[1.0.0,1.1.0)"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Eclipse-RegisterBuddy: org.apache.log4j
Added: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/plugin_customization.ini
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/plugin_customization.ini (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/plugin_customization.ini 2011-07-20 19:36:21 UTC (rev 33079)
@@ -0,0 +1 @@
+org.eclipse.m2e.core/eclipse.m2.updateIndexes=false
\ No newline at end of file
Added: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/projects/simple-jar/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/projects/simple-jar/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/projects/simple-jar/pom.xml 2011-07-20 19:36:21 UTC (rev 33079)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.tools.maven.tests</groupId>
+ <artifactId>simple-jar</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <profiles>
+ <profile>
+ <id>active-profile</id>
+ <activation><activeByDefault>true</activeByDefault></activation>
+ </profile>
+ <profile>
+ <id>inactive-profile</id>
+ </profile>
+ </profiles>
+</project>
+
Added: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/AbstractMavenSWTBotTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/AbstractMavenSWTBotTest.java (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/AbstractMavenSWTBotTest.java 2011-07-20 19:36:21 UTC (rev 33079)
@@ -0,0 +1,141 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.ui.bot.test;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.m2e.tests.common.AbstractMavenProjectTestCase;
+import org.eclipse.m2e.tests.common.JobHelpers;
+import org.eclipse.m2e.tests.common.WorkspaceHelpers;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.results.Result;
+import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.ui.IWorkbenchPreferenceConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.IPreferenceConstants;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.ui.internal.util.PrefUtil;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public abstract class AbstractMavenSWTBotTest extends AbstractMavenProjectTestCase {
+
+ public static final String PACKAGE_EXPLORER = "Package Explorer"; //$NON-NLS-1$
+
+ protected static SWTWorkbenchBot bot;
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ bot = initSWTBot();
+ WorkbenchPlugin.getDefault().getPreferenceStore()
+ .setValue(IPreferenceConstants.RUN_IN_BACKGROUND, true);
+
+ PrefUtil.getAPIPreferenceStore().setValue(
+ IWorkbenchPreferenceConstants.ENABLE_ANIMATIONS, false);
+
+ }
+
+ public static SWTWorkbenchBot initSWTBot() throws CoreException {
+ SWTWorkbenchBot swtbot = new SWTWorkbenchBot();
+ SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
+ SWTBotPreferences.TIMEOUT = 1000;
+ SWTBotPreferences.PLAYBACK_DELAY = 5;
+ waitForIdle();
+ try {
+ SWTBotView view = swtbot.viewByTitle("Welcome");
+ if (view != null) {
+ view.close();
+ }
+ } catch (WidgetNotFoundException ignore) {
+ }
+
+ SWTBotShell[] shells = swtbot.shells();
+ for (SWTBotShell shell : shells) {
+ final Shell widget = shell.widget;
+ Object parent = UIThreadRunnable.syncExec(shell.display,
+ new Result<Object>() {
+ public Object run() {
+ return widget.isDisposed() ? null : widget.getParent();
+ }
+ });
+ if (parent == null) {
+ continue;
+ }
+ shell.close();
+ }
+
+ List<? extends SWTBotEditor> editors = swtbot.editors();
+ for (SWTBotEditor e : editors) {
+ e.close();
+ }
+
+ return swtbot;
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ activateSchell();
+ super.setUp();
+ }
+
+ public static void activateSchell() {
+ UIThreadRunnable.syncExec(new VoidResult() {
+ public void run() {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
+ .forceActive();
+ }
+ });
+ }
+
+ @After
+ public void tearDown() throws Exception {
+
+ }
+
+ @AfterClass
+ public final static void cleanUp() throws Exception {
+ boolean buildAutomatically = ResourcesUtils.setBuildAutomatically(false);
+ ValidationFramework.getDefault().suspendAllValidation(true);
+ try {
+ executeAfterClass();
+ WorkspaceHelpers.cleanWorkspace();
+ } finally {
+ ResourcesUtils.setBuildAutomatically(buildAutomatically);
+ ValidationFramework.getDefault().suspendAllValidation(false);
+ }
+ waitForIdle();
+ }
+
+ protected static void executeAfterClass() throws Exception {
+ }
+
+
+ public static void waitForIdle() {
+ JobHelpers.waitForLaunchesToComplete(30*1000);
+ JobHelpers.waitForJobsToComplete();
+ }
+
+}
Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/Activator.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/Activator.java 2011-07-20 19:06:13 UTC (rev 33078)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/Activator.java 2011-07-20 19:36:21 UTC (rev 33079)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.maven.ui.bot.test;
import org.eclipse.ui.plugin.AbstractUIPlugin;
Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/CreateMavenizedSeamProjectTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/CreateMavenizedSeamProjectTest.java 2011-07-20 19:06:13 UTC (rev 33078)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/CreateMavenizedSeamProjectTest.java 2011-07-20 19:36:21 UTC (rev 33079)
@@ -11,6 +11,7 @@
package org.jboss.tools.maven.ui.bot.test;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -21,6 +22,7 @@
import java.util.List;
import java.util.Properties;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -45,7 +47,12 @@
import org.eclipse.datatools.connectivity.drivers.IPropertySet;
import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
import org.eclipse.datatools.connectivity.drivers.models.TemplateDescriptor;
+import org.eclipse.jface.bindings.keys.KeyStroke;
+import org.eclipse.jface.bindings.keys.ParseException;
import org.eclipse.m2e.core.internal.IMavenConstants;
+import org.eclipse.m2e.tests.common.AbstractMavenProjectTestCase;
+import org.eclipse.m2e.tests.common.JobHelpers;
+import org.eclipse.m2e.tests.common.WorkspaceHelpers;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
@@ -57,6 +64,7 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
import org.eclipse.swtbot.swt.finder.results.Result;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
@@ -103,7 +111,7 @@
@RunWith(SWTBotJunit4ClassRunner.class)
public class CreateMavenizedSeamProjectTest {
- protected static final long IDLE_TIME = 20 * 60 * 1000L;
+ protected static final long IDLE_TIME = 1 * 60 * 1000L;
private static final String CONNECTION_PROFILE_NAME = "DefaultDS";
@@ -169,7 +177,7 @@
@BeforeClass
public final static void beforeClass() throws Exception {
- initSWTBot();
+ bot = AbstractMavenSWTBotTest.initSWTBot();
switchPerspective("org.jboss.tools.seam.ui.SeamPerspective");
@@ -192,61 +200,12 @@
createNewSeamWebProjectWizard(PROJECT_NAME_WAR, DEPLOY_TYPE_WAR);
}
- private static void initSWTBot() throws CoreException {
- bot = new SWTWorkbenchBot();
- SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
- SWTBotPreferences.TIMEOUT = 1000;
- SWTBotPreferences.PLAYBACK_DELAY = 5;
- waitForIdle();
- try {
- SWTBotView view = bot.viewByTitle("Welcome");
- if (view != null) {
- view.close();
- }
- } catch (WidgetNotFoundException ignore) {
- }
- SWTBotShell[] shells = bot.shells();
- for (SWTBotShell shell : shells) {
- final Shell widget = shell.widget;
- Object parent = UIThreadRunnable.syncExec(shell.display,
- new Result<Object>() {
- public Object run() {
- return widget.isDisposed() ? null : widget.getParent();
- }
- });
- if (parent == null) {
- continue;
- }
- shell.close();
- }
- List<? extends SWTBotEditor> editors = bot.editors();
- for (SWTBotEditor e : editors) {
- e.close();
- }
-
- removeProjects();
-
- WorkbenchPlugin.getDefault().getPreferenceStore()
- .setValue(IPreferenceConstants.RUN_IN_BACKGROUND, true);
-
- PrefUtil.getAPIPreferenceStore().setValue(
- IWorkbenchPreferenceConstants.ENABLE_ANIMATIONS, false);
+ private static void removeProjects() throws Exception {
+ WorkspaceHelpers.cleanWorkspace();
}
- private static void removeProjects() throws CoreException {
- final IWorkspace workspace = ResourcesPlugin.getWorkspace();
- workspace.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IProject[] projects = workspace.getRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- projects[i].delete(true, true, monitor);
- }
- }
- }, new NullProgressMonitor());
- }
-
private static void removeServers() throws CoreException {
IServer server = ServerCore.findServer(JBOSS_AS_SERVER_NAME);
IServerWorkingCopy wc = server.createWorkingCopy();
@@ -282,12 +241,7 @@
}
private static void activateSchell() {
- UIThreadRunnable.syncExec(new VoidResult() {
- public void run() {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
- .forceActive();
- }
- });
+ AbstractMavenSWTBotTest.activateSchell();
}
@After
@@ -509,7 +463,6 @@
bot.button("Finish").click();
waitForIdle();
-
}
@Test
@@ -588,36 +541,24 @@
bot.textWithLabel("Goals:").setText("clean package");
bot.button("Run").click();
-
waitForIdle();
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME_WAR);
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- IPath webInfPath = new Path("target/" + PROJECT_NAME_WAR + "-0.0.1-SNAPSHOT/WEB-INF");
- assertFalse(project.getFolder(webInfPath.append("src")).exists());
- assertFalse(project.getFolder(webInfPath.append("dev")).exists());
- assertTrue(project.getFolder(webInfPath.append("lib")).exists());
+ project.getFolder("target").refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+
+ IFolder warFolder = project.getFolder("target/" + PROJECT_NAME_WAR + "-0.0.1-SNAPSHOT");
+
+ assertTrue(warFolder +" is missing ", warFolder.exists());
+ IPath webInfPath = new Path("WEB-INF");
+ assertFalse(warFolder.getFolder(webInfPath.append("src")).exists());
+ assertFalse(warFolder.getFolder(webInfPath.append("dev")).exists());
+ assertTrue(warFolder.getFolder(webInfPath.append("lib")).exists());
+
}
private static void waitForIdle() {
- long start = System.currentTimeMillis();
- int delay = 50;
- while (!Job.getJobManager().isIdle()) {
- delay(delay);
- if ((System.currentTimeMillis() - start) > IDLE_TIME) {
- Job[] jobs = Job.getJobManager().find(null);
- StringBuffer str = new StringBuffer();
- for (Job job : jobs) {
- if (job.getThread() != null) {
- str.append("\n").append(job.getName()).append(" (")
- .append(job.getClass()).append(")");
- }
- }
- throw new RuntimeException(
- "Long running tasks detected:" + str.toString()); //$NON-NLS-1$
- }
- }
+ AbstractMavenSWTBotTest.waitForIdle();
}
public static void delay(long waitTimeMillis) {
@@ -640,6 +581,7 @@
}
}
+
// see https://jira.jboss.org/browse/JBIDE-6767
@Test
public void testLibraries() throws Exception {
Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenAllBotTests.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenAllBotTests.java 2011-07-20 19:06:13 UTC (rev 33078)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenAllBotTests.java 2011-07-20 19:36:21 UTC (rev 33079)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.maven.ui.bot.test;
import org.junit.runner.RunWith;
@@ -10,9 +20,11 @@
*/
@Suite.SuiteClasses({
+ //MavenProfileSelectionTest.class, FIXME enable tests for profiles
CreateMavenizedSeamProjectTest.class,
})
@RunWith(Suite.class)
public class MavenAllBotTests {
+
}
\ No newline at end of file
Added: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenProfileSelectionTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenProfileSelectionTest.java (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/MavenProfileSelectionTest.java 2011-07-20 19:36:21 UTC (rev 33079)
@@ -0,0 +1,56 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.ui.bot.test;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.bindings.keys.KeyStroke;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@SuppressWarnings("restriction")
+(a)RunWith(SWTBotJunit4ClassRunner.class)
+public class MavenProfileSelectionTest extends AbstractMavenSWTBotTest {
+
+ @Test
+ //FIXME Test fail due to Modal Dialog. Need to find a solution
+ public void testOpenMavenProfiles() throws Exception {
+
+ IProject project = importProject("projects/simple-jar/pom.xml");
+ waitForJobsToComplete();
+ //Select the project
+ final SWTBotView packageExplorer = bot.viewByTitle(PACKAGE_EXPLORER);
+ SWTBot innerBot = packageExplorer.bot();
+ innerBot.activeShell().activate();
+ final SWTBotTree tree = innerBot.tree();
+ final SWTBotTreeItem projectItem = tree.getTreeItem(project.getName());
+ projectItem.select();
+ //Open the profiles dialog
+ projectItem.pressShortcut(Keystrokes.CTRL, Keystrokes.ALT, KeyStroke.getInstance("P"));
+
+ //FIXME Either the dialog doesn't open abd the test fails
+ //or SWTBot is blocked by the modal dialog
+ final SWTBotShell selectDialogShell = bot.shell("Select Maven profiles");
+ assertNotNull("selectDialogShell not found", selectDialogShell);
+ assertEquals("Select Maven profiles", selectDialogShell.getText());
+
+ selectDialogShell.activate();
+ Thread.sleep(5000);
+ //TODO implement real tests
+ bot.button("Cancel").click();
+ }
+}
14 years, 5 months
JBoss Tools SVN: r33078 - trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-07-20 15:06:13 -0400 (Wed, 20 Jul 2011)
New Revision: 33078
Modified:
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java
Log:
Removed unnecessary null-check
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java 2011-07-20 19:04:43 UTC (rev 33077)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java 2011-07-20 19:06:13 UTC (rev 33078)
@@ -482,7 +482,7 @@
Artifact seamArtifact = null;
for (Artifact artifact:artifacts) {
String groupId = artifact.getGroupId();
- if (groupId != null && ORG_JBOSS_SEAM_GROUP_ID.equals(groupId)) {
+ if (ORG_JBOSS_SEAM_GROUP_ID.equals(groupId)) {
String artifactId = artifact.getArtifactId();
if (artifactId != null && JBOSS_SEAM_ARTIFACT_ID.equals(artifactId)) {
return artifact.getVersion();
14 years, 5 months
JBoss Tools SVN: r33077 - trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-07-20 15:04:43 -0400 (Wed, 20 Jul 2011)
New Revision: 33077
Modified:
trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java
Log:
Do not install the JSF Facet if the Web Facet is missing, or you'll face terrible consequences
Modified: trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java 2011-07-20 17:36:18 UTC (rev 33076)
+++ trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java 2011-07-20 19:04:43 UTC (rev 33077)
@@ -143,8 +143,9 @@
if (!fproj.hasProjectFacet(dynamicWebFacet)) {
Activator.log(Messages.JSFProjectConfigurator_The_project_does_not_contain_the_Web_Module_facet);
- }
- installJSFFacet(fproj, jsfVersion, mavenProject, monitor);
+ } else {
+ installJSFFacet(fproj, jsfVersion, mavenProject, monitor);
+ }
installM2Facet(fproj, monitor);
}
14 years, 5 months
JBoss Tools SVN: r33076 - in trunk/cdi/tests: org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-07-20 13:36:18 -0400 (Wed, 20 Jul 2011)
New Revision: 33076
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope3.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope3.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope4.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope4.qfxresult
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7633
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope3.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope3.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope3.java 2011-07-20 17:36:18 UTC (rev 33076)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+
+import javax.inject.Scope;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Retention(RUNTIME)
+@Scope
+@Inherited
+@Documented
+public @interface TestScope3 {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope3.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope3.qfxresult
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope3.qfxresult (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope3.qfxresult 2011-07-20 17:36:18 UTC (rev 33076)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+
+import javax.inject.Scope;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import java.lang.annotation.Target;
+
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+@Scope
+@Inherited
+@Documented
+public @interface TestScope3 {
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope4.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope4.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope4.java 2011-07-20 17:36:18 UTC (rev 33076)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+
+import javax.inject.Scope;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+@Target({})
+@Retention(RUNTIME)
+@Scope
+@Inherited
+@Documented
+public @interface TestScope4 {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope4.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope4.qfxresult
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope4.qfxresult (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestScope4.qfxresult 2011-07-20 17:36:18 UTC (rev 33076)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+
+import javax.inject.Scope;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+@Scope
+@Inherited
+@Documented
+public @interface TestScope4 {
+
+}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-20 17:21:46 UTC (rev 33075)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-20 17:36:18 UTC (rev 33076)
@@ -521,4 +521,32 @@
ChangeTargetAnnotationMarkerResolution.class);
}
+ public void testAddTargetToScopeResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestScope3.java"
+ },
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestScope3.qfxresult"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE_ID,
+ AddTargetAnnotationMarkerResolution.class);
+ }
+
+ public void testChangeTargetToScopeResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestScope4.java"
+ },
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestScope4.qfxresult"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE_ID,
+ ChangeTargetAnnotationMarkerResolution.class);
+ }
+
}
\ No newline at end of file
14 years, 5 months
JBoss Tools SVN: r33075 - in trunk/cdi/tests: org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-07-20 13:21:46 -0400 (Wed, 20 Jul 2011)
New Revision: 33075
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestQualifier3.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestQualifier4.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7632
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestQualifier3.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestQualifier3.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestQualifier3.java 2011-07-20 17:21:46 UTC (rev 33075)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import java.lang.annotation.Documented;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface TestQualifier3 {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestQualifier3.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestQualifier4.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestQualifier4.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestQualifier4.java 2011-07-20 17:21:46 UTC (rev 33075)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Retention(RUNTIME)
+@Target({})
+@Documented
+@Qualifier
+public @interface TestQualifier4 {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestQualifier4.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-20 16:51:26 UTC (rev 33074)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-20 17:21:46 UTC (rev 33075)
@@ -498,4 +498,27 @@
CDIValidationErrorManager.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE_ID,
ChangeTargetAnnotationMarkerResolution.class);
}
+
+ public void testAddTargetToQualifierResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestQualifier3.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE_ID,
+ AddTargetAnnotationMarkerResolution.class);
+ }
+
+ public void testChangeTargetToQualifierResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestQualifier4.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE_ID,
+ ChangeTargetAnnotationMarkerResolution.class);
+ }
+
}
\ No newline at end of file
14 years, 5 months
JBoss Tools SVN: r33074 - in trunk/cdi/tests: org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-07-20 12:51:26 -0400 (Wed, 20 Jul 2011)
New Revision: 33074
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype3.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype4.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7630
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype3.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype3.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype3.java 2011-07-20 16:51:26 UTC (rev 33074)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+
+@Retention(RUNTIME)
+@Stereotype
+@ApplicationScoped
+@Named
+public @interface TestStereotype3 {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype3.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype4.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype4.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype4.java 2011-07-20 16:51:26 UTC (rev 33074)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+
+@Retention(RUNTIME)
+@Stereotype
+@Target({})
+@ApplicationScoped
+@Named
+public @interface TestStereotype4 {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestStereotype4.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-20 12:28:40 UTC (rev 33073)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-20 16:51:26 UTC (rev 33074)
@@ -30,7 +30,9 @@
import org.jboss.tools.cdi.ui.marker.AddLocalBeanMarkerResolution;
import org.jboss.tools.cdi.ui.marker.AddRetentionAnnotationMarkerResolution;
import org.jboss.tools.cdi.ui.marker.AddSerializableInterfaceMarkerResolution;
+import org.jboss.tools.cdi.ui.marker.AddTargetAnnotationMarkerResolution;
import org.jboss.tools.cdi.ui.marker.ChangeRetentionAnnotationMarkerResolution;
+import org.jboss.tools.cdi.ui.marker.ChangeTargetAnnotationMarkerResolution;
import org.jboss.tools.cdi.ui.marker.DeleteAllDisposerDuplicantMarkerResolution;
import org.jboss.tools.cdi.ui.marker.DeleteAllInjectedConstructorsMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeFieldStaticMarkerResolution;
@@ -474,4 +476,26 @@
CDIValidationErrorManager.MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE_ID,
ChangeRetentionAnnotationMarkerResolution.class);
}
+
+ public void testAddTargetToStereotypeResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestStereotype3.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE_ID,
+ AddTargetAnnotationMarkerResolution.class);
+ }
+
+ public void testTargetRetentionToStereotypeResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestStereotype4.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE_ID,
+ ChangeTargetAnnotationMarkerResolution.class);
+ }
}
\ No newline at end of file
14 years, 5 months