I really hope someone can help me with this...
I created a method to wait until a button becomes enabled:
public void isButtonEnabled(final String text) {
ICondition condition = new DefaultCondition()
{
public boolean test() throws Exception
{
return bot.button(text).isEnabled();
}
public String getFailureMessage()
{
return "Button isn't enabled.";
}
};
bot.waitUntil( condition );
}
I've imported both:
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.eclipse.swtbot.swt.finder.waits.ICondition;
My Manifest file includes:
Manifest-Version: 1.0
Bnd-LastModified: 1338365577629
Build-Jdk: 1.6.0_29
Built-By: yahav
Bundle-ClassPath: .,junit-dep-4.10.jar
Bundle-ManifestVersion: 2
Bundle-Name: Detection Wizard Tests
Bundle-SymbolicName: com.project.detection-wizard-tests;singleton:=true
Bundle-Version: 1.0.0
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: *;scope=compile|runtime
Embedded-Artifacts: junit-dep-4.10.jar;g="junit";a="junit-dep";v="4.10"
Export-Package: com.project.detection.wizard.tests;uses:="org.eclipse.s
wtbot.eclipse.finder,org.eclipse.swtbot.swt.finder.utils,org.eclipse.sw
tbot.swt.finder.widgets,org.eclipse.swtbot.swt.finder,org.eclipse.swtbo
t.swt.finder.waits,org.eclipse.swt.widgets,org.eclipse.swtbot.swt.finde
r.results,org.apache.log4j,org.eclipse.swtbot.swt.finder.exceptions,org
.hamcrest";version="1.0.0",com.project.detection.wizard.tests.api;uses
:="org.eclipse.swtbot.eclipse.finder,org.eclipse.swtbot.swt.finder,org.
eclipse.swtbot.swt.finder.waits,org.eclipse.swtbot.swt.finder.utils,org
.eclipse.swtbot.swt.finder.widgets,org.eclipse.swt.widgets,org.eclipse.
swtbot.swt.finder.results,org.apache.log4j,org.eclipse.swtbot.swt.finde
r.exceptions,org.hamcrest";version="1.0.0"
Import-Package: org.apache.log4j;version="[1.2,2)",org.eclipse.swt.widge
ts,org.eclipse.swtbot.eclipse.finder,org.eclipse.swtbot.swt.finder,org.
eclipse.swtbot.swt.finder.exceptions,org.eclipse.swtbot.swt.finder.resu
lts,org.eclipse.swtbot.swt.finder.utils,org.eclipse.swtbot.swt.finder.w
aits,org.eclipse.swtbot.swt.finder.widgets,org.hamcrest,org.hamcrest.co
re
Require-Bundle: org.junit4
Tool: Bnd-1.50.0
Everything looks OK, but I still get the following error:
java.lang.NoClassDefFoundError: org/eclipse/swtbot/swt/finder/waits/ICondition
at com.hp.slick.detection.wizard.tests.SmartStepsTest.setUp(SmartStepsTest.java:34)
at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner.run(EclipseTestRunner.java:350)
at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner.run(EclipseTestRunner.java:208)
at org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication.runTests(UITestApplication.java:116)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swtbot.swt.finder.waits.ICondition
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:489)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Can anyone tell me what's wrong?
In my code I use other packages from org.eclipse.swtbot.swt.finder bundle and they work fine (e.g. org.eclipse.swtbot.swt.finder.widgets.SWTBotLabel or org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences)
I have no idea what's going on, and I'm thinking whether to create my own waitUntil method with my own ICondition, but it's a hassle and an ugly workaround.
Ketan is not around as far as I can tell, so I hope someone can assist me with this issue.
Thanks!