mvnForum Homepage Welcome Guest   | Login   
  Search  
  Index  | Recent Threads  | Who's Online  | User List  | Register  | Search  | Help  | RSS feeds


Quick Go »
Thread Status: Normal
Thread Type: Sticky Thread
Total posts in this thread: 1
[Add To My Favorites] [Watch this Thread] [Post new Thread]
Author
Previous Thread This topic has been viewed 2093 times and has 0 replies Next Thread
Male admin
Strandz Developer
Member's Avatar


Joined: Mar 12, 2005
Posts: 93
Status: Offline
Neat trick with subcutaneous testing Reply to this Post
Reply with Quote

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:

//rv = new RosterWorkersStrand( simple , "dt-files/RosterWorkers_NEW_FORMAT.xml");
rv = new RosterWorkersStrand( simple , "dt-files/RosterWorkers_NON_VISUAL.xml");


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]
[May 4, 2005 3:52:14 PM] Show Post Printable Version        Send Private Message    Hidden to Guest    http://www.strandz.org [Link] Report threaten post: please login first  Go to top 
[Show Thread Printable Version] [Post new Thread]