JBoss Tools SVN: r6050 - trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-30 23:55:25 -0500 (Wed, 30 Jan 2008)
New Revision: 6050
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
Log:
missing test JBIDE1657Test has been commented
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:36:04 UTC (rev 6049)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 04:55:25 UTC (rev 6050)
@@ -24,7 +24,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.jboss.ide.eclipse.as.test.model.JBIDE1657Test;
+//import org.jboss.ide.eclipse.as.test.model.JBIDE1657Test;
import org.jboss.ide.eclipse.as.test.model.JEEClasspathContainerTest;
import org.jboss.ide.eclipse.as.test.model.ProjectRuntimeTest;
import org.jboss.ide.eclipse.as.test.model.RuntimeServerModelTest;
@@ -36,7 +36,7 @@
suite.addTestSuite(RuntimeServerModelTest.class);
suite.addTestSuite(JEEClasspathContainerTest.class);
suite.addTestSuite(ProjectRuntimeTest.class);
- suite.addTestSuite(JBIDE1657Test.class);
+ // suite.addTestSuite(JBIDE1657Test.class);
return suite;
}
16 years, 11 months
JBoss Tools SVN: r6049 - in trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test: model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-30 21:36:04 -0500 (Wed, 30 Jan 2008)
New Revision: 6049
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java
Log:
In progress / transition. lots of changes. more to follow
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:23:23 UTC (rev 6048)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:36:04 UTC (rev 6049)
@@ -21,13 +21,14 @@
*/
package org.jboss.ide.eclipse.as.test;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.ide.eclipse.as.test.model.JBIDE1657Test;
import org.jboss.ide.eclipse.as.test.model.JEEClasspathContainerTest;
import org.jboss.ide.eclipse.as.test.model.ProjectRuntimeTest;
import org.jboss.ide.eclipse.as.test.model.RuntimeServerModelTest;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
public class ASTestSuite extends TestSuite {
public static Test suite() {
TestSuite suite = new TestSuite("ASTools Test Suite");
@@ -35,6 +36,7 @@
suite.addTestSuite(RuntimeServerModelTest.class);
suite.addTestSuite(JEEClasspathContainerTest.class);
suite.addTestSuite(ProjectRuntimeTest.class);
+ suite.addTestSuite(JBIDE1657Test.class);
return suite;
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java 2008-01-31 02:23:23 UTC (rev 6048)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java 2008-01-31 02:36:04 UTC (rev 6049)
@@ -41,7 +41,7 @@
public class JEEClasspathContainerTest extends TestCase {
- private static final int ORIGINAL_ENTRIES = 3;
+ private static final int ORIGINAL_ENTRIES = 2;
private TestProjectProvider provider;
private IProject project;
@@ -52,7 +52,10 @@
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}
-
+ protected void tearDown() throws Exception {
+ provider.dispose();
+ }
+
public void testJEE13ClasspathContainer() {
testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.j2ee-1.3", 7);
}
@@ -100,7 +103,7 @@
protected void verifyRawClasspathCount(IJavaProject jproject, int count) throws JavaModelException {
IClasspathEntry[] projectEntry = jproject.getRawClasspath();
- assertEquals("Project should start with only 3 classpath entries", count, projectEntry.length);
+ assertEquals("Project should start with only " + count + " classpath entries", count, projectEntry.length);
}
protected void verifyNotIncludedEntry(IJavaProject jproject, IPath path) throws JavaModelException {
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java 2008-01-31 02:23:23 UTC (rev 6048)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java 2008-01-31 02:36:04 UTC (rev 6049)
@@ -78,31 +78,29 @@
protected void verifyPostRuntimeCPE(IJavaProject jp) throws CoreException {
IClasspathEntry[] entries = jp.getRawClasspath();
assertEquals(3, entries.length);
- String[] acceptable = new String[] { "org.eclipse.jst.server.core.container",
+ jp.getResolvedClasspath(false); // make sure it can resolve all
+ String[] required = new String[] { "org.eclipse.jst.server.core.container",
"basicwebproject", "org.eclipse.jst.j2ee.internal.web.container" };
- verifyClasspathEntries(entries, acceptable);
+ verifyClasspathEntries(entries, required);
}
protected void verifyInitialClasspathEntries(IJavaProject jp) throws CoreException {
IClasspathEntry[] entries = jp.getRawClasspath();
- assertEquals(2, entries.length);
-
- String[] acceptable = new String[] { "org.eclipse.jst.j2ee.internal.web.container",
- "basicwebproject"};
- verifyClasspathEntries(entries, acceptable);
+ jp.getResolvedClasspath(false); // make sure it can resolve all
+ String[] required = new String[] {
+ "org.eclipse.jst.j2ee.internal.web.container", "basicwebproject"};
+ verifyClasspathEntries(entries, required);
}
- protected void verifyClasspathEntries(IClasspathEntry[] entries, String[] acceptablePrefixes) {
- ArrayList list = new ArrayList(Arrays.asList(acceptablePrefixes));
+ protected void verifyClasspathEntries(IClasspathEntry[] entries, String[] required) {
+ ArrayList list = new ArrayList(Arrays.asList(required));
for( int i = 0; i < entries.length; i++ ) {
if( list.contains(entries[i].getPath().segment(0)))
list.remove(entries[i].getPath().segment(0));
- else
- fail("classpath contains unexpected entry: " + entries[i].getPath());
}
if( list.size() > 0 ) {
- String tmp = "Expected enties not found: ";
+ String tmp = "Required enties not found: ";
for( int i = 0; i < list.size(); i++ ) {
tmp += list.get(i) + ", ";
}
16 years, 11 months
JBoss Tools SVN: r6048 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-30 21:23:23 -0500 (Wed, 30 Jan 2008)
New Revision: 6048
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java
Log:
fix exception during JUnit tetsts
java.lang.IllegalStateException: Timer already cancelled.
at java.util.Timer.sched(Timer.java:354)
at java.util.Timer.schedule(Timer.java:170)
at org.jboss.tools.jst.jsp.support.kb.WTPTextJspKbConnector.invokeDelayedUpdateKnownTagLists(WTPTextJspKbConnector.java:185)
at org.jboss.tools.jst.jsp.support.kb.WTPTextJspKbConnector.<init>(WTPTextJspKbConnector.java:132)
at org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor.installActivePropmtSupport(JSPTextEditor.java:550)
at org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor.createPartControl(JSPTextEditor.java:262)
at org.jboss.tools.vpe.editor.VpeEditorPart.createPartControl(VpeEditorPart.java:500)
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java 2008-01-31 02:13:13 UTC (rev 6047)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java 2008-01-31 02:23:23 UTC (rev 6048)
@@ -182,7 +182,10 @@
private boolean taglibTrackerListenerInstalled = false;
public void invokeDelayedUpdateKnownTagLists() {
- timer.schedule(new MyTimerTask(), 500);
+ // Previous code is
+ // timer.schedule(new MyTimerTask(), 500);
+ initTaglibPrefixes();
+ updateKnownTagLists();
}
private boolean isTrackerToWatch(String trackerUri) {
@@ -219,30 +222,26 @@
}
public void taglibPrefixChanged(String[] prefixs) {
- try {
- trackers.clear();
- if(taglibManagerProvider==null || taglibManagerProvider.getTaglibManager()==null) {
- TLDCMDocumentManager manager = TaglibController.getTLDCMDocumentManager(fDocument);
- List list = manager.getTaglibTrackers();
- for(int i=0; i<list.size(); i++) {
- TaglibTracker tracker = (TaglibTracker)list.get(i);
- if (isTrackerToWatch(tracker.getURI())) {
- trackers.put(tracker.getPrefix(), tracker);
- }
+ trackers.clear();
+ if(taglibManagerProvider==null || taglibManagerProvider.getTaglibManager()==null) {
+ TLDCMDocumentManager manager = TaglibController.getTLDCMDocumentManager(fDocument);
+ List list = manager.getTaglibTrackers();
+ for(int i=0; i<list.size(); i++) {
+ TaglibTracker tracker = (TaglibTracker)list.get(i);
+ if (isTrackerToWatch(tracker.getURI())) {
+ trackers.put(tracker.getPrefix(), tracker);
}
- } else {
- List list = taglibManagerProvider.getTaglibManager().getTagLibs();
- for(int i=0; i<list.size(); i++) {
- TaglibData data = (TaglibData)list.get(i);
- if (isTrackerToWatch(data.getUri())) {
- trackers.put(data.getPrefix(), data);
- }
+ }
+ } else {
+ List list = taglibManagerProvider.getTaglibManager().getTagLibs();
+ for(int i=0; i<list.size(); i++) {
+ TaglibData data = (TaglibData)list.get(i);
+ if (isTrackerToWatch(data.getUri())) {
+ trackers.put(data.getPrefix(), data);
}
}
- invokeDelayedUpdateKnownTagLists();
- } catch (Exception x) {
- JspEditorPlugin.getPluginLog().logError("Error while processing change in taglib prefixes", x);
}
+ invokeDelayedUpdateKnownTagLists();
}
public void addTaglib(String uri, String prefix) {
@@ -359,7 +358,6 @@
}
public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index) {
- try {
switch (eventType) {
case INodeNotifier.ADD :
{
@@ -405,9 +403,6 @@
break;
}
}
- } catch (Exception x) {
- JspEditorPlugin.getPluginLog().logError("Error in JSF kb connector", x);
- }
invokeDelayedUpdateKnownTagLists();
}
}
16 years, 11 months
JBoss Tools SVN: r6047 - in trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test: model and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-30 21:13:13 -0500 (Wed, 30 Jan 2008)
New Revision: 6047
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StartupShutdownTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ProjectRuntimeUtil.java
Log:
In progress / transition. lots of changes. more to follow
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java 2008-01-31 02:11:13 UTC (rev 6046)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java 2008-01-31 02:13:13 UTC (rev 6047)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.test;
import org.eclipse.core.runtime.Plugin;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:11:13 UTC (rev 6046)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:13:13 UTC (rev 6047)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.test;
import org.jboss.ide.eclipse.as.test.model.JEEClasspathContainerTest;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java 2008-01-31 02:11:13 UTC (rev 6046)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java 2008-01-31 02:13:13 UTC (rev 6047)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.test.model;
import java.util.ArrayList;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java 2008-01-31 02:11:13 UTC (rev 6046)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java 2008-01-31 02:13:13 UTC (rev 6047)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.test.model;
import java.util.ArrayList;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java 2008-01-31 02:11:13 UTC (rev 6046)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java 2008-01-31 02:13:13 UTC (rev 6047)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.test.model;
import junit.framework.TestCase;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StartupShutdownTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StartupShutdownTest.java 2008-01-31 02:11:13 UTC (rev 6046)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StartupShutdownTest.java 2008-01-31 02:13:13 UTC (rev 6047)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.test.server;
import java.util.ArrayList;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ProjectRuntimeUtil.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ProjectRuntimeUtil.java 2008-01-31 02:11:13 UTC (rev 6046)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ProjectRuntimeUtil.java 2008-01-31 02:13:13 UTC (rev 6047)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.test.util;
import java.util.Collections;
16 years, 11 months
JBoss Tools SVN: r6045 - in trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as: test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-30 21:10:13 -0500 (Wed, 30 Jan 2008)
New Revision: 6045
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java
Removed:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JEEClasspathContainerTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ProjectRuntimeTest.java
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
Log:
In progress / transition. lots of changes. more to follow
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JEEClasspathContainerTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JEEClasspathContainerTest.java 2008-01-31 02:09:20 UTC (rev 6044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JEEClasspathContainerTest.java 2008-01-31 02:10:13 UTC (rev 6045)
@@ -1,107 +0,0 @@
-package org.jboss.ide.eclipse.as.classpath.test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.common.test.util.TestProjectProvider;
-
-public class JEEClasspathContainerTest extends TestCase {
-
- private static final int ORIGINAL_ENTRIES = 3;
-
- private TestProjectProvider provider;
- private IProject project;
-
- protected void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
- project = provider.getProject();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
-
-
- public void testJEE13ClasspathContainer() {
- testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.j2ee-1.3", 7);
- }
-
- public void testJEE14ClasspathContainer() {
- testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.j2ee-1.4", 8);
- }
-
- public void testJEE50ClasspathContainer() {
- testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.javaee-5.0", 1);
- }
-
-
- protected void testGenericClasspathContainer(String containerPath, int expectedEntries) {
- try {
- IJavaProject jproject = JavaCore.create(project);
- IPath path = new Path(containerPath);
- verifyContainerEntries(path, jproject, expectedEntries);
- verifyRawClasspathCount(jproject, ORIGINAL_ENTRIES);
- verifyNotIncludedEntry(jproject, path);
- int beforeRawCount = jproject.getRawClasspath().length;
- int beforeResolvedCount = jproject.getResolvedClasspath(true).length;
- addContainer(jproject, path);
- assertEquals(beforeRawCount+1, jproject.getRawClasspath().length);
- assertEquals(beforeResolvedCount+expectedEntries, jproject.getResolvedClasspath(true).length);
- beforeRawCount = jproject.getRawClasspath().length;
- beforeResolvedCount = jproject.getResolvedClasspath(true).length;
- removeContainer(jproject, path);
- assertEquals(beforeRawCount-1, jproject.getRawClasspath().length);
- assertEquals(beforeResolvedCount-expectedEntries, jproject.getResolvedClasspath(true).length);
-
- } catch( JavaModelException jme ) {
- fail("Exception: " + jme.getMessage());
- } catch( CoreException ce ) {
- fail("Exception: " + ce.getMessage());
- }
-
- }
-
- protected void verifyContainerEntries(IPath path, IJavaProject jproject, int expected) throws JavaModelException {
- IClasspathContainer cpc = JavaCore.getClasspathContainer(path, jproject);
- IClasspathEntry[] entries = cpc.getClasspathEntries();
- assertEquals("Received unexpected number of entries", expected, entries.length );
- }
-
- protected void verifyRawClasspathCount(IJavaProject jproject, int count) throws JavaModelException {
- IClasspathEntry[] projectEntry = jproject.getRawClasspath();
- assertEquals("Project should start with only 3 classpath entries", count, projectEntry.length);
- }
-
- protected void verifyNotIncludedEntry(IJavaProject jproject, IPath path) throws JavaModelException {
- IClasspathEntry[] projectEntry = jproject.getRawClasspath();
- for( int i = 0; i < projectEntry.length; i++ ) {
- if( projectEntry[i].getPath().toOSString().startsWith(path.toOSString())) {
- assertFalse("Project prematurely includes classpath", true);
- }
- }
- }
-
- protected void addContainer(IJavaProject jproject, IPath path) throws JavaModelException {
- ArrayList tmp = new ArrayList();
- tmp.addAll(Arrays.asList(jproject.getRawClasspath()));
- tmp.add(JavaCore.newContainerEntry(path));
- jproject.setRawClasspath((IClasspathEntry[]) tmp.toArray(new IClasspathEntry[tmp.size()]), null);
- }
-
- protected void removeContainer(IJavaProject jproject, IPath path) throws JavaModelException {
- ArrayList tmp = new ArrayList();
- tmp.addAll(Arrays.asList(jproject.getRawClasspath()));
- tmp.remove(JavaCore.newContainerEntry(path));
- jproject.setRawClasspath((IClasspathEntry[]) tmp.toArray(new IClasspathEntry[tmp.size()]), null);
- }
-}
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ProjectRuntimeTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ProjectRuntimeTest.java 2008-01-31 02:09:20 UTC (rev 6044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ProjectRuntimeTest.java 2008-01-31 02:10:13 UTC (rev 6045)
@@ -1,91 +0,0 @@
-package org.jboss.ide.eclipse.as.classpath.test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.wst.server.core.IRuntime;
-import org.jboss.ide.eclipse.as.test.ASTest;
-import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
-import org.jboss.tools.common.test.util.TestProjectProvider;
-
-public class ProjectRuntimeTest extends TestCase {
- private TestProjectProvider provider;
- private IProject project;
-
- protected void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
- project = provider.getProject();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
-
- protected void tearDown() throws Exception {
- provider.dispose();
- }
-
- public void testProjectRuntime() {
- try {
- IJavaProject jp = JavaCore.create(project);
- verifyInitialClasspathEntries(jp);
-
- // lets try a runtime
- IRuntime createdRuntime = ProjectRuntimeUtil.createRuntime("runtime1", ASTest.JBOSS_RUNTIME_42, ASTest.JBOSS_AS_HOME);
- ProjectRuntimeUtil.setTargetRuntime(createdRuntime, project);
- verifyPostRuntimeCPE(jp);
-
- ProjectRuntimeUtil.clearRuntime(project);
- verifyInitialClasspathEntries(jp);
-
- } catch( JavaModelException jme ) {
- jme.printStackTrace();
- fail(jme.getMessage());
- } catch( CoreException ce ) {
- ce.printStackTrace();
- fail(ce.getMessage());
- }
- }
-
- protected void verifyPostRuntimeCPE(IJavaProject jp) throws CoreException {
- IClasspathEntry[] entries = jp.getRawClasspath();
- assertEquals(3, entries.length);
- String[] acceptable = new String[] { "org.eclipse.jst.server.core.container",
- "basicwebproject", "org.eclipse.jst.j2ee.internal.web.container" };
- verifyClasspathEntries(entries, acceptable);
- }
-
- protected void verifyInitialClasspathEntries(IJavaProject jp) throws CoreException {
- IClasspathEntry[] entries = jp.getRawClasspath();
- assertEquals(2, entries.length);
-
- String[] acceptable = new String[] { "org.eclipse.jst.j2ee.internal.web.container",
- "basicwebproject"};
- verifyClasspathEntries(entries, acceptable);
- }
-
- protected void verifyClasspathEntries(IClasspathEntry[] entries, String[] acceptablePrefixes) {
- ArrayList list = new ArrayList(Arrays.asList(acceptablePrefixes));
- for( int i = 0; i < entries.length; i++ ) {
- if( list.contains(entries[i].getPath().segment(0)))
- list.remove(entries[i].getPath().segment(0));
- else
- fail("classpath contains unexpected entry: " + entries[i].getPath());
- }
-
- if( list.size() > 0 ) {
- String tmp = "Expected enties not found: ";
- for( int i = 0; i < list.size(); i++ ) {
- tmp += list.get(i) + ", ";
- }
- fail(tmp.substring(0, tmp.length() - 2));
- }
- }
-}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:09:20 UTC (rev 6044)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:10:13 UTC (rev 6045)
@@ -1,7 +1,7 @@
package org.jboss.ide.eclipse.as.test;
-import org.jboss.ide.eclipse.as.classpath.test.ProjectRuntimeTest;
-import org.jboss.ide.eclipse.as.classpath.test.JEEClasspathContainerTest;
+import org.jboss.ide.eclipse.as.test.model.JEEClasspathContainerTest;
+import org.jboss.ide.eclipse.as.test.model.ProjectRuntimeTest;
import org.jboss.ide.eclipse.as.test.model.RuntimeServerModelTest;
import junit.framework.Test;
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java (from rev 5678, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JEEClasspathContainerTest.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java 2008-01-31 02:10:13 UTC (rev 6045)
@@ -0,0 +1,107 @@
+package org.jboss.ide.eclipse.as.test.model;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+public class JEEClasspathContainerTest extends TestCase {
+
+ private static final int ORIGINAL_ENTRIES = 3;
+
+ private TestProjectProvider provider;
+ private IProject project;
+
+ protected void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
+ project = provider.getProject();
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+
+
+ public void testJEE13ClasspathContainer() {
+ testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.j2ee-1.3", 7);
+ }
+
+ public void testJEE14ClasspathContainer() {
+ testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.j2ee-1.4", 8);
+ }
+
+ public void testJEE50ClasspathContainer() {
+ testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.javaee-5.0", 1);
+ }
+
+
+ protected void testGenericClasspathContainer(String containerPath, int expectedEntries) {
+ try {
+ IJavaProject jproject = JavaCore.create(project);
+ IPath path = new Path(containerPath);
+ verifyContainerEntries(path, jproject, expectedEntries);
+ verifyRawClasspathCount(jproject, ORIGINAL_ENTRIES);
+ verifyNotIncludedEntry(jproject, path);
+ int beforeRawCount = jproject.getRawClasspath().length;
+ int beforeResolvedCount = jproject.getResolvedClasspath(true).length;
+ addContainer(jproject, path);
+ assertEquals(beforeRawCount+1, jproject.getRawClasspath().length);
+ assertEquals(beforeResolvedCount+expectedEntries, jproject.getResolvedClasspath(true).length);
+ beforeRawCount = jproject.getRawClasspath().length;
+ beforeResolvedCount = jproject.getResolvedClasspath(true).length;
+ removeContainer(jproject, path);
+ assertEquals(beforeRawCount-1, jproject.getRawClasspath().length);
+ assertEquals(beforeResolvedCount-expectedEntries, jproject.getResolvedClasspath(true).length);
+
+ } catch( JavaModelException jme ) {
+ fail("Exception: " + jme.getMessage());
+ } catch( CoreException ce ) {
+ fail("Exception: " + ce.getMessage());
+ }
+
+ }
+
+ protected void verifyContainerEntries(IPath path, IJavaProject jproject, int expected) throws JavaModelException {
+ IClasspathContainer cpc = JavaCore.getClasspathContainer(path, jproject);
+ IClasspathEntry[] entries = cpc.getClasspathEntries();
+ assertEquals("Received unexpected number of entries", expected, entries.length );
+ }
+
+ protected void verifyRawClasspathCount(IJavaProject jproject, int count) throws JavaModelException {
+ IClasspathEntry[] projectEntry = jproject.getRawClasspath();
+ assertEquals("Project should start with only 3 classpath entries", count, projectEntry.length);
+ }
+
+ protected void verifyNotIncludedEntry(IJavaProject jproject, IPath path) throws JavaModelException {
+ IClasspathEntry[] projectEntry = jproject.getRawClasspath();
+ for( int i = 0; i < projectEntry.length; i++ ) {
+ if( projectEntry[i].getPath().toOSString().startsWith(path.toOSString())) {
+ assertFalse("Project prematurely includes classpath", true);
+ }
+ }
+ }
+
+ protected void addContainer(IJavaProject jproject, IPath path) throws JavaModelException {
+ ArrayList tmp = new ArrayList();
+ tmp.addAll(Arrays.asList(jproject.getRawClasspath()));
+ tmp.add(JavaCore.newContainerEntry(path));
+ jproject.setRawClasspath((IClasspathEntry[]) tmp.toArray(new IClasspathEntry[tmp.size()]), null);
+ }
+
+ protected void removeContainer(IJavaProject jproject, IPath path) throws JavaModelException {
+ ArrayList tmp = new ArrayList();
+ tmp.addAll(Arrays.asList(jproject.getRawClasspath()));
+ tmp.remove(JavaCore.newContainerEntry(path));
+ jproject.setRawClasspath((IClasspathEntry[]) tmp.toArray(new IClasspathEntry[tmp.size()]), null);
+ }
+}
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java (from rev 6044, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ProjectRuntimeTest.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java 2008-01-31 02:10:13 UTC (rev 6045)
@@ -0,0 +1,91 @@
+package org.jboss.ide.eclipse.as.test.model;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.wst.server.core.IRuntime;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+public class ProjectRuntimeTest extends TestCase {
+ private TestProjectProvider provider;
+ private IProject project;
+
+ protected void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
+ project = provider.getProject();
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+
+ protected void tearDown() throws Exception {
+ provider.dispose();
+ }
+
+ public void testProjectRuntime() {
+ try {
+ IJavaProject jp = JavaCore.create(project);
+ verifyInitialClasspathEntries(jp);
+
+ // lets try a runtime
+ IRuntime createdRuntime = ProjectRuntimeUtil.createRuntime("runtime1", ASTest.JBOSS_RUNTIME_42, ASTest.JBOSS_AS_HOME);
+ ProjectRuntimeUtil.setTargetRuntime(createdRuntime, project);
+ verifyPostRuntimeCPE(jp);
+
+ ProjectRuntimeUtil.clearRuntime(project);
+ verifyInitialClasspathEntries(jp);
+
+ } catch( JavaModelException jme ) {
+ jme.printStackTrace();
+ fail(jme.getMessage());
+ } catch( CoreException ce ) {
+ ce.printStackTrace();
+ fail(ce.getMessage());
+ }
+ }
+
+ protected void verifyPostRuntimeCPE(IJavaProject jp) throws CoreException {
+ IClasspathEntry[] entries = jp.getRawClasspath();
+ assertEquals(3, entries.length);
+ String[] acceptable = new String[] { "org.eclipse.jst.server.core.container",
+ "basicwebproject", "org.eclipse.jst.j2ee.internal.web.container" };
+ verifyClasspathEntries(entries, acceptable);
+ }
+
+ protected void verifyInitialClasspathEntries(IJavaProject jp) throws CoreException {
+ IClasspathEntry[] entries = jp.getRawClasspath();
+ assertEquals(2, entries.length);
+
+ String[] acceptable = new String[] { "org.eclipse.jst.j2ee.internal.web.container",
+ "basicwebproject"};
+ verifyClasspathEntries(entries, acceptable);
+ }
+
+ protected void verifyClasspathEntries(IClasspathEntry[] entries, String[] acceptablePrefixes) {
+ ArrayList list = new ArrayList(Arrays.asList(acceptablePrefixes));
+ for( int i = 0; i < entries.length; i++ ) {
+ if( list.contains(entries[i].getPath().segment(0)))
+ list.remove(entries[i].getPath().segment(0));
+ else
+ fail("classpath contains unexpected entry: " + entries[i].getPath());
+ }
+
+ if( list.size() > 0 ) {
+ String tmp = "Expected enties not found: ";
+ for( int i = 0; i < list.size(); i++ ) {
+ tmp += list.get(i) + ", ";
+ }
+ fail(tmp.substring(0, tmp.length() - 2));
+ }
+ }
+}
16 years, 11 months
JBoss Tools SVN: r6044 - in trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as: test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-30 21:09:20 -0500 (Wed, 30 Jan 2008)
New Revision: 6044
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ProjectRuntimeTest.java
Removed:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JBIDE1657Test.java
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java
Log:
In progress / transition. lots of changes. more to follow
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JBIDE1657Test.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JBIDE1657Test.java 2008-01-31 02:06:39 UTC (rev 6043)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JBIDE1657Test.java 2008-01-31 02:09:20 UTC (rev 6044)
@@ -1,94 +0,0 @@
-package org.jboss.ide.eclipse.as.classpath.test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.wst.server.core.IRuntime;
-import org.jboss.ide.eclipse.as.test.ASTest;
-import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
-import org.jboss.tools.common.test.util.TestProjectProvider;
-
-public class JBIDE1657Test extends TestCase {
- private TestProjectProvider provider;
- private IProject project;
-
- protected void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
- project = provider.getProject();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
-
- protected void tearDown() throws Exception {
- provider.dispose();
- }
-
- public void testJBIDE1657() {
- try {
- IJavaProject jp = JavaCore.create(project);
- verifyInitialClasspathEntries(jp);
-
- // lets try a runtime
- IRuntime createdRuntime = ProjectRuntimeUtil.createRuntime("runtime1", ASTest.JBOSS_RUNTIME_42, ASTest.JBOSS_AS_HOME);
- ProjectRuntimeUtil.setTargetRuntime(createdRuntime, project);
- verifyPostRuntimeCPE(jp);
-
- ProjectRuntimeUtil.clearRuntime(project);
- verifyInitialClasspathEntries(jp);
-
- } catch( JavaModelException jme ) {
- jme.printStackTrace();
- fail(jme.getMessage());
- } catch( CoreException ce ) {
- ce.printStackTrace();
- fail(ce.getMessage());
- }
- }
-
- protected void verifyPostRuntimeCPE(IJavaProject jp) throws CoreException {
- IClasspathEntry[] entries = jp.getRawClasspath();
- assertEquals(3, entries.length);
- String[] acceptable = new String[] { "org.eclipse.jst.server.core.container",
- "basicwebproject", "org.eclipse.jst.j2ee.internal.web.container" };
- verifyClasspathEntries(entries, acceptable);
- }
-
- protected void verifyInitialClasspathEntries(IJavaProject jp) throws CoreException {
- IClasspathEntry[] entries = jp.getRawClasspath();
- assertEquals(2, entries.length);
-
- // TODO: Currently fails because the JRE is not bound. This must be changed.
- //IClasspathEntry[] resolved = jp.getResolvedClasspath(false);
-
- String[] acceptable = new String[] { "org.eclipse.jst.j2ee.internal.web.container",
- "basicwebproject"};
- verifyClasspathEntries(entries, acceptable);
- }
-
- protected void verifyClasspathEntries(IClasspathEntry[] entries, String[] acceptablePrefixes) {
- ArrayList list = new ArrayList(Arrays.asList(acceptablePrefixes));
- for( int i = 0; i < entries.length; i++ ) {
- if( list.contains(entries[i].getPath().segment(0)))
- list.remove(entries[i].getPath().segment(0));
- else
- fail("classpath contains unexpected entry: " + entries[i].getPath());
- }
-
- if( list.size() > 0 ) {
- String tmp = "Expected enties not found: ";
- for( int i = 0; i < list.size(); i++ ) {
- tmp += list.get(i) + ", ";
- }
- fail(tmp.substring(0, tmp.length() - 2));
- }
- }
-}
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ProjectRuntimeTest.java (from rev 6042, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JBIDE1657Test.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ProjectRuntimeTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ProjectRuntimeTest.java 2008-01-31 02:09:20 UTC (rev 6044)
@@ -0,0 +1,91 @@
+package org.jboss.ide.eclipse.as.classpath.test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.wst.server.core.IRuntime;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+public class ProjectRuntimeTest extends TestCase {
+ private TestProjectProvider provider;
+ private IProject project;
+
+ protected void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
+ project = provider.getProject();
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+
+ protected void tearDown() throws Exception {
+ provider.dispose();
+ }
+
+ public void testProjectRuntime() {
+ try {
+ IJavaProject jp = JavaCore.create(project);
+ verifyInitialClasspathEntries(jp);
+
+ // lets try a runtime
+ IRuntime createdRuntime = ProjectRuntimeUtil.createRuntime("runtime1", ASTest.JBOSS_RUNTIME_42, ASTest.JBOSS_AS_HOME);
+ ProjectRuntimeUtil.setTargetRuntime(createdRuntime, project);
+ verifyPostRuntimeCPE(jp);
+
+ ProjectRuntimeUtil.clearRuntime(project);
+ verifyInitialClasspathEntries(jp);
+
+ } catch( JavaModelException jme ) {
+ jme.printStackTrace();
+ fail(jme.getMessage());
+ } catch( CoreException ce ) {
+ ce.printStackTrace();
+ fail(ce.getMessage());
+ }
+ }
+
+ protected void verifyPostRuntimeCPE(IJavaProject jp) throws CoreException {
+ IClasspathEntry[] entries = jp.getRawClasspath();
+ assertEquals(3, entries.length);
+ String[] acceptable = new String[] { "org.eclipse.jst.server.core.container",
+ "basicwebproject", "org.eclipse.jst.j2ee.internal.web.container" };
+ verifyClasspathEntries(entries, acceptable);
+ }
+
+ protected void verifyInitialClasspathEntries(IJavaProject jp) throws CoreException {
+ IClasspathEntry[] entries = jp.getRawClasspath();
+ assertEquals(2, entries.length);
+
+ String[] acceptable = new String[] { "org.eclipse.jst.j2ee.internal.web.container",
+ "basicwebproject"};
+ verifyClasspathEntries(entries, acceptable);
+ }
+
+ protected void verifyClasspathEntries(IClasspathEntry[] entries, String[] acceptablePrefixes) {
+ ArrayList list = new ArrayList(Arrays.asList(acceptablePrefixes));
+ for( int i = 0; i < entries.length; i++ ) {
+ if( list.contains(entries[i].getPath().segment(0)))
+ list.remove(entries[i].getPath().segment(0));
+ else
+ fail("classpath contains unexpected entry: " + entries[i].getPath());
+ }
+
+ if( list.size() > 0 ) {
+ String tmp = "Expected enties not found: ";
+ for( int i = 0; i < list.size(); i++ ) {
+ tmp += list.get(i) + ", ";
+ }
+ fail(tmp.substring(0, tmp.length() - 2));
+ }
+ }
+}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:06:39 UTC (rev 6043)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:09:20 UTC (rev 6044)
@@ -1,6 +1,6 @@
package org.jboss.ide.eclipse.as.test;
-import org.jboss.ide.eclipse.as.classpath.test.JBIDE1657Test;
+import org.jboss.ide.eclipse.as.classpath.test.ProjectRuntimeTest;
import org.jboss.ide.eclipse.as.classpath.test.JEEClasspathContainerTest;
import org.jboss.ide.eclipse.as.test.model.RuntimeServerModelTest;
@@ -13,7 +13,7 @@
suite.addTestSuite(RuntimeServerModelTest.class);
suite.addTestSuite(JEEClasspathContainerTest.class);
- suite.addTestSuite(JBIDE1657Test.class);
+ suite.addTestSuite(ProjectRuntimeTest.class);
return suite;
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java 2008-01-31 02:06:39 UTC (rev 6043)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java 2008-01-31 02:09:20 UTC (rev 6044)
@@ -12,7 +12,7 @@
import org.jboss.ide.eclipse.as.test.ASTest;
public class RuntimeServerModelTest extends TestCase {
-
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=201340
// skipped since reported issue and always failing
public void skip_testDoubleCreateEclipseBug201340() throws CoreException {
16 years, 11 months
JBoss Tools SVN: r6043 - in trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as: test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-30 21:06:39 -0500 (Wed, 30 Jan 2008)
New Revision: 6043
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java
Removed:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
Log:
In proigress / transition. lots of changes. more to follow
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java 2008-01-31 02:04:50 UTC (rev 6042)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java 2008-01-31 02:06:39 UTC (rev 6043)
@@ -1,51 +0,0 @@
-package org.jboss.ide.eclipse.as.classpath.test;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.jboss.ide.eclipse.as.test.ASTest;
-
-public class ASClasspathTest extends TestCase {
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=201340
- // skipped since reported issue and always failing
- public void skip_testDoubleCreateEclipseBug201340() throws CoreException {
- createGenericRuntime(ASTest.TOMCAT_RUNTIME_55);
- createGenericRuntime(ASTest.JBOSS_RUNTIME_42);
- }
-
- private IRuntime[] createGenericRuntime(String runtimeId) throws CoreException {
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, runtimeId);
- assertEquals("expects only one runtime type", runtimeTypes.length, 1);
-
- IRuntimeType runtimeType = runtimeTypes[0];
-
- IRuntimeWorkingCopy firstRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
- IRuntime savedRuntime = firstRuntime.save(true, new NullProgressMonitor());
-
- IRuntimeWorkingCopy secondRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
- IRuntime secondSavedRuntime = secondRuntime.save(true, new NullProgressMonitor());
-
- assertEquals(savedRuntime.getName(), secondSavedRuntime.getName());
- assertNotSame(savedRuntime, secondSavedRuntime);
- assertFalse("Why are two different runtimes " + runtimeId + " created with the same ID ?!", savedRuntime.getId().equals(secondSavedRuntime.getId()));
- return new IRuntime[] { savedRuntime, secondSavedRuntime };
- }
-
- public void testCreateBrokenServer() throws CoreException {
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ASTest.JBOSS_RUNTIME_42);
- assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
- IRuntimeType runtimeType = runtimeTypes[0];
- IRuntimeWorkingCopy jbossRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
- IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
- assertEquals("Neither vm install nor configuration is set - should not be able to validate",savedRuntime.validate(null).getSeverity(), Status.ERROR);
- }
-
-
-}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:04:50 UTC (rev 6042)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:06:39 UTC (rev 6043)
@@ -1,8 +1,8 @@
package org.jboss.ide.eclipse.as.test;
-import org.jboss.ide.eclipse.as.classpath.test.ASClasspathTest;
import org.jboss.ide.eclipse.as.classpath.test.JBIDE1657Test;
import org.jboss.ide.eclipse.as.classpath.test.JEEClasspathContainerTest;
+import org.jboss.ide.eclipse.as.test.model.RuntimeServerModelTest;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -11,7 +11,7 @@
public static Test suite() {
TestSuite suite = new TestSuite("ASTools Test Suite");
- suite.addTestSuite(ASClasspathTest.class);
+ suite.addTestSuite(RuntimeServerModelTest.class);
suite.addTestSuite(JEEClasspathContainerTest.class);
suite.addTestSuite(JBIDE1657Test.class);
return suite;
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java 2008-01-31 02:06:39 UTC (rev 6043)
@@ -0,0 +1,51 @@
+package org.jboss.ide.eclipse.as.test.model;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.jboss.ide.eclipse.as.test.ASTest;
+
+public class RuntimeServerModelTest extends TestCase {
+
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=201340
+ // skipped since reported issue and always failing
+ public void skip_testDoubleCreateEclipseBug201340() throws CoreException {
+ createGenericRuntime(ASTest.TOMCAT_RUNTIME_55);
+ createGenericRuntime(ASTest.JBOSS_RUNTIME_42);
+ }
+
+ private IRuntime[] createGenericRuntime(String runtimeId) throws CoreException {
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, runtimeId);
+ assertEquals("expects only one runtime type", runtimeTypes.length, 1);
+
+ IRuntimeType runtimeType = runtimeTypes[0];
+
+ IRuntimeWorkingCopy firstRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
+ IRuntime savedRuntime = firstRuntime.save(true, new NullProgressMonitor());
+
+ IRuntimeWorkingCopy secondRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
+ IRuntime secondSavedRuntime = secondRuntime.save(true, new NullProgressMonitor());
+
+ assertEquals(savedRuntime.getName(), secondSavedRuntime.getName());
+ assertNotSame(savedRuntime, secondSavedRuntime);
+ assertFalse("Why are two different runtimes " + runtimeId + " created with the same ID ?!", savedRuntime.getId().equals(secondSavedRuntime.getId()));
+ return new IRuntime[] { savedRuntime, secondSavedRuntime };
+ }
+
+ public void testCreateBrokenServer() throws CoreException {
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ASTest.JBOSS_RUNTIME_42);
+ assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
+ IRuntimeType runtimeType = runtimeTypes[0];
+ IRuntimeWorkingCopy jbossRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
+ IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
+ assertEquals("Neither vm install nor configuration is set - should not be able to validate",savedRuntime.validate(null).getSeverity(), Status.ERROR);
+ }
+
+
+}
16 years, 11 months
JBoss Tools SVN: r6042 - in trunk/as/tests/org.jboss.ide.eclipse.as.test: projects/basicwebproject/.settings and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-30 21:04:50 -0500 (Wed, 30 Jan 2008)
New Revision: 6042
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JBIDE1657Test.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ProjectRuntimeUtil.java
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/basicwebproject/.classpath
trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/basicwebproject/.settings/org.eclipse.jst.common.project.facet.core.prefs
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StartupShutdownTest.java
Log:
In proigress / transition. lots of changes. more to follow
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/basicwebproject/.classpath
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/basicwebproject/.classpath 2008-01-30 20:59:43 UTC (rev 6041)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/basicwebproject/.classpath 2008-01-31 02:04:50 UTC (rev 6042)
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.5.0_12"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/basicwebproject/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/basicwebproject/.settings/org.eclipse.jst.common.project.facet.core.prefs 2008-01-30 20:59:43 UTC (rev 6041)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/basicwebproject/.settings/org.eclipse.jst.common.project.facet.core.prefs 2008-01-31 02:04:50 UTC (rev 6042)
@@ -1,3 +1,2 @@
#Mon Aug 27 15:45:43 CEST 2007
-classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:jdk1.5.0_12/owners=jst.java\:5.0
eclipse.preferences.version=1
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java 2008-01-30 20:59:43 UTC (rev 6041)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java 2008-01-31 02:04:50 UTC (rev 6042)
@@ -1,57 +1,23 @@
package org.jboss.ide.eclipse.as.classpath.test;
-import java.util.HashSet;
-
import junit.framework.TestCase;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.ide.eclipse.as.test.ASTest;
public class ASClasspathTest extends TestCase {
-
-
- private static final String ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42 = "org.jboss.ide.eclipse.as.runtime.42";
-
- private static final String JBOSS_AS_HOME = System.getProperty("jbosstools.test.jboss.home", "/home/max/rhdevstudio/jboss-eap/jboss-as");
-
- private TestProjectProvider provider;
- private IProject project;
-
- protected void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
- project = provider.getProject();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
-
-
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=201340
// skipped since reported issue and always failing
public void skip_testDoubleCreateEclipseBug201340() throws CoreException {
-
- createGenericRuntime("org.eclipse.jst.server.tomcat.runtime.55");
-
- createGenericRuntime(ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42);
-
-
+ createGenericRuntime(ASTest.TOMCAT_RUNTIME_55);
+ createGenericRuntime(ASTest.JBOSS_RUNTIME_42);
}
private IRuntime[] createGenericRuntime(String runtimeId) throws CoreException {
@@ -71,94 +37,15 @@
assertFalse("Why are two different runtimes " + runtimeId + " created with the same ID ?!", savedRuntime.getId().equals(secondSavedRuntime.getId()));
return new IRuntime[] { savedRuntime, secondSavedRuntime };
}
- public void testCreateBrokenServer() throws CoreException {
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42);
+ public void testCreateBrokenServer() throws CoreException {
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ASTest.JBOSS_RUNTIME_42);
assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
-
IRuntimeType runtimeType = runtimeTypes[0];
-
IRuntimeWorkingCopy jbossRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
-
IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
-
assertEquals("Neither vm install nor configuration is set - should not be able to validate",savedRuntime.validate(null).getSeverity(), Status.ERROR);
-
-
}
- // see JBIDE-1355 why this is skipped
- public void skip_testClasspathAvailable() throws CoreException {
- // Weirdness: If this method is the only to run everything works as expected.
-
- IJavaProject javaProject = JavaCore.create(project);
- assertTrue(javaProject.exists());
-
- String id = "cp-runtime";
- IRuntime createdRuntime = createRuntime(id);
- setTargetRuntime(createdRuntime, project);
-
- //assertEquals(createdRuntime.getId(), "cp-runtime");
-
-
-
- IClasspathEntry paths[] = javaProject.getRawClasspath();
- boolean found = false;
- for (int i = 0; i < paths.length; i++) {
- IClasspathEntry classpathEntry = paths[i];
-
- if(classpathEntry.getPath().toString().equals("org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer/" + id)) {
- IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), javaProject);
- assertEquals("container not returning userclasses!", container.getKind(), container.K_APPLICATION);
- found = true;
- }
- }
- assertTrue("could not find jboss as specific entry in raw classpath", found);
-
- IClasspathEntry[] resolvedClasspath = javaProject.getResolvedClasspath(false);
-
- boolean jsfFound = false;
- for (int i = 0; i < resolvedClasspath.length; i++) {
- IClasspathEntry classpathEntry = resolvedClasspath[i];
- if(classpathEntry.getPath().toString().contains("jsf")) {
- System.out.println(classpathEntry);
- jsfFound = true;
- }
-
- }
- assertTrue("jsf lib not found!", jsfFound);
-
-
- }
- private void setTargetRuntime(IRuntime runtime, IProject theProject) throws CoreException {
-
- final org.eclipse.wst.common.project.facet.core.runtime.IRuntime facetRuntime = RuntimeManager.getRuntime(runtime.getId());
-
- assertNotNull("bridged facet runtime not found", facetRuntime);
-
- IFacetedProject facetedProject = ProjectFacetsManager.create(theProject);
-
- facetedProject.setTargetedRuntimes(new HashSet<org.eclipse.wst.common.project.facet.core.runtime.IRuntime>() { { this.add(facetRuntime);}}, null);
- facetedProject.setPrimaryRuntime(facetRuntime, null);
-
- }
-
- private IRuntime createRuntime(String runtimeName) throws CoreException {
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42);
- assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
-
- IRuntimeType runtimeType = runtimeTypes[0];
-
- RuntimeWorkingCopy jbossRuntime = (RuntimeWorkingCopy)runtimeType.createRuntime(runtimeName, new NullProgressMonitor());
-
- jbossRuntime.setLocation(new Path(JBOSS_AS_HOME));
- jbossRuntime.setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, "default");
- IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
-
- assertEquals(savedRuntime.validate(null).getCode(), Status.OK);
-
- return savedRuntime;
- }
-
}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JBIDE1657Test.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JBIDE1657Test.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/JBIDE1657Test.java 2008-01-31 02:04:50 UTC (rev 6042)
@@ -0,0 +1,94 @@
+package org.jboss.ide.eclipse.as.classpath.test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.wst.server.core.IRuntime;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+public class JBIDE1657Test extends TestCase {
+ private TestProjectProvider provider;
+ private IProject project;
+
+ protected void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
+ project = provider.getProject();
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+
+ protected void tearDown() throws Exception {
+ provider.dispose();
+ }
+
+ public void testJBIDE1657() {
+ try {
+ IJavaProject jp = JavaCore.create(project);
+ verifyInitialClasspathEntries(jp);
+
+ // lets try a runtime
+ IRuntime createdRuntime = ProjectRuntimeUtil.createRuntime("runtime1", ASTest.JBOSS_RUNTIME_42, ASTest.JBOSS_AS_HOME);
+ ProjectRuntimeUtil.setTargetRuntime(createdRuntime, project);
+ verifyPostRuntimeCPE(jp);
+
+ ProjectRuntimeUtil.clearRuntime(project);
+ verifyInitialClasspathEntries(jp);
+
+ } catch( JavaModelException jme ) {
+ jme.printStackTrace();
+ fail(jme.getMessage());
+ } catch( CoreException ce ) {
+ ce.printStackTrace();
+ fail(ce.getMessage());
+ }
+ }
+
+ protected void verifyPostRuntimeCPE(IJavaProject jp) throws CoreException {
+ IClasspathEntry[] entries = jp.getRawClasspath();
+ assertEquals(3, entries.length);
+ String[] acceptable = new String[] { "org.eclipse.jst.server.core.container",
+ "basicwebproject", "org.eclipse.jst.j2ee.internal.web.container" };
+ verifyClasspathEntries(entries, acceptable);
+ }
+
+ protected void verifyInitialClasspathEntries(IJavaProject jp) throws CoreException {
+ IClasspathEntry[] entries = jp.getRawClasspath();
+ assertEquals(2, entries.length);
+
+ // TODO: Currently fails because the JRE is not bound. This must be changed.
+ //IClasspathEntry[] resolved = jp.getResolvedClasspath(false);
+
+ String[] acceptable = new String[] { "org.eclipse.jst.j2ee.internal.web.container",
+ "basicwebproject"};
+ verifyClasspathEntries(entries, acceptable);
+ }
+
+ protected void verifyClasspathEntries(IClasspathEntry[] entries, String[] acceptablePrefixes) {
+ ArrayList list = new ArrayList(Arrays.asList(acceptablePrefixes));
+ for( int i = 0; i < entries.length; i++ ) {
+ if( list.contains(entries[i].getPath().segment(0)))
+ list.remove(entries[i].getPath().segment(0));
+ else
+ fail("classpath contains unexpected entry: " + entries[i].getPath());
+ }
+
+ if( list.size() > 0 ) {
+ String tmp = "Expected enties not found: ";
+ for( int i = 0; i < list.size(); i++ ) {
+ tmp += list.get(i) + ", ";
+ }
+ fail(tmp.substring(0, tmp.length() - 2));
+ }
+ }
+}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java 2008-01-30 20:59:43 UTC (rev 6041)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java 2008-01-31 02:04:50 UTC (rev 6042)
@@ -47,4 +47,19 @@
return plugin;
}
+
+
+ // set some constants for wide-use
+ public static final String TOMCAT_RUNTIME_55 = "org.eclipse.jst.server.tomcat.runtime.55";
+ public static final String JBOSS_RUNTIME_32 = "org.jboss.ide.eclipse.as.runtime.32";
+ public static final String JBOSS_RUNTIME_40 = "org.jboss.ide.eclipse.as.runtime.40";
+ public static final String JBOSS_RUNTIME_42 = "org.jboss.ide.eclipse.as.runtime.42";
+ public static final String JBOSS_SERVER_32 = "org.jboss.ide.eclipse.as.32";
+ public static final String JBOSS_SERVER_40 = "org.jboss.ide.eclipse.as.40";
+ public static final String JBOSS_SERVER_42 = "org.jboss.ide.eclipse.as.42";
+ public static final String JBOSS_AS_32_HOME = System.getProperty("jbosstools.test.jboss.home.3.2", "C:\\apps\\jboss\\jboss-3.2.8.SP1\\");
+ public static final String JBOSS_AS_40_HOME = System.getProperty("jbosstools.test.jboss.home.4.0", "C:\\apps\\jboss\\jboss-4.0.5.GA\\");
+ public static final String JBOSS_AS_42_HOME = System.getProperty("jbosstools.test.jboss.home.4.2", "C:\\apps\\jboss\\jboss-4.2.1.GA\\");
+
+ public static final String JBOSS_AS_HOME = System.getProperty("jbosstools.test.jboss.home", JBOSS_AS_42_HOME);
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-30 20:59:43 UTC (rev 6041)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-31 02:04:50 UTC (rev 6042)
@@ -1,6 +1,7 @@
package org.jboss.ide.eclipse.as.test;
import org.jboss.ide.eclipse.as.classpath.test.ASClasspathTest;
+import org.jboss.ide.eclipse.as.classpath.test.JBIDE1657Test;
import org.jboss.ide.eclipse.as.classpath.test.JEEClasspathContainerTest;
import junit.framework.Test;
@@ -8,10 +9,11 @@
public class ASTestSuite extends TestSuite {
public static Test suite() {
- TestSuite suite = new TestSuite("Archives Tests");
+ TestSuite suite = new TestSuite("ASTools Test Suite");
suite.addTestSuite(ASClasspathTest.class);
suite.addTestSuite(JEEClasspathContainerTest.class);
+ suite.addTestSuite(JBIDE1657Test.class);
return suite;
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StartupShutdownTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StartupShutdownTest.java 2008-01-30 20:59:43 UTC (rev 6041)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StartupShutdownTest.java 2008-01-31 02:04:50 UTC (rev 6042)
@@ -31,6 +31,7 @@
import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
+import org.jboss.ide.eclipse.as.test.ASTest;
/**
* These tests are for a simple startup / shutdown of a basic,
@@ -41,15 +42,6 @@
*
*/
public class StartupShutdownTest extends TestCase {
- private static final String RUNTIME_32 = "org.jboss.ide.eclipse.as.runtime.32";
- private static final String RUNTIME_40 = "org.jboss.ide.eclipse.as.runtime.40";
- private static final String RUNTIME_42 = "org.jboss.ide.eclipse.as.runtime.42";
- private static final String SERVER_32 = "org.jboss.ide.eclipse.as.32";
- private static final String SERVER_40 = "org.jboss.ide.eclipse.as.40";
- private static final String SERVER_42 = "org.jboss.ide.eclipse.as.42";
- private static final String JBOSS_AS_32_HOME = System.getProperty("jbosstools.test.jboss.home.3.2", "C:\\apps\\jboss\\jboss-3.2.8.SP1\\");
- private static final String JBOSS_AS_40_HOME = System.getProperty("jbosstools.test.jboss.home.4.0", "C:\\apps\\jboss\\jboss-4.0.5.GA\\");
- private static final String JBOSS_AS_42_HOME = System.getProperty("jbosstools.test.jboss.home.4.2", "C:\\apps\\jboss\\jboss-4.2.1.GA\\");
protected static final IVMInstall VM_INSTALL = JavaRuntime.getDefaultVMInstall();
protected static final String DEFAULT_CONFIG = "default";
@@ -64,11 +56,11 @@
public void setUp() {
try {
if( getName().equals("test32"))
- createServer(RUNTIME_32, SERVER_32, JBOSS_AS_32_HOME, DEFAULT_CONFIG);
+ createServer(ASTest.JBOSS_RUNTIME_32, ASTest.JBOSS_SERVER_32, ASTest.JBOSS_AS_32_HOME, DEFAULT_CONFIG);
else if( getName().equals("test40"))
- createServer(RUNTIME_40, SERVER_40, JBOSS_AS_40_HOME, DEFAULT_CONFIG);
+ createServer(ASTest.JBOSS_RUNTIME_40, ASTest.JBOSS_SERVER_40, ASTest.JBOSS_AS_40_HOME, DEFAULT_CONFIG);
else if( getName().equals("test42"))
- createServer(RUNTIME_42, SERVER_42, JBOSS_AS_42_HOME, DEFAULT_CONFIG);
+ createServer(ASTest.JBOSS_RUNTIME_42, ASTest.JBOSS_SERVER_42, ASTest.JBOSS_AS_42_HOME, DEFAULT_CONFIG);
// first thing's first. Let's add a server state listener
stateListener = new ServerStateListener();
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ProjectRuntimeUtil.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ProjectRuntimeUtil.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ProjectRuntimeUtil.java 2008-01-31 02:04:50 UTC (rev 6042)
@@ -0,0 +1,54 @@
+package org.jboss.ide.eclipse.as.test.util;
+
+import java.util.Collections;
+import java.util.HashSet;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+
+public class ProjectRuntimeUtil extends Assert {
+
+ public static void clearRuntime(IProject theProject) throws CoreException {
+ IFacetedProject facetedProject = ProjectFacetsManager.create(theProject);
+ facetedProject.setTargetedRuntimes(new HashSet<org.eclipse.wst.common.project.facet.core.runtime.IRuntime>(), null);
+ facetedProject.setTargetedRuntimes(Collections.EMPTY_SET, new NullProgressMonitor());
+ }
+
+ public static void setTargetRuntime(IRuntime runtime, IProject theProject) throws CoreException {
+ final org.eclipse.wst.common.project.facet.core.runtime.IRuntime facetRuntime = RuntimeManager.getRuntime(runtime.getId());
+ assertNotNull("bridged facet runtime not found", facetRuntime);
+ IFacetedProject facetedProject = ProjectFacetsManager.create(theProject);
+ facetedProject.setTargetedRuntimes(new HashSet<org.eclipse.wst.common.project.facet.core.runtime.IRuntime>() { { this.add(facetRuntime);}}, null);
+ facetedProject.setPrimaryRuntime(facetRuntime, null);
+ }
+
+ public static IRuntime createRuntime(String runtimeName, String runtimeTypeId, String asHome) throws CoreException {
+ return createRuntime(runtimeName, runtimeTypeId, asHome, "default");
+ }
+
+ public static IRuntime createRuntime(String runtimeName, String runtimeTypeId, String asHome, String configuration) throws CoreException {
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, runtimeTypeId);
+ assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
+ IRuntimeType runtimeType = runtimeTypes[0];
+ RuntimeWorkingCopy jbossRuntime = (RuntimeWorkingCopy)runtimeType.createRuntime(runtimeName, new NullProgressMonitor());
+ jbossRuntime.setLocation(new Path(asHome));
+ jbossRuntime.setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, configuration);
+ IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
+ assertEquals(savedRuntime.validate(null).getCode(), Status.OK);
+ return savedRuntime;
+ }
+
+}
16 years, 11 months
JBoss Tools SVN: r6041 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-30 15:59:43 -0500 (Wed, 30 Jan 2008)
New Revision: 6041
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1270
server parameter can be null when 'Manually define new Server' radio selected.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2008-01-30 20:45:19 UTC (rev 6040)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2008-01-30 20:59:43 UTC (rev 6041)
@@ -53,14 +53,16 @@
* @see ILaunchableAdapterDelegate#getLaunchable(IServer, IModuleObject)
*/
public Object getLaunchable(IServer server, IModuleArtifact moduleObject) {
- ServerDelegate delegate = (ServerDelegate)server.loadAdapter(ServerDelegate.class,null);
- if (!(delegate instanceof JBossServer ))
- return null;
- if ((moduleObject instanceof Servlet) ||(moduleObject instanceof WebResource))
- return prepareHttpLaunchable(moduleObject, delegate);
-
- if((moduleObject instanceof EJBBean) || (moduleObject instanceof JndiObject))
- return prepareJndiLaunchable(moduleObject,delegate);
+ if (server != null) {
+ ServerDelegate delegate = (ServerDelegate)server.loadAdapter(ServerDelegate.class,null);
+ if (!(delegate instanceof JBossServer ))
+ return null;
+ if ((moduleObject instanceof Servlet) ||(moduleObject instanceof WebResource))
+ return prepareHttpLaunchable(moduleObject, delegate);
+
+ if((moduleObject instanceof EJBBean) || (moduleObject instanceof JndiObject))
+ return prepareJndiLaunchable(moduleObject,delegate);
+ }
return null;
}
16 years, 11 months