KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > IfTest


1 package org.sapia.soto;
2
3 import junit.framework.TestCase;
4
5 import org.sapia.soto.examples.SecondaryService;
6
7 import java.util.Properties JavaDoc;
8
9
10 /**
11  * @author Yanick Duchesne
12  *
13  * <dl>
14  * <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>
15  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
16  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
17  * </dl>
18  */

19 public class IfTest extends TestCase {
20   public IfTest(String JavaDoc arg0) {
21     super(arg0);
22   }
23
24   public void testIfFalse() throws Exception JavaDoc {
25     SotoContainer cont = new SotoContainer();
26     cont.load("org/sapia/soto/ifTest.xml");
27
28     SecondaryService sec = (SecondaryService) cont.lookup("secondary");
29     super.assertTrue(!sec.hasMaster());
30   }
31
32   public void testIfTrue() throws Exception JavaDoc {
33     SotoContainer cont = new SotoContainer();
34     Properties JavaDoc props = new Properties JavaDoc();
35     props.setProperty("set.master.service", "true");
36     cont.load("org/sapia/soto/ifTest.xml", props);
37
38     SecondaryService sec = (SecondaryService) cont.lookup("secondary");
39     super.assertTrue(sec.hasMaster());
40   }
41 }
42
Popular Tags