Author: adietish
Date: 2011-05-26 14:23:16 -0400 (Thu, 26 May 2011)
New Revision: 31524
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
Log:
[JBIDE-7936] creating a unique deploy- and tmpDeploy folder for each new server
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java 2011-05-26
17:19:36 UTC (rev 31523)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java 2011-05-26
18:23:16 UTC (rev 31524)
@@ -89,8 +89,7 @@
public void testSingleFolderCustomDeployFolderAbsolute() throws CoreException,
IOException {
IPath serverDeployRoot = new Path(ServerRuntimeUtils.getDeployRoot(server));
final String folderName = "test";
- IPath state = ASTest.getDefault().getStateLocation();
- IPath moduleDeployRoot =
state.append("testDeployments").append("absoluteFolder.place");
+ IPath moduleDeployRoot =
ServerRuntimeUtils.getBaseDir().append("absoluteFolder.place");
moduleDeployRoot.toFile().mkdirs();
IModule[] mods = singleFolderCreateModules(folderName);
DeploymentPreferences prefs =
DeploymentPreferenceLoader.loadPreferencesFromServer(server);
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2011-05-26
17:19:36 UTC (rev 31523)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2011-05-26
18:23:16 UTC (rev 31524)
@@ -45,6 +45,7 @@
import org.osgi.framework.Bundle;
public class ServerRuntimeUtils extends TestCase {
+
public static final IVMInstall VM_INSTALL = JavaRuntime.getDefaultVMInstall();
public static final String DEFAULT_CONFIG = "default";
public static final String twiddle_suffix = ".mf.twiddle.jar";
@@ -84,19 +85,28 @@
serverRuntimeMap.put(IJBossToolingConstants.SERVER_EAP_50,
IJBossToolingConstants.EAP_50);
}
public static IServer createMockDeployOnlyServer() throws CoreException {
- IPath state = ASTest.getDefault().getStateLocation();
- IPath deploy = state.append("testDeployments").append("deploy");
- IPath tmpDeploy =
state.append("testDeployments").append("tmpDeploy");
- return ServerRuntimeUtils.createMockDeployOnlyServer(deploy.toOSString(),
- tmpDeploy.toOSString());
+ return ServerRuntimeUtils.createMockDeployOnlyServer(getDeployFolder(),
getTmpDeployFolder());
}
public static IServer createMockJBoss7Server() throws CoreException {
- IPath state = ASTest.getDefault().getStateLocation();
- IPath deploy = state.append("testDeployments").append("deploy");
- IPath tmpDeploy =
state.append("testDeployments").append("tmpDeploy");
- return createMockJBoss7Server(deploy.toOSString(), tmpDeploy.toOSString());
+ return createMockJBoss7Server(getDeployFolder(), getTmpDeployFolder());
}
+ private static String getDeployFolder() {
+ return getBaseDir().append(getRandomString()).append("deploy").toOSString();
+ }
+
+ private static String getTmpDeployFolder() {
+ return
getBaseDir().append(getRandomString()).append("tmpDeploy").toOSString();
+ }
+
+ public static IPath getBaseDir() {
+ return ASTest.getDefault().getStateLocation().append("testDeployments");
+ }
+
+ private static String getRandomString() {
+ return String.valueOf(System.currentTimeMillis());
+ }
+
public static IServer createMockJBoss7Server(String deployLocation, String
tempDeployLocation) throws CoreException {
IServer s = ServerCreationUtils.createServer(IJBossToolingConstants.AS_70,
IJBossToolingConstants.SERVER_AS_70,
"/", "default");
Show replies by date