Author: snjeza
Date: 2008-10-22 11:33:12 -0400 (Wed, 22 Oct 2008)
New Revision: 11082
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java
Log:
Fixing test errors in the org.jboss.ide.eclipse.as.test plugin
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java 2008-10-22
15:28:17 UTC (rev 11081)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java 2008-10-22
15:33:12 UTC (rev 11082)
@@ -1,110 +1,113 @@
-/**
- * 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.classpath;
-
-import java.util.Arrays;
-import java.util.List;
-
-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);
- 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, required);
- }
-
- protected void verifyInitialClasspathEntries(IJavaProject jp) throws CoreException {
- IClasspathEntry[] entries = jp.getRawClasspath();
- 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[] required) {
- List<String> list = 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));
- }
-
- if( list.size() > 0 ) {
- String tmp = "Required enties not found: ";
- for( int i = 0; i < list.size(); i++ ) {
- tmp += list.get(i) + ", ";
- }
- fail(tmp.substring(0, tmp.length() - 2));
- }
- }
-}
+/**
+ * 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.classpath;
+
+import java.util.ArrayList;
+import java.util.List;
+
+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);
+ 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, required);
+ }
+
+ protected void verifyInitialClasspathEntries(IJavaProject jp) throws CoreException {
+ IClasspathEntry[] entries = jp.getRawClasspath();
+ 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[] required) {
+ List<String> list = new ArrayList<String>();
+ for (int i = 0; i < required.length; i++) {
+ list.add(required[i]);
+ }
+ for( int i = 0; i < entries.length; i++ ) {
+ if( list.contains(entries[i].getPath().segment(0)))
+ list.remove(entries[i].getPath().segment(0));
+ }
+
+ if( list.size() > 0 ) {
+ String tmp = "Required 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/publishing/AbstractDeploymentTest.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java 2008-10-22
15:28:17 UTC (rev 11081)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java 2008-10-22
15:33:12 UTC (rev 11082)
@@ -1,180 +1,180 @@
-package org.jboss.ide.eclipse.as.test.publishing;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-
-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.FileLocator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.server.core.IModule;
-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.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-import org.jboss.ide.eclipse.as.test.ASTest;
-import org.jboss.tools.common.test.util.TestProjectProvider;
-import org.osgi.framework.Bundle;
-
-public abstract class AbstractDeploymentTest extends TestCase {
- protected String BUNDLE_NAME = "org.jboss.ide.eclipse.as.test";
- private TestProjectProvider[] provider;
- protected IProject[] workspaceProject;
- protected String[] sourceProjectName;
- protected String[] testProperties;
- protected IRuntime runtime;
- protected IServer server;
- protected String deployLocation;
-
- public AbstractDeploymentTest(String[] projectNames, String[] testProperties) {
- try {
- this.sourceProjectName = projectNames;
- this.testProperties = testProperties;
- this.deployLocation = getFileLocation("/testOutputs").getAbsolutePath();
- this.provider = new TestProjectProvider[sourceProjectName.length];
- this.workspaceProject = new IProject[sourceProjectName.length];
- } catch( CoreException ce ) {
- fail("Could not access deploy location");
- }
- }
- public AbstractDeploymentTest(String projectName, String testProperties) {
- this(new String[]{projectName}, new String[] {testProperties});
- }
-
- protected void setUp() throws Exception {
- createServer();
- for( int i = 0; i < sourceProjectName.length; i++ ) {
- cleanFolder(getProjectLocation("TempProject").getAbsolutePath());
- assembleInTempProject(i);
- String path = "/projects/TempProject/" + sourceProjectName[i];
- provider[i] = new TestProjectProvider(BUNDLE_NAME, path, sourceProjectName[i], true);
- workspaceProject[i] = provider[i].getProject();
- workspaceProject[i].refreshLocal(IResource.DEPTH_INFINITE, new
NullProgressMonitor());
- }
- }
-
- protected void cleanFolder(String folder) throws CoreException {
- cleanFolder(new File(folder));
- }
- protected void cleanFolder(File folder) throws CoreException {
- if( folder != null && folder.exists() ) {
- File[] children = folder.listFiles();
- for( int i = 0; i < children.length; i++ )
- FileUtil.safeDelete(children[i]);
- }
- }
-
- protected File getProjectLocation(String name) throws CoreException {
- return getFileLocation("/projects/" + name);
- }
-
- protected File getFileLocation(String path) throws CoreException {
- Bundle bundle = Platform.getBundle(BUNDLE_NAME);
- URL url = null;
- try {
- url = FileLocator.resolve(bundle.getEntry(path));
- } catch (IOException e) {
- String msg = "Cannot find file " + path + " in " + BUNDLE_NAME;
- IStatus status = new Status(IStatus.ERROR, ASTest.PLUGIN_ID, msg, e);
- throw new CoreException(status);
- }
- String location = url.getFile();
- return new File(location);
- }
-
-
- /*
- * The whole reason for all this is so that I don't duplicate
- * jars or archives all over the place and to keep the size
- * of the test plugin small
- */
- protected void assembleInTempProject(int index) throws CoreException {
- String sourceProjectName = this.sourceProjectName[index];
- File tempProject = getProjectLocation("TempProject");
- File srcProject = getProjectLocation(sourceProjectName);
- File destProject = new File(tempProject, sourceProjectName);
- FileUtil.fileSafeCopy(srcProject, destProject);
-
- // now copy files over from the properties file
- if( testProperties[index] != null ) {
- File propertiesFile = getFileLocation("projectPieces/" +
testProperties[index]);
- Properties props = new Properties();
- try {
- props.load(new FileInputStream(propertiesFile));
- boolean done = false;
- String srcKey, destKey;
- int i = 1;
- while( !done ) {
- srcKey = "copy" + i + "src";
- destKey = "copy" + i + "dest";
- done = copy(props.getProperty(srcKey), props.getProperty(destKey));
- i++;
- }
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- protected boolean copy(String src, String dest) throws CoreException {
- if( src == null || dest == null )
- return true;
-
- // do the copy
- File srcFile, destFile, tmp;
- srcFile = getFileLocation("projectPieces/" + src);
- tmp = getFileLocation("projects/TempProject/" + sourceProjectName);
- destFile = new File(tmp, dest);
- FileUtil.fileSafeCopy(srcFile, destFile);
-
- return false;
- }
-
-
- protected void createServer() throws CoreException {
- IRuntimeType rt =
ServerCore.findRuntimeType("org.jboss.ide.eclipse.as.runtime.stripped");
- IRuntimeWorkingCopy wc = rt.createRuntime("testRuntime", null);
- runtime = wc.save(true, null);
- IServerType st =
ServerCore.findServerType("org.jboss.ide.eclipse.as.systemCopyServer");
- ServerWorkingCopy swc = (ServerWorkingCopy) st.createServer("testServer",
null, null);
- swc.setServerConfiguration(null);
- swc.setName("testServer");
- swc.setAttribute(DeployableServer.DEPLOY_DIRECTORY, deployLocation);
- server = swc.save(true, null);
- }
-
- protected IStatus publish(IModule module) throws CoreException {
- IServerWorkingCopy copy = server.createWorkingCopy();
- copy.modifyModules(new IModule[]{module}, new IModule[0], new NullProgressMonitor());
- server = copy.save(false, new NullProgressMonitor());
- return server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
- }
-
- protected void tearDown() throws Exception {
- for( int i = 0; i < sourceProjectName.length; i++ )
- provider[i].dispose();
-
- cleanFolder(getProjectLocation("TempProject").getAbsolutePath());
- cleanFolder(getFileLocation("testOutputs"));
- runtime.delete();
- server.delete();
- }
-}
+package org.jboss.ide.eclipse.as.test.publishing;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Properties;
+
+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.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+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.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.osgi.framework.Bundle;
+
+public abstract class AbstractDeploymentTest extends TestCase {
+ protected String BUNDLE_NAME = "org.jboss.ide.eclipse.as.test";
+ private TestProjectProvider[] provider;
+ protected IProject[] workspaceProject;
+ protected String[] sourceProjectName;
+ protected String[] testProperties;
+ protected IRuntime runtime;
+ protected IServer server;
+ protected String deployLocation;
+
+ public AbstractDeploymentTest(String[] projectNames, String[] testProperties) {
+ try {
+ this.sourceProjectName = projectNames;
+ this.testProperties = testProperties;
+ this.deployLocation = getFileLocation("/testOutputs").getAbsolutePath();
+ this.provider = new TestProjectProvider[sourceProjectName.length];
+ this.workspaceProject = new IProject[sourceProjectName.length];
+ } catch( CoreException ce ) {
+ fail("Could not access deploy location");
+ }
+ }
+ public AbstractDeploymentTest(String projectName, String testProperties) {
+ this(new String[]{projectName}, new String[] {testProperties});
+ }
+
+ protected void setUp() throws Exception {
+ createServer();
+ for( int i = 0; i < sourceProjectName.length; i++ ) {
+ cleanFolder(getProjectLocation("TempProject").getAbsolutePath());
+ assembleInTempProject(i);
+ String path = "/projects/TempProject/" + sourceProjectName[i];
+ provider[i] = new TestProjectProvider(BUNDLE_NAME, path, sourceProjectName[i], true);
+ workspaceProject[i] = provider[i].getProject();
+ workspaceProject[i].refreshLocal(IResource.DEPTH_INFINITE, new
NullProgressMonitor());
+ }
+ }
+
+ protected void cleanFolder(String folder) throws CoreException {
+ cleanFolder(new File(folder));
+ }
+ protected void cleanFolder(File folder) throws CoreException {
+ if( folder != null && folder.exists() ) {
+ File[] children = folder.listFiles();
+ for( int i = 0; i < children.length; i++ )
+ FileUtil.safeDelete(children[i]);
+ }
+ }
+
+ protected File getProjectLocation(String name) throws CoreException {
+ return getFileLocation("/projects/" + name);
+ }
+
+ protected File getFileLocation(String path) throws CoreException {
+ Bundle bundle = Platform.getBundle(BUNDLE_NAME);
+ URL url = null;
+ try {
+ url = FileLocator.resolve(bundle.getEntry(path));
+ } catch (IOException e) {
+ String msg = "Cannot find file " + path + " in " + BUNDLE_NAME;
+ IStatus status = new Status(IStatus.ERROR, ASTest.PLUGIN_ID, msg, e);
+ throw new CoreException(status);
+ }
+ String location = url.getFile();
+ return new File(location);
+ }
+
+
+ /*
+ * The whole reason for all this is so that I don't duplicate
+ * jars or archives all over the place and to keep the size
+ * of the test plugin small
+ */
+ protected void assembleInTempProject(int index) throws CoreException {
+ String sourceProjectName = this.sourceProjectName[index];
+ File tempProject = getProjectLocation("TempProject");
+ File srcProject = getProjectLocation(sourceProjectName);
+ File destProject = new File(tempProject, sourceProjectName);
+ FileUtil.fileSafeCopy(srcProject, destProject);
+
+ // now copy files over from the properties file
+ if( testProperties[index] != null ) {
+ File propertiesFile = getFileLocation("projectPieces/" +
testProperties[index]);
+ Properties props = new Properties();
+ try {
+ props.load(new FileInputStream(propertiesFile));
+ boolean done = false;
+ String srcKey, destKey;
+ int i = 1;
+ while( !done ) {
+ srcKey = "copy" + i + "src";
+ destKey = "copy" + i + "dest";
+ done = copy(props.getProperty(srcKey), props.getProperty(destKey),i);
+ i++;
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ protected boolean copy(String src, String dest,int i) throws CoreException {
+ if( src == null || dest == null )
+ return true;
+
+ // do the copy
+ File srcFile, destFile, tmp;
+ srcFile = getFileLocation("projectPieces/" + src);
+ tmp = getFileLocation("projects/TempProject/" + sourceProjectName[i-1]);
+ destFile = new File(tmp, dest);
+ FileUtil.fileSafeCopy(srcFile, destFile);
+
+ return false;
+ }
+
+
+ protected void createServer() throws CoreException {
+ IRuntimeType rt =
ServerCore.findRuntimeType("org.jboss.ide.eclipse.as.runtime.stripped");
+ IRuntimeWorkingCopy wc = rt.createRuntime("testRuntime", null);
+ runtime = wc.save(true, null);
+ IServerType st =
ServerCore.findServerType("org.jboss.ide.eclipse.as.systemCopyServer");
+ ServerWorkingCopy swc = (ServerWorkingCopy) st.createServer("testServer",
null, null);
+ swc.setServerConfiguration(null);
+ swc.setName("testServer");
+ swc.setAttribute(DeployableServer.DEPLOY_DIRECTORY, deployLocation);
+ server = swc.save(true, null);
+ }
+
+ protected IStatus publish(IModule module) throws CoreException {
+ IServerWorkingCopy copy = server.createWorkingCopy();
+ copy.modifyModules(new IModule[]{module}, new IModule[0], new NullProgressMonitor());
+ server = copy.save(false, new NullProgressMonitor());
+ return server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
+ }
+
+ protected void tearDown() throws Exception {
+ for( int i = 0; i < sourceProjectName.length; i++ )
+ provider[i].dispose();
+
+ cleanFolder(getProjectLocation("TempProject").getAbsolutePath());
+ cleanFolder(getFileLocation("testOutputs"));
+ runtime.delete();
+ server.delete();
+ }
+}