Skip to main content



      Home
Home » Modeling » TMF (Xtext) » testing autocompletion (and other UI stuff)
testing autocompletion (and other UI stuff) [message #957532] Thu, 25 October 2012 05:42 Go to next message
Eclipse UserFriend
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 06:18 Go to previous messageGo to next message
Eclipse UserFriend
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 07:55 Go to previous messageGo to next message
Eclipse UserFriend
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 10:58 Go to previous messageGo to next message
Eclipse UserFriend
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 11:03 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 04:57:09 EDT 2025

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

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

Back to the top