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 ; 8 9 10 19 public class IfTest extends TestCase { 20 public IfTest(String arg0) { 21 super(arg0); 22 } 23 24 public void testIfFalse() throws Exception { 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 { 33 SotoContainer cont = new SotoContainer(); 34 Properties props = new Properties (); 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 |