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) + ", ";
}
Show replies by date