Help with unit testing using easyMock

2007-01-23 Thread Luciano Resende
I'm trying to use easyMock to create a unit testing to verify that exception is being thrown for duplicated Components... Looks like the reader that is simulating the scdl is returning the right values, but then, the registry does not find a loader to handle implementation.java Portion given by

Re: Help with unit testing using easyMock

2007-01-23 Thread Venkata Krishnan
Hi Luciano, I am just about sharing my experience in this without going too much into what you are doing. Hope this helps. If you still have problems, let me know and I will take a detailed look into this. I assume you are trying to test an ImplementationLoader for its handling of duplicate

Re: Help with unit testing using easyMock

2007-01-23 Thread Jim Marino
Hi Luciano, You shouldn't need to use the registry or other loaders to test this. Just create the loader you want and mock out the XMLStreamReader and LoaderRegistry to return the correct values. The mocked loader should return component definitions that are newed up rather than created by

Re: Help with unit testing using easyMock

2007-01-23 Thread Jim Marino
On Jan 23, 2007, at 9:00 AM, Jeremy Boynes wrote: Isn't this a problem in the verify/build phase rather than the loader? -- Jeremy We already support this in the build phase. Ultimately this function would be moved into the verify phase but since we don't have it yet and the change is

Re: Help with unit testing using easyMock

2007-01-23 Thread Luciano Resende
Well, it looks like I might be doing more then what is required here, but I'll try to give some more comments on the scenario. I assume you are trying to test an ImplementationLoader for its handling of duplicate components. If so, then you must simply have to focus on that 'unit' i.e. the

Re: Help with unit testing using easyMock

2007-01-23 Thread Jim Marino
On Jan 23, 2007, at 10:01 AM, Jeremy Boynes wrote: Do we? Yep in CompositeComponentExtension.register(SCAObject) I was looking at CompositeComponentType#getComponents and it does: for (Include i : includes.values()) { view.putAll(i.getIncluded().getComponents());

Re: Help with unit testing using easyMock

2007-01-23 Thread Jim Marino
On Jan 23, 2007, at 10:02 AM, Luciano Resende wrote: Well, it looks like I might be doing more then what is required here, but I'll try to give some more comments on the scenario. I assume you are trying to test an ImplementationLoader for its handling of duplicate components. If so,