[jbosstools-commits] JBoss Tools SVN: r41858 - trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Jun 11 09:52:34 EDT 2012


Author: jjankovi
Date: 2012-06-11 09:52:34 -0400 (Mon, 11 Jun 2012)
New Revision: 41858

Added:
   trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/FolderTest.java
Modified:
   trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchiveViewReSwitchingTest.java
   trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
Log:
FolderTest implemented and included in test suite

Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchiveViewReSwitchingTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchiveViewReSwitchingTest.java	2012-06-11 13:50:36 UTC (rev 41857)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchiveViewReSwitchingTest.java	2012-06-11 13:52:34 UTC (rev 41858)
@@ -8,7 +8,6 @@
  * Contributors:
  * Red Hat, Inc. - initial API and implementation
  ******************************************************************************/
-
 package org.jboss.tools.archives.ui.bot.test;
 
 import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
@@ -18,7 +17,6 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-
 /**
  * 
  * @author jjankovi

Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java	2012-06-11 13:50:36 UTC (rev 41857)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java	2012-06-11 13:52:34 UTC (rev 41858)
@@ -23,6 +23,7 @@
 	ViewIsPresentTest.class,
 	VariousProjectsArchiving.class,
 	ArchiveViewReSwitchingTest.class,
+	FolderTest.class,
 	BuildingArchiveNode.class,
 	BuildingProjectTest.class,
 	BuildingArchiveTest.class,

Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/FolderTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/FolderTest.java	                        (rev 0)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/FolderTest.java	2012-06-11 13:52:34 UTC (rev 41858)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.archives.ui.bot.test;
+
+import org.jboss.tools.archives.ui.bot.test.dialog.FolderCreatingDialog;
+import org.jboss.tools.archives.ui.bot.test.explorer.ProjectArchivesExplorer;
+import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * 
+ * @author jjankovi
+ *
+ */
+public class FolderTest extends ArchivesTestBase {
+
+	private static String projectName = "pr2";
+	
+	private final String PATH_SUFFIX = " [/" + projectName + "]"; 
+	private final String ARCHIVE_NAME = projectName + ".jar";
+	private final String ARCHIVE_PATH = 
+			ARCHIVE_NAME + PATH_SUFFIX;
+	
+	@BeforeClass
+	public static void setup() {
+		importProjectWithoutRuntime(projectName);
+	}
+	
+	@Test
+	public void testCreatingFolderInView() {
+		String folderName = "a";
+		
+		/* prepare view for testing */
+		ProjectArchivesView view = viewForProject(projectName);
+		
+		/* create folder */
+		createFolderForArchive(view.createFolder(projectName, ARCHIVE_PATH), folderName);
+		
+		/* test if folder was created */
+		assertItemExistsInView(view, projectName, ARCHIVE_PATH, folderName);
+	}
+	
+	@Test
+	public void testCreatingFolderInExplorer() {
+		String folderName = "b";
+		
+		/* prepare explorer for testing */
+		ProjectArchivesExplorer explorer = explorerForProject(projectName);
+		
+		/* create folder */
+		createFolderForArchive(explorer.createFolder(ARCHIVE_PATH), folderName);
+		
+		/* test if folder was created */
+		assertItemExistsInExplorer(explorer, ARCHIVE_PATH, folderName);
+	}
+	
+	private void createFolderForArchive(FolderCreatingDialog dialog,
+			String folderName) {
+		dialog.setNameOfFolder(folderName).ok();
+	}
+	
+}



More information about the jbosstools-commits mailing list