Author: yzhishko
Date: 2009-10-07 11:17:08 -0400 (Wed, 07 Oct 2009)
New Revision: 17963
Modified:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/resources/SWTBot.properties
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/test/TestProperties.java
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.java
Log:
Preferences for SWTBot should be loaded.
Modified: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/resources/SWTBot.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/resources/SWTBot.properties 2009-10-07
15:10:55 UTC (rev 17962)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/resources/SWTBot.properties 2009-10-07
15:17:08 UTC (rev 17963)
@@ -1,2 +1,2 @@
-#SWTBotPreferences.PLAYBACK_DELAY=25
-#SWTBotPreferences.TIMEOUT=1
+SWTBotPreferences.PLAYBACK_DELAY=25
+SWTBotPreferences.TIMEOUT=1000
Modified:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/test/TestProperties.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/test/TestProperties.java 2009-10-07
15:10:55 UTC (rev 17962)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/test/TestProperties.java 2009-10-07
15:17:08 UTC (rev 17963)
@@ -7,21 +7,24 @@
public class TestProperties extends Properties {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2611391472191407247L;
+
+
public TestProperties() {
super();
- // TODO Auto-generated constructor stub
}
public TestProperties(Properties defaults) {
super(defaults);
- // TODO Auto-generated constructor stub
}
@Override
public synchronized void load(InputStream inStream) throws IOException {
- // TODO Auto-generated method stub
super.load(inStream);
substituteSystemProperties(this);
}
Modified:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2009-10-07
15:10:55 UTC (rev 17962)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2009-10-07
15:17:08 UTC (rev 17963)
@@ -6,6 +6,7 @@
import org.eclipse.core.runtime.ILogListener;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
@@ -18,11 +19,11 @@
protected static final String BUILDING_WS = "Building workspace";
protected static final String VISUAL_UPDATE = "Visual Editor View Update";
protected static final String VISUAL_REFRESH = "Visual Editor Refresh";
+ private static Properties SWT_BOT_PROPERTIES;
private volatile Throwable exception;
public static final String PATH_TO_SWT_BOT_PROPERTIES = "SWTBot.properties";
- private static Properties SWT_BOT_PROPERTIES;
protected SWTJBTBot bot = new SWTJBTBot();
- private int sleepTime = 5000;
+ private static int sleepTime = 1000;
/* (non-Javadoc)
* This static block read properties from
@@ -32,6 +33,27 @@
*/
static {
+ try {
+ InputStream inputStream =
JBTSWTBotTestCase.class.getResourceAsStream("/"+PATH_TO_SWT_BOT_PROPERTIES);
+ SWT_BOT_PROPERTIES = new Properties();
+ SWT_BOT_PROPERTIES.load(inputStream);
+ SWTBotPreferences.PLAYBACK_DELAY = Long
+ .parseLong(SWT_BOT_PROPERTIES
+ .getProperty("SWTBotPreferences.PLAYBACK_DELAY"));
+ SWTBotPreferences.TIMEOUT = Long.parseLong(SWT_BOT_PROPERTIES
+ .getProperty("SWTBotPreferences.TIMEOUT"));
+ inputStream.close();
+ }
+ catch (IOException e) {
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Can't load
properties from " + PATH_TO_SWT_BOT_PROPERTIES + " file", e);
+ Activator.getDefault().getLog().log(status);
+ e.printStackTrace();
+ }
+ catch (IllegalStateException e) {
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Property file
" + PATH_TO_SWT_BOT_PROPERTIES + " was not found", e);
+ Activator.getDefault().getLog().log(status);
+ e.printStackTrace();
+ }
// try {
// InputStream swtPreferenceIS =
Platform.getBundle(Activator.PLUGIN_ID).getResource(PATH_TO_SWT_BOT_PROPERTIES)
// .openStream();
@@ -165,6 +187,7 @@
} catch (WidgetNotFoundException e) {
bot.menu("Window").menu("Show
View").menu("Other...").click();
SWTBotTree viewTree = bot.tree();
+ delay();
viewTree.expandNode("General")
.expandNode(WidgetVariables.ERROR_LOG).select();
bot.button("OK").click();
@@ -181,6 +204,7 @@
} catch (WidgetNotFoundException e) {
bot.menu("Window").menu("Show
View").menu("Other...").click();
SWTBotTree viewTree = bot.tree();
+ delay();
viewTree.expandNode("Java").expandNode(
WidgetVariables.PACKAGE_EXPLORER).select();
bot.button("OK").click();
Modified:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java 2009-10-07
15:10:55 UTC (rev 17962)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java 2009-10-07
15:17:08 UTC (rev 17963)
@@ -1,13 +1,10 @@
package org.jboss.tools.ui.bot.test;
-import static
org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartId;
import static
org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
import static org.eclipse.swtbot.eclipse.finder.waits.Conditions.waitForEditor;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.waits.WaitForEditor;
import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IViewReference;
-import org.eclipse.ui.IWorkbenchPartReference;
import org.hamcrest.Matcher;
/**
Modified:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.java 2009-10-07
15:10:55 UTC (rev 17962)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.java 2009-10-07
15:17:08 UTC (rev 17963)
@@ -11,7 +11,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
import org.eclipse.datatools.connectivity.ConnectionProfileException;
@@ -47,6 +46,7 @@
private static final String RUNTIME_PROPERTIES = "runtimePaths.properties";
static{
+// System.setProperty("jbosstools.test.jboss.home",
"C:/jbdevstudio0609/jboss-eap/jboss-as");
try {
InputStream inputStream =
JBossRuntimeStartup.class.getResourceAsStream("/"+RUNTIME_PROPERTIES);
properties = new TestProperties();
Show replies by date