org.opencms.setup
Class CmsSetupTests

java.lang.Object
  extended by org.opencms.setup.CmsSetupTests

public class CmsSetupTests
extends Object

Runs various tests to give users infos about whether their system is compatible to OpenCms.

Since:
6.0.0
Version:
$Revision: 1.21 $
Author:
Thomas Weckert

Constructor Summary
CmsSetupTests()
          Creates a new setup test suite.
 
Method Summary
protected  boolean compareJDKVersions(String usedJDK, String requiredJDK)
          Checks if the used JDK is a higher version than the required JDK.
 CmsSetupBean getSetupBean()
          Returns the CmsSetup bean of the setup wizard.
 List getTestResults()
          Returns the test results.
protected  boolean hasSupportedServletEngine(String thisEngine, String[] supportedEngines)
          Checks if the used servlet engine is part of the servlet engines OpenCms supports.
 boolean isGreen()
          Returns true, if the conditions in all testes were fulfilled.
 boolean isRed()
          Returns true if one of the tests found a violated condition.
 boolean isYellow()
          Returns true if one of the tests found a questionable condition.
 void runTests(PageContext pageContext, CmsSetupBean setupBean)
          Runs all tests.
protected  void setGreen()
          Sets if the conditions in all testes were fulfilled.
protected  void setRed()
          Sets if one of the tests found a violated condition.
protected  void setYellow()
          Sets if one of the tests found a questionable condition.
 void testJdkVersion()
          Tests the version of the JDK.
 void testOperatingSystem()
          Tests the operating system.
 void testServletEngine()
          Tests the servlet engine.
 void testWarFileUnpacked()
          Tests if the OpenCms WAR file is unpacked.
 void testXercesVersion()
          Test for the Xerces version.
protected  int unsupportedServletEngine(String thisEngine, String[] unsupportedEngines)
          Checks if the used servlet engine is part of the servlet engines OpenCms does NOT support.
protected  void writeVersionInfo(String thisEngine, String usedJDK, String basePath)
          Writes the version info of the used servlet engine and the used JDK to the version.txt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsSetupTests

public CmsSetupTests()
Creates a new setup test suite.

Method Detail

getSetupBean

public CmsSetupBean getSetupBean()
Returns the CmsSetup bean of the setup wizard.

Returns:
the CmsSetup bean of the setup wizard

getTestResults

public List getTestResults()
Returns the test results.

Returns:
the test results

isGreen

public boolean isGreen()
Returns true, if the conditions in all testes were fulfilled.

Returns:
true, if the conditions in all testes were fulfilled

isRed

public boolean isRed()
Returns true if one of the tests found a violated condition. It is assumed that it will be impossible to run OpenCms.

Returns:
true if one of the tests violates a condition

isYellow

public boolean isYellow()
Returns true if one of the tests found a questionable condition. It is possible that OpenCms will not run.

Returns:
true if one of the tests found a questionable condition

runTests

public void runTests(PageContext pageContext,
                     CmsSetupBean setupBean)
Runs all tests.

Parameters:
pageContext - the page context of the JSP page
setupBean - the CmsSetup bean of the setup wizard

testJdkVersion

public void testJdkVersion()
Tests the version of the JDK.


testOperatingSystem

public void testOperatingSystem()
Tests the operating system.


testServletEngine

public void testServletEngine()
Tests the servlet engine.


testWarFileUnpacked

public void testWarFileUnpacked()
Tests if the OpenCms WAR file is unpacked.


testXercesVersion

public void testXercesVersion()
Test for the Xerces version.


compareJDKVersions

protected boolean compareJDKVersions(String usedJDK,
                                     String requiredJDK)
Checks if the used JDK is a higher version than the required JDK.

Parameters:
usedJDK - The JDK version in use
requiredJDK - The required JDK version
Returns:
true if used JDK version is equal or higher than required JDK version, false otherwise

hasSupportedServletEngine

protected boolean hasSupportedServletEngine(String thisEngine,
                                            String[] supportedEngines)
Checks if the used servlet engine is part of the servlet engines OpenCms supports.

Parameters:
thisEngine - The servlet engine in use
supportedEngines - All known servlet engines OpenCms supports
Returns:
true if this engine is supported, false if it was not found in the list

setGreen

protected void setGreen()
Sets if the conditions in all testes were fulfilled.


setRed

protected void setRed()
Sets if one of the tests found a violated condition.


setYellow

protected void setYellow()
Sets if one of the tests found a questionable condition.


unsupportedServletEngine

protected int unsupportedServletEngine(String thisEngine,
                                       String[] unsupportedEngines)
Checks if the used servlet engine is part of the servlet engines OpenCms does NOT support.

Parameters:
thisEngine - the servlet engine in use
unsupportedEngines - all known servlet engines OpenCms does NOT support
Returns:
the engine id or -1 if the engine is not supported

writeVersionInfo

protected void writeVersionInfo(String thisEngine,
                                String usedJDK,
                                String basePath)
Writes the version info of the used servlet engine and the used JDK to the version.txt.

Parameters:
thisEngine - The servlet engine in use
usedJDK - The JDK version in use
basePath - the OpenCms base path