KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > state > cocoon > standalone > StateIdParserTest


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

14 public class StateIdParserTest extends TestCase{
15     
16     public StateIdParserTest(String JavaDoc name){
17         super(name);
18     }
19     
20     public void testParseSimplePathNoModule(){
21         StateIdParser.Created created = StateIdParser.parseStateFrom("/state");
22         super.assertEquals(created.state, "state");
23         super.assertTrue("Module should be null", created.module == null);
24         created = StateIdParser.parseStateFrom("state");
25         super.assertEquals(created.state, "state");
26         super.assertTrue("Module should be null", created.module == null);
27     }
28     
29     public void testParseSimplePath(){
30         StateIdParser.Created created = StateIdParser.parseStateFrom("/module.state");
31         super.assertEquals(created.module, "module");
32         super.assertEquals(created.state, "state");
33         created = StateIdParser.parseStateFrom("module.state");
34         super.assertEquals(created.state, "state");
35         super.assertEquals(created.module, "module");
36     }
37     
38     public void testParseComplexPath(){
39         StateIdParser.Created created = StateIdParser.parseStateFrom("some/path/module.state");
40         super.assertEquals(created.module, "module");
41         super.assertEquals(created.state, "state");
42         created = StateIdParser.parseStateFrom("/some/path/module.state");
43         super.assertEquals(created.state, "state");
44         super.assertEquals(created.module, "module");
45     }
46
47 }
48
Popular Tags