Package org.eigenbase.xom
Class MetaTester
java.lang.Object
org.eigenbase.xom.MetaTester
The MetaTester class is a utility class for testing generated models.
The tester reads a model file in XML, validates it against its DTD,
converts it to its corresponding model definition class (always a
subclass of ElementDef), and displays the results.
The MetaTester may be used to test a model against a suite of input
files to verify the model's correctness.
-
Constructor Summary
ConstructorsConstructorDescriptionMetaTester
(String modelFile, String fileDirectory, int parserType) Constructs a new MetaTester using the given model file, the given test file, and the directory containing all support files. -
Method Summary
-
Constructor Details
-
MetaTester
public MetaTester(String modelFile, String fileDirectory, int parserType) throws XOMException, IOException Constructs a new MetaTester using the given model file, the given test file, and the directory containing all support files.- Parameters:
modelFile
- an XML file describing the model to be tested. This model should have already been compiled using the MetaGenerator utility.fileDirectory
- the directory containing all output files (Java classes, dtds, etc) from the model compilation. The model and its associated java class must be compiled.- Throws:
XOMException
- if the model file is corrupted or if any of its compiled components cannot be loaded.IOException
-
-
Method Details
-
testFile
Tests a specific instance of the given model, as described by testFile. Testing includes parsing testFile, validating against its associated dtd, and converting to its assocated java class. The contents of the java class are displayed to complete the test.- Parameters:
testFile
- the XML file to be tested.fileDirectory
- directory containing files.- Throws:
XOMException
- if the test fails for any reason.
-
main
The MetaTester tests a suite of test model files against a compiled model.Arguments:
- The name of the model description file. This is an XML file describing the model itself.
- The name of the output directory. This output directory should contain all files generated when compiling the model.
All other arguments are the names of the test model files. Each of these will be tested and displayed in turn.
- Throws:
XOMException
IOException
-