Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » java.lang.IllegalStateException: Workbench has not been created yet.(errors with JUnit plug-in tests via console )
java.lang.IllegalStateException: Workbench has not been created yet. [message #1828434] Tue, 09 June 2020 14:56 Go to next message
Alberto Debiasi is currently offline Alberto DebiasiFriend
Messages: 84
Registered: March 2018
Member
I have a suite of tests that run with no errors if it is executed inside the Eclipse environment (run as JUnit plug-in tests). The product chosen is "org.eclipse.platform.ide".

But, if the suite of tests is executed via console using Maven (mvn install) it appers the following error:
java.lang.IllegalStateException: Workbench has not been created yet.
In this case I haven't set the "org.eclipse.platform.ide" product.

Do you have any idea to solve this issue?

Thanks in advice,
Alberto
Re: java.lang.IllegalStateException: Workbench has not been created yet. [message #1828456 is a reply to message #1828434] Wed, 10 June 2020 07:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Mostly people building Eclipse software use Maven with Tycho and use tycho-surefire-plugin to launch plugin tests.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: java.lang.IllegalStateException: Workbench has not been created yet. [message #1828459 is a reply to message #1828456] Wed, 10 June 2020 08:18 Go to previous messageGo to next message
Alberto Debiasi is currently offline Alberto DebiasiFriend
Messages: 84
Registered: March 2018
Member
I'm using "tycho-surefire-plugin". This is the build part of the pom.xml:

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<failIfNoTests>false</failIfNoTests>
<product>org.eclipse.platform.ide</product>
</configuration>
</plugin>
</plugins>
</build>
Re: java.lang.IllegalStateException: Workbench has not been created yet. [message #1828478 is a reply to message #1828459] Wed, 10 June 2020 12:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Does the test really launch an IDE with a workspace? Where you're running it, is able to create a display? If you can look at the workspace, you can probably find more details in the log.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: java.lang.IllegalStateException: Workbench has not been created yet. [message #1828482 is a reply to message #1828478] Wed, 10 June 2020 13:26 Go to previous message
Alberto Debiasi is currently offline Alberto DebiasiFriend
Messages: 84
Registered: March 2018
Member
Now it works.
I modified the pom.xml as follow:

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<failIfNoTests>false</failIfNoTests>
<product>org.eclipse.platform.ide</product>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
</configuration>
</plugin>
</plugins>
</build>
Previous Topic:Edit environment variables and start project build automatically with Python
Next Topic:Unable to install scala in eclipse oxygen version
Goto Forum:
  


Current Time: Wed Apr 24 15:30:18 GMT 2024

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

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

Back to the top