There are no functional tests present in the project.
I would very much wish to have these kind of test and have them automated.
Possible approaches: SWTBot, TPTP's Automated GUI Recorder,
GUITAR - http://guitar.sourceforge.net/
abbot - http://abbot.sourceforge.net/doc/overview.shtml
This would be a warmly welcomed addition to the project. I've heard good things about SWTBot, but it might be too basic. I've had some contact with TPTP when attempting to profile a Web application, about 1 year ago, and it seemed overly complex and slow. But it might have changed. Looking forward to see your ideas about this topic.
Hi,
I have added a new project with SWTBot based tests. The name of the project is org.jcommander.ui.tests, you can find it in CVS in the plugins folder. It is a simple plugin project. Currently it only has a single test case, to demonstrate how SWTBot can be used. You can run the test using the JCommanderUITest.launch launcher fount in the root of the project.
For now the test has a hard coded path "C:\" but this will change in the future.
In the future we can configure the test fixture to use an InMemory VFS for the tests, to run identical on all platforms. I think apache's VFS supports this. We can populate the file system with the same structure before each test is run. What do you think about this approach?
While playing with the first SWTBot test I've found a bug in the
FileControlModel.java. There is a concurrent access/modification bug in
the update()/getContent() methods resulting in an IndexOutOfBoundsException. Please run the test and let me know if it also happens to you. I'll fill a bug report for this.
Hi,
I have added a test to model the "Copy file" use case. In the beforeClass()method I prepare a temporary file system (thanks to apaches VFS capabilities) and unpack the content of the "jcmd functional testing resources.zip". Later, the tests can use this file system as their fixture. In the afterClass() method, I just close the VFS manager which results in removing the temporary file system from the disk. This set-up gives us a proper isolated test environment. We can debate if the test fixture should be set up and teared down before/after each test or is it acceptable to set it up before the first test and tear it down after the last one.
Please have a look and let me know what you think. Yes, some parts of the test, like searching for a cell in the table, are a little bit complicated, but I think we can factor them out.
SWTBot tests seem to fail if you click on the JCommander window during a test run.
There is an interesting tool in SWTBot called swtspy. You can use it to inspect the GUI structure and get an idea how to get to a given widget. If you want to run the tool on JCommander you have to:
Best regards,
Dan.