Test Content-Assist withing maven build [message #1705465] |
Sun, 16 August 2015 05:53  |
Eclipse User |
|
|
|
Hi,
I'm writing tests for a DSL.
One of these should test the content-assist.
I came across a reference which says the following:
Most of the mechanisms of a DSL implemented in Xtext can be tested with plain Java
Junit tests without a UI environment. However, when testing UI features, tests need a running Eclipse
Now, my tests should be part of a maven-build of the language, thus no eclipse running.
Is it possible to test the content-assist? how can i do it? this test is most important to us.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Test Content-Assist withing maven build [message #1707426 is a reply to message #1705465] |
Fri, 04 September 2015 12:19   |
Eclipse User |
|
|
|
Hi,
,I did what you suggested, and it did the job.
Now i have another problem which is caused by the scoping which checks that a resource is a physical file to avoid round-inheritance.
To test the content-assist I inherit the AbstractContentAssistTest
and creating a project with Xtext nature and builder at the background, and in this project I create files as resources which I want to cross-reference in my testing.
But I have a problem with the scoping. In the scoping I check that the resource is a physical file, which was a solution to avoid round-inheritance.
On the other hand, the computeProposals() method creates a resource from the newBuilder.append..... using the AbstractContentAssistTest.getResourceFor() method, and this resource is not a physical file, and thus the scoping check fails.
As for now, I'm avoiding this by creating a Degenerate physical-file for this resource on the Xtext-background project, but this is a bad solution as some of my resources could be very complected.
How can I test cross referencing If the scoping (which first get all relevant resources including the one I'm building with newBuilder.append) and its check is a must (to verify no round inheritance)and it test that the resource is a physical file?
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08301 seconds