|
|
Re: Headless testing for xtext [message #1312751 is a reply to message #1292297] |
Thu, 24 April 2014 13:28 |
|
Did you use create a Injector? The standaloneSetup of a language can
create an injector or you can create a separated one for the generator.
The generator should be instantiated only through an injector. Otherwise
the injection will never work. May be you should have a look at
http://www.xpect-tests.org/ which handles generator tests in an easy way.
Cheers,
Holger
On 11.04.14 19:57, Arshad Adavani wrote:
> Hi all,
> I was trying out for headless testing for my code generators in my xtext
> project.
> To begin with, I just created a java class (which is not present in
> ....tests project generated by xtext), Injected the injector and did emf
> registration. I have written a method (Say method name
> "callGenerators()") where my generators are called in the same class.
> And from the main method of this class I am trying to call this method
> i.e callGenerators(). But It doesn't look like all the injections have
> been injected properly. My injector, resourceset everything is null. But
> when I write the same code in JUNIT class then it works fine.
>
> And I will execute this class from the command prompt for my headless
> testing.
> This was just a try. Is this the right approach that I followed? Any
> further configurations needs to be done?
>
> Or can someone tell me how to start with it if I am wrong.
>
> Thanks in advance :)
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
|
|
|
Powered by
FUDForum. Page generated in 0.02960 seconds