Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » [Problem]No context available outside of the request service lifecycle
[Problem]No context available outside of the request service lifecycle [message #1723111] Thu, 11 February 2016 17:32 Go to next message
Andre Lopes is currently offline Andre LopesFriend
Messages: 2
Registered: February 2016
Junior Member
Hi,

I'm trying to add some swtbot tests to an existing RCP application, but whenever I execute the test through the Eclipse IDE, I get the following error:

Quote:

!SESSION 2016-02-11 17:20:52.285 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_79
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -version 3 -port 61365 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames org.eclipsecon.swtbot.example.MyFirstTest -application org.eclipse.swtbot.eclipse.core.swtbottestapplication -testApplication org.eclipse.ui.ide.workbench -testpluginname foo.bar.tests
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -consoleLog -console -version 3 -port 61365 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames org.eclipsecon.swtbot.example.MyFirstTest -application org.eclipse.swtbot.eclipse.core.swtbottestapplication -testApplication org.eclipse.ui.ide.workbench -data /Users/xxxx/developer/workspaces/myws/../junit-workspace -dev file:/Users/xxx/developer/workspaces/myws/.metadata/.plugins/org.eclipse.pde.core/pde-junit/dev.properties -os macosx -ws cocoa -arch x86_64 -consoleLog -console -testpluginname foo.bar.tests

!ENTRY org.eclipse.osgi 4 0 2016-02-11 17:20:53.821
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: No context available outside of the request service lifecycle.
at org.eclipse.rwt.internal.service.ContextProvider.getContext(ContextProvider.java:107)
at org.eclipse.rwt.internal.service.ContextProvider.getStateInfo(ContextProvider.java:160)
at org.eclipse.rwt.SessionSingletonBase.getInstance(SessionSingletonBase.java:84)
at org.eclipse.ui.internal.Workbench.getInstance(Workbench.java:378)
at org.eclipse.ui.internal.Workbench.getWorkbenchTestable(Workbench.java:618)
at org.eclipse.ui.PlatformUI.getTestableObject(PlatformUI.java:182)
at org.eclipse.swtbot.eclipse.core.UITestApplication.start(UITestApplication.java:50)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)


The test class is the following

@RunWith(SWTBotJunit4ClassRunner.class)
public class MyFirstTest {
	private static SWTWorkbenchBot	bot;
	@BeforeClass
	public static void beforeClass() throws Exception {
		bot = new SWTWorkbenchBot();
	}
	@Test
	public void canCreateANewJavaProject() throws Exception {
	    System.out.println( "Start bot...ing" );
	}
}


EDIT-1: My current target platform is the following in the attached screen shot

What am I missing here?

[Updated on: Fri, 12 February 2016 10:22]

Report message to a moderator

Re: [Problem]No context available outside of the request service lifecycle [message #1723197 is a reply to message #1723111] Fri, 12 February 2016 13:06 Go to previous message
Andre Lopes is currently offline Andre LopesFriend
Messages: 2
Registered: February 2016
Junior Member
So it seems that I was adding too much plugins to the Run Configuration "Plug-Ins" section.

In the end I ended up with the following settings in the run configuration "Plug-ins" section:

Launch with: "plug-ins selected below"
Selected plugins: the workspace plugins + the ones selected by "Add required plug-ins"


Also, in my manifest I add to put the following required bundles:


  • org.eclipse.ui
  • org.eclipse.swtbot.eclipse.finder
  • org.eclipse.swtbot.junit4_x
  • org.hamcrest.core
  • org.apache.commons.collections
  • org.junit
  • org.apache.log4
  • org.eclipse.swtbot.go

Previous Topic:drag and drop from FigureCanvas
Next Topic:SWTBot Video Tutorials
Goto Forum:
  


Current Time: Tue Mar 19 08:22:56 GMT 2024

Powered by FUDForum. Page generated in 0.01580 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top