[404587] Server tools JUnits are not independent, which cause JUnits to
fail
diff --git a/tests/org.eclipse.jst.server.tomcat.core.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.jst.server.tomcat.core.tests/META-INF/MANIFEST.MF
index 524580d..85c785c 100644
--- a/tests/org.eclipse.jst.server.tomcat.core.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.jst.server.tomcat.core.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: org.eclipse.jst.server.tomcat.core.tests
Bundle-SymbolicName: org.eclipse.jst.server.tomcat.core.tests
-Bundle-Version: 1.1.101.qualifier
+Bundle-Version: 1.1.200.qualifier
Bundle-ClassPath: tests.jar
Bundle-Activator: org.eclipse.jst.server.tomcat.core.tests.TestsPlugin
Bundle-Vendor: Eclipse.org
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 a17b346..4d48ead 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, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 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
@@ -34,11 +34,6 @@
wc.setLocation(new Path("c://test"));
return wc;
}
-
- public void test00CreateRuntime() throws Exception {
- runtime = createRuntime(RUNTIME_TYPE_ID_32).save(false, null);
- assertTrue(!runtime.isWorkingCopy());
- }
protected void validateRuntime() throws Exception {
IStatus status = runtime.validate(null);
@@ -67,103 +62,60 @@
tomcatRuntime = null;
}
- public void test01ValidateRuntime() throws Exception {
- validateRuntime();
- }
-
- public void test02AdaptRuntime() throws Exception {
- adaptRuntime();
- }
-
- public void test03ModifyRuntime() throws Exception {
- modifyRuntime();
- }
+ public void testAll() throws Exception {
+ runtime = createRuntime(RUNTIME_TYPE_ID_32).save(false, null);
+ assertTrue(!runtime.isWorkingCopy());
- public void test04DeleteRuntime() throws Exception {
+ validateRuntime();
+
+ adaptRuntime();
+
+ modifyRuntime();
+
deleteRuntime();
- }
-
- public void test10CreateRuntime() throws Exception {
+
runtime = createRuntime(RUNTIME_TYPE_ID_40).save(false, null);
assertTrue(!runtime.isWorkingCopy());
- }
- public void test11ValidateRuntime() throws Exception {
validateRuntime();
- }
-
- public void test12AdaptRuntime() throws Exception {
- adaptRuntime();
- }
-
- public void test13ModifyRuntime() throws Exception {
- modifyRuntime();
- }
- public void test14DeleteRuntime() throws Exception {
+ adaptRuntime();
+
+ modifyRuntime();
+
deleteRuntime();
- }
-
- public void test20CreateRuntime() throws Exception {
+
runtime = createRuntime(RUNTIME_TYPE_ID_41).save(false, null);
assertTrue(!runtime.isWorkingCopy());
- }
- public void test21ValidateRuntime() throws Exception {
validateRuntime();
- }
-
- public void test22AdaptRuntime() throws Exception {
- adaptRuntime();
- }
-
- public void test23ModifyRuntime() throws Exception {
- modifyRuntime();
- }
- public void test24DeleteRuntime() throws Exception {
+ adaptRuntime();
+
+ modifyRuntime();
+
deleteRuntime();
- }
-
- public void test30CreateRuntime() throws Exception {
+
runtime = createRuntime(RUNTIME_TYPE_ID_50).save(false, null);
assertTrue(!runtime.isWorkingCopy());
- }
- public void test31ValidateRuntime() throws Exception {
validateRuntime();
- }
-
- public void test32AdaptRuntime() throws Exception {
- adaptRuntime();
- }
-
- public void test33ModifyRuntime() throws Exception {
- modifyRuntime();
- }
- public void test34DeleteRuntime() throws Exception {
+ adaptRuntime();
+
+ modifyRuntime();
+
deleteRuntime();
- }
-
- public void test40CreateRuntime() throws Exception {
+
runtime = createRuntime(RUNTIME_TYPE_ID_55).save(false, null);
assertTrue(!runtime.isWorkingCopy());
- }
- public void test41ValidateRuntime() throws Exception {
validateRuntime();
- }
-
- public void test42AdaptRuntime() throws Exception {
- adaptRuntime();
- }
-
- public void test43ModifyRuntime() throws Exception {
- modifyRuntime();
- }
- public void test44DeleteRuntime() throws Exception {
+ adaptRuntime();
+
+ modifyRuntime();
+
deleteRuntime();
}
}
diff --git a/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/internal/UtilTestCase.java b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/internal/UtilTestCase.java
index b306917..0e935f2 100644
--- a/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/internal/UtilTestCase.java
+++ b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/internal/UtilTestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 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
@@ -24,193 +24,143 @@
assertEquals("", TomcatServerBehaviour.mergeArguments("", new String[] { }, null, false));
assertEquals("", TomcatServerBehaviour.mergeArguments("", new String[] { }, null, true));
assertEquals("", TomcatServerBehaviour.mergeArguments("", new String[] { }, new String[] { "a" } , true));
- }
-
- public void testArgMerge2() {
+
assertEquals("a=b", TomcatServerBehaviour.mergeArguments("", new String[] { "a=b"}, null, false));
assertEquals("a=b", TomcatServerBehaviour.mergeArguments("", new String[] { "a=b"}, null, true));
// new arguments aren't removed
assertEquals("a=b", TomcatServerBehaviour.mergeArguments("", new String[] { "a=b"}, new String[] { "a" }, true));
- }
-
- public void testArgMerge3() {
+
assertEquals("a=b c=d", TomcatServerBehaviour.mergeArguments("", new String[] { "a=b", "c=d" }, null, false));
assertEquals("a=b c=d", TomcatServerBehaviour.mergeArguments("", new String[] { "a=b", "c=d" }, null, true));
// new arguments aren't removed
assertEquals("a=b c=d", TomcatServerBehaviour.mergeArguments("", new String[] { "a=b", "c=d" }, new String[] { "a" }, true));
- }
-
- public void testArgMerge4() {
+
assertEquals("a=b c=d", TomcatServerBehaviour.mergeArguments("a=b", new String[] { "c=d" }, null, false));
assertEquals("a=b c=d", TomcatServerBehaviour.mergeArguments("a=b", new String[] { "c=d" }, null, true));
// old argument is removed
assertEquals("c=d", TomcatServerBehaviour.mergeArguments("a=b", new String[] { "c=d" }, new String[] { "a" }, true));
- }
-
- public void testArgMerge5() {
+
assertEquals("a=c", TomcatServerBehaviour.mergeArguments("a=b", new String[] { "a=c" }, null, false));
assertEquals("a=c", TomcatServerBehaviour.mergeArguments("a=b", new String[] { "a=c" }, null, true));
// replaced argument is removed
assertEquals("", TomcatServerBehaviour.mergeArguments("a=b", new String[] { "a=c" }, new String[] { "a" }, true));
- }
-
- public void testArgMerge6() {
+
assertEquals("a b=2 d e=3", TomcatServerBehaviour.mergeArguments("a b=c d", new String[] { "b=2", "e=3" }, null, false));
assertEquals("a b=2 d e=3", TomcatServerBehaviour.mergeArguments("a b=c d", new String[] { "b=2", "e=3" }, null, true));
// old argument is removed
assertEquals("b=2 d e=3", TomcatServerBehaviour.mergeArguments("a b=c d", new String[] { "b=2", "e=3" }, new String[] { "a" }, true));
assertEquals("a e=3", TomcatServerBehaviour.mergeArguments("a b=c d", new String[] { "b=2", "e=3" }, new String[] { "b", "d" }, true));
assertEquals("a e=3", TomcatServerBehaviour.mergeArguments("a b=c d", new String[] { "b=2", "e=3" }, new String[] { "b=", "d" }, true));
- }
-
- public void testArgMerge7() {
+
assertEquals("a bb=c d b=2 e=3", TomcatServerBehaviour.mergeArguments("a bb=c d", new String[] { "b=2", "e=3" }, null, false));
assertEquals("a bb=c d b=2 e=3", TomcatServerBehaviour.mergeArguments("a bb=c d", new String[] { "b=2", "e=3" }, null, true));
// remove expected wrong argument
assertEquals("a d b=2 e=3", TomcatServerBehaviour.mergeArguments("a bb=c d", new String[] { "b=2", "e=3" }, new String[] { "b" }, true));
// avoid removing wrong argument
assertEquals("a bb=c d b=2 e=3", TomcatServerBehaviour.mergeArguments("a bb=c d", new String[] { "b=2", "e=3" }, new String[] { "b=" }, true));
- }
-
- public void testArgMerge8() {
+
assertEquals("a", TomcatServerBehaviour.mergeArguments("a", new String[] { }, null, false));
assertEquals("a", TomcatServerBehaviour.mergeArguments("a", new String[] { }, null, true));
// remove single exiting argument
assertEquals("", TomcatServerBehaviour.mergeArguments("a", new String[] { }, new String[] { "a" }, true));
- }
-
- public void testArgMerge9() {
+
assertEquals("a b", TomcatServerBehaviour.mergeArguments("a", new String[] { "b" }, null, false));
assertEquals("a b", TomcatServerBehaviour.mergeArguments("a", new String[] { "b" }, null, true));
// remove single exiting argument
assertEquals("b", TomcatServerBehaviour.mergeArguments("a", new String[] { "b" }, new String[] { "a" }, true));
- }
-
- public void testArgMerge10() {
+
assertEquals("a b c d", TomcatServerBehaviour.mergeArguments("a b ", new String[] { "c", "d" }, null, false));
assertEquals("a b c d", TomcatServerBehaviour.mergeArguments("a b ", new String[] { "c", "d" }, null, true));
// remove argumets
assertEquals("b c d", TomcatServerBehaviour.mergeArguments("a b ", new String[] { "c", "d" }, new String[] { "a" }, true));
assertEquals("a c d", TomcatServerBehaviour.mergeArguments("a b ", new String[] { "c", "d" }, new String[] { "b" }, true));
assertEquals("c d", TomcatServerBehaviour.mergeArguments("a b ", new String[] { "c", "d" }, new String[] { "a", "b" }, true));
- }
-
- public void testArgMerge11() {
+
assertEquals("a=b c=\"e\"", TomcatServerBehaviour.mergeArguments("a=b c=d", new String[] { "c=\"e\"" }, null, false));
assertEquals("a=b c=\"e\"", TomcatServerBehaviour.mergeArguments("a=b c=d", new String[] { "c=\"e\"" }, null, true));
// remove argument
assertEquals("c=\"e\"", TomcatServerBehaviour.mergeArguments("a=b c=d", new String[] { "c=\"e\"" }, new String[] { "a=" }, true));
- }
-
- public void testArgMerge12() {
+
assertEquals("a=b c=\"e f\"", TomcatServerBehaviour.mergeArguments("a=b c=\"d e\"", new String[] { "c=\"e f\"" }, null, false));
assertEquals("a=b c=\"e f\"", TomcatServerBehaviour.mergeArguments("a=b c=\"d e\"", new String[] { "c=\"e f\"" }, null, true));
// remove argument
assertEquals("c=\"e f\"", TomcatServerBehaviour.mergeArguments("a=b c=\"d e\"", new String[] { "c=\"e f\"" }, new String[] { "a=" }, true));
assertEquals("a=g ", TomcatServerBehaviour.mergeArguments("a=b c=\"d e\"", new String[] { "a=g" }, new String[] { "c=" }, true));
- }
-
- public void testArgMerge13() {
+
assertEquals("a=b -c \"e\"", TomcatServerBehaviour.mergeArguments("a=b -c d", new String[] { "-c \"e\"" }, null, false));
assertEquals("a=b -c \"e\"", TomcatServerBehaviour.mergeArguments("a=b -c d", new String[] { "-c \"e\"" }, null, true));
// remove argument
assertEquals("-c \"e\"", TomcatServerBehaviour.mergeArguments("a=b -c d", new String[] { "-c \"e\"" }, new String[] { "a=" }, true));
assertEquals("a=g ", TomcatServerBehaviour.mergeArguments("a=b -c d", new String[] { "a=g" }, new String[] { "-c " }, true));
- }
-
- public void testArgMerge14() {
+
assertEquals("a=b -c \"e f\"", TomcatServerBehaviour.mergeArguments("a=b -c \"d e\"", new String[] { "-c \"e f\"" }, null, false));
assertEquals("a=b -c \"e f\"", TomcatServerBehaviour.mergeArguments("a=b -c \"d e\"", new String[] { "-c \"e f\"" }, null, true));
// remove argument
assertEquals("-c \"e f\"", TomcatServerBehaviour.mergeArguments("a=b -c \"d e\"", new String[] { "-c \"e f\"" }, new String[] { "a=" }, true));
assertEquals("a=g ", TomcatServerBehaviour.mergeArguments("a=b -c \"d e\"", new String[] { "a=g" }, new String[] { "-c " }, true));
- }
- public void testArgMerge15() {
assertEquals("b a", TomcatServerBehaviour.mergeArguments("b", new String[] { "a", "b" }, null, false));
assertEquals("a b", TomcatServerBehaviour.mergeArguments("b", new String[] { "a", "b" }, null, true));
- }
-
- public void testArgMerge16() {
+
assertEquals("c b a", TomcatServerBehaviour.mergeArguments("c b", new String[] { "a", "b" }, null, false));
assertEquals("c a b", TomcatServerBehaviour.mergeArguments("c b", new String[] { "a", "b" }, null, true));
- }
-
- public void testArgMerge17() {
+
// remove middle arguments
assertEquals("a e f", TomcatServerBehaviour.mergeArguments("a -b c e", new String[] { "f" }, new String[] { "-b " }, false));
assertEquals("a e f", TomcatServerBehaviour.mergeArguments("a -b \"c d\" e", new String[] { "f" }, new String[] { "-b " }, false));
assertEquals("a e f", TomcatServerBehaviour.mergeArguments("a b=c e", new String[] { "f" }, new String[] { "b=" }, false));
assertEquals("a e f", TomcatServerBehaviour.mergeArguments("a b=\"c d\" e", new String[] { "f" }, new String[] { "b=" }, false));
- }
-
- public void testVerifySpec() {
+
VerifyResourceSpec spec = new VerifyResourceSpec("");
assertEquals("", spec.toString());
String [] paths = spec.getPaths();
assertEquals(1, paths.length);
assertEquals("", paths[0]);
- }
- public void testVerifySpec2() {
- VerifyResourceSpec spec = new VerifyResourceSpec("file ");
+ spec = new VerifyResourceSpec("file ");
assertEquals("file ", spec.toString());
- String [] paths = spec.getPaths();
+ paths = spec.getPaths();
assertEquals(1, paths.length);
assertEquals("file", paths[0]);
- }
-
- public void testVerifySpec3() {
- VerifyResourceSpec spec = new VerifyResourceSpec("dir" + File.separator + "file");
- String [] paths = spec.getPaths();
+
+ spec = new VerifyResourceSpec("dir" + File.separator + "file");
+ paths = spec.getPaths();
assertEquals(1, paths.length);
assertEquals("dir" + File.separator + "file", paths[0]);
- }
- public void testVerifySpec4() {
- VerifyResourceSpec spec = new VerifyResourceSpec("dir" + File.separator + "file| alt ");
- String [] paths = spec.getPaths();
+ spec = new VerifyResourceSpec("dir" + File.separator + "file| alt ");
+ paths = spec.getPaths();
assertEquals(2, paths.length);
assertEquals("dir" + File.separator + "file", paths[0]);
assertEquals("dir" + File.separator + "alt", paths[1]);
- }
- public void testVerifySpec5() {
- VerifyResourceSpec spec = new VerifyResourceSpec("dir" + File.separator + "file| alt1 | alt2 ");
- String [] paths = spec.getPaths();
+ spec = new VerifyResourceSpec("dir" + File.separator + "file| alt1 | alt2 ");
+ paths = spec.getPaths();
assertEquals(3, paths.length);
assertEquals("dir" + File.separator + "file", paths[0]);
assertEquals("dir" + File.separator + "alt1", paths[1]);
assertEquals("dir" + File.separator + "alt2", paths[2]);
- }
-
- public void testVerifySpec6() {
- if (RuntimeLocation.runtimeLocation != null) {
- VerifyResourceSpec spec = new VerifyResourceSpec("conf");
- IStatus status = spec.checkResource(RuntimeLocation.runtimeLocation);
- assertTrue(status.isOK());
- }
- }
-
- public void testVerifySpec7() {
- if (RuntimeLocation.runtimeLocation != null) {
- VerifyResourceSpec spec = new VerifyResourceSpec("conf" + File.separator + "server.xml");
- IStatus status = spec.checkResource(RuntimeLocation.runtimeLocation);
- assertTrue(status.isOK());
- }
- }
- public void testVerifySpec8() {
if (RuntimeLocation.runtimeLocation != null) {
- VerifyResourceSpec spec = new VerifyResourceSpec("conf" + File.separator + "nofile|server.xml");
+ spec = new VerifyResourceSpec("conf");
IStatus status = spec.checkResource(RuntimeLocation.runtimeLocation);
assertTrue(status.isOK());
}
- }
- public void testVerifySpec9() {
if (RuntimeLocation.runtimeLocation != null) {
- VerifyResourceSpec spec = new VerifyResourceSpec("conf" + File.separator + "nofile");
+ spec = new VerifyResourceSpec("conf" + File.separator + "server.xml");
+ IStatus status = spec.checkResource(RuntimeLocation.runtimeLocation);
+ assertTrue(status.isOK());
+ }
+
+ if (RuntimeLocation.runtimeLocation != null) {
+ spec = new VerifyResourceSpec("conf" + File.separator + "nofile|server.xml");
+ IStatus status = spec.checkResource(RuntimeLocation.runtimeLocation);
+ assertTrue(status.isOK());
+ }
+
+ if (RuntimeLocation.runtimeLocation != null) {
+ spec = new VerifyResourceSpec("conf" + File.separator + "nofile");
IStatus status = spec.checkResource(RuntimeLocation.runtimeLocation);
assertFalse(status.isOK());
}
diff --git a/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/module/ModuleTestCase.java b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/module/ModuleTestCase.java
index 3565f32..9af7055 100644
--- a/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/module/ModuleTestCase.java
+++ b/tests/org.eclipse.jst.server.tomcat.core.tests/src/org/eclipse/jst/server/tomcat/core/tests/module/ModuleTestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 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
@@ -19,24 +19,16 @@
protected static final String CLOSED_PROJECT = "ClosedProject";
public static IModule webModule;
- public void test00ClosedProject() throws Exception {
+ public void testAll() throws Exception {
ModuleHelper.createClosedProject(CLOSED_PROJECT);
- }
- public void test01CreateWebModule() throws Exception {
ModuleHelper.createModule(WEB_MODULE_NAME);
- }
- public void test02CreateWebContent() throws Exception {
ModuleHelper.createWebContent(WEB_MODULE_NAME, 0);
- }
- public void test04GetModule() throws Exception {
ModuleHelper.buildFull();
webModule = ModuleHelper.getModule(WEB_MODULE_NAME);
- }
- public void test05CountFilesInModule() throws Exception {
assertEquals(ModuleHelper.countFilesInModule(webModule), 3);
}
}
\ No newline at end of file