JBoss Tools SVN: r43927 - in trunk/archives/plugins: org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-21 09:37:27 -0400 (Fri, 21 Sep 2012)
New Revision: 43927
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/PostBuildRefresher.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/PathUtils.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java
Log:
JBIDE-12494
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/PostBuildRefresher.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/PostBuildRefresher.java 2012-09-21 13:16:57 UTC (rev 43926)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/PostBuildRefresher.java 2012-09-21 13:37:27 UTC (rev 43927)
@@ -2,6 +2,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.WorkspaceJob;
@@ -31,6 +32,13 @@
}
private void handlePostBuild(IArchive pkg) {
+ String projectName = pkg.getProjectName();
+ IProject p = projectName == null ? null :
+ ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if( p == null || !p.exists()) {
+ return;
+ }
+
IPath loc = PathUtils.getGlobalLocation(pkg);
IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(loc);
for( int i = 0; i < files.length; i++ ) {
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java 2012-09-21 13:16:57 UTC (rev 43926)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java 2012-09-21 13:37:27 UTC (rev 43927)
@@ -103,8 +103,10 @@
}
public void setBasedir2(String path) {
-
- IPath translatedPath = new Path(PathUtils.getAbsoluteLocation(path, fs.projectName, fs.inWorkspace, fs.version));
+ String s = PathUtils.getAbsoluteLocation(path, fs.projectName, fs.inWorkspace, fs.version);
+ if( s == null )
+ return;
+ IPath translatedPath = new Path(s);
if( workspaceRelative ) {
IPath p = PathUtils.getGlobalLocation(path, fs.projectName, true, fs.version);
setBasedir(new FileWrapper(p.toFile(), translatedPath, fs.rootArchiveRelativePath));
@@ -202,7 +204,7 @@
}
protected boolean isSelected(String name, File file) {
- return super.isSelected(name, file) && file.isFile();
+ return file != null && super.isSelected(name, file) && file.isFile();
}
@@ -291,6 +293,9 @@
}
public boolean couldBeIncluded(String path, boolean inWorkspace) {
+ if( getBasedir() == null )
+ return false;
+
IPath targetBase = ((FileWrapper)getBasedir()).getWrapperPath();
IPath[] questionFiles = new IPath[] { new Path(path) };
if( workspaceRelative && !inWorkspace) {
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/PathUtils.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/PathUtils.java 2012-09-21 13:16:57 UTC (rev 43926)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/PathUtils.java 2012-09-21 13:37:27 UTC (rev 43927)
@@ -66,7 +66,9 @@
// Get an absolute path, workspace-absolute or fs-absolute
public static String getAbsoluteLocation(String expression,
String projectName, boolean inWorkspace, double version) {
-
+ if( projectName == null )
+ return null;
+
if( inWorkspace && ("".equals(expression) || ".".equals(expression))) //$NON-NLS-1$ //$NON-NLS-2$
return new Path(projectName).makeAbsolute().toString();
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java 2012-09-21 13:16:57 UTC (rev 43926)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java 2012-09-21 13:37:27 UTC (rev 43927)
@@ -177,12 +177,18 @@
topChanges = getChanges(delta);
else if( delta.getKind() == IArchiveNodeDelta.NO_CHANGE)
return;
- else
+ else if( delta.getPostNode() == null )
+ topChanges = null;
+ else
topChanges = new IArchiveNode[]{delta.getPostNode()};
// now go through and refresh them
Display.getDefault().asyncExec(new Runnable () {
public void run () {
+ if( topChanges == null ) {
+ refreshViewer(null);
+ return;
+ }
for( int i = 0; i < topChanges.length; i++ ) {
refreshViewer(topChanges[i]);
}
@@ -207,9 +213,13 @@
if( !viewerInUse.getControl().isDisposed()) {
if( viewerInUse instanceof StructuredViewer ) {
- ((StructuredViewer)viewerInUse).refresh(o);
- if( viewerInUse instanceof TreeViewer ) {
- ((TreeViewer)viewerInUse).expandToLevel(o, 1);
+ if( o == null ) {
+ ((StructuredViewer)viewerInUse).refresh();
+ } else {
+ ((StructuredViewer)viewerInUse).refresh(o);
+ if( viewerInUse instanceof TreeViewer ) {
+ ((TreeViewer)viewerInUse).expandToLevel(o, 1);
+ }
}
} else
viewerInUse.refresh();
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java 2012-09-21 13:16:57 UTC (rev 43926)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java 2012-09-21 13:37:27 UTC (rev 43927)
@@ -57,7 +57,7 @@
}
return wrap((IProject[]) tmp.toArray(new IProject[tmp.size()]));
}
- if( cp != null )
+ if( cp != null && cp.isAccessible())
return wrap(new IProject[]{cp});
} else if( cp != null ){
return getChildren(new WrappedProject(cp, WrappedProject.NAME));
13 years, 6 months
JBoss Tools SVN: r43926 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-09-21 09:16:57 -0400 (Fri, 21 Sep 2012)
New Revision: 43926
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SSHUtils.java
Log:
[JBIDE-10118] adding key with name only, if it's stored in ssh2 home, full path otherwise
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SSHUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SSHUtils.java 2012-09-21 13:14:46 UTC (rev 43925)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SSHUtils.java 2012-09-21 13:16:57 UTC (rev 43926)
@@ -80,22 +80,37 @@
public static void addToPrivateKeysPreferences(File privateKey) {
Preferences preferences = JSchCorePlugin.getPlugin().getPluginPreferences();
String privateKeys = preferences.getString(IConstants.KEY_PRIVATEKEY);
+ String privateKeyPath = getKeyPath(privateKey);
+
if (privateKeys != null
&& privateKeys.trim().length() > 0) {
- privateKeys = privateKeys + "," + privateKey.getAbsolutePath();
+ privateKeys = privateKeys + "," + privateKeyPath;
} else {
- privateKeys = privateKey.getAbsolutePath();
+ privateKeys = privateKeyPath;
}
preferences.setValue(IConstants.KEY_PRIVATEKEY, privateKeys);
JSchCorePlugin.getPlugin().setNeedToLoadKeys(true);
JSchCorePlugin.getPlugin().savePluginPreferences();
}
+ private static String getKeyPath(File privateKey) {
+ String ssh2Home = getSSH2Home();
+ if (ssh2Home == null
+ || ssh2Home.isEmpty()) {
+ return privateKey.getAbsolutePath();
+ }
+
+ if (!privateKey.getAbsolutePath().startsWith(ssh2Home)) {
+ return privateKey.getAbsolutePath();
+ }
+
+ return privateKey.getName();
+ }
+
public static int openPreferencesPage(Shell shell) {
PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
shell, SSH_PREFERENCE_PAGE_ID, null, null);
return dialog.open();
-
}
/**
13 years, 6 months
JBoss Tools SVN: r43925 - branches/jbosstools-3.3.x/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-09-21 09:14:46 -0400 (Fri, 21 Sep 2012)
New Revision: 43925
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
Log:
[JBIDE-10118] adding key with name only, if it's stored in ssh2 home, full path otherwise
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2012-09-21 12:18:14 UTC (rev 43924)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2012-09-21 13:14:46 UTC (rev 43925)
@@ -198,17 +198,33 @@
private void addToPrivateKeysPreferences(SSHKeyPair keyPair) {
Preferences preferences = JSchCorePlugin.getPlugin().getPluginPreferences();
String privateKeys = preferences.getString(IConstants.KEY_PRIVATEKEY);
- if (privateKeys != null
+ String privateKeyPath = getKeyPath(new File(keyPair.getPrivateKeyPath()));
+
+ if (privateKeys != null
&& privateKeys.trim().length() > 0) {
- privateKeys = privateKeys + "," + keyPair.getPrivateKeyPath();
+ privateKeys = privateKeys + "," + privateKeyPath;
} else {
- privateKeys = keyPair.getPrivateKeyPath();
+ privateKeys = privateKeyPath;
}
preferences.setValue(IConstants.KEY_PRIVATEKEY, privateKeys);
- JSchCorePlugin.getPlugin().setNeedToLoadKeys(true);
- JSchCorePlugin.getPlugin().savePluginPreferences();
+ JSchCorePlugin.getPlugin().setNeedToLoadKeys(true);
+ JSchCorePlugin.getPlugin().savePluginPreferences();
}
+
+ private String getKeyPath(File privateKey) {
+ String ssh2Home = checkedGetSSH2Home();
+ if (ssh2Home == null
+ || ssh2Home.isEmpty()) {
+ return privateKey.getAbsolutePath();
+ }
+ if (!privateKey.getAbsolutePath().startsWith(ssh2Home)) {
+ return privateKey.getAbsolutePath();
+ }
+
+ return privateKey.getName();
+ }
+
public void setSshKey(String sshKey) {
firePropertyChange(PROPERTY_SSHKEY, this.sshKey, this.sshKey = sshKey);
}
13 years, 6 months
JBoss Tools SVN: r43924 - branches/jbosstools-3.3.x/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-09-21 08:18:14 -0400 (Fri, 21 Sep 2012)
New Revision: 43924
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainDialog.java
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java
Log:
[JBIDE-12382] set titles to "Edit Domain" and "Create Domain" wizards
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainDialog.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainDialog.java 2012-09-21 12:17:55 UTC (rev 43923)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainDialog.java 2012-09-21 12:18:14 UTC (rev 43924)
@@ -34,6 +34,7 @@
public EditDomainDialog(UserDelegate user) {
this.model = new EditDomainWizardPageModel(user);
setNeedsProgressMonitor(true);
+ setWindowTitle("Edit Domain");
}
@Override
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java 2012-09-21 12:17:55 UTC (rev 43923)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java 2012-09-21 12:18:14 UTC (rev 43924)
@@ -33,6 +33,7 @@
public NewDomainDialog(UserDelegate user) {
this.model = new NewDomainWizardPageModel(user);
setNeedsProgressMonitor(true);
+ setWindowTitle("Create Domain");
}
@Override
13 years, 6 months
JBoss Tools SVN: r43923 - 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-09-21 08:17:55 -0400 (Fri, 21 Sep 2012)
New Revision: 43923
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainDialog.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java
Log:
[JBIDE-12382] set titles to "Edit Domain" and "Create Domain" wizards
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainDialog.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainDialog.java 2012-09-21 11:16:22 UTC (rev 43922)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainDialog.java 2012-09-21 12:17:55 UTC (rev 43923)
@@ -34,6 +34,7 @@
public EditDomainDialog(UserDelegate user) {
this.model = new EditDomainWizardPageModel(user);
setNeedsProgressMonitor(true);
+ setWindowTitle("Edit Domain");
}
@Override
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java 2012-09-21 11:16:22 UTC (rev 43922)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java 2012-09-21 12:17:55 UTC (rev 43923)
@@ -33,6 +33,7 @@
public NewDomainDialog(UserDelegate user) {
this.model = new NewDomainWizardPageModel(user);
setNeedsProgressMonitor(true);
+ setWindowTitle("Create Domain");
}
@Override
13 years, 6 months
JBoss Tools SVN: r43922 - branches/jbosstools-3.3.x/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-09-21 07:16:22 -0400 (Fri, 21 Sep 2012)
New Revision: 43922
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java
Log:
[JBIDE-12357] set window title for "Edit Embedded Cartridges" wizard
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java 2012-09-21 11:14:18 UTC (rev 43921)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java 2012-09-21 11:16:22 UTC (rev 43922)
@@ -26,6 +26,7 @@
public EmbedCartridgeWizard(IApplication application, UserDelegate user) {
this.wizardModel = new ApplicationWizardModel(application, user);
setNeedsProgressMonitor(true);
+ setWindowTitle("Edit Embedded Cartridges");
}
@Override
13 years, 6 months
JBoss Tools SVN: r43921 - 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-09-21 07:14:18 -0400 (Fri, 21 Sep 2012)
New Revision: 43921
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java
Log:
[JBIDE-12357] set window title for "Edit Embedded Cartridges" wizard
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java 2012-09-21 09:58:02 UTC (rev 43920)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java 2012-09-21 11:14:18 UTC (rev 43921)
@@ -26,6 +26,7 @@
public EmbedCartridgeWizard(IApplication application, UserDelegate user) {
this.wizardModel = new ApplicationWizardModel(application, user);
setNeedsProgressMonitor(true);
+ setWindowTitle("Edit Embedded Cartridges");
}
@Override
13 years, 6 months
JBoss Tools SVN: r43920 - trunk/tests/plugins/org.jboss.tools.tests.installation/src/org/jboss/tools/tests/installation.
by jbosstools-commits@lists.jboss.org
Author: psrna
Date: 2012-09-21 05:58:02 -0400 (Fri, 21 Sep 2012)
New Revision: 43920
Modified:
trunk/tests/plugins/org.jboss.tools.tests.installation/src/org/jboss/tools/tests/installation/InstallTest.java
Log:
* fix: if InvalidFailureException is catched the test should fail. Added fail(message.toString());
Modified: trunk/tests/plugins/org.jboss.tools.tests.installation/src/org/jboss/tools/tests/installation/InstallTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests.installation/src/org/jboss/tools/tests/installation/InstallTest.java 2012-09-21 09:37:03 UTC (rev 43919)
+++ trunk/tests/plugins/org.jboss.tools.tests.installation/src/org/jboss/tools/tests/installation/InstallTest.java 2012-09-21 09:58:02 UTC (rev 43920)
@@ -22,6 +22,7 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.waits.ICondition;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.junit.Test;
@@ -115,6 +116,8 @@
message.append("Could not install from: " + site);
message.append("\n");
message.append(ex.getMessage());
+
+ fail(message.toString());
}
}
@@ -178,6 +181,7 @@
restartShellBot.button("No").click();
}
} catch (Exception ex) {
+
String installDesc = bot.text().getText();
if (installDesc == null || installDesc.isEmpty()) {
throw new RuntimeException("Internal error", ex);
13 years, 6 months
JBoss Tools SVN: r43919 - in trunk/tests/scripts/installation-updates: .settings and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-09-21 05:37:03 -0400 (Fri, 21 Sep 2012)
New Revision: 43919
Added:
trunk/tests/scripts/installation-updates/.classpath
trunk/tests/scripts/installation-updates/.project
trunk/tests/scripts/installation-updates/.settings/
trunk/tests/scripts/installation-updates/.settings/org.eclipse.jdt.core.prefs
trunk/tests/scripts/installation-updates/.settings/org.eclipse.jdt.groovy.core.prefs
trunk/tests/scripts/installation-updates/.settings/org.eclipse.m2e.core.prefs
trunk/tests/scripts/installation-updates/src/
trunk/tests/scripts/installation-updates/src/main/
trunk/tests/scripts/installation-updates/src/main/groovy/
trunk/tests/scripts/installation-updates/src/main/groovy/testInstall.groovy
trunk/tests/scripts/installation-updates/src/main/java/
trunk/tests/scripts/installation-updates/src/main/resources/
trunk/tests/scripts/installation-updates/src/test/
trunk/tests/scripts/installation-updates/src/test/java/
Modified:
trunk/tests/scripts/installation-updates/pom.xml
trunk/tests/scripts/installation-updates/testInstall.sh
Log:
Groovy version for testInstall
Added: trunk/tests/scripts/installation-updates/.classpath
===================================================================
--- trunk/tests/scripts/installation-updates/.classpath (rev 0)
+++ trunk/tests/scripts/installation-updates/.classpath 2012-09-21 09:37:03 UTC (rev 43919)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
+ <classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" path="src/main/groovy"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Property changes on: trunk/tests/scripts/installation-updates/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/tests/scripts/installation-updates/.project
===================================================================
--- trunk/tests/scripts/installation-updates/.project (rev 0)
+++ trunk/tests/scripts/installation-updates/.project 2012-09-21 09:37:03 UTC (rev 43919)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>installation-updates</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</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.jdt.groovy.core.groovyNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/tests/scripts/installation-updates/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/tests/scripts/installation-updates/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/tests/scripts/installation-updates/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/tests/scripts/installation-updates/.settings/org.eclipse.jdt.core.prefs 2012-09-21 09:37:03 UTC (rev 43919)
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/tests/scripts/installation-updates/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/tests/scripts/installation-updates/.settings/org.eclipse.jdt.groovy.core.prefs
===================================================================
--- trunk/tests/scripts/installation-updates/.settings/org.eclipse.jdt.groovy.core.prefs (rev 0)
+++ trunk/tests/scripts/installation-updates/.settings/org.eclipse.jdt.groovy.core.prefs 2012-09-21 09:37:03 UTC (rev 43919)
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+groovy.script.filters=scripts/**/*.groovy,y,src/main/resources/**/*.groovy,y,src/test/resources/**/*.groovy,y
Property changes on: trunk/tests/scripts/installation-updates/.settings/org.eclipse.jdt.groovy.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/tests/scripts/installation-updates/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- trunk/tests/scripts/installation-updates/.settings/org.eclipse.m2e.core.prefs (rev 0)
+++ trunk/tests/scripts/installation-updates/.settings/org.eclipse.m2e.core.prefs 2012-09-21 09:37:03 UTC (rev 43919)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=false
+version=1
Property changes on: trunk/tests/scripts/installation-updates/.settings/org.eclipse.m2e.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/tests/scripts/installation-updates/pom.xml
===================================================================
--- trunk/tests/scripts/installation-updates/pom.xml 2012-09-21 09:27:12 UTC (rev 43918)
+++ trunk/tests/scripts/installation-updates/pom.xml 2012-09-21 09:37:03 UTC (rev 43919)
@@ -4,15 +4,27 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.tools.tests.scripts</groupId>
<artifactId>installation-updates</artifactId>
- <packaging>pom</packaging>
-
+
<parent>
<groupId>org.jboss.tools.tests</groupId>
<artifactId>scripts</artifactId>
<version>3.4.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
-
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>1.8.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.gmaven.runtime</groupId>
+ <artifactId>gmaven-runtime-2.0</artifactId>
+ <version>1.4</version>
+ </dependency>
+ </dependencies>
+
<build>
<plugins>
<plugin>
@@ -34,8 +46,21 @@
</descriptors>
</configuration>
</plugin>
- </plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generateStubs</goal>
+ <goal>compile</goal>
+ <goal>generateTestStubs</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
-
+
</project>
-
\ No newline at end of file
Added: trunk/tests/scripts/installation-updates/src/main/groovy/testInstall.groovy
===================================================================
--- trunk/tests/scripts/installation-updates/src/main/groovy/testInstall.groovy (rev 0)
+++ trunk/tests/scripts/installation-updates/src/main/groovy/testInstall.groovy 2012-09-21 09:37:03 UTC (rev 43919)
@@ -0,0 +1,128 @@
+import org.apache.tools.ant.taskdefs.Java;
+import java.text.SimpleDateFormat;
+
+void usage() {
+ println "Script to test installation";
+ println "usage: groovy.sh testInstall.groovy <eclipse_home> <file_containing_list_of_sites|repository_url|CHECK_FOR_UPDATES>*";
+ println " <eclipse_home>: an eclipse installation will be performed on";
+ println " <file_containing_list_of_sites> a file containing a list of p2-friendly URLs of repositories";
+ println " separated by spaces or line breaks";
+ println " <repository_url>: URL of a p2 repo to install from";
+ println " CHECK_FOR_UPDATES: will trigger the check for updates";
+}
+
+
+// Takes a repo or a directory.xml URL single parameter
+void installUrl(String repoUrl, File eclipseHome, String product) {
+ if (repoUrl.endsWith(".xml")) {
+ installFromCentral(repoUrl, eclipseHome, product);
+ } else if (repoUrl.equals("CHECK_FOR_UPDATES")) {
+ checkForUpdates(eclipseHome, product);
+ } else {
+ installRepo(repoUrl, eclipseHome, product);
+ }
+}
+
+
+//Takes repo URL as single parameter
+void installRepo(String repoUrl, File eclipseHome, String productName) {
+ println("Installing content from " + repoUrl);
+ String additionalVMArgs = "-DUPDATE_SITE=" + repoUrl;
+ runSWTBotInstallRoutine(eclipseHome, productName, additionalVMArgs, "org.jboss.tools.tests.installation.InstallTest");
+}
+
+void runSWTBotInstallRoutine(File eclipseHome, String productName, String additionalVMArgs, String testClassName) {
+ String report = "TEST-install-" + new SimpleDateFormat("yyyyMMddh-hmm").format(new Date()) + ".xml";
+ File output = File.createTempFile("install", ".txt");
+ output.deleteOnExit();
+ // Invoke tests
+ Java proc = new org.apache.tools.ant.taskdefs.Java();
+ proc.setFork(true);
+ proc.setDir(eclipseHome);
+ proc.setOutput(output);
+ proc.setJvmargs(additionalVMArgs + " " +
+ "-Dorg.eclipse.swtbot.search.timeout=10000 " +
+ "-Dusage_reporting_enabled=false " +
+ "-Xms256M -Xmx768M -XX:MaxPermSize=512M");
+ proc.setJar(new File(eclipseHome, "plugins").listFiles().find {it.getName().startsWith("org.eclipse.equinox.launcher_") && it.getName().endsWith(".jar")} );
+ proc.setArgs("-application org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplication " +
+ "-testApplication org.eclipse.ui.ide.workbench " +
+ "-product " + productName + " " +
+ "-data workspace " +
+ "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter," + report + " " +
+ "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter " +
+ "-testPluginName org.jboss.tools.tests.installation " +
+ "-className " + testClassName + " " +
+ "-consoleLog -debug");
+ proc.init();
+ int returnCode = proc.executeJava();
+
+ output.eachLine { line ->
+ if (line.contains("Failures:")) {
+ if (line.contains("Failures: 0, Errors: 0")) {
+ return;
+ } else {
+ println("Error while installing. Read " + report + " for details and see screenshots/")
+ }
+ }
+ }
+}
+
+// Takes a Central directory.xml URL single parameter
+void installFromCentral(File eclipseHome, String productName) {
+ println("Installing content from " + repoUrl);
+ String report = "TEST-install-" + new SimpleDateFormat("yyyyMMddh-hmm").format(new Date()) + ".xml";
+ runSWTBotInstallRoutine(eclipseHome, productName, "", "org.jboss.tools.tests.installation.InstallFromCentralTest");
+}
+
+// Check for updates
+void checkForUpdates(File eclipseHome, String productName) {
+ println("Check for updates");
+ runSWTBotInstallRoutine(eclipseHome, productName, "", "org.jboss.tools.tests.installation.CheckForUpdatesTest");
+}
+
+if (args.length < 2) {
+ usage();
+ System.exit(2);
+}
+
+File eclipseHome = new File(args[0]);
+
+if (!eclipseHome.isDirectory()) {
+ usage();
+ System.exit(2);
+}
+
+println "Preparing tests, installing framework";
+
+// Install test framework
+Java proc = new org.apache.tools.ant.taskdefs.Java();
+proc.setDir(eclipseHome);
+proc.setFork(true);
+proc.setJar(new File(eclipseHome, "plugins").listFiles().find({it.getName().startsWith("org.eclipse.equinox.launcher_") && it.getName().endsWith(".jar")}).getAbsoluteFile());
+proc.setArgs("-application org.eclipse.equinox.p2.director " +
+ "-repository http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/," +
+ "http://download.jboss.org/jbosstools/builds/staging/jbosstools-4.0_trunk.... " +
+ "-installIU org.jboss.tools.tests.installation " +
+ "-installIU org.eclipse.swtbot.eclipse.test.junit4.feature.group " +
+ "-consolelog");
+proc.init();
+int returnCode = proc.executeJava();
+
+
+File iniFile = eclipseHome.listFiles().find({it.getName().endsWith(".ini")});
+iniLines = iniFile.readLines();
+targetIndex = iniLines.findIndexOf {line -> line.startsWith("-product") };
+String productName = iniLines[targetIndex + 1];
+println ("Product is: " + productName);
+
+args[1..-1].each {
+ if (new File(it).isFile()) {
+ new File(it).eachLine({ line ->
+ installUrl(line, eclipseHome, productName);
+ });
+ } else {
+ installUrl(it, eclipseHome, productName);
+ }
+}
+System.exit(0)
Modified: trunk/tests/scripts/installation-updates/testInstall.sh
===================================================================
--- trunk/tests/scripts/installation-updates/testInstall.sh 2012-09-21 09:27:12 UTC (rev 43918)
+++ trunk/tests/scripts/installation-updates/testInstall.sh 2012-09-21 09:37:03 UTC (rev 43919)
@@ -137,7 +137,6 @@
-installIU org.eclipse.swtbot.eclipse.test.junit4.feature.group \
-consoleLog
-
while (($#)); do
if [ -f "$1" ]; then
for repoUrl in $(cat "$1"); do
13 years, 6 months
JBoss Tools SVN: r43918 - trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-21 05:27:12 -0400 (Fri, 21 Sep 2012)
New Revision: 43918
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimeViewerDialog.java
Log:
very small changes to UI to improve download runtime dialog
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimeViewerDialog.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimeViewerDialog.java 2012-09-21 09:20:20 UTC (rev 43917)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/download/DownloadRuntimeViewerDialog.java 2012-09-21 09:27:12 UTC (rev 43918)
@@ -19,8 +19,8 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.ColumnLayoutData;
import org.eclipse.jface.viewers.ColumnWeightData;
@@ -55,7 +55,7 @@
* @author snjeza
*
*/
-public class DownloadRuntimeViewerDialog extends Dialog {
+public class DownloadRuntimeViewerDialog extends TitleAreaDialog {
private TableViewer viewer;
private Map<String, DownloadRuntime> downloadRuntimes;
@@ -88,9 +88,11 @@
@Override
protected Control createDialogArea(Composite parent) {
- getShell().setText("Runtimes");
+ getShell().setText("Download Runtimes");
+ setTitle("Download Runtimes");
+ setMessage("Please select a runtime to download and install.");
+
Composite area = (Composite) super.createDialogArea(parent);
- area.setLayout(new GridLayout());
Composite contents = new Composite(area, SWT.NONE);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
contents.setLayoutData(gd);
@@ -98,7 +100,7 @@
applyDialogFont(contents);
initializeDialogUnits(area);
- viewer = new TableViewer(parent, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL
+ viewer = new TableViewer(contents, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.BORDER);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.heightHint = 400;
@@ -112,8 +114,7 @@
viewer.setContentProvider(new DownloadRuntimesContentProvider());
- //String[] columnHeaders = {"Name", "ID", "Version", "URL"};
- String[] columnHeaders = {"Name", "ID", "Version"};
+ String[] columnHeaders = {"Name", "Version", "URL"};
for (int i = 0; i < columnHeaders.length; i++) {
TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
column.setLabelProvider(new DownloadRuntimesLabelProvider(i));
@@ -210,11 +211,11 @@
case 0:
return downloadRuntime.getName();
case 1:
- return downloadRuntime.getId();
+ return downloadRuntime.getVersion();
case 2:
- return downloadRuntime.getVersion();
+ return downloadRuntime.getUrl();
case 3:
- return downloadRuntime.getUrl();
+ return downloadRuntime.getId();
}
}
return null;
13 years, 6 months