KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > state > util > AssertTest


1 package org.sapia.soto.state.util;
2
3 import junit.framework.TestCase;
4
5 import org.sapia.soto.state.*;
6
7
8 /**
9  * @author Yanick Duchesne
10  * <dl>
11  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
12  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
13  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
14  * </dl>
15  */

16 public class AssertTest extends TestCase {
17   public AssertTest(String JavaDoc name) {
18     super(name);
19   }
20
21   public void testMissingParam() {
22     ContextImpl ctx;
23     Result res = new Result(new StateMachine(), ctx = new ContextImpl());
24     Scope sc = new MapScope();
25     sc.putVal("key", "value");
26     ctx.addScope("test", sc);
27
28     Assert a = new Assert();
29     a.setKey("key");
30     a.execute(res);
31     super.assertTrue(!res.isError());
32     sc = new MapScope();
33     ctx.addScope("test2", sc);
34     a.setScopes("test2");
35     res = new Result(new StateMachine(), ctx);
36     a.execute(res);
37     super.assertTrue(res.isError());
38   }
39 }
40
Popular Tags