1 4 package com.tc.config.schema.dynamic; 5 6 import com.tc.config.schema.MockXmlObject; 7 8 import java.io.File ; 9 10 13 public class FileXPathBasedConfigItemTest extends XPathBasedConfigItemTestBase { 14 15 private class SubBean extends MockXmlObject { 16 public String getStringValue() { 17 return currentValue; 18 } 19 } 20 21 private String currentValue; 22 23 protected MockXmlObject createSubBean() throws Exception { 24 return new SubBean(); 25 } 26 27 protected void setUp() throws Exception { 28 super.setUp(); 29 30 this.currentValue = "foobar"; 31 } 32 33 public void testAll() throws Exception { 34 FileXPathBasedConfigItem withoutDefault = new FileXPathBasedConfigItem(context, xpath); 35 36 assertEquals(new File ("foobar"), withoutDefault.getFile()); 37 assertEquals(new File ("foobar"), withoutDefault.getObject()); 38 39 this.currentValue = null; 40 withoutDefault = new FileXPathBasedConfigItem(context, xpath); 41 assertNull(withoutDefault.getFile()); 42 assertNull(withoutDefault.getObject()); 43 } 44 45 } 46 | Popular Tags |