[308916] Add Tomcat 7 support
diff --git a/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/AllTests.java b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/AllTests.java
index a7cefb0..c694ab4 100644
--- a/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/AllTests.java
+++ b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/AllTests.java
@@ -108,6 +108,20 @@
 			System.err.println("Warning: Tomcat 6.0 not found - tests skipped");
 		}
 
+		// Note that Tomcat 7.0 requires Java SE 6
+		s = System.getProperty("org.eclipse.jst.server.tomcat.70");
+		if (s != null && s.length() > 0) {
+			RuntimeLocation.runtimeLocation = s;
+			TestSuite subSuite = new TestSuite(Tomcat70RuntimeTestCase.class);
+			Tomcat70RuntimeTestCase.addOrderedTests(subSuite);
+			suite.addTest(subSuite);
+			subSuite = new TestSuite(Tomcat70ServerTestCase.class);
+			Tomcat70ServerTestCase.addOrderedTests(subSuite);
+			suite.addTest(subSuite);
+		} else {
+			System.err.println("Warning: Tomcat 7.0 not found - tests skipped");
+		}
+
 		suite.addTestSuite(UtilTestCase.class);
 		suite.addTestSuite(XmlTestCase.class);
 		
diff --git a/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/Tomcat70RuntimeTestCase.java b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/Tomcat70RuntimeTestCase.java
new file mode 100644
index 0000000..6e17df7
--- /dev/null
+++ b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/Tomcat70RuntimeTestCase.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.server.tomcat.core.tests;
+
+import junit.framework.TestSuite;
+
+public class Tomcat70RuntimeTestCase extends AbstractTomcatRuntimeTestCase {
+	protected String getRuntimeTypeId() {
+		return "org.eclipse.jst.server.tomcat.runtime.70";
+	}
+
+	public static void addOrderedTests(TestSuite suite) {
+		AbstractTomcatRuntimeTestCase.addOrderedTests(Tomcat70RuntimeTestCase.class, suite);
+	}
+}
diff --git a/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/Tomcat70ServerTestCase.java b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/Tomcat70ServerTestCase.java
new file mode 100644
index 0000000..544d1de
--- /dev/null
+++ b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/Tomcat70ServerTestCase.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.server.tomcat.core.tests;
+
+import junit.framework.TestSuite;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jst.server.tomcat.core.internal.Tomcat70Configuration;
+import org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context;
+import org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance;
+import org.eclipse.wst.server.core.IModule;
+
+/**
+ *
+ */
+public class Tomcat70ServerTestCase extends AbstractTomcatServerTestCase {
+	protected String getServerTypeId() {
+		return "org.eclipse.jst.server.tomcat.70";
+	}
+
+	public static void addOrderedTests(TestSuite suite) {
+		AbstractTomcatServerTestCase.addOrderedTests(Tomcat70ServerTestCase.class, suite);
+	}
+
+	protected void verifyPublishedModule(IPath baseDir, IModule module)
+			throws Exception {
+		Tomcat70TestConfiguration config = new Tomcat70TestConfiguration(null);
+		config.load(baseDir.append("conf"), null);
+		
+		ServerInstance serverInstance = config.getServerInstance();
+		Context context = serverInstance.getContext(module.getName());
+
+		String deployDir = getTomcatServer().getDeployDirectory();
+		if ("webapps".equals(deployDir)) {
+			assertEquals(module.getName(), context.getDocBase());
+		}
+		else {
+			assertEquals(getTomcatServerBehaviour().getModuleDeployDirectory(module).toOSString(), context.getDocBase());
+		}
+		verifyPublishedModuleFiles(module);
+	}
+}
+
+class Tomcat70TestConfiguration extends  Tomcat70Configuration {
+	/**
+	 * @param path
+	 */
+	public Tomcat70TestConfiguration(IFolder path) {
+		super(path);
+	}
+
+	/**
+	 * @return server instance
+	 */
+	public ServerInstance getServerInstance() {
+		return serverInstance;
+	}
+}
diff --git a/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/TomcatRuntimeTestCase.java b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/TomcatRuntimeTestCase.java
index 732031d..a17b346 100644
--- a/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/TomcatRuntimeTestCase.java
+++ b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/TomcatRuntimeTestCase.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -49,7 +49,7 @@
 		tomcatRuntime = (ITomcatRuntime) runtime.loadAdapter(ITomcatRuntime.class, null);
 		assertNotNull(tomcatRuntime);
 		assertNotNull(tomcatRuntime.getVMInstall());
-		assertNotNull(tomcatRuntime.getRuntimeClasspath());
+		assertNotNull(tomcatRuntime.getRuntimeClasspath(null));
 	}
 	
 	protected void modifyRuntime() throws Exception {