Package org.apache.uima.pear.tools
Class InstallationTester
- java.lang.Object
-
- org.apache.uima.pear.tools.InstallationTester
-
public class InstallationTester extends java.lang.Object
TheInstallationTester
application allows performing simple verification of the installed UIMA compliant component by using standard UIMA framework interface.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
PEAR_MESSAGE_RESOURCE_BUNDLE
private PackageBrowser
pkgBrowser
private java.util.Properties
systemProps
private java.lang.String
uimaCategory
-
Constructor Summary
Constructors Constructor Description InstallationTester(PackageBrowser pkgBrowser)
Creates new instance of theInstallationTester
class, identifies a specified component using UIMA API.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InstallationController.TestStatus
doTest()
private static ResourceManager
getResourceManager(PackageBrowser pkgBrowser)
returns a valid ResourceManager with the information from the PackageBrowser object.private void
resetSystemProperties()
reset the System properties as it was before the pear verification is executed.private static void
setSystemProperties(PackageBrowser pkgBrowser)
Set the environment variables that are specified in the PackageBrowser object as System propertiesprivate void
testAnalysisEngine(ResourceSpecifier specifier, ResourceManager resource_manager, InstallationController.TestStatus status)
Checks if a given analysis engine specifier file can be used to produce an instance of analysis engine.private void
testCasConsumer(ResourceSpecifier specifier, ResourceManager resource_manager, InstallationController.TestStatus status)
Checks if a given CC specifier file can be used to produce an instance of CC.private void
testCasInitializer(ResourceSpecifier specifier, ResourceManager resource_manager, InstallationController.TestStatus status)
Checks if a given CI specifier file can be used to produce an instance of CI.private void
testCollectionReader(ResourceSpecifier specifier, ResourceManager resource_manager, InstallationController.TestStatus status)
Checks if a given CR specifier file can be used to produce an instance of CR.private void
testCpeCongifuration(ResourceSpecifier specifier, ResourceManager resource_manager, InstallationController.TestStatus status)
Checks if a given CPE specifier file can be used to produce an instance of CPE.private InstallationController.TestStatus
testTypeSystem()
Checks if a given TS specifier file can be used to create an instance of CAS.
-
-
-
Field Detail
-
uimaCategory
private java.lang.String uimaCategory
-
pkgBrowser
private PackageBrowser pkgBrowser
-
systemProps
private java.util.Properties systemProps
-
PEAR_MESSAGE_RESOURCE_BUNDLE
private static final java.lang.String PEAR_MESSAGE_RESOURCE_BUNDLE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InstallationTester
public InstallationTester(PackageBrowser pkgBrowser) throws java.io.IOException, InvalidXMLException, ResourceInitializationException, UIMAException, UIMARuntimeException
Creates new instance of theInstallationTester
class, identifies a specified component using UIMA API.- Parameters:
pkgBrowser
- packageBrowser object of an installed PEAR package- Throws:
java.io.IOException
- if any I/O exception occurred.InvalidXMLException
- if component descriptor is invalid.ResourceInitializationException
- if the specified component cannot be instantiated.UIMAException
- if this exception occurred while identifying UIMA component category.UIMARuntimeException
- if this exception occurred while identifying UIMA component category.
-
-
Method Detail
-
doTest
public InstallationController.TestStatus doTest() throws java.io.IOException, InvalidXMLException, ResourceInitializationException
- Throws:
java.io.IOException
InvalidXMLException
ResourceInitializationException
-
getResourceManager
private static ResourceManager getResourceManager(PackageBrowser pkgBrowser) throws java.io.IOException
returns a valid ResourceManager with the information from the PackageBrowser object.- Parameters:
pkgBrowser
- packageBrowser object of an installed PEAR package- Returns:
- a ResourceManager object with the information from the PackageBrowser object.
- Throws:
java.io.IOException
- passthru
-
setSystemProperties
private static void setSystemProperties(PackageBrowser pkgBrowser) throws java.io.IOException
Set the environment variables that are specified in the PackageBrowser object as System properties- Parameters:
pkgBrowser
- packageBrowser object of an installed PEAR package- Throws:
java.io.IOException
- passthru
-
resetSystemProperties
private void resetSystemProperties()
reset the System properties as it was before the pear verification is executed.
-
testAnalysisEngine
private void testAnalysisEngine(ResourceSpecifier specifier, ResourceManager resource_manager, InstallationController.TestStatus status) throws java.io.IOException, InvalidXMLException, ResourceInitializationException
Checks if a given analysis engine specifier file can be used to produce an instance of analysis engine. Returnstrue
, if an analysis engine can be instantiated,false
otherwise.- Parameters:
specifier
- the resource specifierresource_manager
- a new resource_managerstatus
- the place where to put the results- Throws:
java.io.IOException
- If an I/O exception occurred while creatingXMLInputSource
.InvalidXMLException
- If the XML parser failed to parse the given input file.ResourceInitializationException
- If the specified AE cannot be instantiated.
-
testCasConsumer
private void testCasConsumer(ResourceSpecifier specifier, ResourceManager resource_manager, InstallationController.TestStatus status) throws java.io.IOException, InvalidXMLException, ResourceInitializationException
Checks if a given CC specifier file can be used to produce an instance of CC. Returnstrue
, if a CC can be instantiated,false
otherwise.- Parameters:
specifier
- the resource specifierresource_manager
- a new resource_managerstatus
- the place where to put the results- Throws:
java.io.IOException
- If an I/O exception occurred while creatingXMLInputSource
.InvalidXMLException
- If the XML parser failed to parse the given input file.ResourceInitializationException
- If the specified CC cannot be instantiated.
-
testCasInitializer
private void testCasInitializer(ResourceSpecifier specifier, ResourceManager resource_manager, InstallationController.TestStatus status) throws java.io.IOException, InvalidXMLException, ResourceInitializationException
Checks if a given CI specifier file can be used to produce an instance of CI. Returnstrue
, if a CI can be instantiated,false
otherwise.- Parameters:
specifier
- the resource specifierresource_manager
- a new resource_managerstatus
- the place where to put the results- Throws:
java.io.IOException
- If an I/O exception occurred while creatingXMLInputSource
.InvalidXMLException
- If the XML parser failed to parse the given input file.ResourceInitializationException
- If the specified CI cannot be instantiated.
-
testCollectionReader
private void testCollectionReader(ResourceSpecifier specifier, ResourceManager resource_manager, InstallationController.TestStatus status) throws java.io.IOException, InvalidXMLException, ResourceInitializationException
Checks if a given CR specifier file can be used to produce an instance of CR. Returnstrue
, if a CR can be instantiated,false
otherwise.- Parameters:
specifier
- the resource specifierresource_manager
- a new resource_managerstatus
- the place where to put the results- Throws:
java.io.IOException
- If an I/O exception occurred while creatingXMLInputSource
.InvalidXMLException
- If the XML parser failed to parse the given input file.ResourceInitializationException
- If the specified CR cannot be instantiated.
-
testCpeCongifuration
private void testCpeCongifuration(ResourceSpecifier specifier, ResourceManager resource_manager, InstallationController.TestStatus status) throws java.io.IOException, InvalidXMLException, ResourceInitializationException
Checks if a given CPE specifier file can be used to produce an instance of CPE. Returnstrue
, if a CPE can be instantiated,false
otherwise.- Parameters:
specifier
- the resource specifierresource_manager
- a new resource_managerstatus
- the place where to put the results- Throws:
java.io.IOException
- If an I/O exception occurred while creatingXMLInputSource
.InvalidXMLException
- If the XML parser failed to parse the given input file.ResourceInitializationException
- If the specified CPE cannot be instantiated.
-
testTypeSystem
private InstallationController.TestStatus testTypeSystem() throws java.io.IOException, InvalidXMLException, ResourceInitializationException
Checks if a given TS specifier file can be used to create an instance of CAS. Returnstrue
, if a CAS can be created for a given TS,false
otherwise.- Returns:
- the result of the testing
- Throws:
java.io.IOException
- If an I/O exception occurred while creatingXMLInputSource
.InvalidXMLException
- If the XML parser failed to parse the given input file.ResourceInitializationException
- If the specified TS cannot be used to create a CAS.
-
-