Hi Andy,

The SPA project has set up unit tests with JUnit for a few actors and
composite actors.  The source is at http://www-
casc.llnl.gov/sdm/download.php .  Run "ant test" to run the tests--there
are only four of them right now.

There are two kinds of tests:

1. Programmatically *create* a workflow, insert the actor, run the
workflow, then assert that the outputs are as expected.
org.sdm.spa.StringConstTest is a toy example of this.

2. Programmatically instantiate an *existing* workflow, programmatically
generate inputs for it, run it, then assert that the outputs are as
expected.  org.sdm.spa.test.junit.actors.util.RetryTest is an example of
this.


If you try it and run into problems, feel free to email me questions!

Xiaowen


Am Montag, den 18.04.2005, 12:22 -0700 schrieb Zimdars, Andrew:
> To date, I've taken an ad hoc approach to testing new Ptolemy actors I've 
> written:  I draft the Java implementation, put together a simple MoML model 
> (source + new actor + sink), and inspect the output.  I would rather have a 
> more disciplined approach (possibly with JUnit), but I'm not sure how to 
> instantiate suitable a "minimal" Ptolemy runtime, and I couldn't find any 
> examples in the ptII-4.0.1-src tree.  
> 
> Ptolemy developers (both at UCB and in the community at large):  what sorts 
> of "best practices" have you evolved for developing and testing your Ptolemy 
> actors (including/in addition to unit tests)?  Are there example test cases 
> in the Ptolemy source distribution that I didn't see on first inspection?
> 
> Thanks,
> 
> Andy Z.
> 
> -----
> Andrew Zimdars
> Modeling, Simulation, and Information Sciences (Org. ABCS)
> Advanced Technology Center, Lockheed Martin Space Systems Co.
> Bldg. 153, Col. 2J4
> 1111 Lockheed Martin Way, Sunnyvale, CA  94089
> 
> w: 408/742.2111 m: 510/915.0662
> 
> ----------------------------------------------------------------------------
> Posted to the ptolemy-hackers mailing list.  Please send administrative
> mail for this list to: [EMAIL PROTECTED]


----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to