This commit was manufactured by cvs2svn to create tag 'v20041207'.
diff --git a/tests/org.eclipse.jst.server.generic.tests/.classpath b/tests/org.eclipse.jst.server.generic.tests/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.jst.server.generic.tests/.cvsignore b/tests/org.eclipse.jst.server.generic.tests/.cvsignore
deleted file mode 100644
index 60463af..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-build.xml
diff --git a/tests/org.eclipse.jst.server.generic.tests/.project b/tests/org.eclipse.jst.server.generic.tests/.project
deleted file mode 100644
index 5ceacf5..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.server.generic.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.jst.server.generic.tests/build.properties b/tests/org.eclipse.jst.server.generic.tests/build.properties
deleted file mode 100644
index 5b5f309..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.genericServerTests.jar = src/
-output.genericServerTests.jar = bin/
-bin.includes = plugin.xml,\
- test.xml,\
- genericServerTests.jar
-src.includes = test.xml,\
- plugin.xml
-
diff --git a/tests/org.eclipse.jst.server.generic.tests/plugin.xml b/tests/org.eclipse.jst.server.generic.tests/plugin.xml
deleted file mode 100644
index c0f8887..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/plugin.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.jst.server.generic.tests"
- name="Generic Server Tests Plug-in"
- version="1.0.0"
- provider-name="Eteration.com"
- class="org.eclipse.jst.server.generic.tests.TestsPlugin">
-
- <runtime>
- <library name="genericServerTests.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.jst.server.generic.core"/>
- <import plugin="org.eclipse.jst.server.generic.modules"/>
- <import plugin="org.eclipse.jst.server.generic.ui"/>
- <import plugin="org.junit"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.debug.core"/>
- </requires>
-
-</plugin>
diff --git a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/AllGenericServerTests.java b/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/AllGenericServerTests.java
deleted file mode 100644
index e22ca2c..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/AllGenericServerTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Naci M. Dai - initial API and implementation
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-
-package org.eclipse.jst.server.generic.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-public class AllGenericServerTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for org.eclipse.jst.server.generic.tests");
- //$JUnit-BEGIN$
- suite.addTestSuite(PluginIntegrityTest.class);
- suite.addTestSuite(ModuleFactoryTests.class);
- suite.addTestSuite(ServerDefinitionTypeTest.class);
- suite.addTestSuite(ServerCreationTest.class);
- //$JUnit-END$
- return suite;
- }
-}
diff --git a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/ModuleFactoryTests.java b/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/ModuleFactoryTests.java
deleted file mode 100644
index a03b3d4..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/ModuleFactoryTests.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Naci M. Dai - initial API and implementation
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-
-package org.eclipse.jst.server.generic.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jst.server.generic.modules.J2eeSpecModuleFactoryDelegate;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleType;
-
-
-public class ModuleFactoryTests extends TestCase {
-
- TestProject aProject;
- public final static String webXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+
- "<!DOCTYPE web-app PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\" \"http://java.sun.com/dtd/web-app_2_3.dtd\">\n"+
- "<web-app id=\"WebApp\">\n"+
- " <display-name>Web Project</display-name>\n"+
- " <welcome-file-list>\n"+
- " <welcome-file>index.html</welcome-file>\n"+
- " <welcome-file>index.htm</welcome-file>\n"+
- " <welcome-file>index.jsp</welcome-file>\n"+
- " <welcome-file>default.html</welcome-file>\n"+
- " <welcome-file>default.htm</welcome-file>\n"+
- " <welcome-file>default.jsp</welcome-file>\n"+
- " </welcome-file-list>\n"+
- "</web-app>\n";
-
- /*
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- aProject = new TestProject();
- aProject.createWebModule("myWebApp",webXML);
- }
-
- /*
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- aProject.dispose();
- }
-
- /**
- * Constructor for PluginIntegrityTest.
- * @param name
- */
- public ModuleFactoryTests(String name) {
- super(name);
- }
-
- public void testProjectExists(){
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = root.getProject("Project-1");
- assertNotNull(project);
- }
-
- public void testModules(){
- IModule[] moduleList = J2eeSpecModuleFactoryDelegate.getInstance().getModules();
- assertNotNull(moduleList);
- assertEquals(1,moduleList.length);
- IModule aWebModule = (IModule)moduleList[0];
- assertNotNull(aWebModule);
- assertEquals("myWebApp",aWebModule.getName());
- IModuleType moduleType = aWebModule.getModuleType();
- assertNotNull("Web module does not have a type",moduleType);
- assertEquals("j2ee.web",moduleType.getId());
- }
-
-
-}
diff --git a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/PluginIntegrityTest.java b/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/PluginIntegrityTest.java
deleted file mode 100644
index a7627d0..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/PluginIntegrityTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Naci M. Dai - initial API and implementation
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-
-package org.eclipse.jst.server.generic.tests;
-
-import org.eclipse.jst.server.generic.core.CorePlugin;
-import org.eclipse.jst.server.generic.modules.ModulesPlugin;
-import org.eclipse.jst.server.generic.ui.GenericUiPlugin;
-
-
-import junit.framework.TestCase;
-
-/**
- * @author naci
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PluginIntegrityTest extends TestCase {
-
- /*
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /*
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Constructor for PluginIntegrityTest.
- * @param name
- */
- public PluginIntegrityTest(String name) {
- super(name);
- }
-
- public void testGenericUiPluginExists(){
- assertNotNull(GenericUiPlugin.getDefault());
- }
- public void testModulesPluginExists(){
- assertNotNull(ModulesPlugin.getDefault());
- }
- public void testCorePluginExists(){
- assertNotNull(CorePlugin.getDefault());
- }
-
-}
diff --git a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/ServerCreationTest.java b/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/ServerCreationTest.java
deleted file mode 100644
index 810c78e..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/ServerCreationTest.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Naci M. Dai - initial API and implementation
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-
-package org.eclipse.jst.server.generic.tests;
-
-import java.util.HashMap;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.server.generic.internal.core.GenericServer;
-import org.eclipse.jst.server.generic.internal.core.GenericServerRuntime;
-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.IServerType;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.internal.RuntimeType;
-import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
-import org.eclipse.wst.server.core.model.RuntimeDelegate;
-import org.eclipse.wst.server.core.model.ServerDelegate;
-
-public class ServerCreationTest extends TestCase {
-
- RuntimeType j2eeRuntimeType = null;
- private final static String ID = "org.eclipse.jst.server.generic";
-
- /*
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- IRuntimeType[] listAll = ServerCore.getRuntimeTypes();
- if (listAll != null) {
- for (int i = 0; i < listAll.length; i++) {
- IRuntimeType runtimeType = listAll[i];
-
- if ("J2EE Runtime Library".equals(runtimeType.getName()))
- j2eeRuntimeType = (RuntimeType) runtimeType;
- }
- }
-
- }
-
- /*
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Constructor for PluginIntegrityTest.
- *
- * @param name
- */
- public ServerCreationTest(String name) {
- super(name);
- }
-
- public void testGetTypes() {
- assertNotNull(j2eeRuntimeType);
- }
-
- public void testCreateServer() throws Exception {
-
- // Finds the generic server type
- IServerType[] sTypes = ServerCore.getServerTypes();
- IServerType serverType = null;
- for (int i = 0; i < sTypes.length; i++) {
- IServerType sType = sTypes[i];
- if (ID.equals(sType.getId()))
- serverType = sType;
- }
- assertNotNull("Could not find org.eclipse.jst.server.generic server type",serverType);
-
- //Finds the generic server runtime type
- IRuntimeType runtimeType = serverType.getRuntimeType();
- assertNotNull("Could not find runtime type for the generic server type",runtimeType);
-
-
- //Create a new server instance from the type
- IServerWorkingCopy server = serverType.createServer(ID+".Jonas.Server", null,
- (IRuntime) null, null);
- assertNotNull("Could not create server",server);
-
-
- //Create a new runtime instance from the type
- IRuntime runtime = runtimeType.createRuntime(ID+".Jonas.Runtime",null);
-
- assertNotNull("Could not create runtime",runtime);
-
-
- //Set the runtime for the server
- server.setRuntime(runtime);
-
- //Save the server
- server.save(false,null);
-
- // Set properties for the runtime
- IRuntimeWorkingCopy runtimeWorkingCopy = runtime.createWorkingCopy();
- assertNotNull("Could not create runtime working copy",runtimeWorkingCopy);
-
- // Set the JONAS runtime as the default runtime
- ServerUtil.setRuntimeDefaultName(runtimeWorkingCopy);
- assertNotNull("Runtime working copy has no name",runtimeWorkingCopy.getName());
-
- // Set properties for the JONAS runtime
- RuntimeDelegate runtimeDelegate = (RuntimeDelegate)runtimeWorkingCopy.getAdapter(RuntimeDelegate.class);
- assertNotNull("Could not obtain runtime delegate",runtimeDelegate);
-
- HashMap props = new HashMap();
- props.put("mappernames", "");
- props.put("classPathVariableName", "JONAS");
- props.put("serverAddress", "127.0.0.1");
- props.put("jonasBase", "C:\\nmd\\dev\\java\\appservers\\JOnAS-4.1.4");
- props.put("jonasRoot", "C:\\nmd\\dev\\java\\appservers\\JOnAS-4.1.4");
- props.put("classPath", "C:\\nmd\\dev\\java\\appservers\\JOnAS-4.1.4");
- props.put("protocols", "C:\\nmd\\dev\\java\\appservers\\JOnAS-4.1.4");
- props.put("port", "9000");
- runtimeDelegate.setAttribute(
- GenericServerRuntime.SERVER_INSTANCE_PROPERTIES, props);
-
- //Save the runtime working copy
- runtimeWorkingCopy.save(false,null);
-
- }
-
-
-
-
- public void testGetWebTypes() {
-
- IRuntimeType listWeb[] = ServerUtil.getRuntimeTypes("j2ee.web", null);
- assertNotNull(listWeb);
-
- boolean found = false;
- for (int i = 0; i < listWeb.length; i++) {
- IRuntimeType runtimeType = listWeb[i];
- if ("J2EE Runtime Library".equals(runtimeType.getName()))
- found = true;
- }
- assertTrue(found);
- }
-
-
-
- private ServerDelegate getDelegate(
- IServerWorkingCopy serverWC, IServerType serverType) {
-
- GenericServer server = new GenericServer();
- server.initialize((ServerWorkingCopy)serverWC);
- return server;
- }
-
-}
diff --git a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/ServerDefinitionTypeTest.java b/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/ServerDefinitionTypeTest.java
deleted file mode 100644
index f92010b..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/ServerDefinitionTypeTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Naci M. Dai - initial API and implementation
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-
-package org.eclipse.jst.server.generic.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.server.generic.core.CorePlugin;
-import org.eclipse.jst.server.generic.internal.core.ServerTypeDefinitionManager;
-import org.eclipse.jst.server.generic.servertype.definition.ServerRuntime;
-
-/**
- * @author naci
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class ServerDefinitionTypeTest extends TestCase {
-
- /*
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /*
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Constructor for PluginIntegrityTest.
- *
- * @param name
- */
- public ServerDefinitionTypeTest(String name) {
- super(name);
- }
-
- public void testGetTypes() {
- ServerTypeDefinitionManager serverTypeDefinitionManager = CorePlugin
- .getDefault().getServerTypeDefinitionManager();
- assertNotNull(serverTypeDefinitionManager);
- ServerRuntime[] types = serverTypeDefinitionManager
- .getServerTypeDefinitions();
- assertNotNull(types);
- assertEquals(3, types.length);
- }
-
- public void testResolve() {
- ServerTypeDefinitionManager serverTypeDefinitionManager = CorePlugin
- .getDefault().getServerTypeDefinitionManager();
- assertNotNull(serverTypeDefinitionManager);
- ServerRuntime[] types = serverTypeDefinitionManager
- .getServerTypeDefinitions();
- assertNotNull(types);
- assertTrue(types.length > 0);
- for (int i = 0; i < types.length; i++) {
- ServerRuntime definition = types[i];
- String wd = definition.getStart().getWorkingDirectory();
- String resolved = definition.getResolver().resolveProperties(wd);
- assertFalse(resolved.indexOf("${") >= 0);
- }
- }
-}
diff --git a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/TestProject.java b/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/TestProject.java
deleted file mode 100644
index 500b9f0..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/TestProject.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Naci M. Dai - initial API and implementation
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-
-package org.eclipse.jst.server.generic.tests;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.eclipse.jdt.core.search.ITypeNameRequestor;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.launching.JavaRuntime;
-public class TestProject {
- public IProject project;
- public IJavaProject javaProject;
- private IPackageFragmentRoot sourceFolder;
- public TestProject() throws CoreException {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- project = root.getProject("Project-1");
- project.create(null);
- project.open(null);
- javaProject = JavaCore.create(project);
- IFolder binFolder = createBinFolder();
- setJavaNature();
- javaProject.setRawClasspath(new IClasspathEntry[0], null);
- createOutputFolder(binFolder);
- addSystemLibraries();
- }
- public IProject getProject() {
- return project;
- }
- public IJavaProject getJavaProject() {
- return javaProject;
- }
- public void addJar(String plugin, String jar) throws MalformedURLException,
- IOException, JavaModelException {
- Path result = findFileInPlugin(plugin, jar);
- IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
- IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
- System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
- newEntries[oldEntries.length] = JavaCore.newLibraryEntry(result, null,
- null);
- javaProject.setRawClasspath(newEntries, null);
- }
- public IPackageFragment createPackage(String name) throws CoreException {
- if (sourceFolder == null)
- sourceFolder = createSourceFolder();
- return sourceFolder.createPackageFragment(name, false, null);
- }
- public IType createType(IPackageFragment pack, String cuName, String source)
- throws JavaModelException {
- StringBuffer buf = new StringBuffer();
- buf.append("package " + pack.getElementName() + ";\n");
- buf.append("\n");
- buf.append(source);
- ICompilationUnit cu = pack.createCompilationUnit(cuName,
- buf.toString(), false, null);
- return cu.getTypes()[0];
- }
- public void dispose() throws CoreException {
- waitForIndexer();
- project.delete(true, true, null);
- }
- private IFolder createBinFolder() throws CoreException {
- IFolder binFolder = project.getFolder("bin");
- binFolder.create(false, true, null);
- return binFolder;
- }
-
- public IFolder createWebModule(String moduleName, String contents) throws CoreException {
- IFolder moduleFolder = project.getFolder(moduleName);
- moduleFolder.create(false, true, null);
-
- IFolder folder = project.getFolder(moduleName + "/WEB-INF");
- folder.create(false, true, null);
- folder = project.getFolder(moduleName + "/WEB-INF/classes");
- folder.create(false, true, null);
- folder = project.getFolder(moduleName + "/WEB-INF/lib");
- folder.create(false, true, null);
-
- ByteArrayInputStream stream = new ByteArrayInputStream(contents.getBytes());
- IFile file = project.getFile(moduleName + "/WEB-INF/web.xml");
- file.create(stream, true, null);
-
- return moduleFolder;
- }
-
- private void setJavaNature() throws CoreException {
- IProjectDescription description = project.getDescription();
- description.setNatureIds(new String[]{JavaCore.NATURE_ID});
- project.setDescription(description, null);
- }
- private void createOutputFolder(IFolder binFolder)
- throws JavaModelException {
- IPath outputLocation = binFolder.getFullPath();
- javaProject.setOutputLocation(outputLocation, null);
- }
- public IPackageFragmentRoot createSourceFolder() throws CoreException {
- IFolder folder = project.getFolder("src");
- folder.create(false, true, null);
- IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(folder);
- IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
- IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
- System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
- newEntries[oldEntries.length] = JavaCore.newSourceEntry(root.getPath());
- javaProject.setRawClasspath(newEntries, null);
- return root;
- }
- private void addSystemLibraries() throws JavaModelException {
- IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
- IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
- System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
- newEntries[oldEntries.length] = JavaRuntime
- .getDefaultJREContainerEntry();
- javaProject.setRawClasspath(newEntries, null);
- }
- private Path findFileInPlugin(String plugin, String file)
- throws MalformedURLException, IOException {
- IPluginRegistry registry = Platform.getPluginRegistry();
- IPluginDescriptor descriptor = registry.getPluginDescriptor(plugin);
- URL pluginURL = descriptor.getInstallURL();
- URL jarURL = new URL(pluginURL, file);
- URL localJarURL = Platform.asLocalURL(jarURL);
- return new Path(localJarURL.getPath());
- }
- private void waitForIndexer() throws JavaModelException {
- new SearchEngine().searchAllTypeNames(ResourcesPlugin.getWorkspace(),
- null, null, IJavaSearchConstants.EXACT_MATCH,
- IJavaSearchConstants.CASE_SENSITIVE,
- IJavaSearchConstants.CLASS, SearchEngine
- .createJavaSearchScope(new IJavaElement[0]),
- new ITypeNameRequestor() {
- public void acceptClass(char[] packageName,
- char[] simpleTypeName, char[][] enclosingTypeNames,
- String path) {
- }
- public void acceptInterface(char[] packageName,
- char[] simpleTypeName, char[][] enclosingTypeNames,
- String path) {
- }
- }, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
- }
- /**
- * @return Returns the sourceFolder.
- */
- public IPackageFragmentRoot getSourceFolder() {
- return sourceFolder;
- }
- /**
- * @param sourceFolder The sourceFolder to set.
- */
- public void setSourceFolder(IPackageFragmentRoot sourceFolder) {
- this.sourceFolder = sourceFolder;
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/TestsPlugin.java b/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/TestsPlugin.java
deleted file mode 100644
index 95fff08..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/src/org/eclipse/jst/server/generic/tests/TestsPlugin.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Naci M. Dai - initial API and implementation
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-
-package org.eclipse.jst.server.generic.tests;
-
-import org.eclipse.ui.plugin.*;
-import org.osgi.framework.BundleContext;
-import java.util.*;
-
-
-public class TestsPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static TestsPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public TestsPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- resourceBundle = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static TestsPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = TestsPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.eclipse.jst.server.generic.tests.TestsPluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-}
diff --git a/tests/org.eclipse.jst.server.generic.tests/test.xml b/tests/org.eclipse.jst.server.generic.tests/test.xml
deleted file mode 100644
index 900f5bb..0000000
--- a/tests/org.eclipse.jst.server.generic.tests/test.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <!-- <property name="eclipse-home" value="${basedir}\..\.."/> -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name, and library-file -->
- <property name="plugin-name" value="org.eclipse.jst.server.generic.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="jst-folder" value="${eclipse-home}/jst_folder"/>
- <delete dir="${jst-folder}" quiet="true"/>
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jst-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jst.server.generic.tests.AllGenericServerTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-</project>
\ No newline at end of file