org.jboss.jsfunit.framework
Class Environment

java.lang.Object
  extended by org.jboss.jsfunit.framework.Environment

public class Environment
extends Object

Contains methods to determine the test environment.

Since:
1.0
Author:
Stan Silvert

Method Summary
static int getJSFMajorVersion()
          Return 2 for JSF 2.0 and above.
static int getJSFMinorVersion()
          Returns the JSF minor version.
static boolean is12Compatible()
          Determine if the running JSF version is compatible with the JSF 1.2 specification.
static boolean is20Compatible()
          Determine if the running JSF version is compatible with the JSF 2.0 specification.
static Class loadClass(String clazz)
          Load a class using the context class loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

is20Compatible

public static boolean is20Compatible()
Determine if the running JSF version is compatible with the JSF 2.0 specification.

Returns:
true if running JSF 2.0 or higher, false otherwise.

is12Compatible

public static boolean is12Compatible()
Determine if the running JSF version is compatible with the JSF 1.2 specification.

Returns:
true if running JSF 1.2 or higher, false otherwise.

getJSFMajorVersion

public static int getJSFMajorVersion()
Return 2 for JSF 2.0 and above. Return 1 otherwise.

Returns:
2 for JSF 2.0 and above. Return 1 otherwise.

getJSFMinorVersion

public static int getJSFMinorVersion()
Returns the JSF minor version. This method will not detect JSF 1.0.

Returns:
1 for JSF 1.1, 2 for JSF 1.2, or 0 for JSF 2.0.

loadClass

public static Class loadClass(String clazz)
Load a class using the context class loader.

Parameters:
clazz - The class name to load.
Returns:
The Class or null if not found.


Copyright © 2007-2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.