KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > config > schema > dynamic > XPathBasedConfigItemTestBase


1 /**
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.config.schema.dynamic;
5
6 import org.apache.xmlbeans.XmlObject;
7
8 import com.tc.config.schema.MockXmlObject;
9 import com.tc.config.schema.context.MockConfigContext;
10 import com.tc.test.TCTestCase;
11
12 /**
13  * A base for all {@link XPathBasedConfigItem} tests.
14  */

15 public abstract class XPathBasedConfigItemTestBase extends TCTestCase {
16
17   protected MockConfigContext context;
18   protected String JavaDoc xpath;
19
20   protected MockXmlObject bean;
21   protected MockXmlObject subBean;
22
23   protected void setUp() throws Exception JavaDoc {
24     this.context = new MockConfigContext();
25     this.xpath = "foobar/baz";
26
27     this.bean = new MockXmlObject();
28     this.context.setReturnedBean(this.bean);
29
30     this.subBean = createSubBean();
31     this.bean.setReturnedSelectPath(new XmlObject[] { this.subBean });
32   }
33
34   protected abstract MockXmlObject createSubBean() throws Exception JavaDoc;
35
36 }
37
Popular Tags