Author: jjankovi
Date: 2012-05-23 09:47:41 -0400 (Wed, 23 May 2012)
New Revision: 41296
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveNode.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingProjectTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ViewIsPresentTest.java
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
Log:
new archives bot tests added
Property changes on: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test
___________________________________________________________________
Added: svn:ignore
+ *
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-05-23
13:46:09 UTC (rev 41295)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-05-23
13:47:41 UTC (rev 41296)
@@ -20,7 +20,14 @@
*/
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({
- ExampleTest.class
+ ViewIsPresentTest.class,
+ BuildingArchiveNode.class,
+ BuildingProjectTest.class,
+ BuildingArchiveTest.class,
+// CreatingArchiveTest.class,
+// ModifyingArchiveTest.class,
+// DeletingArchiveTest.class,
+// DeployingArchiveTest.class,
})
public class ArchivesAllBotTests {
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java
(rev 0)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java 2012-05-23
13:47:41 UTC (rev 41296)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * 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.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+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.helper.ImportHelper;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+@Require(clearProjects = true, perspective = "Java",
+ server = @Server(state = ServerState.NotRunning,
+ version = "6.0", operator = ">="))
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ ArchivesAllBotTests.class })
+public class ArchivesTestBase extends SWTTestExt {
+
+ protected static void importProject(String projectName) {
+
+ String location = "/resources/prj/" + projectName;
+
+ importProject(projectName, location, projectName);
+ }
+
+ protected static void importProject(String projectName,
+ String projectLocation, String dir) {
+
+ ImportHelper.importProject(projectLocation, dir, Activator.PLUGIN_ID);
+
+ eclipse.addConfiguredRuntimeIntoProject(projectName,
+ configuredState.getServer().name);
+ }
+
+ protected static void importProjectWithoutRuntime(String projectName) {
+
+ String location = "/resources/prj/" + projectName;
+
+ importProjectWithoutRuntime(projectName, location, projectName);
+ }
+
+ protected static void importProjectWithoutRuntime(String projectName,
+ String projectLocation, String dir) {
+
+ ImportHelper.importProject(projectLocation, dir, Activator.PLUGIN_ID);
+
+ }
+
+}
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveNode.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveNode.java
(rev 0)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveNode.java 2012-05-23
13:47:41 UTC (rev 41296)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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.view.ProjectArchivesView;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class BuildingArchiveNode extends ArchivesTestBase {
+
+ private static String projectName = "pr2";
+ private String archiveName = projectName + ".jar [/" + projectName +
"]";
+
+ @BeforeClass
+ public static void setup() {
+ importProjectWithoutRuntime(projectName);
+ }
+
+ @Test
+ public void testBuildingArchiveNode() {
+ ProjectArchivesView view = new ProjectArchivesView();
+ view.show();
+ projectExplorer.selectProject(projectName);
+ view.buildArchiveNode(projectName, archiveName);
+ }
+
+}
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveTest.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveTest.java
(rev 0)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingArchiveTest.java 2012-05-23
13:47:41 UTC (rev 41296)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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.explorer.ProjectArchivesExplorer;
+import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class BuildingArchiveTest extends ArchivesTestBase{
+
+ private static String projectName = "pr2";
+ private String archiveName = projectName + ".jar [/" + projectName +
"]";
+
+ @BeforeClass
+ public static void setup() {
+ importProjectWithoutRuntime(projectName);
+ }
+
+ @Test
+ public void testBuildingArchiveWithView() {
+ ProjectArchivesView view = new ProjectArchivesView();
+ view.show();
+ projectExplorer.selectProject(projectName);
+ view.buildArchiveFull(projectName, archiveName);
+ }
+
+ @Test
+ public void testBuildingArchiveWithExplorer() {
+ ProjectArchivesExplorer explorer =
+ new ProjectArchivesExplorer(projectName);
+ explorer.buildArchiveFull(archiveName);
+ }
+
+}
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingProjectTest.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingProjectTest.java
(rev 0)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/BuildingProjectTest.java 2012-05-23
13:47:41 UTC (rev 41296)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * 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.explorer.ProjectArchivesExplorer;
+import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class BuildingProjectTest extends ArchivesTestBase {
+
+ private static String projectName = "pr1";
+
+ @BeforeClass
+ public static void setup() {
+ importProjectWithoutRuntime(projectName);
+ }
+
+ @Test
+ public void testBuildingProjectWithView() {
+ ProjectArchivesView view = new ProjectArchivesView();
+ view.show();
+ projectExplorer.selectProject(projectName);
+ view.buildProjectFull(projectName);
+ }
+
+ @Test
+ public void testBuildingProjectWithExplorer() {
+ ProjectArchivesExplorer explorer =
+ new ProjectArchivesExplorer(projectName);
+ explorer.buildProjectFull();
+ }
+
+}
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ViewIsPresentTest.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ViewIsPresentTest.java
(rev 0)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ViewIsPresentTest.java 2012-05-23
13:47:41 UTC (rev 41296)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.view.ProjectArchivesView;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class ViewIsPresentTest extends ArchivesTestBase {
+
+ @Test
+ public void testArchivesViewIsPresent() {
+ ProjectArchivesView view = new ProjectArchivesView();
+ view.show();
+ assertTrue("Project Archives view is not active.",
+ bot.activeView().getTitle().equals(IDELabel.View.PROJECT_ARCHIVES));
+ }
+
+}