001: /**
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
003: */package com.tc.config.schema;
004:
005: import org.apache.xmlbeans.QNameSet;
006: import org.apache.xmlbeans.SchemaType;
007: import org.apache.xmlbeans.XmlCursor;
008: import org.apache.xmlbeans.XmlDocumentProperties;
009: import org.apache.xmlbeans.XmlObject;
010: import org.apache.xmlbeans.XmlOptions;
011: import org.apache.xmlbeans.xml.stream.XMLInputStream;
012: import org.w3c.dom.Node;
013: import org.xml.sax.ContentHandler;
014: import org.xml.sax.ext.LexicalHandler;
015:
016: import java.io.File;
017: import java.io.InputStream;
018: import java.io.OutputStream;
019: import java.io.Reader;
020: import java.io.Writer;
021:
022: import javax.xml.namespace.QName;
023: import javax.xml.stream.XMLStreamReader;
024:
025: /**
026: * A mock {@link XmlObject}, for use in tests.
027: */
028: public class MockXmlObject implements XmlObject {
029:
030: public static final SchemaType type = new MockSchemaType();
031:
032: private int numSelectPaths;
033: private String lastSelectPath;
034: private XmlObject[] returnedSelectPath;
035:
036: public MockXmlObject() {
037: reset();
038:
039: this .returnedSelectPath = null;
040: }
041:
042: public void reset() {
043: this .numSelectPaths = 0;
044: this .lastSelectPath = null;
045: }
046:
047: public XmlDocumentProperties documentProperties() {
048: return null;
049: }
050:
051: public void dump() {
052: // Nothing here
053: }
054:
055: public Node getDomNode() {
056: return null;
057: }
058:
059: public Object monitor() {
060: return null;
061: }
062:
063: public XmlCursor newCursor() {
064: return null;
065: }
066:
067: public Node newDomNode() {
068: return null;
069: }
070:
071: public Node newDomNode(XmlOptions arg0) {
072: return null;
073: }
074:
075: public InputStream newInputStream() {
076: return null;
077: }
078:
079: public InputStream newInputStream(XmlOptions arg0) {
080: return null;
081: }
082:
083: public Reader newReader() {
084: return null;
085: }
086:
087: public Reader newReader(XmlOptions arg0) {
088: return null;
089: }
090:
091: public XMLInputStream newXMLInputStream() {
092: return null;
093: }
094:
095: public XMLInputStream newXMLInputStream(XmlOptions arg0) {
096: return null;
097: }
098:
099: public XMLStreamReader newXMLStreamReader() {
100: return null;
101: }
102:
103: public XMLStreamReader newXMLStreamReader(XmlOptions arg0) {
104: return null;
105: }
106:
107: public void save(ContentHandler arg0, LexicalHandler arg1,
108: XmlOptions arg2) {
109: // Nothing here
110: }
111:
112: public void save(ContentHandler arg0, LexicalHandler arg1) {
113: // Nothing here
114: }
115:
116: public void save(File arg0, XmlOptions arg1) {
117: // Nothing here
118: }
119:
120: public void save(File arg0) {
121: // Nothing here
122: }
123:
124: public void save(OutputStream arg0, XmlOptions arg1) {
125: // Nothing here
126: }
127:
128: public void save(OutputStream arg0) {
129: // Nothing here
130: }
131:
132: public void save(Writer arg0, XmlOptions arg1) {
133: // Nothing here
134: }
135:
136: public void save(Writer arg0) {
137: // Nothing here
138: }
139:
140: public String xmlText() {
141: return null;
142: }
143:
144: public String xmlText(XmlOptions arg0) {
145: return null;
146: }
147:
148: public XmlObject changeType(SchemaType arg0) {
149: return null;
150: }
151:
152: public int compareTo(Object arg0) {
153: return 0;
154: }
155:
156: public int compareValue(XmlObject arg0) {
157: return 0;
158: }
159:
160: public XmlObject copy() {
161: return null;
162: }
163:
164: public XmlObject[] execQuery(String arg0, XmlOptions arg1) {
165: return null;
166: }
167:
168: public XmlObject[] execQuery(String arg0) {
169: return null;
170: }
171:
172: public boolean isImmutable() {
173: return false;
174: }
175:
176: public boolean isNil() {
177: return false;
178: }
179:
180: public SchemaType schemaType() {
181: return null;
182: }
183:
184: public XmlObject selectAttribute(QName arg0) {
185: return null;
186: }
187:
188: public XmlObject selectAttribute(String arg0, String arg1) {
189: return null;
190: }
191:
192: public XmlObject[] selectAttributes(QNameSet arg0) {
193: return null;
194: }
195:
196: public XmlObject[] selectChildren(QName arg0) {
197: return null;
198: }
199:
200: public XmlObject[] selectChildren(QNameSet arg0) {
201: return null;
202: }
203:
204: public XmlObject[] selectChildren(String arg0, String arg1) {
205: return null;
206: }
207:
208: public XmlObject[] selectPath(String arg0, XmlOptions arg1) {
209: return null;
210: }
211:
212: public XmlObject[] selectPath(String arg0) {
213: ++this .numSelectPaths;
214: this .lastSelectPath = arg0;
215: return this .returnedSelectPath;
216: }
217:
218: public XmlObject set(XmlObject arg0) {
219: return null;
220: }
221:
222: public void setNil() {
223: // Nothing here
224: }
225:
226: public XmlObject substitute(QName arg0, SchemaType arg1) {
227: return null;
228: }
229:
230: public boolean validate() {
231: return false;
232: }
233:
234: public boolean validate(XmlOptions arg0) {
235: return false;
236: }
237:
238: public boolean valueEquals(XmlObject arg0) {
239: return false;
240: }
241:
242: public int valueHashCode() {
243: return 0;
244: }
245:
246: public String getLastSelectPath() {
247: return lastSelectPath;
248: }
249:
250: public int getNumSelectPaths() {
251: return numSelectPaths;
252: }
253:
254: public void setReturnedSelectPath(XmlObject[] returnedSelectPath) {
255: this.returnedSelectPath = returnedSelectPath;
256: }
257:
258: }
|