Author: rob.stryker(a)jboss.com
Date: 2012-02-28 02:21:49 -0500 (Tue, 28 Feb 2012)
New Revision: 39160
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java
Log:
Provide a superclass for tests that require one test for every server type
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java 2012-02-28
06:59:09 UTC (rev 39159)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java 2012-02-28
07:21:49 UTC (rev 39160)
@@ -1,21 +1,13 @@
package org.jboss.ide.eclipse.as.test.publishing.v2;
-import junit.framework.TestCase;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.test.server.SimpleServerImplTest;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
-public class BehaviourModelDefectTest extends TestCase {
- public void tearDown() {
- try {
- ServerRuntimeUtils.deleteAllServers();
- ServerRuntimeUtils.deleteAllRuntimes();
- } catch(CoreException ce) {}
- }
+public class BehaviourModelDefectTest extends SimpleServerImplTest {
public void serverTestImpl(String type) {
IServer server = ServerRuntimeUtils.createMockServerWithRuntime(type,
"server1", "default");
@@ -47,39 +39,4 @@
assertNotNull(BehaviourModel.getModel().getBehaviour(serverType).getImpl("local").createPublishMethod());
assertNull(BehaviourModel.getModel().getBehaviour(serverType).getImpl("local").createLaunchDelegate());
}
-
- public void test32BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
- }
- public void test40BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
- }
- public void test42BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
- }
- public void test50BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
- }
- public void test51BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
- }
- public void test60BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
- }
- public void test70BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_70);
- }
- public void test71BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_71);
- }
- public void testEap43BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
- }
- public void testEap50BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
- }
- public void testEap60BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_60);
- }
-
}
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java 2012-02-28
06:59:09 UTC (rev 39159)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java 2012-02-28
07:21:49 UTC (rev 39160)
@@ -27,19 +27,9 @@
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
-public class MockArgsTests extends TestCase {
- public void setUp() {
- }
- public void tearDown() {
- try {
- ServerRuntimeUtils.deleteAllServers();
- ServerRuntimeUtils.deleteAllRuntimes();
- } catch(CoreException ce) {}
- }
-
-
+public class MockArgsTests extends SimpleServerImplTest {
public void testRemoveCriticalVMArgs() {
- IServer server = serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ IServer server = serverTestImpl2(IJBossToolingConstants.SERVER_AS_50);
try {
ILaunchConfiguration config = server.getLaunchConfiguration(true, new
NullProgressMonitor());
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
@@ -63,7 +53,7 @@
public void testChangeArgs() {
// should still match the defaults since the defaults are extremely all required
- IServer server = serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ IServer server = serverTestImpl2(IJBossToolingConstants.SERVER_AS_50);
try {
ILaunchConfiguration config = server.getLaunchConfiguration(true, new
NullProgressMonitor());
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
@@ -79,7 +69,11 @@
}
}
- protected IServer serverTestImpl(String type) {
+ protected void serverTestImpl(String type) {
+ serverTestImpl2(type);
+ }
+
+ protected IServer serverTestImpl2(String type) {
IServer server = ServerRuntimeUtils.createMockServerWithRuntime(type,
"server1", "default");
IServer fixed = setMockDetails(server);
String command = runAndGetCommand(fixed);
@@ -129,35 +123,4 @@
}
return null;
}
-
- public void test32Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
- }
-
- public void test40Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
- }
-
- public void test42Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
- }
-
- public void test50Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
- }
- public void test51Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
- }
- public void test60Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
- }
- public void testEap43Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
- }
- public void testEap50Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
- }
- public void testEap60Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_60);
- }
}
Show replies by date