Package org.jboss.cdi.tck.impl
Class PropertiesBasedConfigurationBuilder
- java.lang.Object
-
- org.jboss.cdi.tck.impl.PropertiesBasedConfigurationBuilder
-
public class PropertiesBasedConfigurationBuilder extends Object
CDI TCK configuration builder. Mostly based on jboss-test-harness code fromorg.jboss.testharness.impl.PropertiesBasedConfigurationBuilderandorg.jboss.testharness.properties.PropertiesManager.
-
-
Field Summary
Fields Modifier and Type Field Description static StringRESOURCE_BUNDLE
-
Constructor Summary
Constructors Constructor Description PropertiesBasedConfigurationBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleangetBooleanValue(String propertyName, Boolean defaultValue, boolean required)protected <T> Class<T>getClassValue(String propertyName, Class<T> expectedType, boolean required)ConfigurationgetConfiguration()protected <T> TgetInstanceValue(String propertyName, Class<T> expectedType, boolean required)intgetIntegerValue(String propertyName, int defaultValue, boolean required)longgetLongValue(String propertyName, long defaultValue, boolean required)Set<String>getPropertyValues(String key)Get a list of possible values for a given key.Enumeration<URL>getResources(String name)StringgetStringValue(String propertyName, String defaultValue, boolean required)PropertiesBasedConfigurationBuilderinit(boolean deploymentPhase)
-
-
-
Field Detail
-
RESOURCE_BUNDLE
public static final String RESOURCE_BUNDLE
- See Also:
- Constant Field Values
-
-
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 namedefaultValue- - default valuerequired- - is required flag- Returns:
- property value as integer
-
getBooleanValue
public Boolean getBooleanValue(String propertyName, Boolean defaultValue, boolean required)
-
getResources
public Enumeration<URL> getResources(String name) throws IOException
- Parameters:
name-- Returns:
- Throws:
IOException
-
getInstanceValue
protected <T> T getInstanceValue(String propertyName, Class<T> expectedType, boolean required)
- Type Parameters:
T-- Parameters:
propertyName-expectedType-required-- Returns:
-
-