Have used the ContactManagerRCP to do a simple test ---- start the application and close the application.... (and failed (hand in face))
It's failing on the line........
ui.ensureThat(new ShellLocator("RCP Contacts Editor").isClosed());
Don't understand why.....noticed something similar on this forum but never went on to provide how to fix.
I also noticed by accident that if I run it as a 'org.eclipse.platform.ide' in the run config bit --- it passes ----- but if I run it as the actual rcp product it fails (this might be a red herring?)
Any help appreciated.
Error log and full code (minus import statements) below.
!ENTRY com.instantiations.eclipse 1 0 2011-04-19 17:33:50.453
!MESSAGE WindowTester: 201009131510 - win32,win32,x86
Exception in thread "WorkbenchTestable" org.eclipse.swt.SWTException: Device is disposed
at org.eclipse.swt.SWT.error(SWT.java:4083)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.SWT.error(SWT.java:3969)
at org.eclipse.swt.widgets.Display.error(Display.java:1249)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4581)
at org.eclipse.ui.internal.testing.WorkbenchTestable.testingFinished(WorkbenchTestable.java:122)
at org.eclipse.pde.internal.junit.runtime.UITestApplication.runTests(UITestApplication.java:120)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
at java.lang.Thread.run(Unknown Source)
public class test1 extends UITestCaseSWT {
/* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
IUIContext ui = getUI();
ui.ensureThat(new WorkbenchLocator().hasFocus());
ui.ensureThat(ViewLocator.forName("Welcome").isClosed());
ui.ensureThat(new WorkbenchLocator().isMaximized());
}
/**
* Main test method.
*/
public void testtest1() throws Exception {
IUIContext ui = getUI();
ui.ensureThat(new ShellLocator("RCP Contacts Editor").isClosed());
ui.wait(new ShellDisposedCondition("RCP Contacts Editor"));
}
}