|
|
|
Re: How to unit test global scoping [message #865293 is a reply to message #865244] |
Mon, 30 April 2012 10:24 |
|
Hi,
you have basically two choices:
(1) use the std behaviour without any mocks => simply take care the eobjects that should be in the global scope
have to reside in the same resourceset as test object you test the scoping on.
(a) create a resourceset
(b) create a resource in the resourceset and add the objects in the global scope to it
(c) create a resource in the resourceset and add the test object there
(2) you bind a IGlobalScopeProvider in a special runtime module + setup you use in the test
the global scopeprovider returns a scope. use e.g. a simple scope
btw if you dont do any customizations to the global scope, why do you want to test it at all?
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: How to unit test global scoping [message #867707 is a reply to message #865293] |
Tue, 01 May 2012 12:43 |
Felix Feisst Messages: 20 Registered: February 2012 Location: Germany |
Junior Member |
|
|
Well, I misunderstood you earlier, I do some changes to the index: I provide an own implementation of IDefaultResourceDescriptionStrategy (btw, why is there a Default in the interface name?) to handle which EObjects are exported.
When I do create a ResourceSet (with ResourceSetImpl) for the tests, how does the framework know of my own ResourceSet or does the creation of ResourceSetImpl take care of that?
A second thing is, i want to check that a declared entity is unique on the index. For that reason I inject my Validator with an instance of IResourceDescriptions (note the plural 's') and calling the "getExportedObjects(..)" method. Running the plugin, this works fine. However, running the tests, an exception is thrown when invoking that method. I guess it has something to do with the index and ResourceSet, too?
Thanks so far,
Felix
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04158 seconds