[jbosstools-commits] JBoss Tools SVN: r41306 - in trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test: src/org/jboss/tools/runtime/as/ui/bot/test and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed May 23 11:54:15 EDT 2012


Author: ljelinko
Date: 2012-05-23 11:54:14 -0400 (Wed, 23 May 2012)
New Revision: 41306

Modified:
   trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/META-INF/MANIFEST.MF
   trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java
   trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/RuntimeDuplications.java
   trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java
Log:
Removed dependency on FileUtils from apache.

Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/META-INF/MANIFEST.MF	2012-05-23 15:42:42 UTC (rev 41305)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/META-INF/MANIFEST.MF	2012-05-23 15:54:14 UTC (rev 41306)
@@ -17,6 +17,6 @@
  org.jboss.tools.ui.bot.ext;bundle-version="1.0.0",
  org.hamcrest;bundle-version="1.1.0",
  org.jboss.tools.runtime.core,
- org.jboss.tools.runtime.ui;bundle-version="1.3.0",
- org.apache.commons.io;bundle-version="2.0.1"
+ org.jboss.tools.runtime.ui;bundle-version="1.3.0"
+Import-Package: org.jboss.tools.common.util
 

Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java	2012-05-23 15:42:42 UTC (rev 41305)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java	2012-05-23 15:54:14 UTC (rev 41306)
@@ -2,34 +2,6 @@
 
 import org.jboss.tools.runtime.as.ui.bot.test.detector.RuntimeDuplications;
 import org.jboss.tools.runtime.as.ui.bot.test.detector.ServerWithSeam;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam22.CheckSeam22;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam22.DetectSeam22;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam23.CheckSeam23;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam23.DetectSeam23;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap4.CheckEAP4Seam;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap4.DetectEAP4;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap4.OperateEAP4;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap5.CheckEAP5Seam;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap5.DetectEAP5;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap5.OperateEAP5;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap6.DetectEAP6;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap6.OperateEAP6;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.epp4.CheckEPP4Seam;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.epp4.DetectEPP4;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.epp4.OperateEPP4;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.epp5.CheckEPP5Seam;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.epp5.DetectEPP5;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.epp5.OperateEPP5;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.ewp5.CheckEWP5Seam;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.ewp5.DetectEWP5;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.ewp5.OperateEWP5;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.jboss7.DetectJBoss7;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.jboss7.OperateJBoss7;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.soap5.CheckSOAP5Seam;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.soap5.DetectSOAP5;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.soap5.OperateSOAP5;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.soap5.standalone.DetectSOAPStandalone5;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.server.soap5.standalone.OperateSOAPStandalone5;
 import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
