Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » testing autocompletion (and other UI stuff)
testing autocompletion (and other UI stuff) [message #957532] Thu, 25 October 2012 09:42 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 430
Registered: July 2009
Location: Gothenburg
Senior Member
Hi!

I am lost again in the Xtext jungle Smile

I want to test autocompletion and other UI stuff as part of the acceptance tests. I don't want to use UI tests for that, as they are too heavy. So I am targeting the language's service classes, for example the MylangProposalProvider.

All well, but there is quite a lot of scaffolding: for example implementing a dummy ICompletionProposalAcceptor and such.

Is there any support for making this easier? I suppose everybody has to do it and it's not language-specific.

best regards,
Vlad
Re: testing autocompletion (and other UI stuff) [message #957570 is a reply to message #957532] Thu, 25 October 2012 10:18 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 211
Registered: July 2009
Senior Member
Hi,

to me, the best way to test Xtext languages is Moritz' Xpect Framework:
https://github.com/meysholdt/Xpect

Andreas
Re: testing autocompletion (and other UI stuff) [message #957664 is a reply to message #957570] Thu, 25 October 2012 11:55 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 430
Registered: July 2009
Location: Gothenburg
Senior Member
Thanks Andreas!

That might be interesting to explore, but I can't even compile it, it can't find a reference to de.itemis.statefullexer.StatefulLexerFragment, which is not included in the sources... And there's no documentation either...

regards,
Vlad
Re: testing autocompletion (and other UI stuff) [message #960519 is a reply to message #957532] Sat, 27 October 2012 14:58 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3109
Registered: July 2009
Senior Member
Hi Vlad,

you should have a look at the org.eclipse.xtext.junit4 bundle. It
contains some useful utilities, e.g. the
ContentAssistProcessorTestBuilder, or the
AbstractContentAssistProcessorTest (and its subtypes).

It allows to write tests like this one (example for Xtext grammar CA tests):

@Test public void testCompleteAfterGrammarName_02() throws Exception {
newBuilder().append("grammar org.foo.bar ").assertText(
"with",
"Name",
"enum", "terminal",
"hidden",
"generate", "import");
}

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 25.10.12 11:42, schrieb Vlad Dumitrescu:
> Hi!
>
> I am lost again in the Xtext jungle :)
>
> I want to test autocompletion and other UI stuff as part of the
> acceptance tests. I don't want to use UI tests for that, as they are too
> heavy. So I am targeting the language's service classes, for example the
> MylangProposalProvider.
>
> All well, but there is quite a lot of scaffolding: for example
> implementing a dummy ICompletionProposalAcceptor and such.
> Is there any support for making this easier? I suppose everybody has to
> do it and it's not language-specific.
>
> best regards,
> Vlad
>
Re: testing autocompletion (and other UI stuff) [message #960520 is a reply to message #960519] Sat, 27 October 2012 15:03 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 430
Registered: July 2009
Location: Gothenburg
Senior Member
Thank you again, Christian!

There's so much good stuff in Xtext, well hidden in plain sight Smile
Previous Topic:pre-generate resource descriptions
Next Topic:How to execute two different types of resolution in same unit of work?
Goto Forum:
  


Current Time: Thu Apr 15 03:37:30 GMT 2021

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

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

Back to the top