It’s 112.3.10 in the R6 spec. Too bad we missed the opportunity to clarify this section. I believe it is intended to refer only to static references, where indeed you can’t bind the optional one in a cycle. My interpretation of this section is that DS should make its best effort to bind whatever it can, and in some cases with static references it won’t be able to bind everything.
Note that with static references that use ServiceReference or prototype scope it may still be possible to bind everything called for. david jencks > On Jul 28, 2015, at 5:54 PM, Pierre De Rop <pierre.de...@gmail.com> wrote: > > Hi all, > > I'd like to have some help regarding the intention of the > "test_A11_B0n_immediate_A_first()" method in the CircularReferenceTest.java > test from SCR. > Indeed, the javadoc of this method seems to indicate that the intention is > to test the following use case: > > - A is immediate and has a 1..1 dynamic ref to B > - B is immediate ans has a 0..N dynamic ref to A > - then both A and B should be started, however B should not be bound to A > because there is a cycle (112.3.7 chapter, in the DS spec) > > now, if you look at the last assertion in the > test_A11_B0n_immediate_A_first() method, then it looks like B is asserted > to be bound to A, which seems to be in contradiction with the intent of > this test: > > @Test > public void test_A11_B0n_immediate_A_first() throws > InvalidSyntaxException > { > String componentNameA = "2.A.1.1.dynamic"; > final ComponentConfigurationDTO componentA = > findComponentConfigurationByName( componentNameA, > ComponentConfigurationDTO.ACTIVE ); > A a = getServiceFromConfiguration(componentA, A.class); > assertEquals( 1, a.getBs().size()); > > String componentNameB = "2.B.0.n.dynamic"; > final ComponentConfigurationDTO componentB = > findComponentConfigurationByName( componentNameB, > ComponentConfigurationDTO.ACTIVE ); > B b = getServiceFromConfiguration(componentB, B.class); > assertEquals( 1, b.getAs().size() ); > } > > IMO, the last assert should be: > > assertEquals( 0, b.getAs().size() ); > > instead of > > assertEquals( 1, b.getAs().size() ); > > then do we have currently a bug in SCR (because B should not be bound to A > in this situation ?) > > thanks; > > cheers; > /Pierre