osgi / bugzilla-archive

Archive of OSGi Alliance Specification Bugzilla bugs. The Specification Bugzilla system was decommissioned with the move to GitHub. The issues in this repository are imported from the Specification Bugzilla system for archival purposes.
0 stars 1 forks source link

Service Component test case is not correct #2995

Closed bjhargrave closed 4 years ago

bjhargrave commented 5 years ago

Original bug ID: BZ#3127 From: Georgi Boyvalenkov <georgi.boyvalenkov@bosch-si.com> Reported version: R6

bjhargrave commented 5 years ago

Comment author: Georgi Boyvalenkov <georgi.boyvalenkov@bosch-si.com>

There are several problems(DeclarativeServicesControl):

  1. testServiceComponentRuntimeEnablement At line 3283 - test must wait for the promise to complete before checking the result.

  2. testBadFieldReference130 Field badUpdate of org.osgi.test.cases.component.tb24.BadFieldReceiver seems to be of correct type, but the test case expects that no service is injected.

  3. testMinimumCardinality110 In org.osgi.test.cases.component.tb21.Receiverv11 policy-option="greedy" is missing.

  4. testStaticScalarFieldReferenceModified130 At line 4831 it is expected that a component is reactived by a configuration change, but this is not required by specification(112.7.1). Component configuration does not become unsatisfied by changing value of org.osgi.test.cases.component.tb24 property.

bjhargrave commented 4 years ago

Comment author: @bjhargrave

CPEG call: BJ to investigate.

bjhargrave commented 4 years ago

Comment author: @bjhargrave

(In reply to Georgi Boyvalenkov from comment BZ#0)

There are several problems(DeclarativeServicesControl):

  1. testServiceComponentRuntimeEnablement At line 3283 - test must wait for the promise to complete before checking the result.

Fixed by https://osgi.org/gitweb/build.git/commit/744bf6261e0ccca36e83d68d3689eba9f675df29

  1. testBadFieldReference130 Field badUpdate of org.osgi.test.cases.component.tb24.BadFieldReceiver seems to be of correct type, but the test case expects that no service is injected.

The test is correct.

The field is defined as:

private volatile Set badUpdate = null;

But the reference in the XML defines it as field-option="update" which means the code must have initialized the field to a value which SCR will update.

  1. testMinimumCardinality110 In org.osgi.test.cases.component.tb21.Receiverv11 policy-option="greedy" is missing.

I don't see why policy-option="greedy" is needed here. The component has a minimum cardinality of 2 and the test ensure the static reference activate when 2 service are present and deactivates when less than 2 services are present. Greediness has no bearing in this test.

  1. testStaticScalarFieldReferenceModified130 At line 4831 it is expected that a component is reactived by a configuration change, but this is not required by specification(112.7.1). Component configuration does not become unsatisfied by changing value of org.osgi.test.cases.component.tb24 property.

The test case is correct. Since the configuration-policy is not ignore, setting a configuration for the component must cause SCR to react since the component now has modified component properties which must be visible in the component's component properties.