Test Handlers
There are several runnable test programs included in the src directory. Since they aren't part of the project as such, they are generally poorly written and documented, and they do not print usage information when run. Here is some information that may help.
- TestCrash is designed to demonstrate a nasty threading bug in JIProlog, which affects it when run on Java 1.4.1 on Redhat 7.3. It relies on the file src/crashcode.pl, which uses forms of some semantic utilities. It takes no arguments, and when run on Linux, crashes with a strange bug. On Windows, it enters an infinite loop.
- TestDiscourse is not a working part of the current system. It uses several classes which are not functional. If it is still in the directory at all, please delete it; if it is not, I have taken my own advice and done so already.
- TestInterpret tests the interpreter. If run without arguments, it enters parse mode, and waits for keyboard input, which it parses and interprets. If run with the name of a file created by TestParserOutput as its only argument, it displays a list of parses from the file and allows the user to select one, then interprets it. To exit the program, type 'q' at any prompt.
- TestParse tests the parser. It takes no arguments, and waits for keyboard input, which it parses. To exit the program, type 'q' at any prompt.
- TestParserOutput creates a file of parses for use with the interpreter. It requires one command line argument, the name of a file to write to. It then waits for keyboard input, which it parses. After each parse, it asks the question 'Keep', and waits for a line beginning with 'y' or some other character. If it gets a line starting with 'y', it writes the parse to the file. To exit the program, type a 'q' after the 'Enter' prompt, not the 'Keep' prompt.
- TestProlog is designed to test the JIPPrologEngine class. It takes no arguments. It reads some hardcoded Prolog files, then allows the user to query Prolog. To test Prolog code, as opposed to the Java code in JIPPrologEngine, use JIProlog/jipconsole.bat instead, as it is far more convenient.
- TestTCP is designed to test the parser on input from Sphinx. To use it, start the mabelserver program in Sphinx first, then start TestTCP with no arguments. Speak to the microphone and wait for console output from TestTCP. For effective communication, mabelserver should send on port 8009. TestTCP runs forever, or until its server dies, or until it is killed.