felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-4584) Change retention to RUNTIME for Property and Properties annotations
Date Mon, 28 Jul 2014 05:39:38 GMT

    [ https://issues.apache.org/jira/browse/FELIX-4584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14075918#comment-14075918
] 

Carsten Ziegeler commented on FELIX-4584:
-----------------------------------------

Changing retention to RUNTIME has a great consequence: it requires the annotations at runtime
in the OSGi framework - which is the number one reason why neither the DS annotations nor
the Apache Felix annotations have retention runtime, especially as they are not used at runtime
at all.
Therefore changing the retention would result in unresolved bundles once a bundle would be
built using these annotations.

For your unit tests, regardless of the retention, as soon as you evaluate the annotations
(which is possible with both retention runtime and class), you're duplicating the tooling
- and apart from duplicating sooner or later you might end up with minor difference which
might cause problems.
Therefore if you really need this, I suggest you write a little helper class for your unit
tests which reads the generated xml file and uses the property definitions from there.

With RFC 190 a new way of configurations will be introduced which makes all of this obsolete.

> Change retention to RUNTIME for Property and Properties annotations
> -------------------------------------------------------------------
>
>                 Key: FELIX-4584
>                 URL: https://issues.apache.org/jira/browse/FELIX-4584
>             Project: Felix
>          Issue Type: Improvement
>          Components: SCR Tooling
>            Reporter: Jyrki Ruuskanen
>            Priority: Minor
>
> This change allows us to access Property annotation values in plain java unit tests.
Without this our unit tests would have to run in an SCR-capable container.
> You may consider changing the retention for the whole lot (why not), but at least these
two are necessary.
> https://github.com/apache/felix/pull/9



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message