JBoss Tools SVN: r43906 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-21 04:19:16 -0400 (Fri, 21 Sep 2012)
New Revision: 43906
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
Log:
change button to hyperlink, looks better
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2012-09-21 08:06:33 UTC (rev 43905)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2012-09-21 08:19:16 UTC (rev 43906)
@@ -59,6 +59,7 @@
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
@@ -102,7 +103,7 @@
protected int jreComboIndex;
protected Button homeDirButton, jreButton;
protected Composite nameComposite, homeDirComposite, jreComposite;
- protected Button downloadAndInstallButton;
+ protected Link downloadAndInstallButton;
protected String name, homeDir;
// Configuration stuff
@@ -337,8 +338,8 @@
homeDirButton = new Button(homeDirComposite, SWT.NONE);
homeDirButton.setText(Messages.browse);
- downloadAndInstallButton = new Button(homeDirComposite, SWT.NONE);
- downloadAndInstallButton.setText(Messages.rwf_DownloadRuntime);
+ downloadAndInstallButton = new Link(homeDirComposite, SWT.NONE);
+ downloadAndInstallButton.setText("<a href=\"\">" + Messages.rwf_DownloadRuntime + "</a>");
downloadAndInstallButton.addSelectionListener(new DownloadAndInstallListener());
downloadAndInstallButton.setEnabled(true);
@@ -365,7 +366,7 @@
homeDirLabel.setLayoutData(UIUtil.createFormData2(null,0,homeDirText,-5,0,5,null,0));
homeDirText.setLayoutData(UIUtil.createFormData2(homeDirLabel,5,null,0,0,5,homeDirButton,-5));
homeDirButton.setLayoutData(UIUtil.createFormData2(homeDirLabel,5,null,0,null,0,100,0));
- downloadAndInstallButton.setLayoutData(UIUtil.createFormData2(0,0,homeDirButton,-5,null,0,100,-5));
+ downloadAndInstallButton.setLayoutData(UIUtil.createFormData2(0,0,homeDirButton,-5,null,0,100,-10));
}
protected class DownloadAndInstallListener extends SelectionAdapter {
13 years, 6 months
JBoss Tools SVN: r43905 - trunk/runtime-soa/site.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-09-21 04:06:33 -0400 (Fri, 21 Sep 2012)
New Revision: 43905
Modified:
trunk/runtime-soa/site/category.xml
Log:
JBIDE-12523 - runtime-soa duplicates unit tests
Modified: trunk/runtime-soa/site/category.xml
===================================================================
--- trunk/runtime-soa/site/category.xml 2012-09-21 08:02:25 UTC (rev 43904)
+++ trunk/runtime-soa/site/category.xml 2012-09-21 08:06:33 UTC (rev 43905)
@@ -17,9 +17,6 @@
<feature url="features/org.jboss.tools.runtime.jbpm.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.jbpm.detector.feature" version="0.0.0">
<category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
</feature>
- <feature url="features/org.jboss.tools.runtime.soa.test.feature_0.0.0.jar" id="org.jboss.tools.runtime.soa.test.feature" version="0.0.0">
- <category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
- </feature>
<!-- TODO: add sources -->
<feature url="features/org.jboss.tools.runtime.drools.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.drools.detector.feature.source" version="0.0.0">
@@ -31,7 +28,4 @@
<feature url="features/org.jboss.tools.runtime.jbpm.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.jbpm.detector.feature.source" version="0.0.0">
<category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
</feature>
- <feature url="features/org.jboss.tools.runtime.soa.test.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.soa.test.feature.source" version="0.0.0">
- <category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
- </feature>
</site>
13 years, 6 months
JBoss Tools SVN: r43900 - in trunk/runtime-soa: features and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-09-21 02:55:38 -0400 (Fri, 21 Sep 2012)
New Revision: 43900
Modified:
trunk/runtime-soa/features/pom.xml
trunk/runtime-soa/pom.xml
Log:
JBIDE-12523 - runtime-soa duplicates unit tests
Modified: trunk/runtime-soa/features/pom.xml
===================================================================
--- trunk/runtime-soa/features/pom.xml 2012-09-21 06:55:37 UTC (rev 43899)
+++ trunk/runtime-soa/features/pom.xml 2012-09-21 06:55:38 UTC (rev 43900)
@@ -16,6 +16,5 @@
<module>org.jboss.tools.runtime.drools.detector.feature</module>
<module>org.jboss.tools.runtime.esb.detector.feature</module>
<module>org.jboss.tools.runtime.jbpm.detector.feature</module>
- <module>org.jboss.tools.runtime.soa.test.feature</module>
</modules>
</project>
Modified: trunk/runtime-soa/pom.xml
===================================================================
--- trunk/runtime-soa/pom.xml 2012-09-21 06:55:37 UTC (rev 43899)
+++ trunk/runtime-soa/pom.xml 2012-09-21 06:55:38 UTC (rev 43900)
@@ -15,7 +15,6 @@
<packaging>pom</packaging>
<modules>
<module>plugins</module>
- <!-- <module>tests</module> -->
<module>features</module>
<module>site</module>
</modules>
13 years, 6 months
JBoss Tools SVN: r43899 - trunk/modeshape.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2012-09-21 02:55:37 -0400 (Fri, 21 Sep 2012)
New Revision: 43899
Modified:
trunk/modeshape/README
Log:
test if trunk is closed
Modified: trunk/modeshape/README
===================================================================
--- trunk/modeshape/README 2012-09-21 06:55:14 UTC (rev 43898)
+++ trunk/modeshape/README 2012-09-21 06:55:37 UTC (rev 43899)
@@ -3,3 +3,4 @@
If you got questions regarding this project move and/or think you need maintance work done on these sources contact jbosstools-dev(a)lists.jboss.org
Thank you!
+.
\ No newline at end of file
13 years, 6 months
JBoss Tools SVN: r43896 - trunk/modeshape.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2012-09-21 02:38:21 -0400 (Fri, 21 Sep 2012)
New Revision: 43896
Added:
trunk/modeshape/README
Removed:
trunk/modeshape/README.deprecated.project.marked.read-only.moved.to.github.txt
trunk/modeshape/docs/
trunk/modeshape/features/
trunk/modeshape/plugins/
trunk/modeshape/pom.xml
trunk/modeshape/site/
trunk/modeshape/tests/
Log:
Modeshape is dead - long live Modeshape
Added: trunk/modeshape/README
===================================================================
--- trunk/modeshape/README (rev 0)
+++ trunk/modeshape/README 2012-09-21 06:38:21 UTC (rev 43896)
@@ -0,0 +1,5 @@
+This project have moved to https://github.com/ModeShape/modeshape-tools
+
+If you got questions regarding this project move and/or think you need maintance work done on these sources contact jbosstools-dev(a)lists.jboss.org
+
+Thank you!
Deleted: trunk/modeshape/README.deprecated.project.marked.read-only.moved.to.github.txt
===================================================================
--- trunk/modeshape/README.deprecated.project.marked.read-only.moved.to.github.txt 2012-09-21 06:14:37 UTC (rev 43895)
+++ trunk/modeshape/README.deprecated.project.marked.read-only.moved.to.github.txt 2012-09-21 06:38:21 UTC (rev 43896)
@@ -1,9 +0,0 @@
-This project is read-only as it has migrated to github.
-
-For editable sources and new development work, see
-
-https://github.com/ModeShape/modeshape-tools
-
-If you need maintance work done on these sources, contact Dan Florian (dflorian(a)redhat.com, elvisisking) or Nick Boldt (nboldt(a)redhat.com, nickboldt) for assistance.
-
-2012-09-20 16:25:30
Deleted: trunk/modeshape/pom.xml
===================================================================
--- trunk/modeshape/pom.xml 2012-09-21 06:14:37 UTC (rev 43895)
+++ trunk/modeshape/pom.xml 2012-09-21 06:38:21 UTC (rev 43896)
@@ -1,23 +0,0 @@
-<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</groupId>
- <artifactId>parent</artifactId>
- <version>4.0.0.Alpha2-SNAPSHOT</version>
- <relativePath>../build/parent/pom.xml</relativePath>
- </parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>modeshape</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <name>modeshape.all</name>
- <packaging>pom</packaging>
- <modules>
- <module>features</module>
- <module>plugins</module>
- <module>tests</module>
- <module>site</module>
- </modules>
-</project>
-
13 years, 6 months
JBoss Tools SVN: r43895 - trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-21 02:14:37 -0400 (Fri, 21 Sep 2012)
New Revision: 43895
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
Log:
JBIDE-12493 to trunk missing menu
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2012-09-21 05:18:11 UTC (rev 43894)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2012-09-21 06:14:37 UTC (rev 43895)
@@ -37,6 +37,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IViewSite;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.navigator.CommonActionProvider;
import org.eclipse.ui.navigator.ICommonActionExtensionSite;
@@ -114,14 +115,9 @@
menuAboutToShow2(manager);
}
- public void menuAboutToShow2(IMenuManager manager) {
- if (ProjectArchivesCommonView.getInstance() == null) {
+ public void menuAboutToShow2(IMenuManager manager) {
+ if( site == null || site.getAdapter(IViewSite.class) == null )
return;
- }
- IProject currentProject = ProjectArchivesCommonView.getInstance().getCurrentProject();
- if (currentProject == null || !currentProject.exists() || !currentProject.isOpen()) {
- return;
- }
addNewPackageActions(newPackageManager);
IStructuredSelection selection = getSelection(site);
13 years, 6 months
JBoss Tools SVN: r43894 - trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-21 01:18:11 -0400 (Fri, 21 Sep 2012)
New Revision: 43894
Modified:
trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java
Log:
JBIDE-12583 to trunk
Modified: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java 2012-09-21 00:26:12 UTC (rev 43893)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java 2012-09-21 05:18:11 UTC (rev 43894)
@@ -10,38 +10,28 @@
************************************************************************************/
package org.jboss.tools.runtime.test;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
+import junit.framework.Assert;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.runtime.IJBossRuntimePluginConstants;
import org.jboss.tools.runtime.core.JBossRuntimeLocator;
import org.jboss.tools.runtime.core.RuntimeCoreActivator;
-import org.jboss.tools.runtime.core.internal.InvalidRuntimeDetector;
import org.jboss.tools.runtime.core.model.IRuntimeDetector;
import org.jboss.tools.runtime.core.model.RuntimeDefinition;
import org.jboss.tools.runtime.core.model.RuntimePath;
@@ -49,130 +39,204 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.junit.After;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
/**
*
* @author snjeza
- *
+ * @author rob stryker
*/
-public class RuntimeDetectionTest implements IJBossRuntimePluginConstants {
+public class RuntimeDetectionTest extends Assert implements IJBossRuntimePluginConstants {
private final static String seamVersionAttributeName = "Seam-Version";
-
+ private final static String SKIP_PRIVATE = "org.jboss.tools.tests.skipPrivateRequirements";
+
@BeforeClass
public static void create() {
RuntimeCoreActivator.getDefault();
RuntimeUIActivator.getDefault();
- addRuntimePaths();
- createRuntimes();
}
- private static void addRuntimePaths() {
- RuntimePath[] runtimePaths = RuntimeUIActivator.getRuntimePaths();
- String[] paths = { IRuntimeDetectionConstants.JBOSS_42_HOME,
- IRuntimeDetectionConstants.JBOSS_51_HOME,
- IRuntimeDetectionConstants.JBOSS_70_HOME,
- IRuntimeDetectionConstants.SEAM_20_HOME,
- IRuntimeDetectionConstants.SEAM_22_HOME,
- IRuntimeDetectionConstants.EAP_43_HOME };
-
- for (String path : paths) {
- RuntimePath runtimePath = new RuntimePath(path);
- runtimePath.setScanOnEveryStartup(false);
- runtimePaths.add(runtimePath);
- }
- RuntimeUIActivator.getDefault().saveRuntimePaths();
- List<RuntimeDefinition> serverDefinitions = new ArrayList<RuntimeDefinition>();
- Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getDefault()
- .getRuntimeDetectors();
- for (IRuntimeDetector detector : detectors) {
- if (detector.isEnabled()) {
- detector.initializeRuntimes(serverDefinitions);
+ @Before
+ public void setUp() {
+ clearAll();
+ }
+ @After
+ public void tearDown() {
+ clearAll();
+ }
+
+ public void clearAll() {
+ // remove all wtp servers
+ IServer[] s = ServerCore.getServers();
+ for( int i = 0; i < s.length; i++ ) {
+ try {
+ s[i].delete();
+ } catch(CoreException ce ) {
+ ce.printStackTrace();
+ fail();
}
}
- }
- private static void createRuntimes() {
- JBossRuntimeLocator locator = new JBossRuntimeLocator();
- Set<RuntimePath> runtimePaths = RuntimeUIActivator.getDefault()
- .getRuntimePaths();
- for (RuntimePath runtimePath : runtimePaths) {
- List<RuntimeDefinition> serverDefinitions = locator
- .searchForRuntimes(runtimePath.getPath(),
- new NullProgressMonitor());
- runtimePath.getRuntimeDefinitions().clear();
- for (RuntimeDefinition serverDefinition : serverDefinitions) {
- serverDefinition.setRuntimePath(runtimePath);
+ // Remove all wtp runtimes
+ IRuntime[] r = ServerCore.getRuntimes();
+ for( int i = 0; i < r.length; i++ ) {
+ try {
+ r[i].delete();
+ } catch(CoreException ce ) {
+ ce.printStackTrace();
+ fail();
}
- runtimePath.getRuntimeDefinitions().addAll(serverDefinitions);
}
- List<RuntimeDefinition> serverDefinitions = RuntimeUIActivator
- .getDefault().getServerDefinitions();
- Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getDefault()
- .getRuntimeDetectors();
- for (IRuntimeDetector detector : detectors) {
- if (detector.isEnabled()) {
- detector.initializeRuntimes(serverDefinitions);
- }
+ // Remove all seam runtimes
+ SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
+ for( int i = 0; i < seamRuntimes.length; i++ ) {
+ SeamRuntimeManager.getInstance().removeRuntime(seamRuntimes[i]);
}
+ SeamRuntimeManager.getInstance().save();
}
-
+
+
@Test
public void testRuntimeDetectors() {
- Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getDefault()
- .getRuntimeDetectors();
+ Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getDefault().getRuntimeDetectors();
assertTrue("Runtime detectors don't exist.", detectors.size() > 0);
+ assertTrue(handlerExists("org.jboss.tools.runtime.handlers.SeamHandler"));
}
+
+ private boolean handlerExists(String id) {
+ Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getDefault().getRuntimeDetectors();
+ boolean found = false;
+ Iterator<IRuntimeDetector> i = detectors.iterator();
+ while(i.hasNext()) {
+ IRuntimeDetector next = i.next();
+ String nid = next.getId();
+ if( id.equals(nid))
+ found = true;
+ }
+ return found;
+ }
@Test
- public void testRuntimePaths() {
- RuntimePath[] runtimePaths = RuntimeUIActivator.getRuntimePaths();
- assertTrue(
- "runtimePaths.size()\nExpected: 6\nWas: " + runtimePaths.size(),
- runtimePaths.length == 6);
+ public void testJBossAs42() {
+ testOneApplicationServer(IRuntimeDetectionConstants.JBOSS_42_HOME, IJBossToolingConstants.AS_42);
}
@Test
- public void testRuntimePathsExists() {
- RuntimePath[] runtimePaths = RuntimeUIActivator.getRuntimePaths();
- for (RuntimePath runtimePath:runtimePaths) {
- String path = runtimePath.getPath();
- File file = new File(path);
- assertTrue("The '" + file.getAbsolutePath()
- + "' path isn't valid.", file.isDirectory());
- }
+ public void testJBossAs51() {
+ testOneApplicationServer(IRuntimeDetectionConstants.JBOSS_51_HOME, IJBossToolingConstants.AS_51);
}
+
+ @Test
+ public void testJBossAs70() {
+ testOneApplicationServer(IRuntimeDetectionConstants.JBOSS_70_HOME, IJBossToolingConstants.AS_70);
+ }
+ public void testOneApplicationServer(String homeDir, String typeId) {
+ List<RuntimeDefinition> runtimeDefinitions = initializeOnePath(homeDir);
+ RuntimeDefinition def1 = runtimeDefinitions.get(0);
+
+ def1.setEnabled(false);
+ initializeDefinitions(runtimeDefinitions);
+ int count = countRuntimesOfType(typeId);
+ assertEquals(0, count);
+
+ def1.setEnabled(true);
+ initializeDefinitions(runtimeDefinitions);
+ count = countRuntimesOfType(typeId);
+ assertEquals(1, count);
+ }
+
+ private List<RuntimeDefinition> initializeOnePath(String homeDir) {
+ RuntimePath path = createRuntimePath(homeDir, false);
+ setRuntimePaths(path, true);
+ File file = new File(path.getPath());
+ assertTrue("The '" + file.getAbsolutePath() + "' path isn't valid.", file.isDirectory());
+
+ List<RuntimeDefinition> runtimeDefinitions = createDefinitionsForPath(path);
+ assertEquals(1, runtimeDefinitions.size());
+ RuntimeDefinition def1 = runtimeDefinitions.get(0);
+
+ File location = def1.getLocation();
+ assertTrue("The '" + location.getAbsolutePath() + "' path isn't valid.", location.isDirectory());
+ return runtimeDefinitions;
+ }
+
+
+ // 1.2 is bundled in eap ?
+ // public void testSeam12() {
+// testOneSeamLocation(IRuntimeDetectionConstants., SeamVersion.SEAM_1_2, "1.2");
+// int count = countSeamRuntimesForVersion(SeamVersion.SEAM_1_2);
+// assertEquals(1, count);
+// }
+
+
@Test
- public void testLocations() {
- List<RuntimeDefinition> serverDefinitions = RuntimeUIActivator
- .getDefault().getServerDefinitions();
- for (RuntimeDefinition serverDefinition : serverDefinitions) {
- File location = serverDefinition.getLocation();
- assertTrue("The '" + location.getAbsolutePath()
- + "' path isn't valid.", location.isDirectory());
+ public void testJBossEap43() {
+ if( Boolean.getBoolean(SKIP_PRIVATE))
+ return;
+
+ List<RuntimeDefinition> runtimeDefinitions = initializeOnePath(IRuntimeDetectionConstants.EAP_43_HOME);
+ RuntimeDefinition def1 = runtimeDefinitions.get(0);
+
+ // Should setting this to false cascade to the nested definitions?
+ //def1.setEnabled(false);
+ setServerDefinitionsEnabledRecurse(def1, false);
+ initializeDefinitions(runtimeDefinitions);
+ int count = countRuntimesOfType(IJBossToolingConstants.EAP_43);
+ assertEquals(0, count);
+ count = countSeamRuntimesForVersion(SeamVersion.SEAM_1_2);
+ assertEquals(0, count);
+
+ setServerDefinitionsEnabledRecurse(def1, true);
+ initializeDefinitions(runtimeDefinitions);
+ count = countRuntimesOfType(IJBossToolingConstants.EAP_43);
+ assertEquals(1, count);
+ count = countSeamRuntimesForVersion(SeamVersion.SEAM_1_2);
+ assertEquals(1, count);
+ }
+ private void setServerDefinitionsEnabledRecurse(RuntimeDefinition def, boolean enabled) {
+ def.setEnabled(enabled);
+ List<RuntimeDefinition> nested = def.getIncludedRuntimeDefinitions();
+ Iterator<RuntimeDefinition> i = nested.iterator();
+ while(i.hasNext()) {
+ setServerDefinitionsEnabledRecurse(i.next(), enabled);
}
}
-
@Test
- public void testSeam22Location() throws Exception {
- String seamHome = IRuntimeDetectionConstants.SEAM_22_HOME;
- testSeamHome(seamHome, "2.2");
+ public void testSeam20() throws Exception {
+ testOneSeamLocation(IRuntimeDetectionConstants.SEAM_20_HOME, SeamVersion.SEAM_2_0, "2.0");
}
@Test
- public void testSeam20Location() throws Exception {
- String seamHome = IRuntimeDetectionConstants.SEAM_20_HOME;
- testSeamHome(seamHome, "2.0");
+ public void testSeam22() throws Exception {
+ testOneSeamLocation(IRuntimeDetectionConstants.SEAM_22_HOME, SeamVersion.SEAM_2_2, "2.2");
}
+
+ public void testOneSeamLocation(String homeDir, SeamVersion version, String versionString) throws Exception {
+ testSeamHome(homeDir, versionString);
+
+ List<RuntimeDefinition> runtimeDefinitions = initializeOnePath(homeDir);
+ RuntimeDefinition def1 = runtimeDefinitions.get(0);
+
+ def1.setEnabled(false);
+ initializeDefinitions(runtimeDefinitions);
+ int count = countSeamRuntimesForVersion(version);
+ assertEquals(0, count);
+
+ def1.setEnabled(true);
+ initializeDefinitions(runtimeDefinitions);
+ count = countSeamRuntimesForVersion(version);
+ assertEquals(1, count);
+
+ List<RuntimeDefinition> nested = def1.getIncludedRuntimeDefinitions();
+ System.out.println(nested.size());
+ }
+
+
private void testSeamHome(String seamHome, String seamVersion) throws IOException {
File file = new File(seamHome);
assertTrue("The '" + file.getAbsolutePath()
@@ -200,127 +264,85 @@
assertTrue("seamVersion: " + version, version != null && version.startsWith(seamVersion));
}
- @Test
- public void testServerDefinitions() {
- List<RuntimeDefinition> serverDefinitions = RuntimeUIActivator
- .getDefault().getServerDefinitions();
- RuntimePath[] runtimePaths = RuntimeUIActivator.getRuntimePaths();
- assertTrue("serverDefinitions.size()\nExpected: 6\nWas: "
- + serverDefinitions.size() +
- "\nserverDefinitions: " + serverDefinitions +
- "\nruntimePaths=" + runtimePaths, serverDefinitions.size() == 6);
- }
+
- @Test
- public void testSeam22() {
- SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance()
- .getRuntimes();
- int count = 0;
- for (SeamRuntime seamRuntime : seamRuntimes) {
- SeamVersion version = seamRuntime.getVersion();
- if (SeamVersion.SEAM_2_2.equals(version)) {
- count++;
+ /*
+ * Utility methods for counting things
+ */
+
+ /* Pass to all handlers the list of runtime definitions and let them initialize them */
+ private void initializeDefinitions(List<RuntimeDefinition> runtimeDefinitions) {
+ Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getDefault()
+ .getRuntimeDetectors();
+ for (IRuntimeDetector detector : detectors) {
+ if (detector.isEnabled()) {
+ detector.initializeRuntimes(runtimeDefinitions);
}
}
- assertTrue("Seam 2.2\nExpected: 1\nWas: " + count, count == 1);
}
-
- @Test
- public void testSeam20() {
- SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance()
- .getRuntimes();
- int count = 0;
- for (SeamRuntime seamRuntime : seamRuntimes) {
- SeamVersion version = seamRuntime.getVersion();
- if (SeamVersion.SEAM_2_0.equals(version)) {
- count++;
- }
- }
- assertTrue("Seam 2.0\nExpected: 2\nWas: " + count, count == 2);
+ private List<RuntimeDefinition> createDefinitionsForPath(RuntimePath runtimePath) {
+ JBossRuntimeLocator locator = new JBossRuntimeLocator();
+ List<RuntimeDefinition> serverDefinitions = locator
+ .searchForRuntimes(runtimePath.getPath(),
+ new NullProgressMonitor());
+//
+// // Shouldn't this be done by the framework somehow??
+// runtimePath.getRuntimeDefinitions().clear();
+// for (RuntimeDefinition serverDefinition : serverDefinitions) {
+// serverDefinition.setRuntimePath(runtimePath);
+// }
+// runtimePath.getRuntimeDefinitions().addAll(serverDefinitions);
+ return serverDefinitions;
}
-
- @Test
- public void testSeam12() {
- SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance()
- .getRuntimes();
- int count = 0;
- for (SeamRuntime seamRuntime : seamRuntimes) {
- SeamVersion version = seamRuntime.getVersion();
- if (SeamVersion.SEAM_1_2.equals(version)) {
- count++;
- }
- }
- assertTrue("Seam 1.2\nExpected: 1\nWas: " + count, count == 1);
+
+ private RuntimePath createRuntimePath(String path, boolean enableForStartup) {
+ RuntimePath runtimePath = new RuntimePath(path);
+ runtimePath.setScanOnEveryStartup(enableForStartup);
+ return runtimePath;
}
-
- @Test
- public void testSeamRuntimes() {
- SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance()
- .getRuntimes();
- assertTrue("seamRuntimes.length\nExpected: 4\nWas: "
- + seamRuntimes.length, seamRuntimes.length == 4);
+ private void setRuntimePaths(RuntimePath runtimePath, boolean save) {
+ //Set<RuntimePath> runtimePaths = RuntimeUIActivator.getDefault().getRuntimePaths();
+ //runtimePaths.clear();
+ //runtimePaths.add(runtimePath);
+ if( save )
+ RuntimeUIActivator.getDefault().saveRuntimePreferences();
}
- @Test
- public void testJBossAs42() {
- IRuntime[] runtimes = ServerCore.getRuntimes();
- int count = 0;
- for (IRuntime runtime : runtimes) {
- IRuntimeType runtimeType = runtime.getRuntimeType();
- if (IJBossToolingConstants.AS_42.equals(runtimeType.getId())) {
- count++;
- }
- }
- assertTrue("JBoss AS 4.2\nExpected: 1\nWas: " + count, count == 1);
- }
- @Test
- public void testJBossAs51() {
- IRuntime[] runtimes = ServerCore.getRuntimes();
- int count = 0;
- for (IRuntime runtime : runtimes) {
- IRuntimeType runtimeType = runtime.getRuntimeType();
- if (IJBossToolingConstants.AS_51.equals(runtimeType.getId())) {
- count++;
- }
- }
- assertTrue("JBoss AS 5.1\nExpected: 1\nWas: " + count, count == 1);
+ private int countSeamRuntimes() {
+ return SeamRuntimeManager.getInstance().getRuntimes().length;
}
-
- @Test
- public void testJBossAs70() {
- IRuntime[] runtimes = ServerCore.getRuntimes();
+ private int countSeamRuntimesForVersion(SeamVersion version) {
+ SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
int count = 0;
- for (IRuntime runtime : runtimes) {
- IRuntimeType runtimeType = runtime.getRuntimeType();
- if (IJBossToolingConstants.AS_70.equals(runtimeType.getId())) {
+ for (SeamRuntime seamRuntime : seamRuntimes) {
+ SeamVersion version2 = seamRuntime.getVersion();
+ if (version.equals(version2)) {
count++;
}
}
- assertTrue("JBoss AS 7.0\nExpected: 1\nWas: " + count, count == 1);
+ return count;
}
- @Test
- public void testJBossEap43() {
+
+ private int countRuntimesOfType(String typeId) {
IRuntime[] runtimes = ServerCore.getRuntimes();
int count = 0;
for (IRuntime runtime : runtimes) {
IRuntimeType runtimeType = runtime.getRuntimeType();
- if (IJBossToolingConstants.EAP_43.equals(runtimeType.getId())) {
+ if (typeId.equals(runtimeType.getId())) {
count++;
}
}
- assertTrue("JBoss EAP 4.3\nExpected: 1\nWas: " + count, count == 1);
+ return count;
}
- @Test
public void testWtpRuntimes() {
IRuntime[] runtimes = ServerCore.getRuntimes();
assertTrue("runtimes.length\nExpected: 4\nWas: " + runtimes.length,
runtimes.length == 4);
}
- @Test
public void testIncludedDefinitions() {
for (RuntimeDefinition serverDefinition:RuntimeUIActivator.getDefault().getServerDefinitions()){
String type = serverDefinition.getType();
@@ -333,77 +355,70 @@
}
}
- @Test
- public void testSavePreferences() throws Exception {
- // saves preferences
- Bundle bundle = Platform.getBundle(RuntimeUIActivator.PLUGIN_ID);
- bundle.stop();
- // loads preferences
- bundle.start();
- // calls tests again
- testServerDefinitions();
- testIncludedDefinitions();
- testRuntimePaths();
- testRuntimeDetectors();
- testLocations();
- testSeamRuntimes();
- testWtpRuntimes();
- testSeam22();
- testSeam22Location();
- }
- @Test
- public void testOldWorkspace() throws Exception {
- String runtimes = ConfigurationScope.INSTANCE.getNode(
- RuntimeUIActivator.PLUGIN_ID).get(
- RuntimeUIActivator.RUNTIME_PATHS, null);
- // removes version and included definitions
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- Document doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(runtimes)));
- Element runtimePaths = (Element) doc.getElementsByTagName(RuntimeUIActivator.RUNTIME_PATHS).item(0);
- runtimePaths.removeAttribute(RuntimeUIActivator.PREFERENCES_VERSION);
- removeIncluded(doc);
- runtimes = serialize(doc);
- // restarts the bundle
- Bundle bundle = Platform.getBundle(RuntimeUIActivator.PLUGIN_ID);
- bundle.stop();
- bundle.start();
- // saves preferences
- ConfigurationScope.INSTANCE.getNode(RuntimeUIActivator.PLUGIN_ID).put(
- RuntimeUIActivator.RUNTIME_PATHS, runtimes);
- // calls tests again
- testIncludedDefinitions();
- testServerDefinitions();
- }
- private void removeIncluded(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE
- && node.getNodeName().equals("included")) {
- node.getParentNode().removeChild(node);
- } else {
- NodeList list = node.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- removeIncluded(list.item(i));
- }
- }
- }
+ // Things to test in runtime core test suite, not here
- @Test
- public void testInvalidDetectors() {
- Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getDefault().getDeclaredRuntimeDetectors();
- IRuntimeDetector invalidDetector = null;
- for (IRuntimeDetector detector:detectors) {
- if (detector instanceof InvalidRuntimeDetector) {
- invalidDetector = detector;
- }
- }
- assertFalse("Invalid detector is enabled.", invalidDetector.isEnabled());
- }
-
- private String serialize(Document doc) throws TransformerException {
- StringWriter stringWriter = new StringWriter();
- Transformer serializer = TransformerFactory.newInstance().newTransformer();
- serializer.transform(new DOMSource(doc), new StreamResult(stringWriter));
- return stringWriter.toString();
- }
+//
+// @Test
+// public void testSavePreferences() throws Exception {
+// // saves preferences
+// Bundle bundle = Platform.getBundle(RuntimeUIActivator.PLUGIN_ID);
+// bundle.stop();
+// // loads preferences
+// bundle.start();
+// // calls tests again
+// testServerDefinitions();
+// testIncludedDefinitions();
+// testRuntimePaths();
+// testRuntimeDetectors();
+// testLocations();
+// testSeamRuntimes();
+// testWtpRuntimes();
+// testSeam22();
+// testSeam22Location();
+// }
+//
+// @Test
+// public void testOldWorkspace() throws Exception {
+// String runtimes = ConfigurationScope.INSTANCE.getNode(
+// RuntimeUIActivator.PLUGIN_ID).get(
+// RuntimeUIActivator.RUNTIME_PATHS, null);
+// // removes version and included definitions
+// DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+// Document doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(runtimes)));
+// Element runtimePaths = (Element) doc.getElementsByTagName(RuntimeUIActivator.RUNTIME_PATHS).item(0);
+// runtimePaths.removeAttribute(RuntimeUIActivator.PREFERENCES_VERSION);
+// removeIncluded(doc);
+// runtimes = serialize(doc);
+// // restarts the bundle
+// Bundle bundle = Platform.getBundle(RuntimeUIActivator.PLUGIN_ID);
+// bundle.stop();
+// bundle.start();
+// // saves preferences
+// ConfigurationScope.INSTANCE.getNode(RuntimeUIActivator.PLUGIN_ID).put(
+// RuntimeUIActivator.RUNTIME_PATHS, runtimes);
+// // calls tests again
+// testIncludedDefinitions();
+// testServerDefinitions();
+// }
+//
+// private void removeIncluded(Node node) {
+// if (node.getNodeType() == Node.ELEMENT_NODE
+// && node.getNodeName().equals("included")) {
+// node.getParentNode().removeChild(node);
+// } else {
+// NodeList list = node.getChildNodes();
+// for (int i = 0; i < list.getLength(); i++) {
+// removeIncluded(list.item(i));
+// }
+// }
+// }
+//
+// private String serialize(Document doc) throws TransformerException {
+// StringWriter stringWriter = new StringWriter();
+// Transformer serializer = TransformerFactory.newInstance().newTransformer();
+// serializer.transform(new DOMSource(doc), new StreamResult(stringWriter));
+// return stringWriter.toString();
+// }
}
13 years, 6 months
JBoss Tools SVN: r43893 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-09-20 20:26:12 -0400 (Thu, 20 Sep 2012)
New Revision: 43893
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
JBIDE-12479
https://issues.jboss.org/browse/JBIDE-12479
Cache unique Path objects.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2012-09-21 00:21:33 UTC (rev 43892)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2012-09-21 00:26:12 UTC (rev 43893)
@@ -40,6 +40,7 @@
import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.util.UniquePaths;
import org.jboss.tools.common.validation.internal.ProjectValidationContext;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.BijectedAttributeType;
@@ -869,6 +870,7 @@
* @param source
*/
public void registerComponents(LoadedDeclarations ds, IPath source) {
+ source = UniquePaths.getInstance().intern(source);
boolean isThisProject = pathCheck.isThisProject(source);
ISeamNamespace[] ns = ds.getNamespaces().toArray(new ISeamNamespace[0]);
@@ -2522,7 +2524,7 @@
IFile f = path.segmentCount() < 2 ? null : ResourcesPlugin.getWorkspace().getRoot().getFile(path);
b = !(f != null && f.exists() && f.getProject() != project);
}
- paths.put(path, b);
+ paths.put(UniquePaths.getInstance().intern(path), b);
}
return b.booleanValue();
}
13 years, 6 months
JBoss Tools SVN: r43892 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-09-20 20:21:33 -0400 (Thu, 20 Sep 2012)
New Revision: 43892
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ModelTransfer.java
Log:
JBIDE-12648
https://issues.jboss.org/browse/JBIDE-12648
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ModelTransfer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ModelTransfer.java 2012-09-20 23:58:44 UTC (rev 43891)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ModelTransfer.java 2012-09-21 00:21:33 UTC (rev 43892)
@@ -33,9 +33,9 @@
}
protected void javaToNative (Object data, TransferData transferData){
- if (data == null) return;
+ if (!(data instanceof String)) return;
try {
- String realData = (String)data;
+ String realData = data.toString();
/// String[] realData = (String[])data;
ByteArrayOutputStream out = new ByteArrayOutputStream();
DataOutputStream dataOut = new DataOutputStream(out);
13 years, 6 months