Author: mickael_istria
Date: 2012-10-04 03:29:39 -0400 (Thu, 04 Oct 2012)
New Revision: 44279
Modified:
trunk/tests/plugins/org.jboss.tools.tests.installation/src/org/jboss/tools/tests/installation/InstallFromCentralTest.java
Log:
Close welcome screen to ensure Central gets enough space to work.
Modified:
trunk/tests/plugins/org.jboss.tools.tests.installation/src/org/jboss/tools/tests/installation/InstallFromCentralTest.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.tests.installation/src/org/jboss/tools/tests/installation/InstallFromCentralTest.java 2012-10-04
07:20:26 UTC (rev 44278)
+++
trunk/tests/plugins/org.jboss.tools.tests.installation/src/org/jboss/tools/tests/installation/InstallFromCentralTest.java 2012-10-04
07:29:39 UTC (rev 44279)
@@ -1,12 +1,12 @@
-/*******************************************************************************
- * Copyright (c) 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
+/*******************************************************************************
+ * Copyright (c) 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.tests.installation;
@@ -19,27 +19,37 @@
import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* This is a bot scenario which performs install through JBoss Central.
- *
+ *
* @author Mickael Istria
*/
@RunWith(SWTBotJunit4ClassRunner.class)
public class InstallFromCentralTest extends SWTBotEclipseTestCase {
-
+
+ @Before
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ if (this.bot.activeView().getTitle().equals("Welcome")) {
+ this.bot.viewByTitle("Welcome").close();
+ }
+ }
+
@Test
public void testInstall() throws Exception {
- bot.menu("Help").menu("JBoss Central").click();
- SWTBotMultiPageEditor centralEditor = (SWTBotMultiPageEditor)
bot.multipageEditorByTitle("JBoss Central");
+ this.bot.menu("Help").menu("JBoss Central").click();
+ SWTBotMultiPageEditor centralEditor = (SWTBotMultiPageEditor)
this.bot.multipageEditorByTitle("JBoss Central");
centralEditor.show();
centralEditor.activatePage("Software/Update");
try {
int i = 0;
SWTBotCheckBox check = null;
- while ((check = bot.checkBox(i)) != null) {
+ while ((check = this.bot.checkBox(i)) != null) {
if (check.getText() == null || !check.getText().contains("Show Installed"))
{
check.click();
}
@@ -56,21 +66,21 @@
public boolean test() throws Exception {
return bot.activeShell().getText().equals("Install") ||
bot.activeShell().getText().equals("Problem Occured");
}
-
+
@Override
public void init(SWTBot bot) {
}
-
+
@Override
public String getFailureMessage() {
return "Blocking while calculating deps";
}
}, 10 * 60000); // 5 minutes timeout
- if (bot.activeShell().getText().equals("Problem Occured")) {
- String reason = bot.text().getText();
+ if (this.bot.activeShell().getText().equals("Problem Occured")) {
+ String reason = this.bot.text().getText();
Assert.fail("Could not install Central content from " +
System.getProperty("org.jboss.tools.central.discovery") + "\n" +
reason);
}
- bot.button("Next >").click();
+ this.bot.button("Next >").click();
InstallTest.continueInstall(bot);
}