JBoss Tools SVN: r40823 - in trunk/maven/plugins/org.jboss.tools.maven.ui: icons and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-05-07 12:30:02 -0400 (Mon, 07 May 2012)
New Revision: 40823
Added:
trunk/maven/plugins/org.jboss.tools.maven.ui/icons/
trunk/maven/plugins/org.jboss.tools.maven.ui/icons/jboss.png
trunk/maven/plugins/org.jboss.tools.maven.ui/icons/repo_wiz.gif
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/ConfigureMavenRepositoriesMarkerResolution.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizard.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizardPage.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/build.properties
trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/MavenDependencyMarkerResolutionGenerator.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/OpenPageInBrowserMarkerResolution.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/preferences/ConfiguratorPreferencePage.java
Log:
JBIDE-11235 - Recognize EAP/WFK maven repositories and add them into ~/.m2/settings.xml
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/build.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/build.properties 2012-05-07 16:21:53 UTC (rev 40822)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/build.properties 2012-05-07 16:30:02 UTC (rev 40823)
@@ -8,4 +8,5 @@
about.mappings,\
about.ini,\
about.html,\
- plugin.properties
+ plugin.properties,\
+ icons/
Added: trunk/maven/plugins/org.jboss.tools.maven.ui/icons/jboss.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.ui/icons/jboss.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/maven/plugins/org.jboss.tools.maven.ui/icons/repo_wiz.gif
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.ui/icons/repo_wiz.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.properties 2012-05-07 16:21:53 UTC (rev 40822)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.properties 2012-05-07 16:30:02 UTC (rev 40823)
@@ -11,3 +11,6 @@
JBoss_Public_Repo_description=The JBoss Public repository is a composite repository of several major repositories
JBoss_Releases_Repo_name=JBoss Releases repository
JBoss_Releases_Repo_description=The JBoss Releases repository mostly contains JBoss projects artifacts
+
+JBossTools_Category = JBoss Tools
+Configure_Maven_Repositories = Configure Maven Repositories
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2012-05-07 16:21:53 UTC (rev 40822)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2012-05-07 16:30:02 UTC (rev 40823)
@@ -145,4 +145,18 @@
markerType="org.eclipse.m2e.core.maven2Problem.pomloading">
</markerResolutionGenerator>
</extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <category
+ name="%JBossTools_Category"
+ id="org.jboss.ide.eclipse.ui.wizards">
+ </category>
+ <wizard
+ category="org.jboss.ide.eclipse.ui.wizards"
+ class="org.jboss.tools.maven.ui.wizard.ConfigureMavenRepositoriesWizard"
+ icon="icons/repo_wiz.gif"
+ id="org.jboss.tools.maven.ui.wizard.ConfigureMavenRepositoriesWizard"
+ name="%Configure_Maven_Repositories">
+ </wizard>
+ </extension>
</plugin>
Added: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/ConfigureMavenRepositoriesMarkerResolution.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/ConfigureMavenRepositoriesMarkerResolution.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/ConfigureMavenRepositoriesMarkerResolution.java 2012-05-07 16:30:02 UTC (rev 40823)
@@ -0,0 +1,49 @@
+/*************************************************************************************
+ * Copyright (c) 2009-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.internal.markers;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolution2;
+import org.jboss.tools.maven.ui.wizard.ConfigureMavenRepositoriesWizard;
+
+public class ConfigureMavenRepositoriesMarkerResolution implements IMarkerResolution,
+ IMarkerResolution2 {
+
+
+ public ConfigureMavenRepositoriesMarkerResolution() {
+ }
+
+ public String getDescription() {
+ return getLabel();
+ }
+
+ public Image getImage() {
+ return null;
+ }
+
+ public String getLabel() {
+ return "Configure Maven Repositories";
+ }
+
+ public void run(IMarker arg0) {
+
+ ConfigureMavenRepositoriesWizard wizard = new ConfigureMavenRepositoriesWizard();
+ WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
+ dialog.create();
+ dialog.open();
+
+ }
+
+}
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/MavenDependencyMarkerResolutionGenerator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/MavenDependencyMarkerResolutionGenerator.java 2012-05-07 16:21:53 UTC (rev 40822)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/MavenDependencyMarkerResolutionGenerator.java 2012-05-07 16:30:02 UTC (rev 40823)
@@ -47,11 +47,13 @@
switch (type) {
case JBOSS_REPO:
return new IMarkerResolution[] {
+ new ConfigureMavenRepositoriesMarkerResolution(),
new OpenPageInBrowserMarkerResolution(Messages.Quickfix_setupCommunityRepo,
JBOSS_COMMUNITY_REPO_SETUP_GUIDE_URL)
};
case EAP_REPO:
return new IMarkerResolution[] {
+ new ConfigureMavenRepositoriesMarkerResolution(),
new OpenPageInBrowserMarkerResolution(Messages.Quickfix_setupEnterpriseRepo,
JBOSS_ENTERPRISE_REPO_SETUP_GUIDE_URL)
};
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/OpenPageInBrowserMarkerResolution.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/OpenPageInBrowserMarkerResolution.java 2012-05-07 16:21:53 UTC (rev 40822)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/markers/OpenPageInBrowserMarkerResolution.java 2012-05-07 16:30:02 UTC (rev 40823)
@@ -21,6 +21,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.jboss.tools.maven.ui.Activator;
public class OpenPageInBrowserMarkerResolution implements IMarkerResolution,
IMarkerResolution2 {
@@ -58,11 +59,9 @@
}
browser.openURL(new URL(url));
} catch (PartInitException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Activator.log(e);
} catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Activator.log(e);
}
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/preferences/ConfiguratorPreferencePage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/preferences/ConfiguratorPreferencePage.java 2012-05-07 16:21:53 UTC (rev 40822)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/preferences/ConfiguratorPreferencePage.java 2012-05-07 16:30:02 UTC (rev 40823)
@@ -13,18 +13,24 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.jboss.tools.maven.ui.Activator;
import org.jboss.tools.maven.ui.Messages;
+import org.jboss.tools.maven.ui.wizard.ConfigureMavenRepositoriesWizard;
import org.osgi.framework.Bundle;
/**
@@ -58,6 +64,7 @@
private Button configureJaxRsButton;
private Button configureJpaButton;
private Button configureGwtButton;
+ private Image jbossImage;
@Override
protected Control createContents(Composite parent) {
@@ -165,9 +172,33 @@
configureGwtButton.setSelection(configureJpa);
}
+ Button configureMavenButton = new Button(composite, SWT.PUSH);
+ configureMavenButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false));
+ configureMavenButton.setText("Configure Maven Repositories...");
+ configureMavenButton.setImage(getJBossImage());
+ configureMavenButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ ConfigureMavenRepositoriesWizard wizard = new ConfigureMavenRepositoriesWizard();
+ WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
+ dialog.create();
+ dialog.open();
+ }
+ });
+
return composite;
}
+
+ private Image getJBossImage() {
+ if (jbossImage == null) {
+ ImageDescriptor desc = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
+ "icons/jboss.png"); //$NON-NLS-1$
+ jbossImage = desc.createImage();
+ }
+ return jbossImage;
+ }
private boolean bundleExists(String bundleId) {
Bundle bundle = Platform.getBundle(bundleId);
@@ -293,5 +324,13 @@
return super.performOk();
}
+ @Override
+ public void dispose() {
+ if (jbossImage != null) {
+ jbossImage.dispose();
+ }
+ super.dispose();
+ }
+
}
Added: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizard.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizard.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizard.java 2012-05-07 16:30:02 UTC (rev 40823)
@@ -0,0 +1,41 @@
+package org.jboss.tools.maven.ui.wizard;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.jboss.tools.maven.ui.Activator;
+
+public class ConfigureMavenRepositoriesWizard extends Wizard implements
+ INewWizard {
+
+ private ConfigureMavenRepositoriesWizardPage page;
+
+ public ConfigureMavenRepositoriesWizard() {
+ super();
+ setWindowTitle("Maven Repositories");
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ initializeDefaultPageImageDescriptor();
+ }
+
+ private void initializeDefaultPageImageDescriptor() {
+ ImageDescriptor desc = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
+ "icons/repo_wiz.gif"); //$NON-NLS-1$
+ setDefaultPageImageDescriptor(desc);
+ }
+
+ @Override
+ public boolean performFinish() {
+ page.finishPage();
+ return true;
+ }
+
+ @Override
+ public void addPages() {
+ page = new ConfigureMavenRepositoriesWizardPage();
+ addPage(page);
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizardPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizardPage.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizardPage.java 2012-05-07 16:30:02 UTC (rev 40823)
@@ -0,0 +1,710 @@
+package org.jboss.tools.maven.ui.wizard;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.settings.Activation;
+import org.apache.maven.settings.Profile;
+import org.apache.maven.settings.Repository;
+import org.apache.maven.settings.RepositoryPolicy;
+import org.apache.maven.settings.Settings;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.jboss.tools.maven.ui.Activator;
+
+public class ConfigureMavenRepositoriesWizardPage extends WizardPage {
+
+ private static final String SEPARATOR = "/"; //$NON-NLS-1$
+
+ private static final String JSF_IMPL = "com" + File.separator + "sun" + File.separator + "faces" + File.separator + "jsf-impl"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ private static final String WFK_BOMS = "com" + File.separator + "redhat" + File.separator + "jboss" + File.separator + "wfk" + File.separator + "boms"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+
+ private static final String PAGE_NAME = "org.jboss.tools.maven.ui.wizard.page"; //$NON-NLS-1$
+ private static final String ADD_ALL = " Add All>> ";
+ private static final String ADD = " Add>> ";
+ private static final String REMOVE_ALL = " <<Remove All ";
+ private static final String REMOVE = " <Remove ";
+
+ private Button removeButton;
+ private Button removeAllButton;
+ private Button addButton;
+ private Button addAllButton;
+ private IMavenConfiguration mavenConfiguration;
+ private IMaven maven;
+ private Image jbossImage;
+ private ListViewer includedRepositoriesViewer;
+ private List<Repository> includedRepositories;
+ private List<Repository> availableRepositories;
+ private List<Repository> selectedIncludedRepositories = new ArrayList<Repository>();
+ private List<Repository> selectedAvailableRepositories = new ArrayList<Repository>();
+ private ListViewer availableRepositoriesViewer;
+
+ public ConfigureMavenRepositoriesWizardPage() {
+ super(PAGE_NAME);
+ setTitle("Configure Maven Repositories");
+ mavenConfiguration = MavenPlugin.getMavenConfiguration();
+ maven = MavenPlugin.getMaven();
+ try {
+ maven.reloadSettings();
+ } catch (CoreException e) {
+ Activator.log(e);
+ }
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(1, false));
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ composite.setLayoutData(gd);
+ Dialog.applyDialogFont(composite);
+ setControl(composite);
+
+ Label userSettingsLabel = new Label(composite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ userSettingsLabel.setLayoutData(gd);
+
+ String userSettings = getUserSettings();
+ userSettingsLabel.setText("User settings: " + userSettings);
+
+ Group repositoriesGroup = new Group(composite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ GridLayout layout = new GridLayout(3, false);
+ repositoriesGroup.setLayout(layout);
+ repositoriesGroup.setLayoutData(gd);
+ repositoriesGroup.setText("Repositories");
+
+ Composite availableRepositoriesComposite = new Composite(repositoriesGroup, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ availableRepositoriesComposite.setLayoutData(gd);
+ availableRepositoriesComposite.setLayout(new GridLayout());
+
+ Label availableRepositoriesLabel = new Label(availableRepositoriesComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ availableRepositoriesLabel.setLayoutData(gd);
+ availableRepositoriesLabel.setText("Available Repositories:");
+
+ availableRepositoriesViewer = new ListViewer(availableRepositoriesComposite, SWT.BORDER | SWT.MULTI |SWT.H_SCROLL|SWT.V_SCROLL);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ gd.heightHint = 300;
+ gd.widthHint = 300;
+ availableRepositoriesViewer.getList().setLayoutData(gd);
+ availableRepositoriesViewer.setContentProvider(new ArrayContentProvider());
+ availableRepositoriesViewer.setLabelProvider(new RepositoryLabelProvider());
+
+ Composite buttonsComposite = new Composite(repositoriesGroup, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ buttonsComposite.setLayoutData(gd);
+ buttonsComposite.setLayout(new GridLayout(1, false));
+
+ Label buttonsLabel = new Label(buttonsComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ buttonsLabel.setLayoutData(gd);
+
+ Composite buttonsComp = new Composite(buttonsComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, false, true);
+ buttonsComp.setLayoutData(gd);
+ buttonsComp.setLayout(new GridLayout());
+
+ GC gc = new GC(buttonsComp);
+ int maxAddRemoveButtonsWidth = computeMaxAddRemoveButtonsWidth(gc);
+ gc.dispose();
+
+ removeButton = createButton(buttonsComp, maxAddRemoveButtonsWidth, REMOVE);
+ removeAllButton = createButton(buttonsComp, maxAddRemoveButtonsWidth, REMOVE_ALL);
+ addButton = createButton(buttonsComp, maxAddRemoveButtonsWidth, ADD);
+ addAllButton = createButton(buttonsComp, maxAddRemoveButtonsWidth, ADD_ALL);
+
+ Composite includedRepositoriesComposite = new Composite(repositoriesGroup, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ includedRepositoriesComposite.setLayoutData(gd);
+ includedRepositoriesComposite.setLayout(new GridLayout(1, false));
+
+ Label includedRepositoriesLabel = new Label(includedRepositoriesComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ includedRepositoriesLabel.setLayoutData(gd);
+ includedRepositoriesLabel.setText("Maven Repositories:");
+
+ includedRepositoriesViewer = new ListViewer(includedRepositoriesComposite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL|SWT.V_SCROLL);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ gd.heightHint = 300;
+ gd.widthHint = 300;
+
+ includedRepositoriesViewer.getList().setLayoutData(gd);
+ includedRepositoriesViewer.setContentProvider(new ArrayContentProvider());
+ includedRepositoriesViewer.setLabelProvider(new RepositoryLabelProvider());
+
+
+ Button recognizeButton = new Button(composite, SWT.PUSH);
+ recognizeButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false));
+ recognizeButton.setText("Recognize JBoss Maven Enterprise Repositories...");
+ recognizeButton.setImage(getJBossImage());
+
+ recognizeButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ DirectoryDialog directoryDialog = new DirectoryDialog(getShell());
+ directoryDialog.setMessage("Select the directory in which to search for JBoss Maven Enterprise Repositories:");
+ directoryDialog.setText("Search for JBoss Maven Enterprise Repositories");
+
+ String pathStr = directoryDialog.open();
+ if (pathStr == null)
+ return;
+
+ final IPath path = new Path(pathStr);
+
+ final ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
+ dialog.setBlockOnOpen(false);
+ dialog.setCancelable(true);
+ dialog.open();
+ final IProgressMonitor monitor = dialog.getProgressMonitor();
+ monitor.beginTask("Searching...", 110);
+ final List<Repository> list = new ArrayList<Repository>();
+
+ IRunnableWithProgress runnable = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor2) {
+ searchForRepositories(path, list, monitor2);
+ }
+ };
+ try {
+ dialog.run(true, true, runnable);
+ } catch (Exception e1) {
+ Activator.log(e1);
+ }
+
+ if (monitor.isCanceled()) {
+ return;
+ }
+ List<Repository> newRepositories = new ArrayList<Repository>();
+ if (list.size() > 0) {
+ for (Repository repository:list) {
+ String url = repository.getUrl();
+ if (url == null) {
+ continue;
+ }
+ url = changeUrl(url);
+ boolean included = false;
+ for (Repository rep:availableRepositories) {
+ String url1 = rep.getUrl();
+ if (url1 == null) {
+ continue;
+ }
+ url1 = changeUrl(url1);
+ if (url1.equals(url)) {
+ included = true;
+ break;
+ }
+ }
+ for (Repository rep:includedRepositories) {
+ String url1 = rep.getUrl();
+ if (url1 == null) {
+ continue;
+ }
+ url1 = changeUrl(url1);
+ if (url1.equals(url)) {
+ included = true;
+ break;
+ }
+ }
+ if (!included) {
+ newRepositories.add(repository);
+ }
+ }
+ }
+ if (newRepositories.size() > 0) {
+ availableRepositories.addAll(newRepositories);
+ refreshRepositories();
+ }
+ }
+ });
+
+ includedRepositories = getIncludedRepositories();
+ availableRepositories = getAvailableRepositories();
+ List<Repository> remove = new ArrayList<Repository>();
+ for (Repository availableRepository:availableRepositories) {
+ String url = availableRepository.getUrl();
+ if (url == null) {
+ continue;
+ }
+ url = changeUrl(url);
+ for (Repository includedRepository:includedRepositories) {
+ String url1 = includedRepository.getUrl();
+ if (url1 == null) {
+ continue;
+ }
+ url1 = changeUrl(url1);
+ if (url1.equals(url)) {
+ remove.add(availableRepository);
+ }
+ }
+ }
+ for (Repository repository:remove) {
+ availableRepositories.remove(repository);
+ }
+
+ availableRepositoriesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection sel = event.getSelection();
+ selectedAvailableRepositories.clear();
+ if (sel instanceof IStructuredSelection) {
+ IStructuredSelection selection = (IStructuredSelection) sel;
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object object = iterator.next();
+ if (object instanceof Repository) {
+ selectedAvailableRepositories.add((Repository) object);
+ }
+ }
+ }
+ configureButtons();
+ }
+ });
+ includedRepositoriesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection sel = event.getSelection();
+ selectedIncludedRepositories.clear();
+ if (sel instanceof IStructuredSelection) {
+ IStructuredSelection selection = (IStructuredSelection) sel;
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object object = iterator.next();
+ if (object instanceof Repository) {
+ selectedIncludedRepositories.add((Repository) object);
+ }
+ }
+ }
+ configureButtons();
+ }
+ });
+ removeButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ includedRepositories.removeAll(selectedIncludedRepositories);
+ availableRepositories.addAll(selectedIncludedRepositories);
+ setPageComplete(true);
+ refreshRepositories();
+ }
+
+ });
+ removeAllButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ availableRepositories.addAll(includedRepositories);
+ includedRepositories.clear();
+ setPageComplete(true);
+ refreshRepositories();
+ }
+
+ });
+ addButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ includedRepositories.addAll(selectedAvailableRepositories);
+ availableRepositories.removeAll(selectedAvailableRepositories);
+ setPageComplete(true);
+ refreshRepositories();
+ }
+
+ });
+ addAllButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ includedRepositories.addAll(availableRepositories);
+ availableRepositories.clear();
+ setPageComplete(true);
+ refreshRepositories();
+ }
+
+ });
+ refreshRepositories();
+ setPageComplete(false);
+ }
+
+ private void searchForRepositories(IPath path,
+ List<Repository> list, IProgressMonitor monitor) {
+ File[] files = null;
+ if (path != null) {
+ File f = path.toFile();
+ if (f.isDirectory()) {
+ files = new File[1];
+ files[0] = f;
+ }
+ else
+ return;
+ } else
+ files = File.listRoots();
+
+ if (files != null) {
+ int size = files.length;
+ int work = 100 / size;
+ int workLeft = 100 - (work * size);
+ for (int i = 0; i < size; i++) {
+ if (monitor.isCanceled())
+ return;
+ if (files[i] != null && files[i].isDirectory()) {
+ searchDir(list, files[i], 4, monitor);
+ }
+ monitor.worked(work);
+ }
+ monitor.worked(workLeft);
+ } else
+ monitor.worked(100);
+ }
+
+ private void searchDir(List<Repository> list, File directory, int depth,
+ IProgressMonitor monitor) {
+
+ monitor.setTaskName("Searching " + directory.getAbsolutePath());
+ File comFile = new File(directory, "com");
+ if (comFile.isDirectory()) { //$NON-NLS-1$
+ Repository repository = getRepositoryFromDir(directory, list, monitor);
+ if (repository != null) {
+ list.add(repository);
+ return;
+ }
+ }
+
+ if (depth == 0)
+ return;
+
+ File[] files = directory.listFiles(new FileFilter() {
+ public boolean accept(File file) {
+ return file.isDirectory();
+ }
+ });
+ if (files != null) {
+ int size = files.length;
+ for (int i = 0; i < size; i++) {
+ if (monitor.isCanceled())
+ return;
+ searchDir(list, files[i], depth - 1, monitor);
+ }
+ }
+ }
+
+ private Repository getRepositoryFromDir(File directory,List<Repository> repositories, IProgressMonitor monitor) {
+ if (monitor.isCanceled()) {
+ return null;
+ }
+
+ File file = new File(directory, JSF_IMPL);
+ if (file.isDirectory()) {
+ File[] list = file.listFiles(new FileFilter() {
+
+ public boolean accept(File pathname) {
+ if (pathname != null && pathname.getName() != null && pathname.getName().contains("redhat")) {
+ return true;
+ }
+ return false;
+ }
+ });
+ if (list != null && list.length >= 1) {
+ // JBoss EAP Maven Repository
+ Repository repository = getDefaultRepository();
+ String id = "jboss-eap-maven-repository";
+ List<Repository> allRepositories = new ArrayList<Repository>();
+ allRepositories.addAll(repositories);
+ allRepositories.addAll(includedRepositories);
+ allRepositories.addAll(availableRepositories);
+ repository.setId(getUniqueId(id, allRepositories));
+ repository.setName("JBoss EAP Maven Repository");
+ try {
+ repository.setUrl(directory.toURI().toURL().toString());
+ } catch (MalformedURLException e) {
+ Activator.log(e);
+ }
+ return repository;
+ }
+ }
+ file = new File(directory, WFK_BOMS);
+ if (file.isDirectory()) {
+ // JBoss WFK Maven Repository
+ Repository repository = getDefaultRepository();
+ repository.setId("jboss-wfk-maven-repository");
+ repository.setName("JBoss WFK Maven Repository");
+ try {
+ repository.setUrl(directory.toURI().toURL().toString());
+ } catch (MalformedURLException e) {
+ Activator.log(e);
+ }
+ return repository;
+ }
+ return null;
+ }
+
+ private String getUniqueId(String id, List<Repository> allRepositories) {
+ int i = 0;
+ String startId = id;
+ while (true) {
+ boolean found = false;
+ for (Repository repository:allRepositories) {
+ if (id.equals(repository.getId())) {
+ id = startId + "." + i;
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ return id;
+ }
+ }
+ }
+
+ private String getUserSettings() {
+ String userSettings = mavenConfiguration.getUserSettingsFile();
+ if(userSettings == null || userSettings.length() == 0) {
+ userSettings = MavenCli.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath();
+ }
+ return userSettings;
+ }
+
+ private void configureButtons() {
+ removeButton.setEnabled(selectedIncludedRepositories.size() > 0);
+ removeAllButton.setEnabled(includedRepositories.size() > 0);
+ addButton.setEnabled(selectedAvailableRepositories.size() > 0);
+ addAllButton.setEnabled(availableRepositories.size() > 0);
+ }
+
+ private void refreshRepositories() {
+ includedRepositoriesViewer.setInput(includedRepositories.toArray(new Repository[0]));
+ availableRepositoriesViewer.setInput(availableRepositories.toArray(new Repository[0]));
+
+ selectedIncludedRepositories.clear();
+ selectedAvailableRepositories.clear();
+ includedRepositoriesViewer.setSelection(new StructuredSelection(selectedIncludedRepositories.toArray(new Repository[0])));
+ availableRepositoriesViewer.setSelection(new StructuredSelection(selectedAvailableRepositories.toArray(new Repository[0])));
+ configureButtons();
+ }
+
+ private String changeUrl(String url) {
+ url = url.trim();
+ if (!url.endsWith(SEPARATOR)) {
+ url = url + SEPARATOR;
+ }
+ return url;
+ }
+
+ private List<Repository> getIncludedRepositories() {
+ List<Repository> repositories = new ArrayList<Repository>();
+ try {
+ List<Profile> activeProfiles = getActiveProfiles();
+ for (Profile profile:activeProfiles) {
+ repositories.addAll(profile.getRepositories());
+ }
+ } catch (CoreException e) {
+ Activator.log(e);
+ }
+ return repositories;
+ }
+
+ private List<Repository> getAvailableRepositories() {
+ List<Repository> repositories = new ArrayList<Repository>();
+
+ Repository repository = getDefaultRepository();
+
+ repository.setId("jboss-public-repository");
+ repository.setName("JBoss Public");
+ repository.setUrl("https://repository.jboss.org/nexus/content/groups/public-jboss/");
+
+ repositories.add(repository);
+
+ repository = getDefaultRepository();
+ repository.setId("java-net-public");
+ repository.setName("Java Net Public");
+ repository.setUrl("https://maven.java.net/content/groups/public/");
+
+ repositories.add(repository);
+
+ repository = getDefaultRepository();
+ repository.setId("com.springsource.repository.bundles.release");
+ repository.setName("EBR Spring Release");
+ repository.setUrl("http://repository.springsource.com/maven/bundles/release/");
+
+ repositories.add(repository);
+
+ repository = getDefaultRepository();
+ repository.setId("com.springsource.repository.bundles.external");
+ repository.setName("EBR External Release");
+ repository.setUrl("http://repository.springsource.com/maven/bundles/external/");
+
+ repositories.add(repository);
+
+ repository = getDefaultRepository();
+ repository.setId("repository.apache.org");
+ repository.setName("Apache Repository");
+ repository.setUrl("https://repository.apache.org/content/groups/public/");
+
+ repositories.add(repository);
+
+ return repositories;
+ }
+
+ private Repository getDefaultRepository() {
+ Repository repository = new Repository();
+ repository.setLayout("default"); //$NON-NLS-1$
+ RepositoryPolicy releases = new RepositoryPolicy();
+ releases.setEnabled(true);
+ releases.setUpdatePolicy("never"); //$NON-NLS-1$
+ repository.setReleases(releases);
+ RepositoryPolicy snapshots = new RepositoryPolicy();
+ snapshots.setEnabled(false);
+ snapshots.setUpdatePolicy("never"); //$NON-NLS-1$
+ repository.setSnapshots(snapshots);
+ return repository;
+ }
+
+ private Image getJBossImage() {
+ if (jbossImage == null) {
+ ImageDescriptor desc = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
+ "icons/jboss.png"); //$NON-NLS-1$
+ jbossImage = desc.createImage();
+ }
+ return jbossImage;
+ }
+
+ private List<Profile> getActiveProfiles() throws CoreException {
+ Settings settings = maven.getSettings();
+ List<String> activeProfilesIds = settings.getActiveProfiles();
+ List<Profile> activeProfiles = new ArrayList<Profile>();
+ for (Profile profile : settings.getProfiles()) {
+ if ((profile.getActivation() != null && profile.getActivation().isActiveByDefault())
+ || activeProfilesIds.contains(profile.getId())) {
+ activeProfiles.add(profile);
+ }
+ }
+ return activeProfiles;
+ }
+
+ private Button createButton(Composite buttonsComp,
+ int maxAddRemoveButtonsWidth, String text) {
+ GridData gd;
+ Button button = new Button(buttonsComp, SWT.NONE | SWT.LEFT);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+ gd.widthHint = maxAddRemoveButtonsWidth;
+ button.setLayoutData(gd);
+ button.setText(text);
+ return button;
+ }
+
+ private int computeMaxAddRemoveButtonsWidth(GC gc) {
+ int maxWidth = 0;
+
+ maxWidth = getGreaterWidth(gc,REMOVE, maxWidth);
+ maxWidth = getGreaterWidth(gc,REMOVE_ALL, maxWidth);
+ maxWidth = getGreaterWidth(gc,ADD, maxWidth);
+ maxWidth = getGreaterWidth(gc,ADD_ALL, maxWidth);
+
+ return maxWidth;
+ }
+
+ private int getGreaterWidth(GC gc, String str, int compareWidth) {
+ int greaterWidth = compareWidth;
+
+ Point strExtentPoint = gc.stringExtent(str);
+ int strWidth = strExtentPoint.x;
+ if (strWidth > compareWidth) {
+ greaterWidth = strWidth;
+ }
+
+ return greaterWidth + 5;
+ }
+
+ @Override
+ public void dispose() {
+ if (jbossImage != null) {
+ jbossImage.dispose();
+ }
+ super.dispose();
+ }
+
+ class RepositoryLabelProvider extends LabelProvider {
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ public String getText(Object element) {
+ if (element instanceof Repository) {
+ Repository repository = (Repository) element;
+ String name = repository.getName() == null ? "<no-name>" : repository.getName(); //$NON-NLS-1$
+ return name + "-" + repository.getUrl(); //$NON-NLS-1$
+ }
+ return null;
+ }
+ }
+
+ public void finishPage() {
+ try {
+ List<Profile> profiles;
+ profiles = getActiveProfiles();
+ Profile profile;
+ Settings settings = maven.getSettings();
+ if (profiles.size() <= 0) {
+ profile = new Profile();
+ profile.setId("jbosstools-maven-profile");
+ Activation activation = new Activation();
+ activation.setActiveByDefault(true);
+ profile.setActivation(activation);
+ settings.addProfile(profile);
+ } else {
+ profile = profiles.get(0);
+ }
+ profile.setRepositories(includedRepositories);
+ profile.setPluginRepositories(includedRepositories);
+ String userSettings = getUserSettings();
+ File file = new File(userSettings);
+ OutputStream out = new FileOutputStream(file);
+ maven.writeSettings(settings, out);
+ maven.reloadSettings();
+ } catch (Exception e) {
+ // FIXME
+ Activator.log(e);
+ }
+
+ }
+
+}
13 years, 7 months
JBoss Tools SVN: r40822 - trunk/documentation/whatsnew/openshift.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-05-07 12:21:53 -0400 (Mon, 07 May 2012)
New Revision: 40822
Added:
trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta3.html
Log:
[JBIDE-11763] added stub for N&N
Added: trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta3.html
===================================================================
--- trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta3.html (rev 0)
+++ trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta3.html 2012-05-07 16:21:53 UTC (rev 40822)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>OpenShift Tools 2.3.0.M1 What's New</title>
+<script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push([ '_setAccount', 'UA-17645367-5' ]);
+ _gaq.push([ '_trackPageview' ]);
+
+ (function() {
+ var ga = document.createElement('script');
+ ga.type = 'text/javascript';
+ ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl'
+ : 'http://www')
+ + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(ga, s);
+ })();
+</script>
+</head>
+<body>
+ <h1>OpenShift 2.3.0.Beta3 What's New</h1>
+
+ <p align="right">
+ <a href="../index.html">< Main Index</a> <a
+ href="../cdi/cdi-news-3.3.0.Beta3.html">CDI Tools ></a>
+ </p>
+ <table border="0" cellpadding="10" cellspacing="0" width="80%">
+
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>XXX</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemname3" id="itemname3"></a>
+ <b>XXX</b>
+ </td>
+ <td valign="top">
+ some content
+ </td>
+ </tr>
+ </table>
+</body>
+
+</html>
+
+
Property changes on: trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta3.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 7 months
JBoss Tools SVN: r40821 - trunk/forge/plugins/org.jboss.tools.forge.runtime.ext.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2012-05-07 12:10:45 -0400 (Mon, 07 May 2012)
New Revision: 40821
Modified:
trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/.classpath
Log:
make classes compile in bin folder
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/.classpath
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/.classpath 2012-05-07 16:06:16 UTC (rev 40820)
+++ trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/.classpath 2012-05-07 16:10:45 UTC (rev 40821)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
13 years, 7 months
JBoss Tools SVN: r40820 - in trunk/bpel/tests: org.jboss.tools.bpel.ui.bot.test and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: apodhrad
Date: 2012-05-07 12:06:16 -0400 (Mon, 07 May 2012)
New Revision: 40820
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.project
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.settings/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.settings/org.eclipse.m2e.core.prefs
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.classpath
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.project
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.jdt.core.prefs
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.m2e.core.prefs
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/META-INF/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/META-INF/MANIFEST.MF
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/build.properties
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/pom.xml
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/MANIFEST.MF
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/local-artifacts.properties
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/maven-archiver/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/maven-archiver/pom.properties
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/org.custommonkey.xmlunit-1.0.0.jar
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2artifacts.xml
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2content.xml
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/xmlunit-1.3.jar
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/pom.xml
Modified:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/MANIFEST.MF
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/org.jboss.tools.bpel.ui.bot.test.properties
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/OdeDeployTest.java
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/ToolingCompatibilityTest.java
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELTest.java
Log:
BPEL Bot Tests: adapted for JBT 3.3
Modified: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/MANIFEST.MF 2012-05-07 13:20:14 UTC (rev 40819)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/MANIFEST.MF 2012-05-07 16:06:16 UTC (rev 40820)
@@ -17,7 +17,8 @@
org.eclipse.wst.wsdl;bundle-version="1.2.103",
org.eclipse.emf.ecore;bundle-version="2.6.1",
org.jboss.tools.ui.bot.ext;bundle-version="3.2.0",
- org.eclipse.swtbot.eclipse.gef.finder;bundle-version="2.0.3"
+ org.eclipse.swtbot.eclipse.gef.finder;bundle-version="2.0.3",
+ org.custommonkey.xmlunit;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: JBoss by Red Hat
Modified: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/org.jboss.tools.bpel.ui.bot.test.properties
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/org.jboss.tools.bpel.ui.bot.test.properties 2012-05-07 13:20:14 UTC (rev 40819)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/org.jboss.tools.bpel.ui.bot.test.properties 2012-05-07 16:06:16 UTC (rev 40820)
@@ -6,6 +6,7 @@
# note : when server is type of SOA, version is version of SOA (not the bundled EAP)
#SERVER=JBOSS_AS,5.0,1.6,/home/psrna/data/jboss/jboss/jboss-as
SERVER=SOA,5.2,1.6,/home/apodhrad/Software/jboss-soa-p-5.2.0/jboss-as
+#SERVER=AS,5.1,1.6,/home/apodhrad/Software/jboss-5.1.0.GA
#<seam version>,<seam runtime home>
#SEAM=2.2,/home/psrna/data/jboss/soa-5.1.0.ER6-eds/seam
#<esb versoin>,<esb runtime home>
Modified: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/OdeDeployTest.java
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/OdeDeployTest.java 2012-05-07 13:20:14 UTC (rev 40819)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/OdeDeployTest.java 2012-05-07 16:06:16 UTC (rev 40820)
@@ -1,9 +1,9 @@
package org.jboss.tools.bpel.ui.bot.test;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
import org.eclipse.core.resources.IFile;
import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -14,16 +14,13 @@
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.config.Annotations.ServerType;
-import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
import org.jboss.tools.ui.bot.ext.view.ServersView;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
- * @author psrna
+ * @author psrna, apodhrad
*
*/
@Require(server = @Server(type = ServerType.SOA, state = ServerState.Running, version = "5.2"), perspective="BPEL")
@@ -43,8 +40,16 @@
" </q0:SayHelloRequest>" +
" </soapenv:Body>" +
"</soapenv:Envelope>";
+
+ final static String EXPECTED_RESPONSE = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+ + " <SOAP-ENV:Header />"
+ + " <SOAP-ENV:Body>"
+ + " <SayHelloResponse xmlns=\"http://www.jboss.org/bpel/examples\">"
+ + " <tns:result xmlns:tns=\"http://www.jboss.org/bpel/examples\">Hello JBDS</tns:result>"
+ + " </SayHelloResponse>"
+ + " </SOAP-ENV:Body>"
+ + "</SOAP-ENV:Envelope>";
-
ServersView sView = new ServersView();
@@ -104,7 +109,7 @@
SWTBotTreeItem server = tree.getTreeItem(serverName + " [Started, Synchronized]").select();
server.expand();
bot.sleep(TIME_5S);
- assertTrue(server.getNode("say_hello [Synchronized]").isVisible());
+ assertTrue(isProjectDeployed("say_hello"));
}
@Test
@@ -112,17 +117,11 @@
// Test the process
String response = SendSoapMessage.sendMessage(ENDPOINT, MESSAGE, "simple");
-
- Assert.assertTrue(response != null);
- Assert.assertTrue(response.contains("<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"));
- Assert.assertTrue(response.contains("<SOAP-ENV:Header />"));
- Assert.assertTrue(response.contains("<SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("<SayHelloResponse xmlns=\"http://www.jboss.org/bpel/examples\">"));
- Assert.assertTrue(response.contains("<tns:result xmlns:tns=\"http://www.jboss.org/bpel/examples\">Hello JBDS</tns:result>"));
- Assert.assertTrue(response.contains("</SayHelloResponse>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Envelope>"));
+ XMLUnit.setIgnoreWhitespace(true);
+ Diff diff = new Diff(response, EXPECTED_RESPONSE);
+
+ assertTrue(diff.similar());
}
}
Modified: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/ToolingCompatibilityTest.java
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/ToolingCompatibilityTest.java 2012-05-07 13:20:14 UTC (rev 40819)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/ToolingCompatibilityTest.java 2012-05-07 16:06:16 UTC (rev 40820)
@@ -3,6 +3,8 @@
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
import java.util.List;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor;
@@ -78,7 +80,7 @@
SWTBotTreeItem server = tree.getTreeItem(serverName + " [Started, Synchronized]").select();
server.expand();
bot.sleep(TIME_5S);
- assertTrue(server.getNode("eclipse_tooling_proj [Synchronized]").isVisible());
+ assertTrue(isProjectDeployed("eclipse_tooling_proj"));
}
@Test
@@ -86,16 +88,22 @@
// Test the process
String response = SendSoapMessage.sendMessage(ENDPOINT, MESSAGE, "simple");
+
+ Assert.assertTrue(response != null);
- Assert.assertTrue(response != null);
- Assert.assertTrue(response.contains("<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"));
- Assert.assertTrue(response.contains("<SOAP-ENV:Header />"));
- Assert.assertTrue(response.contains("<SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("<HelloWorldResponse xmlns=\"http://helloWorld\">"));
- Assert.assertTrue(response.contains("<tns:result xmlns:tns=\"http://helloWorld\">Kitty</tns:result>"));
- Assert.assertTrue(response.contains("</HelloWorldResponse>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Envelope>"));
+ String expectedResponse = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+ + " <SOAP-ENV:Header />"
+ + " <SOAP-ENV:Body>"
+ + " <HelloWorldResponse xmlns=\"http://helloWorld\">"
+ + " <tns:result xmlns:tns=\"http://helloWorld\">Kitty</tns:result>"
+ + " </HelloWorldResponse>"
+ + " </SOAP-ENV:Body>"
+ + "</SOAP-ENV:Envelope>";
+ XMLUnit.setIgnoreWhitespace(true);
+
+ Diff diff = new Diff(response, expectedResponse);
+
+ assertTrue(diff.similar());
}
@@ -149,7 +157,7 @@
SWTBotTreeItem server = tree.getTreeItem(serverName + " [Started, Synchronized]").select();
server.expand();
bot.sleep(TIME_20S);
- assertTrue(server.getNode("eclipse_tooling_proj [Synchronized]").isVisible());
+ assertTrue(isProjectDeployed("eclipse_tooling_proj"));
}
@Test
@@ -157,16 +165,24 @@
// Test the process
String response = SendSoapMessage.sendMessage(ENDPOINT, MESSAGE, "simple");
+
+ Assert.assertTrue(response != null);
+ String expectedResponse = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+ + " <SOAP-ENV:Header />"
+ + " <SOAP-ENV:Body>"
+ + " <HelloWorldResponse xmlns=\"http://helloWorld\">"
+ + " <tns:result xmlns:tns=\"http://helloWorld\">Hello Kitty</tns:result>"
+ + " </HelloWorldResponse>"
+ + " </SOAP-ENV:Body>"
+ + "</SOAP-ENV:Envelope>";
+
Assert.assertTrue(response != null);
- Assert.assertTrue(response.contains("<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"));
- Assert.assertTrue(response.contains("<SOAP-ENV:Header />"));
- Assert.assertTrue(response.contains("<SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("<HelloWorldResponse xmlns=\"http://helloWorld\">"));
- Assert.assertTrue(response.contains("<tns:result xmlns:tns=\"http://helloWorld\">Hello Kitty</tns:result>"));
- Assert.assertTrue(response.contains("</HelloWorldResponse>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Envelope>"));
+
+ XMLUnit.setIgnoreWhitespace(true);
+ Diff diff = new Diff(response, expectedResponse);
+
+ assertTrue("Expected response is\n" + expectedResponse + "\nbut received message is as follows\n" + response, diff.similar());
}
@Test
Modified: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELTest.java
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELTest.java 2012-05-07 13:20:14 UTC (rev 40819)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELTest.java 2012-05-07 16:06:16 UTC (rev 40820)
@@ -7,6 +7,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
@@ -20,193 +21,218 @@
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.view.PackageExplorer;
import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
+import org.osgi.framework.Version;
public class BPELTest extends SWTTestExt {
public static void prepare() {
log.info("BPEL All Test started...");
-
-// jbt.closeReportUsageWindowIfOpened(true);
-// eclipse.maximizeActiveShell();
-// eclipse.closeView(IDELabel.View.WELCOME);
-// bot.closeAllEditors();
+
+ // jbt.closeReportUsageWindowIfOpened(true);
+ // eclipse.maximizeActiveShell();
+ // eclipse.closeView(IDELabel.View.WELCOME);
+ // bot.closeAllEditors();
}
public static void clean() {
util.waitForNonIgnoredJobs();
bot.sleep(TIME_5S, "BPEL All Tests Finished!");
}
-
+
protected PackageExplorer pExplorer = new PackageExplorer();
- protected ProjectExplorer projExplorer = new ProjectExplorer(){
-
+ protected ProjectExplorer projExplorer = new ProjectExplorer() {
+
@Override
public void runOnServer(String projectName) {
String serverName = BPELTest.configuredState.getServer().name;
- //serverName = "SOA-5.1";
+ // serverName = "SOA-5.1";
bot.viewByTitle("Servers").show();
bot.viewByTitle("Servers").setFocus();
-
- SWTBotTree tree = bot.viewByTitle("Servers").bot().tree();
+
+ SWTBotTree tree = bot.viewByTitle("Servers").bot().tree();
bot.sleep(TIME_5S);
SWTBotTreeItem server = tree.getTreeItem(serverName + " [Started, Synchronized]").select();
-
+
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.ADD_AND_REMOVE, false)).click();
-
+
SWTBotShell shell = OdeDeployTest.bot.shell("Add and Remove...");
shell.activate();
-
+
SWTBot viewBot = shell.bot();
viewBot.tree().setFocus();
viewBot.tree().select(projectName);
viewBot.button("Add >").click();
viewBot.button("Finish").click();
}
-
};
-
-
/**
* Creates a new process in a project identified by it's name.
*
* TODO: extend WSDL validation
*
- * @param project project name in which to create the new process
- * @param name process name
- * @param type process type (sync, async, empty)
- * @param isAbstract is the process supposed to be abstract?
+ * @param project
+ * project name in which to create the new process
+ * @param name
+ * process name
+ * @param type
+ * process type (sync, async, empty)
+ * @param isAbstract
+ * is the process supposed to be abstract?
*
- * @return process file
+ * @return process file
*/
protected IFile createNewProcess(String project, String name, String type, boolean isAbstract) {
SWTBotView view = bot.viewByTitle("Project Explorer");
view.show();
view.setFocus();
-
+
SWTBot viewBot = view.bot();
SWTBotTreeItem item = viewBot.tree().expandNode(project).expandNode("bpelContent");
item.select();
-
+
bot.menu("File").menu("New").menu("Other...").click();
bot.shell("New").activate();
+
+ SWTBotTree tree = bot.tree();
+ tree.expandNode("BPEL 2.0").expandNode("BPEL Process File").select();
+ // tree.expandNode("BPEL 2.0").expandNode("New BPEL Process File").select();
+ assertTrue(bot.button("Next >").isEnabled());
+
+ bot.button("Next >").click();
+ assertFalse(bot.button("Next >").isEnabled());
- SWTBotTree tree = bot.tree();
- tree.expandNode("BPEL 2.0").expandNode("BPEL Process File").select();
- //tree.expandNode("BPEL 2.0").expandNode("New BPEL Process File").select();
- assertTrue(bot.button("Next >").isEnabled());
-
- bot.button("Next >").click();
- assertFalse(bot.button("Next >").isEnabled());
-
- bot.textWithLabel("BPEL Process Name:").setText(name);
- bot.comboBoxWithLabel("Namespace:").setText("http://eclipse.org/bpel/sample");
- bot.comboBoxWithLabel("Template:").setSelection(type + " BPEL Process");
- if(isAbstract) {
- bot.checkBox().select();
- } else {
- bot.checkBox().deselect();
- assertTrue(bot.button("Next >").isEnabled());
-
- bot.button("Next >").click();
- assertEquals(name, bot.textWithLabel("Service Name").getText());
- }
-
- bot.button("Finish").click();
- bot.sleep(TIME_5S);
-
- IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(project);
- IFile bpelFile = iproject.getFile(new Path("bpelContent/" + name + ".bpel"));
- assertTrue(bpelFile.exists());
- //assertTrue(iproject.getFile(new Path("bpelContent/" + name + ".bpelex")).exists());
- assertTrue(iproject.getFile(new Path("bpelContent/" + name + "Artifacts.wsdl")).exists());
-
- return bpelFile;
+ createNewBpelProcess(project, name, type, isAbstract, getBpelUiVersion());
+
+ bot.button("Next >").click();
+ bot.button("Finish").click();
+ bot.sleep(TIME_5S);
+
+ IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(project);
+ IFile bpelFile = iproject.getFile(new Path("bpelContent/" + name + ".bpel"));
+ assertTrue(bpelFile.exists());
+ // assertTrue(iproject.getFile(new Path("bpelContent/" + name +
+ // ".bpelex")).exists());
+ assertTrue(iproject.getFile(new Path("bpelContent/" + name + "Artifacts.wsdl")).exists());
+
+ return bpelFile;
}
-
+
+ protected void createNewBpelProcess(String project, String name, String type, boolean isAbstract, Version version) {
+ if (version.toString().startsWith("0.8.0")) {
+ bot.textWithLabel("Process Name:").setText(name);
+ bot.comboBoxWithLabel("Namespace:").setText("http://eclipse.org/bpel/sample");
+ if (isAbstract) {
+ bot.checkBox().select();
+ } else {
+ bot.checkBox().deselect();
+ }
+ assertTrue(bot.button("Next >").isEnabled());
+ bot.button("Next >").click();
+ bot.comboBoxWithLabel("Template:").setSelection(type + " BPEL Process");
+ } else {
+ bot.textWithLabel("BPEL Process Name:").setText(name);
+ bot.comboBoxWithLabel("Namespace:").setText("http://eclipse.org/bpel/sample");
+ bot.comboBoxWithLabel("Template:").setSelection(type + " BPEL Process");
+ if (isAbstract) {
+ bot.checkBox().select();
+ } else {
+ bot.checkBox().deselect();
+ assertTrue(bot.button("Next >").isEnabled());
+
+ bot.button("Next >").click();
+ assertEquals(name, bot.textWithLabel("Service Name").getText());
+ }
+ }
+ }
+
/**
- * Creates a new ODE deployment descriptor in a project identified by it's name.
+ * Creates a new ODE deployment descriptor in a project identified by it's
+ * name.
*
* @author psrna
*
- * @param project project name in which to create the new ODE deployment descriptor
- * @return deployment descriptor file
+ * @param project
+ * project name in which to create the new ODE deployment
+ * descriptor
+ * @return deployment descriptor file
*/
- protected IFile createNewDeployDescriptor(String project){
-
+ protected IFile createNewDeployDescriptor(String project) {
+
SWTBotView view = bot.viewByTitle("Project Explorer");
view.show();
view.setFocus();
-
+
SWTBot viewBot = view.bot();
SWTBotTreeItem item = viewBot.tree().expandNode(project).expandNode("bpelContent");
item.select();
-
+
bot.menu("File").menu("New").menu("Other...").click();
bot.shell("New").activate();
-
- SWTBotTree tree = bot.tree();
+
+ SWTBotTree tree = bot.tree();
tree.expandNode("BPEL 2.0").expandNode("BPEL Deployment Descriptor").select();
- //tree.expandNode("BPEL 2.0").expandNode("Apache ODE Deployment Descriptor").select();
- assertTrue(bot.button("Next >").isEnabled());
-
- bot.button("Next >").click();
+ // tree.expandNode("BPEL 2.0").expandNode("Apache ODE Deployment Descriptor").select();
+ assertTrue(bot.button("Next >").isEnabled());
- assertTrue(bot.textWithLabel("BPEL Project:").getText().equals("/" + project + "/bpelContent"));
- assertTrue(bot.textWithLabel("File name:").getText().equals("deploy.xml"));
-
- bot.button("Finish").click();
- bot.sleep(5000);
-
- IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(project);
- IFile deployFile = iproject.getFile(new Path("bpelContent/deploy.xml"));
- assertTrue(deployFile.exists());
+ bot.button("Next >").click();
+ assertTrue(bot.textWithLabel("BPEL Project:").getText().equals("/" + project + "/bpelContent"));
+ assertTrue(bot.textWithLabel("File name:").getText().equals("deploy.xml"));
+
+ bot.button("Finish").click();
+ bot.sleep(5000);
+
+ IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(project);
+ IFile deployFile = iproject.getFile(new Path("bpelContent/deploy.xml"));
+ assertTrue(deployFile.exists());
+
return deployFile;
}
-
-
+
/**
* Create a new BPEL project
- * @param name project name
- * @return project reference
+ *
+ * @param name
+ * project name
+ * @return project reference
*/
protected IProject createNewProject(String name) {
SWTBotView view = bot.viewByTitle("Project Explorer");
view.show();
view.setFocus();
-
+
bot.menu("File").menu("New").menu("Project...").click();
bot.shell("New Project").activate();
-
- SWTBotTree tree = bot.tree();
+
+ SWTBotTree tree = bot.tree();
tree.expandNode("BPEL 2.0").expandNode("BPEL Project").select();
- assertTrue(bot.button("Next >").isEnabled());
-
- bot.button("Next >").click();
- bot.shell("New BPEL Project").activate();
- assertFalse(bot.button("Finish").isEnabled());
-
- bot.textWithLabel("Project name:").setText(name);
- assertTrue(bot.button("Finish").isEnabled());
-
- bot.button("Finish").click();
- bot.sleep(3000);
-
- IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- assertNotNull(iproject);
-
- return iproject;
+ assertTrue(bot.button("Next >").isEnabled());
+
+ bot.button("Next >").click();
+ bot.shell("New BPEL Project").activate();
+ assertFalse(bot.button("Finish").isEnabled());
+
+ bot.textWithLabel("Project name:").setText(name);
+ assertTrue(bot.button("Finish").isEnabled());
+
+ bot.button("Finish").click();
+ bot.sleep(3000);
+
+ IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
+ assertNotNull(iproject);
+
+ return iproject;
}
-
+
public String loadFile(IFile file) throws Exception {
- if(file.getType() != IFile.FILE) {
+ if (file.getType() != IFile.FILE) {
throw new IllegalArgumentException("File: " + file.getFullPath().toString() + " is a directory!");
}
-
+
InputStream in = null;
StringBuffer out;
try {
@@ -214,11 +240,11 @@
out = new StringBuffer();
byte[] buffer = new byte[4 * 1024];
int c = 0;
- while((c = in.read(buffer)) > -1) {
+ while ((c = in.read(buffer)) > -1) {
out.append(new String(buffer, 0, c));
}
} finally {
- if(in != null) {
+ if (in != null) {
try {
in.close();
} catch (IOException e) {
@@ -228,10 +254,37 @@
}
return out.length() == 0 ? null : out.toString();
}
-
+
protected void openFile(String projectName, String... path) throws Exception {
log.info("Opening file: " + path[path.length - 1] + " ...");
pExplorer.openFile(projectName, path);
}
+ public Version getServerToolsVersion() {
+ return Platform.getBundle("org.eclipse.wst.server.ui").getVersion();
+ }
+
+ public Version getBpelUiVersion() {
+ return Platform.getBundle("org.eclipse.bpel.ui").getVersion();
+ }
+
+ public boolean isProjectDeployed(String projectName) {
+ String serverName = OdeDeployTest.configuredState.getServer().name;
+
+ bot.viewByTitle("Servers").show();
+ bot.viewByTitle("Servers").setFocus();
+
+ SWTBotTree tree = bot.viewByTitle("Servers").bot().tree();
+ SWTBotTreeItem server = tree.getTreeItem(serverName + " [Started, Synchronized]").select();
+ server.expand();
+ bot.sleep(TIME_5S);
+
+ String status = "[Synchronized]";
+ // TODO: the version comparison should be better
+ if (getServerToolsVersion().toString().startsWith("1.3")) {
+ status = "[Started, Synchronized]";
+ }
+
+ return server.getNode(projectName + " " + status).isVisible();
+ }
}
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.project
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.project (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.project 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>libs</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.settings/org.eclipse.m2e.core.prefs (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.settings/org.eclipse.m2e.core.prefs 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.classpath
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.classpath (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.classpath 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry exported="true" kind="lib" path="xmlunit-1.3.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.project
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.project (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.project 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.custommonkey.xmlunit</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.jdt.core.prefs 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.m2e.core.prefs (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.m2e.core.prefs 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/META-INF/MANIFEST.MF
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/META-INF/MANIFEST.MF (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/META-INF/MANIFEST.MF 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: XMLUnit
+Bundle-SymbolicName: org.custommonkey.xmlunit
+Bundle-Version: 1.0.0
+Bundle-ClassPath: xmlunit-1.3.jar
+Export-Package: org.custommonkey.xmlunit,
+ org.custommonkey.xmlunit.examples,
+ org.custommonkey.xmlunit.exceptions,
+ org.custommonkey.xmlunit.jaxp13,
+ org.custommonkey.xmlunit.util
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/build.properties
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/build.properties (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/build.properties 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,2 @@
+bin.includes = META-INF/,\
+ xmlunit-1.3.jar
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/pom.xml
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/pom.xml (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/pom.xml 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.bpel</groupId>
+ <artifactId>tests</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <groupId>org.custommonkey.xmlunit</groupId>
+ <artifactId>org.custommonkey.xmlunit</artifactId>
+ <version>1.0.0</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/MANIFEST.MF
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/MANIFEST.MF (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/MANIFEST.MF 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Export-Package: org.custommonkey.xmlunit,org.custommonkey.xmlunit.exam
+ ples,org.custommonkey.xmlunit.exceptions,org.custommonkey.xmlunit.jax
+ p13,org.custommonkey.xmlunit.util
+Bundle-ClassPath: xmlunit-1.3.jar
+Bundle-Version: 1.0.0
+Bundle-Name: XMLUnit
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.custommonkey.xmlunit
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/local-artifacts.properties
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/local-artifacts.properties (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/local-artifacts.properties 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,4 @@
+#Mon May 07 15:09:07 CEST 2012
+artifact.attached.p2metadata=/home/apodhrad/Repos/svn/jbosstools/trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2content.xml
+artifact.main=/home/apodhrad/Repos/svn/jbosstools/trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/org.custommonkey.xmlunit-1.0.0.jar
+artifact.attached.p2artifacts=/home/apodhrad/Repos/svn/jbosstools/trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2artifacts.xml
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/maven-archiver/pom.properties
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/maven-archiver/pom.properties (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/maven-archiver/pom.properties 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Mon May 07 15:09:07 CEST 2012
+version=1.0.0
+groupId=org.custommonkey.xmlunit
+artifactId=org.custommonkey.xmlunit
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/org.custommonkey.xmlunit-1.0.0.jar
===================================================================
(Binary files differ)
Property changes on: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/org.custommonkey.xmlunit-1.0.0.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2artifacts.xml
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2artifacts.xml (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2artifacts.xml 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,13 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?artifactRepository version='1.1.0'?>
+<artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='org.custommonkey.xmlunit' version='1.0.0'>
+ <properties size='5'>
+ <property name='artifact.size' value='89520'/>
+ <property name='download.size' value='89520'/>
+ <property name='maven-groupId' value='org.custommonkey.xmlunit'/>
+ <property name='maven-artifactId' value='org.custommonkey.xmlunit'/>
+ <property name='maven-version' value='1.0.0'/>
+ </properties>
+ </artifact>
+</artifacts>
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2content.xml
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2content.xml (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2content.xml 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,33 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<units size='1'>
+ <unit id='org.custommonkey.xmlunit' version='1.0.0' singleton='false'>
+ <update id='org.custommonkey.xmlunit' range='[0.0.0,1.0.0)' severity='0'/>
+ <properties size='4'>
+ <property name='org.eclipse.equinox.p2.name' value='XMLUnit'/>
+ <property name='maven-groupId' value='org.custommonkey.xmlunit'/>
+ <property name='maven-artifactId' value='org.custommonkey.xmlunit'/>
+ <property name='maven-version' value='1.0.0'/>
+ </properties>
+ <provides size='8'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='org.custommonkey.xmlunit' version='1.0.0'/>
+ <provided namespace='osgi.bundle' name='org.custommonkey.xmlunit' version='1.0.0'/>
+ <provided namespace='java.package' name='org.custommonkey.xmlunit' version='0.0.0'/>
+ <provided namespace='java.package' name='org.custommonkey.xmlunit.examples' version='0.0.0'/>
+ <provided namespace='java.package' name='org.custommonkey.xmlunit.exceptions' version='0.0.0'/>
+ <provided namespace='java.package' name='org.custommonkey.xmlunit.jaxp13' version='0.0.0'/>
+ <provided namespace='java.package' name='org.custommonkey.xmlunit.util' version='0.0.0'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
+ </provides>
+ <artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='org.custommonkey.xmlunit' version='1.0.0'/>
+ </artifacts>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='manifest'>
+ Bundle-SymbolicName: org.custommonkey.xmlunit
Bundle-Version: 1.0.0

+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
+</units>
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/xmlunit-1.3.jar
===================================================================
(Binary files differ)
Property changes on: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/xmlunit-1.3.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/pom.xml
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/pom.xml (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/pom.xml 2012-05-07 16:06:16 UTC (rev 40820)
@@ -0,0 +1,12 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.tools.bpel</groupId>
+ <artifactId>libs</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.custommonkey.xmlunit</module>
+ </modules>
+</project>
+
13 years, 7 months
JBoss Tools SVN: r40819 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-05-07 09:20:14 -0400 (Mon, 07 May 2012)
New Revision: 40819
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
Log:
[JBIDE-10851] displaying page description when mandatory input fields/combos are empty
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-05-07 13:10:41 UTC (rev 40818)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-05-07 13:20:14 UTC (rev 40819)
@@ -119,7 +119,7 @@
public ApplicationConfigurationWizardPage(IWizard wizard, OpenShiftExpressApplicationWizardModel wizardModel) {
super("Setup OpenShift Application",
- "Enter a name and select a type for your new OpenShift application.",
+ "Select an existing or create a new OpenShift Application.",
"Setup OpenShift Application", wizard);
try {
this.pageModel = new ApplicationConfigurationWizardPageModel(wizardModel);
@@ -947,8 +947,7 @@
return ValidationStatus.ok();
}
if (applicationName.isEmpty()) {
- return ValidationStatus.cancel(
- "Select an alphanumerical name and a type for the application to create.");
+ return ValidationStatus.cancel(getDescription());
}
if (!StringUtils.isAlphaNumeric(applicationName)) {
return ValidationStatus.error(
@@ -997,8 +996,7 @@
return ValidationStatus.ok();
}
if (StringUtils.isEmpty(cartridge)) {
- return OpenShiftUIActivator
- .createCancelStatus("Select an alphanumerical name and a type for the application to create.");
+ return ValidationStatus.cancel(getDescription());
}
return ValidationStatus.ok();
}
13 years, 7 months
JBoss Tools SVN: r40818 - trunk/documentation/whatsnew/central.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-05-07 09:10:41 -0400 (Mon, 07 May 2012)
New Revision: 40818
Added:
trunk/documentation/whatsnew/central/central-news-1.0.0.Beta3.html
Log:
JBIDE-11765 - CLONE - JBoss Central N&N
Added: trunk/documentation/whatsnew/central/central-news-1.0.0.Beta3.html
===================================================================
--- trunk/documentation/whatsnew/central/central-news-1.0.0.Beta3.html (rev 0)
+++ trunk/documentation/whatsnew/central/central-news-1.0.0.Beta3.html 2012-05-07 13:10:41 UTC (rev 40818)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css"/>
+<title>JBoss Central 1.0.0.Beta3 What's New</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>JBoss Central 1.0.0.Beta1 What's New</h1>
+
+<p align="right"><a href="../index.html">< Main Index</a> <a
+href="../usage/usage-news-3.3.0.Beta1.html">Usage ></a>
+
+</p>
+
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+ <tr>
+ <td colspan="2">
+ <hr/>
+ <h3>General</h3>
+ <hr/>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemnam1e" id="itemname1"></a><b>Offline support</b>
+ </td>
+ <td width="70%" valign="top">
+ Now JBoss Central can be used offline.
+ The project examples archives and descriptors, maven artifacts, news/blogs feeds are cached
+ so if the user has already started JBoss Central and created project examples, he can use
+ JBoss Central and the created project examples without any network connection.
+ <p>
+ <small><a href="https://jira.jboss.org/jira/browse/JBIDE-11192">Related Jira</a></small>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+</table>
+
+</body>
+
+</html>
13 years, 7 months
JBoss Tools SVN: r40817 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-05-07 05:52:41 -0400 (Mon, 07 May 2012)
New Revision: 40817
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/OpenOnHelper.java
Log:
increase sleep time when select text for open on
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/OpenOnHelper.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/OpenOnHelper.java 2012-05-07 09:49:18 UTC (rev 40816)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/OpenOnHelper.java 2012-05-07 09:52:41 UTC (rev 40817)
@@ -33,7 +33,7 @@
public boolean openOnByOption(String openOnString, String titleName, String chosenOption) {
selectTextForOpenOn(openOnString, titleName);
bot.menu(CDIConstants.NAVIGATE).menu(CDIConstants.OPEN_HYPERLINK).click();
- bot.sleep(Timing.time500MS());
+ bot.sleep(Timing.time3S());
SWTBotTable table = bot.activeShell().bot().table(0);
boolean optionFound = false;
13 years, 7 months
JBoss Tools SVN: r40816 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-05-07 05:49:18 -0400 (Mon, 07 May 2012)
New Revision: 40816
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionDialog.java
Log:
moved class header from below package declaration to above
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionDialog.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionDialog.java 2012-05-07 08:54:53 UTC (rev 40815)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionDialog.java 2012-05-07 09:49:18 UTC (rev 40816)
@@ -1,5 +1,3 @@
-package org.jboss.tools.openshift.express.internal.ui.wizard;
-
/*******************************************************************************
* Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
@@ -10,6 +8,7 @@
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard;
import java.util.Collection;
13 years, 7 months
JBoss Tools SVN: r40815 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test: beansxml and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-05-07 04:54:53 -0400 (Mon, 07 May 2012)
New Revision: 40815
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/annotations/ValidationType.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/base/BeansXMLQuickFixTestBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/validators/BeansXmlValidationProvider.java
Log:
modifying xml validation tests according to JBIDE-11731
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/annotations/ValidationType.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/annotations/ValidationType.java 2012-05-07 08:40:48 UTC (rev 40814)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/annotations/ValidationType.java 2012-05-07 08:54:53 UTC (rev 40815)
@@ -14,7 +14,7 @@
SERIALIZABLE, MULTIPLE_BEAN_ELIGIBLE, NO_BEAN_ELIGIBLE, DISPOSES, OBSERVES,
PRODUCES, TARGET, RETENTION, TYPED, NAMED, NONBINDING, SPECIALIZES, STATELESS,
- NO_CLASS, NO_ANNOTATION, ALTERNATIVE_BEAN_XML, ALTERNATIVE_STEREOTYPE_BEAN_XML,
- SPECIFY_ALTERNATIVE, SPECIFY_DECORATOR, SPECIFY_INTERCEPTOR,
+ NO_CLASS, NO_ANNOTATION, NO_ALTERNATIVE_STEREOTYPE,
+ NO_ALTERNATIVE, NO_DECORATOR, NO_INTERCEPTOR,
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java 2012-05-07 08:40:48 UTC (rev 40814)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java 2012-05-07 08:54:53 UTC (rev 40815)
@@ -71,7 +71,7 @@
beansHelper.createBeansXMLWithInterceptor(getProjectName(), getPackageName(), someBean);
assertFalse(isBeanXMLValidationErrorEmpty());
- assertNotNull(getProblem(ValidationType.SPECIFY_INTERCEPTOR));
+ assertNotNull(getProblem(ValidationType.NO_INTERCEPTOR));
}
@@ -97,7 +97,7 @@
beansHelper.createBeansXMLWithDecorator(getProjectName(), getPackageName(), someBean);
assertFalse(isBeanXMLValidationErrorEmpty());
- assertNotNull(getProblem(ValidationType.SPECIFY_DECORATOR));
+ assertNotNull(getProblem(ValidationType.NO_DECORATOR));
}
@Test
@@ -122,7 +122,7 @@
beansHelper.createBeansXMLWithAlternative(getProjectName(), getPackageName(), someBean);
assertFalse(isBeanXMLValidationErrorEmpty());
- assertNotNull(getProblem(ValidationType.SPECIFY_ALTERNATIVE));
+ assertNotNull(getProblem(ValidationType.NO_ALTERNATIVE));
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/base/BeansXMLQuickFixTestBase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/base/BeansXMLQuickFixTestBase.java 2012-05-07 08:40:48 UTC (rev 40814)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/base/BeansXMLQuickFixTestBase.java 2012-05-07 08:54:53 UTC (rev 40815)
@@ -143,7 +143,7 @@
*/
public void resolveAddAlternativeToBean(String name) {
- openBeanXMLValidationProblem(ValidationType.ALTERNATIVE_BEAN_XML);
+ openBeanXMLValidationProblem(ValidationType.NO_ALTERNATIVE);
String content = bot.editorByTitle(name + ".java").toTextEditor().getText();
assertTrue(content.contains("@Alternative"));
@@ -157,7 +157,7 @@
*/
public void resolveAddAlternativeToStereotype(String name) {
- openBeanXMLValidationProblem(ValidationType.ALTERNATIVE_STEREOTYPE_BEAN_XML);
+ openBeanXMLValidationProblem(ValidationType.NO_ALTERNATIVE_STEREOTYPE);
String content = bot.editorByTitle(name + ".java").toTextEditor().getText();
assertTrue(content.contains("@Alternative"));
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/validators/BeansXmlValidationProvider.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/validators/BeansXmlValidationProvider.java 2012-05-07 08:40:48 UTC (rev 40814)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/validators/BeansXmlValidationProvider.java 2012-05-07 08:54:53 UTC (rev 40815)
@@ -25,26 +25,23 @@
void init() {
problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.NO_CLASS,
- "There is no class with the specified name"));
+ "There is no class"));
problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.NO_ANNOTATION,
- "There is no annotation with the specified name"));
+ "There is no annotation"));
- problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.ALTERNATIVE_BEAN_XML,
- "<class> element must specify the name of an alternative bean class"));
+ problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.NO_ALTERNATIVE_STEREOTYPE,
+ "is not @Alternative stereotype annotation"));
- problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.ALTERNATIVE_STEREOTYPE_BEAN_XML,
- "<stereotype> element must specify the name of an @Alternative stereotype annotation"));
+ problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.NO_ALTERNATIVE,
+ "is not an alternative bean class"));
- problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.SPECIFY_ALTERNATIVE,
- "must specify the name of an alternative bean class"));
+ problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.NO_DECORATOR,
+ "is not a decorator bean class"));
- problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.SPECIFY_DECORATOR,
- "must specify the name of a decorator bean class"));
+ problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.NO_INTERCEPTOR,
+ "is not an interceptor class"));
- problems.add(new ValidationProblem(ProblemsType.ERRORS, ValidationType.SPECIFY_INTERCEPTOR,
- "must specify the name of an interceptor class"));
-
}
}
13 years, 7 months
JBoss Tools SVN: r40814 - in trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime: handlers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-05-07 04:40:48 -0400 (Mon, 07 May 2012)
New Revision: 40814
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
Log:
JBIDE-11612 - Runtime detection does not add database connection for EAP6/AS7
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java 2012-05-07 08:38:55 UTC (rev 40813)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java 2012-05-07 08:40:48 UTC (rev 40814)
@@ -98,14 +98,24 @@
public static final String HSQL_DRIVER_DEFINITION_ID
= "DriverDefn.Hypersonic DB"; //$NON-NLS-1$
+ public static final String H2_DRIVER_DEFINITION_ID
+ = "DriverDefn.H2 DB"; //$NON-NLS-1$
+
public static final String HSQL_DRIVER_NAME = "Hypersonic DB"; //$NON-NLS-1$
+
+ public static final String H2_DRIVER_NAME = "H2 Database"; //$NON-NLS-1$
public static final String HSQL_DRIVER_TEMPLATE_ID
= "org.eclipse.datatools.enablement.hsqldb.1_8.driver"; //$NON-NLS-1$
+
+ public static final String H2_DRIVER_TEMPLATE_ID
+ = "org.eclipse.datatools.connectivity.db.generic.genericDriverTemplate"; //$NON-NLS-1$
public static final String DTP_DB_URL_PROPERTY_ID
= "org.eclipse.datatools.connectivity.db.URL"; //$NON-NLS-1$
public static final String HSQL_PROFILE_ID = "org.eclipse.datatools.enablement.hsqldb.connectionProfile";
+
+ public static final String H2_PROFILE_ID = "org.eclipse.datatools.connectivity.db.generic.connectionProfile";
}
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java 2012-05-07 08:38:55 UTC (rev 40813)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java 2012-05-07 08:40:48 UTC (rev 40814)
@@ -20,6 +20,7 @@
public static String JBossRuntimeStartup_Cannot_create_new_JBoss_Server;
public static String JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile;
public static String JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver;
+ public static String JBossRuntimeStartup_Cannot_create_new_DB_Driver;
public static String JBossRuntimeStartup_JBoss_Application_Server_3_2;
public static String JBossRuntimeStartup_JBoss_Application_Server_4_0;
public static String JBossRuntimeStartup_JBoss_Application_Server_4_2;
@@ -31,6 +32,7 @@
// NEW_SERVER_ADAPTER add logic for new adapter here
public static String JBossRuntimeStartup_Runtime;
public static String JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database;
+ public static String JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties 2012-05-07 08:38:55 UTC (rev 40813)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties 2012-05-07 08:40:48 UTC (rev 40814)
@@ -1,6 +1,7 @@
JBossRuntimeStartup_Cannot_create_new_JBoss_Server=Can''t create new JBoss Server
JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile=Can''t create new DTP Connection Profile for JBoss AS Hypersonic embedded database
JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver=Can''t create new HSQL DB Driver.
+JBossRuntimeStartup_Cannot_create_new_DB_Driver=Can''t create new DB Driver.
JBossRuntimeStartup_JBoss_Application_Server_3_2=JBoss Application Server 3.2
JBossRuntimeStartup_JBoss_Application_Server_4_0=JBoss Application Server 4.0
JBossRuntimeStartup_JBoss_Application_Server_4_2=JBoss Application Server 4.2
@@ -14,3 +15,4 @@
JBossRuntimeStartup_JBoss_EAP_Server_6_0=JBoss EAP Server 6.0
JBossRuntimeStartup_Runtime=Runtime
JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database=The JBoss AS Hypersonic embedded database
+JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database=The JBoss AS H2 embedded database
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java 2012-05-07 08:38:55 UTC (rev 40813)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java 2012-05-07 08:40:48 UTC (rev 40814)
@@ -12,6 +12,7 @@
import java.io.File;
import java.io.FileFilter;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -269,25 +270,25 @@
// Don't create the driver a few times
return;
}
- if (index == JBOSS_AS70_INDEX || index == JBOSS_AS71_INDEX || index == JBOSS_EAP60_INDEX) {
- // AS 7
- return;
- }
String driverPath;
try {
- driverPath = new File(jbossASLocation + JBOSS_AS_HSQL_DRIVER_LOCATION[index]).getCanonicalPath(); //$NON-NLS-1$
+ driverPath = getDriverPath(jbossASLocation, index);
} catch (IOException e) {
RuntimeAsActivator.getDefault().getLog().log(new Status(IStatus.ERROR,
RuntimeAsActivator.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver, e));
return;
}
+ if (driverPath == null) {
+ RuntimeAsActivator.getDefault().getLog().log(new Status(IStatus.ERROR,
+ RuntimeAsActivator.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannot_create_new_DB_Driver));
+ }
- DriverInstance driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ DriverInstance driver = getDriver(index);
if (driver == null) {
- TemplateDescriptor descr = TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
- IPropertySet instance = new PropertySetImpl(HSQL_DRIVER_NAME, HSQL_DRIVER_DEFINITION_ID);
- instance.setName(HSQL_DRIVER_NAME);
- instance.setID(HSQL_DRIVER_DEFINITION_ID);
+ TemplateDescriptor descr = getDriverTemplateDescriptor(index);
+ IPropertySet instance = new PropertySetImpl(getDriverName(index), getDriverDefinitionId(index));
+ instance.setName(getDriverName(index));
+ instance.setID(getDriverDefinitionId(index));
Properties props = new Properties();
IConfigurationElement[] template = descr.getProperties();
@@ -298,21 +299,27 @@
String value = prop.getAttribute("value"); //$NON-NLS-1$
props.setProperty(id, value == null ? "" : value); //$NON-NLS-1$
}
- props.setProperty(DTP_DB_URL_PROPERTY_ID, "jdbc:hsqldb:."); //$NON-NLS-1$
+ props.setProperty(DTP_DB_URL_PROPERTY_ID, getDriverUrl(index)); //$NON-NLS-1$
props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr.getId());
props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, driverPath);
-
+ if (index == JBOSS_AS70_INDEX || index == JBOSS_AS71_INDEX || index == JBOSS_EAP60_INDEX) {
+ props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, "org.h2.Driver");
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, "H2 driver");
+ props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, "jdbc:h2:mem");
+ props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, "sa");
+ }
+
instance.setBaseProperties(props);
DriverManager.getInstance().removeDriverInstance(instance.getID());
System.gc();
DriverManager.getInstance().addDriverInstance(instance);
}
- driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ driver = DriverManager.getInstance().getDriverInstanceByName(getDriverName(index));
if (driver != null && ProfileManager.getInstance().getProfileByName(DEFAULT_DS) == null) { //$NON-NLS-1$
// create profile
Properties props = new Properties();
- props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, HSQL_DRIVER_DEFINITION_ID);
+ props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, getDriverDefinitionId(index));
props.setProperty(IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID, ""); //$NON-NLS-1$
props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID));
props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID));
@@ -323,11 +330,79 @@
props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID));
props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.URL_PROP_ID));
- ProfileManager.getInstance().createProfile(DEFAULT_DS, Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, HSQL_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (index == JBOSS_AS70_INDEX || index == JBOSS_AS71_INDEX || index == JBOSS_EAP60_INDEX) {
+ ProfileManager.getInstance().createProfile(DEFAULT_DS, Messages.JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database, H2_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ } else {
+ ProfileManager.getInstance().createProfile(DEFAULT_DS, Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, HSQL_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
}
}
+ protected static String getDriverUrl(int index) {
+ if (index == JBOSS_AS70_INDEX || index == JBOSS_AS71_INDEX || index == JBOSS_EAP60_INDEX) {
+ return "jdbc:h2:mem";
+ } else {
+ return "jdbc:hsqldb:.";
+ }
+ }
+
+ private static String getDriverDefinitionId(int index) {
+ if (index == JBOSS_AS70_INDEX || index == JBOSS_AS71_INDEX || index == JBOSS_EAP60_INDEX) {
+ return H2_DRIVER_DEFINITION_ID;
+ } else {
+ return HSQL_DRIVER_DEFINITION_ID;
+ }
+ }
+
+ private static String getDriverName(int index) {
+ if (index == JBOSS_AS70_INDEX || index == JBOSS_AS71_INDEX || index == JBOSS_EAP60_INDEX) {
+ return H2_DRIVER_NAME;
+ } else {
+ return HSQL_DRIVER_NAME;
+ }
+ }
+
+ protected static TemplateDescriptor getDriverTemplateDescriptor(int index) {
+ if (index == JBOSS_AS70_INDEX || index == JBOSS_AS71_INDEX || index == JBOSS_EAP60_INDEX) {
+ return TemplateDescriptor.getDriverTemplateDescriptor(H2_DRIVER_TEMPLATE_ID);
+ } else {
+ return TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
+ }
+ }
+
+ protected static DriverInstance getDriver(int index) {
+ if (index == JBOSS_AS70_INDEX || index == JBOSS_AS71_INDEX || index == JBOSS_EAP60_INDEX) {
+ return DriverManager.getInstance().getDriverInstanceByName(H2_DRIVER_NAME);
+ }
+ return DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ }
+
+ private static String getDriverPath(String jbossASLocation, int index)
+ throws IOException {
+ String driverPath;
+ if (index == JBOSS_AS70_INDEX || index == JBOSS_AS71_INDEX || index == JBOSS_EAP60_INDEX) {
+ File file = new File(jbossASLocation + "/modules/com/h2database/h2/main").getCanonicalFile();
+ File[] fileList = file.listFiles(new FilenameFilter() {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.startsWith("h2") && name.endsWith(".jar")) {
+ return true;
+ }
+ return false;
+ }
+ });
+ if (fileList != null && fileList.length > 0) {
+ return fileList[0].getCanonicalPath();
+ }
+ return null;
+ } else {
+ driverPath = new File(jbossASLocation + JBOSS_AS_HSQL_DRIVER_LOCATION[index]).getCanonicalPath(); //$NON-NLS-1$
+ }
+ return driverPath;
+ }
+
public RuntimeDefinition getServerDefinition(File root,
IProgressMonitor monitor) {
if (monitor.isCanceled() || root == null || !isEnabled()) {
13 years, 7 months