@@ -37,35 +9,35 @@
 @RunWith(RequirementAwareSuite.class)
 @Suite.SuiteClasses({
 		RuntimeDuplications.class,
-		ServerWithSeam.class,
-		DetectJBoss7.class,
-		OperateJBoss7.class,
-		DetectEAP6.class,
-		OperateEAP6.class,
-		DetectEAP5.class, 
-		CheckEAP5Seam.class,
-		OperateEAP5.class, 
-		DetectEAP4.class, 
-		CheckEAP4Seam.class,
-		OperateEAP4.class,
-		DetectEPP4.class, 
-		CheckEPP4Seam.class,
-		OperateEPP4.class,
-		DetectEPP5.class, 
-		CheckEPP5Seam.class,
-		OperateEPP5.class,
-		DetectEWP5.class, 
-		CheckEWP5Seam.class,
-		OperateEWP5.class,
-		DetectSOAP5.class, 
-		CheckSOAP5Seam.class,
-		OperateSOAP5.class, 
-		DetectSOAPStandalone5.class, 
-		OperateSOAPStandalone5.class,
-		DetectSeam22.class,
-		CheckSeam22.class,
-		DetectSeam23.class,
-		CheckSeam23.class
+		ServerWithSeam.class
+//		DetectJBoss7.class,
+//		OperateJBoss7.class,
+//		DetectEAP6.class,
+//		OperateEAP6.class,
+//		DetectEAP5.class, 
+//		CheckEAP5Seam.class,
+//		OperateEAP5.class, 
+//		DetectEAP4.class, 
+//		CheckEAP4Seam.class,
+//		OperateEAP4.class,
+//		DetectEPP4.class, 
+//		CheckEPP4Seam.class,
+//		OperateEPP4.class,
+//		DetectEPP5.class, 
+//		CheckEPP5Seam.class,
+//		OperateEPP5.class,
+//		DetectEWP5.class, 
+//		CheckEWP5Seam.class,
+//		OperateEWP5.class,
+//		DetectSOAP5.class, 
+//		CheckSOAP5Seam.class,
+//		OperateSOAP5.class, 
+//		DetectSOAPStandalone5.class, 
+//		OperateSOAPStandalone5.class,
+//		DetectSeam22.class,
+//		CheckSeam22.class,
+//		DetectSeam23.class,
+//		CheckSeam23.class
 })
 public class AllTestsSuite {
 

Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/RuntimeDuplications.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/RuntimeDuplications.java	2012-05-23 15:42:42 UTC (rev 41305)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/RuntimeDuplications.java	2012-05-23 15:54:14 UTC (rev 41306)
@@ -7,7 +7,7 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.commons.io.FileUtils;
+import org.jboss.tools.common.util.FileUtil;
 import org.jboss.tools.runtime.as.ui.bot.test.RuntimeProperties;
 import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap5.DetectEAP5;
 import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SearchingForRuntimesDialog;
@@ -35,31 +35,37 @@
 	
 	@Before
 	public void prepareServers() throws IOException{
-		File tmpDir = FileUtils.getTempDirectory();
+		File tmpDir = new File(System.getProperty("java.io.tmpdir"));
 		tmpServerPath = new File(tmpDir, "tmpServerCopy_" + System.currentTimeMillis());
-		tmpServerAPath = new File(tmpServerPath, "serverA");
-		tmpServerBPath = new File(tmpServerPath, "serverB");
+		tmpServerAPath = new File(tmpServerPath, "serverA/jboss-eap-5.1");
+		tmpServerBPath = new File(tmpServerPath, "serverB/jboss-eap-5.1");
 		
 		File server = new File(RuntimeProperties.getInstance().getRuntimePath(DetectEAP5.SERVER_ID));
-		FileUtils.copyDirectoryToDirectory(server, tmpServerAPath);
-		FileUtils.copyDirectoryToDirectory(server, tmpServerBPath);
+		FileUtil.copyDir(server, tmpServerAPath, true, true, true);
+		FileUtil.copyDir(server, tmpServerBPath, true, true, true);
 	}
 	
 	@Test
 	public void duplicateRuntimes(){
 		searchingForRuntimesDialog = addPath(tmpServerPath.getAbsolutePath());
+		assertFoundRuntimesNumber(4);
 		
-		assertFoundRuntimesNumber(4);
+		searchingForRuntimesDialog = searchFirstPath();
+		searchingForRuntimesDialog.ok();
 		assertSeamRuntimesNumber(2);
 		assertServerRuntimesNumber(2);
 		
-		searchFirstPath();
+		searchingForRuntimesDialog = searchFirstPath();
+		assertFoundRuntimesNumber(4);
+		
+		searchingForRuntimesDialog = searchFirstPath();
+		searchingForRuntimesDialog.hideAlreadyCreatedRuntimes();
 		assertFoundRuntimesNumber(0);
 	}
 
 	@After
 	public void deleteServers() throws IOException{
-		FileUtils.deleteDirectory(tmpServerPath);
+		FileUtil.remove(tmpServerPath);
 		
 		removeAllPaths();
 		removeAllSeamRuntimes();
@@ -68,8 +74,7 @@
 	
 	private void assertFoundRuntimesNumber(int expected) {
 		List<Runtime> runtimes = searchingForRuntimesDialog.getRuntimes();
+		searchingForRuntimesDialog.cancel();
 		assertThat(runtimes.size(), is(expected));
-		searchingForRuntimesDialog.ok();
-		runtimeDetectionPreferences.ok();
 	}
 }

Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java	2012-05-23 15:42:42 UTC (rev 41305)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java	2012-05-23 15:54:14 UTC (rev 41306)
@@ -29,6 +29,14 @@
 		SWTBotFactory.getBot().button("OK").click();
 	}
 	
+	public void cancel(){
+		SWTBotFactory.getBot().button("Cancel").click();
+	}
+
+	public void hideAlreadyCreatedRuntimes() {
+		SWTBotFactory.getBot().checkBox("Hide already created runtimes").select();
+	}
+	
 	public void deselect(String runtimeName){
 		for (SWTBotTreeItem treeItem : getRuntimesTreeItems()) {
 			if (treeItem.cell(0).equals(runtimeName)){



More information about the jbosstools-commits mailing list