Class PropertiesBasedConfigurationBuilder


  • public class PropertiesBasedConfigurationBuilder
    extends Object
    CDI TCK configuration builder. Mostly based on jboss-test-harness code from org.jboss.testharness.impl.PropertiesBasedConfigurationBuilder and org.jboss.testharness.properties.PropertiesManager.
    • Constructor Detail

      • PropertiesBasedConfigurationBuilder

        public PropertiesBasedConfigurationBuilder()
    • Method Detail

      • getConfiguration

        public Configuration getConfiguration()
        Returns:
        built configuration
      • init

        public PropertiesBasedConfigurationBuilder init​(boolean deploymentPhase)
        Parameters:
        deploymentPhase - Deployment phase (building test archive) initialization includes deployment specific properties
        Returns:
        initialized self
      • getPropertyValues

        public Set<String> getPropertyValues​(String key)
        Get a list of possible values for a given key. First, System properties are tried, followed by the specified resource bundle (first in classpath only).
        Parameters:
        key - The key to search for
        Returns:
        A list of possible values. An empty list is returned if there are no matches.
      • getStringValue

        public String getStringValue​(String propertyName,
                                     String defaultValue,
                                     boolean required)
        Parameters:
        propertyName -
        defaultValue -
        required -
        Returns:
      • getLongValue

        public long getLongValue​(String propertyName,
                                 long defaultValue,
                                 boolean required)
        Parameters:
        propertyName -
        defaultValue -
        required -
        Returns:
      • getIntegerValue

        public int getIntegerValue​(String propertyName,
                                   int defaultValue,
                                   boolean required)
        Parameters:
        propertyName - - System property name
        defaultValue - - default value
        required - - is required flag
        Returns:
        property value as integer
      • getBooleanValue

        public Boolean getBooleanValue​(String propertyName,
                                       Boolean defaultValue,
                                       boolean required)
      • getInstanceValue

        protected <T> T getInstanceValue​(String propertyName,
                                         Class<T> expectedType,
                                         boolean required)
        Type Parameters:
        T -
        Parameters:
        propertyName -
        expectedType -
        required -
        Returns:
      • getClassValue

        protected <T> Class<T> getClassValue​(String propertyName,
                                             Class<T> expectedType,
                                             boolean required)
        Type Parameters:
        T -
        Parameters:
        propertyName -
        expectedType -
        required -
        Returns: