|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectpatterntesting.runtime.util.Environment
public final class Environment
This class provides some utilities for the access to the environment
(e.g. the system properties).
TODO: Use common.lang.SystemUtils for OS_NAME or other system properties
| Field Summary | |
|---|---|
static String |
DISABLE_THREADS
System property to disable multithreading. |
static String |
INTEGRATION_TEST
System property to enable integration tests |
static boolean |
integrationTestEnabled
True if property for integration test is set. |
static String |
JAVA_VENDOR
Java vendor (e.g. |
static String |
JAVA_VERSION
JDK version (e.g. "1.6.0_17"). |
static String |
OS_ARCH
architecture (e.g. |
static String |
OS_NAME
operating system (e.g. |
static String |
OS_VERSION
os version (e.g. "10.6.2"). |
static String |
RUN_SMOKE_TESTS
System property for annotation SmokeTest. |
static String |
RUN_TESTS_PARALLEL
System property for annotation RunTestsParallel. |
static boolean |
smokeTestEnabled
True if SmokeTest property is set. |
static String |
USER_NAME
User (e.g. |
| Method Summary | |
|---|---|
static boolean |
areThreadsAllowed()
In some JEE environment like Google's App Engine (GAE) it is not allowed to use multi threading. |
static ClassLoader |
getClassLoader()
|
static File |
getLocalMavenRepositoryDir()
Normally you'll find the local Maven repository at ~/.m2/repository. |
static String |
getName()
The name of an environment is derived from the classloader. |
static boolean |
isGoogleAppEngine()
If we are in a Google App Engine (GAE) environment we will return true here. |
static boolean |
isJamonAvailable()
It is only tested for Jamon 2.4 and 2.7 so we look for it |
static boolean |
isPropertyEnabled(String key)
Returns true if the given property is set as System property and the value of it is not false. |
static boolean |
isWeblogicServer()
If we are inside a Weblogic Server (WLS) we will return true here. |
static Properties |
loadProperties(InputStream istream)
Loads the properties from the given InputStream and provides them as system properties. |
static Properties |
loadProperties(String resource)
Loads the properties from the classpath and provides them as system properties. |
static boolean |
matchesOneOf(String[] props)
Looks if one of the given properties matches a system property. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String OS_NAME
public static final String OS_ARCH
public static final String OS_VERSION
public static final String JAVA_VERSION
public static final String JAVA_VENDOR
public static final String USER_NAME
public static final String DISABLE_THREADS
public static final String INTEGRATION_TEST
public static final String RUN_TESTS_PARALLEL
public static final String RUN_SMOKE_TESTS
public static final boolean integrationTestEnabled
public static final boolean smokeTestEnabled
| Method Detail |
|---|
public static String getName()
public static ClassLoader getClassLoader()
public static boolean matchesOneOf(String[] props)
props - the properties to be checked
public static boolean isPropertyEnabled(String key)
key - e.g. "patterntesting.runTestsParallel"
public static Properties loadProperties(String resource)
throws IOException
resource - the name of the classpath resource
IOException - if properties can't be loadedloadProperties(InputStream)
public static Properties loadProperties(InputStream istream)
throws IOException
istream - from here the properties are loaded
IOException - if properties can't be loadedpublic static boolean areThreadsAllowed()
DISABLE_THREADS.
public static boolean isGoogleAppEngine()
public static boolean isWeblogicServer()
public static File getLocalMavenRepositoryDir()
throws IOException
IOException - Signals that an I/O exception has occurred.public static boolean isJamonAvailable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||