Re: Test Error found...

2015-07-10 Thread Niclas Hedhman
Ah, so the testcase around all of this is listing a usecase like; public interface MyService public interface MyService2 extends MyService That both MyService and MyService can be injected with their primary type. TypeLookup would need to better understand type hierarchies, but I suspect th

Re: Test Error found...

2015-07-10 Thread Niclas Hedhman
That was quick... single() also throw IllegalArgumentException on zero results. I added a atMostOne() method in Iterables. All this will be re-written in 3.0 and use Java 8 Function+Stream API. On Fri, Jul 10, 2015 at 5:09 PM, Niclas Hedhman wrote: > I am introducing a small fix (use single() in

Re: Test Error found...

2015-07-10 Thread Niclas Hedhman
I am introducing a small fix (use single() instead of first(), catch IllegalArgumentException and rethrow a AmbiguousTypeException), and the output is org.qi4j.api.composite.AmbiguousTypeException: More than one model matches the classname org.qi4j.api.value.ValueSerialization:[OrgJsonValueSeriali

Re: Test Error found...

2015-07-10 Thread Niclas Hedhman
So, the question is; SHOULD a AmbiguousTypeException be thrown when one is asking for a @Service injection of a composite type or ServiceReference? And I am pretty sure the exact same code is called if one calls ServiceFinder.findService(), and that would also throw the AmbiguousTypeException. C

Re: Test Error found...

2015-07-10 Thread Niclas Hedhman
And it is not done there... It takes, and instantiates, the first one. Line 378 in TypeLookup On Fri, Jul 10, 2015 at 4:50 PM, Niclas Hedhman wrote: > The findService() (single instance) should be checking ambiguity, where as > findServices() shouldn't. I am looking into that at the moment. > >

Re: Test Error found...

2015-07-10 Thread Niclas Hedhman
The findService() (single instance) should be checking ambiguity, where as findServices() shouldn't. I am looking into that at the moment. On Fri, Jul 10, 2015 at 4:45 PM, Paul Merlin wrote: > Good catch Niclas. > > No AmbiguousTypeException should be expected though. > > There is two services r

Re: Test Error found...

2015-07-10 Thread Paul Merlin
Good catch Niclas. No AmbiguousTypeException should be expected though. There is two services registered for the ValueSerialization type with != identities, possibly different qualifiers etc... there's no type ambiguity with multiple services of the same type. Think @Service Iterable inject; /P

Re: Test Error found...

2015-07-10 Thread Niclas Hedhman
EntityTestAssembler is the answer... which is invoked in the AbstractValueCompositeSerializationTest. I'll resolve that. Sorry for the noise. On Fri, Jul 10, 2015 at 4:31 PM, Niclas Hedhman wrote: > So, the Module contains TWO ValueSerialization systems, both the OrgJson > and the Jackson ones.

Re: Test Error found...

2015-07-10 Thread Niclas Hedhman
So, the Module contains TWO ValueSerialization systems, both the OrgJson and the Jackson ones. That should then raise the question, Why don't we get AmbigiousTypeException?? There are also a MemoryEntityStore and a UuidIdentityGenerator in the Module Where are those coming from? Cheers On

Test Error found...

2015-07-10 Thread Niclas Hedhman
I think I have found a Testcase problem, while trying to improve the ValueSerialization subsystem. To show what I mean; a. Put a breakpoint on the first line in the only(!) test in AbstractValueCompositeSerializationTest b. Run the JacksonValueCompositeSerializationTest. c. At breakpoi