Return-Path: X-Original-To: apmail-zest-dev-archive@minotaur.apache.org Delivered-To: apmail-zest-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A96E17EDE for ; Fri, 10 Jul 2015 14:10:15 +0000 (UTC) Received: (qmail 76462 invoked by uid 500); 10 Jul 2015 14:10:15 -0000 Delivered-To: apmail-zest-dev-archive@zest.apache.org Received: (qmail 76425 invoked by uid 500); 10 Jul 2015 14:10:15 -0000 Mailing-List: contact dev-help@zest.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zest.apache.org Delivered-To: mailing list dev@zest.apache.org Received: (qmail 76413 invoked by uid 99); 10 Jul 2015 14:10:14 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jul 2015 14:10:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 33114D387F for ; Fri, 10 Jul 2015 14:10:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.001 X-Spam-Level: *** X-Spam-Status: No, score=3.001 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 5VkTCkCYZ9KC for ; Fri, 10 Jul 2015 14:10:05 +0000 (UTC) Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 9673C20E40 for ; Fri, 10 Jul 2015 14:10:05 +0000 (UTC) Received: by iebmu5 with SMTP id mu5so196528233ieb.1 for ; Fri, 10 Jul 2015 07:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=rKn0WQHhiHvqr07vHAY98GkCysmYZSocGqHRzIV/+p0=; b=PQlLhu6KSGzHhWGIR9lbxDW3Vu+FRPbCTKWMFOkrlY2kvZvwCBhfreSvHOCYlLIjWK Kq7B//cEXrzFADIO6Kcxpf1wcyB9cVeB0HW7KGv6cVb0O5LIjel2tQN6xtD5fhgOQ/d4 874hGwqJy34eUFCPjCbzcp+W33YipWGKSPVaD49uZkPLEpFtOMvOj+hXBA09Uz+awQpl EQrtvcjF75C7EFjuWLqlyFBszYskqfGnNRavhX/9/vrZ/Q7+PVaafWKj+YZleQ6GCmSv 7xCZhyaXXXv/24lMwhQNsi5BR6cSUGYs78gGhMTvW49TCpEOtOjmPJ81t7op1vfFF1rB g7KQ== X-Received: by 10.50.49.34 with SMTP id r2mr3580116ign.66.1436537405056; Fri, 10 Jul 2015 07:10:05 -0700 (PDT) MIME-Version: 1.0 Sender: hedhman@gmail.com Received: by 10.36.98.18 with HTTP; Fri, 10 Jul 2015 07:09:45 -0700 (PDT) In-Reply-To: References: <559FCC8D.5020807@nosphere.org> From: Niclas Hedhman Date: Fri, 10 Jul 2015 17:09:45 +0300 X-Google-Sender-Auth: wOAdivQlWpK9Ug3bc3t8d8vh2Cs Message-ID: Subject: Re: Test Error found... To: dev Content-Type: multipart/alternative; boundary=e89a8f839a51bc2f6b051a85edf0 --e89a8f839a51bc2f6b051a85edf0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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:[OrgJsonValueSerializationService(act= ive=3Dfalse,module=3D'Module 1'), JacksonValueSerializationService(active=3Dfalse,module=3D'Module 1')] for the case that I just detected. I am starting a local build to see what else fails and whether there is concern for this change. Perhaps some way it is needed to ignore ambiguous types in some usecase. I'll report back later. Niclas On Fri, Jul 10, 2015 at 4:56 PM, Niclas Hedhman wrote: > So, the question is; SHOULD a AmbiguousTypeException be thrown when one i= s > 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. > > > Cheers > Niclas > > On Fri, Jul 10, 2015 at 4:53 PM, Niclas Hedhman > wrote: > >> 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. >>> >>> 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 registered for the ValueSerialization type with = !=3D >>>> identities, possibly different qualifiers etc... there's no type >>>> ambiguity with multiple services of the same type. >>>> >>>> Think @Service Iterable inject; >>>> >>>> /Paul >>>> >>>> Niclas Hedhman a =C3=A9crit : >>>> > 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. >>>> >> >>>> >> That should then raise the question, Why don't we get >>>> >> AmbigiousTypeException?? >>>> >> >>>> >> There are also a MemoryEntityStore and a UuidIdentityGenerator in t= he >>>> >> Module.... Where are those coming from? >>>> >> >>>> >> >>>> >> Cheers >>>> >> >>>> >> On Fri, Jul 10, 2015 at 4:25 PM, Niclas Hedhman >>>> >> wrote: >>>> >> >>>> >>> I think I have found a Testcase problem, while trying to improve t= he >>>> >>> 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 breakpoint, look at the this.valueSerialization member. I= t >>>> has >>>> >>> a ServiceComposite reference to the >>>> OrgJsonValueSerializationService, >>>> >>> not the Jackson one. >>>> >>> >>>> >>> >>>> >>> I am trying to figure out how this is at all possible. >>>> >>> >>>> >>> >>>> >>> Cheers >>>> >>> -- >>>> >>> Niclas Hedhman, Software Developer >>>> >>> http://zest.apache.org - New Energy for Java >>>> >>> >>>> >> -- >>>> >> Niclas Hedhman, Software Developer >>>> >> http://zest.apache.org - New Energy for Java >>>> >> >>>> > >>>> > >>>> > >>>> >>> >>> >>> >>> -- >>> Niclas Hedhman, Software Developer >>> http://zest.apache.org - New Energy for Java >>> >> >> >> >> -- >> Niclas Hedhman, Software Developer >> http://zest.apache.org - New Energy for Java >> > > > > -- > Niclas Hedhman, Software Developer > http://zest.apache.org - New Energy for Java > --=20 Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java --e89a8f839a51bc2f6b051a85edf0--