[jbosstools-commits] JBoss Tools SVN: r41880 - 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
Tue Jun 12 04:18:22 EDT 2012
Author: jjankovi
Date: 2012-06-12 04:18:22 -0400 (Tue, 12 Jun 2012)
New Revision: 41880
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/FilesetTest.java
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
Log:
FilesetTest implemented and added into test suite
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-12 08:17:44 UTC (rev 41879)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-06-12 08:18:22 UTC (rev 41880)
@@ -24,6 +24,7 @@
VariousProjectsArchiving.class,
ArchiveViewReSwitchingTest.class,
FolderTest.class,
+ FilesetTest.class,
UserLibrariesFilesetTest.class,
BuildingArchiveNode.class,
BuildingProjectTest.class,
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/FilesetTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/FilesetTest.java (rev 0)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/FilesetTest.java 2012-06-12 08:18:22 UTC (rev 41880)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * 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.FilesetDialog;
+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 FilesetTest 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 testCreatingFileSetInView() {
+ String includes = "**";
+ String excludes = "*.jar";
+
+ /* prepare view for testing */
+ ProjectArchivesView view = viewForProject(projectName);
+
+ /* create folder */
+ String fileset = createFileset(view.createFileset(projectName, ARCHIVE_PATH),
+ includes, excludes, true);
+
+ /* test if folder was created */
+ assertItemExistsInView(view, projectName, ARCHIVE_PATH, fileset + projectName);
+ }
+
+ @Test
+ public void testCreatingFileSetInExplorer() {
+ String includes = "**";
+ String excludes = "*.jar, .svn/**";
+
+ /* prepare view for testing */
+ ProjectArchivesExplorer explorer = explorerForProject(projectName);
+
+ /* create folder */
+ String fileset = createFileset(explorer.createFileset(ARCHIVE_PATH),
+ includes, excludes, true);
+
+ /* test if folder was created */
+ assertItemExistsInExplorer(explorer, ARCHIVE_PATH, fileset + projectName);
+ }
+
+ private String createFileset(FilesetDialog dialog, String includes,
+ String excludes, boolean setFlatten) {
+ dialog.setIncludes(includes).setExcludes(excludes).
+ setFlatten(setFlatten).finish();
+ return "+[" + includes + "] -[" + excludes + "] : /";
+ }
+
+}
More information about the jbosstools-commits
mailing list