|
Re: AbstractXtextTests in 2.0 [message #650931 is a reply to message #650887] |
Thu, 27 January 2011 08:00 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Henrik,
that's the right way to initialize the validator tester. It ensures,
that the global EMF registries will not be messed up after on test
execution.
Are you sure that your standalone setup registeres all the necessary
metamodels and resource factories?
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 27.01.11 04:09, schrieb Henrik Lindberg:
> Hi,
> how is the Validator used in Xtext 2.0 AbstractXtextTest ?
> There is an extra parameter EValidatorRegistrar and I tried a wild guess
> how it was supposed to be used.
>
> In my setUp I now have:
>
> with(MyStandaloneSetup.class);
> // TODO: Xtext 2.0 - is the below ok ? (registrar is new parameter).
> PPJavaValidator validator = get(MyJavaValidator.class);
> EValidatorRegistrar registrar = get(EValidatorRegistrar.class);
> tester = new ValidatorTester<MyJavaValidator>(validator, registrar);
>
> Is this the correct way to get the EValidatorRegistrar?
>
> I was able to call the validator, but I have lots of errors from failing
> serialization, and problems with unresolved proxies - probably not
> related to the ValidatorTester, but best to ask...
>
> The editor parses and produces the model ok, but not when run using the
> AbstractXtextTest. Is there some registration of my (external model)
> that may be missing and that is done differently in 2.0 ?
>
> Regards
> - henrik
|
|
|
|
Re: AbstractXtextTests in 2.0 [message #651080 is a reply to message #650960] |
Thu, 27 January 2011 17:04 |
Henrik Lindberg Messages: 2509 Registered: July 2009 |
Senior Member |
|
|
First part of the problem was a red herring - it was a toasted launch
config for the tests... - it now finds models as it is supposed to.
I do however not get calls to MyJavaValidator when running the tests
(works in the IDE and in 1.0). (I checked with the debugger, I can't say
I understand the data that is passed around when it is performing
validation, but the MyJavaValidator is included.
Do I need to make some specific declarations when running the tests?
Basically, the MyJavaValidator has a bunch of @Check methods for model
elements in the imported "MyModel" - in 1.0 it was enough to return the
MyPackage.eInstance from getPackages() (in 2.0, the imported package was
already registered by the super class so I added a check to not add it
twice).
Hints what to check next?
- henrik
On 1/27/11 11:18 AM, Henrik Lindberg wrote:
> I did not change anything in the standalone setup from the working setup
> for Xtext 1.0. Will investigate...
>
> - henrik
>
> On 1/27/11 9:00 AM, Sebastian Zarnekow wrote:
>> Hi Henrik,
>>
>> that's the right way to initialize the validator tester. It ensures,
>> that the global EMF registries will not be messed up after on test
>> execution.
>>
>> Are you sure that your standalone setup registeres all the necessary
>> metamodels and resource factories?
>>
>> Regards,
>> Sebastian
>
|
|
|
Re: AbstractXtextTests in 2.0 [message #651081 is a reply to message #651080] |
Thu, 27 January 2011 17:12 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Henrik,
does it make a differnce if your return a different result from
AbstractDeclarativeValidator#isLanguageSpecific?
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 27.01.11 18:04, schrieb Henrik Lindberg:
> First part of the problem was a red herring - it was a toasted launch
> config for the tests... - it now finds models as it is supposed to.
>
> I do however not get calls to MyJavaValidator when running the tests
> (works in the IDE and in 1.0). (I checked with the debugger, I can't say
> I understand the data that is passed around when it is performing
> validation, but the MyJavaValidator is included.
>
> Do I need to make some specific declarations when running the tests?
> Basically, the MyJavaValidator has a bunch of @Check methods for model
> elements in the imported "MyModel" - in 1.0 it was enough to return the
> MyPackage.eInstance from getPackages() (in 2.0, the imported package was
> already registered by the super class so I added a check to not add it
> twice).
>
> Hints what to check next?
>
> - henrik
>
> On 1/27/11 11:18 AM, Henrik Lindberg wrote:
>> I did not change anything in the standalone setup from the working setup
>> for Xtext 1.0. Will investigate...
>>
>> - henrik
>>
>> On 1/27/11 9:00 AM, Sebastian Zarnekow wrote:
>>> Hi Henrik,
>>>
>>> that's the right way to initialize the validator tester. It ensures,
>>> that the global EMF registries will not be messed up after on test
>>> execution.
>>>
>>> Are you sure that your standalone setup registeres all the necessary
>>> metamodels and resource factories?
>>>
>>> Regards,
>>> Sebastian
>>
>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03835 seconds