Author: jjankovi
Date: 2012-06-04 10:29:35 -0400 (Mon, 04 Jun 2012)
New Revision: 41682
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/VariousProjectsArchiving.java
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/CreatingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeployingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java
Log:
new test VariousProjectArchiving 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-04
14:28:58 UTC (rev 41681)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-06-04
14:29:35 UTC (rev 41682)
@@ -21,6 +21,7 @@
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({
ViewIsPresentTest.class,
+ VariousProjectsArchiving.class,
BuildingArchiveNode.class,
BuildingProjectTest.class,
BuildingArchiveTest.class,
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java 2012-06-04
14:28:58 UTC (rev 41681)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java 2012-06-04
14:29:35 UTC (rev 41682)
@@ -54,7 +54,7 @@
}
@Test
- public void testCreatingArchivetWithView() {
+ public void testCreatingArchiveWithView() {
/* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java 2012-06-04
14:28:58 UTC (rev 41681)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java 2012-06-04
14:29:35 UTC (rev 41682)
@@ -39,7 +39,7 @@
}
@Test
- public void testDeletingArchivetWithView() {
+ public void testDeletingArchiveWithView() {
/* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeployingArchiveTest.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeployingArchiveTest.java 2012-06-04
14:28:58 UTC (rev 41681)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeployingArchiveTest.java 2012-06-04
14:29:35 UTC (rev 41682)
@@ -46,7 +46,7 @@
}
@Test
- public void testDeployingArchivetWithView() {
+ public void testDeployingArchiveWithView() {
/* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java 2012-06-04
14:28:58 UTC (rev 41681)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java 2012-06-04
14:29:35 UTC (rev 41682)
@@ -49,7 +49,7 @@
}
@Test
- public void testModifyingArchivetWithView() {
+ public void testModifyingArchiveWithView() {
/* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/VariousProjectsArchiving.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/VariousProjectsArchiving.java
(rev 0)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/VariousProjectsArchiving.java 2012-06-04
14:29:35 UTC (rev 41682)
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * 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.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.gen.INewObject;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.After;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+@Require(clearProjects = true, perspective = "Java",
+ server = @Server(state = ServerState.NotRunning,
+ version = "6.0", operator = ">="))
+public class VariousProjectsArchiving extends ArchivesTestBase {
+
+ @BeforeClass
+ public static void prepareWorkspace() {
+ showErrorView();
+ clearErrorView();
+ }
+
+ @After
+ public void testEmptyErrorLog() {
+ assertClearErrorLog();
+ }
+
+ @Test
+ public void testDynamicWebProject() {
+ String project = "pr1";
+
+ /* create dynamic web project */
+ createDynamicWebProject(project);
+
+ /* open view for project */
+ ProjectArchivesView view = viewForProject(project);
+
+ /* create archive */
+ view.createNewJarArchive(project).finish();
+
+ /* test if archive was created and no error was thrown*/
+ assertItemExistsInView(view,
+ project, project + ".jar [/" + project + "]");
+ }
+
+ @Test
+ public void testEJBProject() {
+ String project = "pr2";
+
+ /* create ejb project */
+ createEJBProject(project);
+
+ /* open view for project */
+ ProjectArchivesView view = viewForProject(project);
+
+ /* create archive */
+ view.createNewJarArchive(project).finish();
+
+ /* test if archive was created and no error was thrown*/
+ assertItemExistsInView(view,
+ project, project + ".jar [/" + project + "]");
+ }
+
+ private void createDynamicWebProject(String project) {
+ createProject(ActionItem.NewObject.
+ WebDynamicWebProject.LABEL, project);
+ }
+
+ private void createEJBProject(String project) {
+ createProject(ActionItem.NewObject.
+ EJBEJBProject.LABEL, project);
+
+ }
+
+ private void createProject(INewObject object,
+ String project) {
+ SWTBot bot = open.newObject(object);
+ SWTBotText t = bot.textWithLabel("Project name:");
+ t.setFocus();
+ t.setText(project);
+ bot.button(IDELabel.Button.FINISH).click();
+ handlePerspectivePopUpDialog();
+ util.waitForNonIgnoredJobs();
+ }
+
+ private void handlePerspectivePopUpDialog() {
+ try {
+ bot.shell(IDELabel.Shell.OPEN_ASSOCIATED_PERSPECTIVE)
+ .bot().button(IDELabel.Button.NO).click();
+ } catch (WidgetNotFoundException exc) {
+ //do nothing here
+ }
+ }
+}