Package org.apache.uima.pear.tools
Class InstallationTester
java.lang.Object
org.apache.uima.pear.tools.InstallationTester
The
InstallationTester
application allows performing simple verification of the
installed UIMA compliant component by using standard UIMA framework interface.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private PackageBrowser
private Properties
private String
-
Constructor Summary
ConstructorsConstructorDescriptionInstallationTester
(PackageBrowser pkgBrowser) Creates new instance of theInstallationTester
class, identifies a specified component using UIMA API. -
Method Summary
Modifier and TypeMethodDescriptiondoTest()
private static ResourceManager
getResourceManager
(PackageBrowser pkgBrowser) returns a valid ResourceManager with the information from the PackageBrowser object.private void
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.Checks if a given TS specifier file can be used to create an instance of CAS.
-
Field Details
-
uimaCategory
-
pkgBrowser
-
systemProps
-
PEAR_MESSAGE_RESOURCE_BUNDLE
- See Also:
-
-
Constructor Details
-
InstallationTester
public InstallationTester(PackageBrowser pkgBrowser) throws 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:
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 Details
-
doTest
public InstallationController.TestStatus doTest() throws IOException, InvalidXMLException, ResourceInitializationException -
getResourceManager
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:
IOException
- passthru
-
setSystemProperties
Set the environment variables that are specified in the PackageBrowser object as System properties- Parameters:
pkgBrowser
- packageBrowser object of an installed PEAR package- Throws:
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 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:
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 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:
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 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:
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 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:
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 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:
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 IOException, InvalidXMLException, ResourceInitializationExceptionChecks 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:
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.
-