Author: jgargula
Date: 2012-01-11 09:46:24 -0500 (Wed, 11 Jan 2012)
New Revision: 37769
Modified:
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
Log:
Fixed problem with second run.
Modified:
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
===================================================================
---
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java 2012-01-11
14:43:35 UTC (rev 37768)
+++
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java 2012-01-11
14:46:24 UTC (rev 37769)
@@ -12,16 +12,17 @@
import java.io.File;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.jboss.tools.drools.ui.bot.test.smoke.DecisionTableTest;
import org.jboss.tools.drools.ui.bot.test.smoke.DomainSpecificLanguageEditorTest;
-//import org.jboss.tools.drools.ui.bot.test.smoke.GuidedDroolsRulesEditorTest;
+import org.jboss.tools.drools.ui.bot.test.smoke.DroolsRulesEditorTest;
+import org.jboss.tools.drools.ui.bot.test.smoke.DroolsViewsTest;
import org.jboss.tools.drools.ui.bot.test.smoke.GuvnorRepositoriesTest;
-import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsRuntime;
import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsProject;
import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsRules;
-import org.jboss.tools.drools.ui.bot.test.smoke.DroolsRulesEditorTest;
+import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsRuntime;
import org.jboss.tools.drools.ui.bot.test.smoke.OpenDroolsPerspective;
import org.jboss.tools.drools.ui.bot.test.smoke.RuleFlowTest;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
@@ -52,7 +53,8 @@
DomainSpecificLanguageEditorTest.class,
RuleFlowTest.class,
DecisionTableTest.class,
- GuvnorRepositoriesTest.class})
+ GuvnorRepositoriesTest.class,
+ DroolsViewsTest.class})
public class DroolsAllBotTests extends SWTTestExt {
public static final String DROOLS_PROJECT_NAME = "droolsTest";
public static final String DROOLS_RUNTIME_NAME = "Drools Test Runtime";
@@ -67,12 +69,13 @@
public static final String GUIDED_DROOLS_RULE_NAME = "GuidedRule.brl";
public static final String DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME =
"DslTest.dsl";
public static final String RULE_FLOW_JAVA_TEST_FILE_NAME =
"ProcessTest.java";
- public static final String RULE_FLOW_RF_FILE_NAME = "ruleflow.rf";
+ public static final String RULE_FLOW_RF_FILE_NAME =
"ruleflow.rf";//"sample.bpmn";
public static final String DECISION_TABLE_JAVA_TEST_FILE_NAME =
"DecisionTableTest.java";
public static final String USE_EXTERNAL_DROOLS_RUNTIME_PROPERTY_NAME =
"use-external-drools-runtime";
public static final String EXTERNAL_DROOLS_RUTIME_HOME_PROPERTY_NAME =
"external-drools-runtime-home";
public static final String GUVNOR_REPOSITORY_URL_PROPERTY_NAME =
"guvnor-repository-url";
private static boolean USE_EXTERNAL_DROOLS_RUNTIME;
+ private static boolean isFirstRun = true;
private static String testDroolsRuntimeName = null;
private static String testDroolsRuntimeLocation = null;
@@ -114,6 +117,11 @@
@BeforeClass
public static void setUpTest() {
+ if (isFirstRun) {
+ isFirstRun = false;
+ } else {
+ return;
+ }
props = util.loadProperties(Activator.PLUGIN_ID);
String guvnorRepositoryUrl =
props.getProperty(DroolsAllBotTests.GUVNOR_REPOSITORY_URL_PROPERTY_NAME);
if (guvnorRepositoryUrl != null){
@@ -124,7 +132,7 @@
DroolsAllBotTests.USE_EXTERNAL_DROOLS_RUNTIME = useExternalDroolRuntime != null
&& useExternalDroolRuntime.equalsIgnoreCase("true");
String droolsRuntimeLocation =
props.getProperty(DroolsAllBotTests.EXTERNAL_DROOLS_RUTIME_HOME_PROPERTY_NAME);
String tmpDir = System.getProperty("java.io.tmpdir");
- if (droolsRuntimeLocation == null || droolsRuntimeLocation.length() ==0){
+ if (droolsRuntimeLocation == null || droolsRuntimeLocation.length() == 0) {
DroolsAllBotTests.DROOLS_RUNTIME_LOCATION = tmpDir;
}
else{
@@ -134,11 +142,19 @@
// Create directory for Drools Runtime which will be created as a part of test
new File(DroolsAllBotTests.CREATE_DROOLS_RUNTIME_LOCATION).mkdir();
try{
+ bot.button(IDELabel.Button.NO).click();
SWTBotView welcomeView = eclipse.getBot().viewByTitle(IDELabel.View.WELCOME);
welcomeView.close();
} catch (WidgetNotFoundException wnfe){
// Do nothing ignore this error
}
+ // Close JBoss Central editor
+ for (SWTBotEditor editor : bot.editors()) {
+ if (IDELabel.View.JBOSS_CENTRAL.equals(editor.getTitle())) {
+ editor.close();
+ break;
+ }
+ }
eclipse.openPerspective(PerspectiveType.JAVA);
eclipse.maximizeActiveShell();
}
Show replies by date