Annotation Type SetConfig
-
@Repeatable(SetConfigs.class) @Retention(RUNTIME) public @interface SetConfig
Define this annotation on a test class or method to use theConfigurationAdmin
service to update the persisted properties for the configuration whose pid matches thepid()
attribute. Updates should be applied top-down for each test context scope, from with the outermost (class-level) to the innermost (method-level).
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Class<?>
component
Whenpid()
is set to the default value ofComponent.NAME
, set this attribute to a class whose name should be used instead.String
pid
Specify a configuration pid to update with values specified byproperty()
.String[]
property
Parsed likeComponent.property()
.
-
-
-
Element Detail
-
pid
String pid
Specify a configuration pid to update with values specified byproperty()
. The default value isComponent.NAME
, which is a special string ("$") that can be used to specify the name of thecomponent()
class as a configuration PID.- Returns:
- a configuration pid
- Default:
- "$"
-
-
-
component
Class<?> component
Whenpid()
is set to the default value ofComponent.NAME
, set this attribute to a class whose name should be used instead. This can be more convenient when usingSetConfig
in combination withOsgiContextImpl.registerInjectActivateService(Class)
. The default value isVoid
, which seems perfectly fine for a pid, but which in practice is a somewhat challenging class to construct for binding the configuration to.- Returns:
- the configurable component class
- Default:
- java.lang.Void.class
-
-
-
property
String[] property
Parsed likeComponent.property()
.- Returns:
- osgi config properties
- Default:
- {}
-
-