|
|
Index
| Recent Threads
| Who's Online
| User List
| Register
| Search
| Help
| |
![]() |
mvnForum » List all forums » Forum: General » Thread: Neat trick with subcutaneous testing |
|
Total posts in this thread: 1 |
[Add To My Favorites] [Watch this Thread] [Post new Thread] |
| Author |
|
|
Strandz Developer Joined: Mar 12, 2005 Posts: 93 Status: Offline |
With Wombat Rescue (WR) I didn't follow the methodology (at http://www.strandz.org/methodology.html ) with the unit tests. So TestRoster was originally written as a set of unit tests that used the WR SdzBag (which is an XML model file) with FieldAttributes in it rather than NonVisualFieldAttributes. Unit tests are run on the server in a 'headless' java environment so originally when I tried to run TestRoster on the server I got HeadlessException errors as the actual controls (JTextFields etc) had their set methods called. To resolve this problem I did a search and replace to change all occurances of FieldAttribute to be NonVisualFieldAttribute, and called the file something different. Here is the code in TestRoster:
The unit tests now work on the server because each NonVisualFieldAttribute has a little dummy component that is never displayed. Because I don't want to repeat this every time a change is made to RosterWorkers_NEW_FORMAT.xml I put a little sed onto the server which will create the new file automatically. Thus unit testing will always be up to date and RosterWorkers_NON_VISUAL.xml does not have to be put into version control. The implications of this are that no matter whether you do things by the methodology or not, you will always be at most a couple (NonVisualFieldAttributes and NonVisualTableAttributes) of search and replaces away from subcutaneous testing. For the future probably the Designer can do the work of creating the non-visual file, and we can have a standard naming convention and the relevant test suite will use the non-visual XML version. ---------------------------------------- [Edit 5 times, last edit by admin at May 31, 2007 7:28:09 AM] |
||
|
| [Show Thread Printable Version] [Post new Thread] |