KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > cruisecontrol > util > NamedXPathAwareChildTest


1 package net.sourceforge.cruisecontrol.util;
2
3 import junit.framework.TestCase;
4 import net.sourceforge.cruisecontrol.CruiseControlException;
5
6 public class NamedXPathAwareChildTest extends TestCase {
7     public void testNameRequiredAttribute() throws CruiseControlException {
8         NamedXPathAwareChild field = new NamedXPathAwareChild();
9         try {
10             field.validate();
11             fail("Expected an exception");
12         } catch (CruiseControlException expected) {
13         }
14
15         field.setValue("foo");
16         try {
17             field.validate();
18             fail("Expected an exception");
19         } catch (CruiseControlException expected) {
20         }
21
22         field.setName("bar");
23         field.validate();
24     }
25 }
26
Popular Tags