01: /**
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */package com.tc.config.schema.dynamic;
04:
05: import org.apache.xmlbeans.XmlObject;
06:
07: import com.tc.config.schema.MockXmlObject;
08: import com.tc.config.schema.context.MockConfigContext;
09: import com.tc.test.TCTestCase;
10:
11: /**
12: * A base for all {@link XPathBasedConfigItem} tests.
13: */
14: public abstract class XPathBasedConfigItemTestBase extends TCTestCase {
15:
16: protected MockConfigContext context;
17: protected String xpath;
18:
19: protected MockXmlObject bean;
20: protected MockXmlObject subBean;
21:
22: protected void setUp() throws Exception {
23: this .context = new MockConfigContext();
24: this .xpath = "foobar/baz";
25:
26: this .bean = new MockXmlObject();
27: this .context.setReturnedBean(this .bean);
28:
29: this .subBean = createSubBean();
30: this .bean
31: .setReturnedSelectPath(new XmlObject[] { this .subBean });
32: }
33:
34: protected abstract MockXmlObject createSubBean() throws Exception;
35:
36: }
|