Annotation Type SetConfig


  • @Repeatable(SetConfigs.class)
    @Retention(RUNTIME)
    public @interface SetConfig
    Define this annotation on a test class or method to use the ConfigurationAdmin service to update the persisted properties for the configuration whose pid matches the pid() 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
      When pid() is set to the default value of Component.NAME, set this attribute to a class whose name should be used instead.
      String pid
      Specify a configuration pid to update with values specified by property().
      String[] property
      Parsed like Component.property().
    • Element Detail

      • pid

        String pid
        Specify a configuration pid to update with values specified by property(). The default value is Component.NAME, which is a special string ("$") that can be used to specify the name of the component() class as a configuration PID.
        Returns:
        a configuration pid
        Default:
        "$"
      • component

        Class<?> component
        When pid() is set to the default value of Component.NAME, set this attribute to a class whose name should be used instead. This can be more convenient when using SetConfig in combination with OsgiContextImpl.registerInjectActivateService(Class). The default value is Void, 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 like Component.property().
        Returns:
        osgi config properties
        Default:
        {}