KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > config > schema > MockApplication


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

5 package com.tc.config.schema;
6
7 import org.apache.commons.lang.builder.HashCodeBuilder;
8 import org.apache.xmlbeans.QNameSet;
9 import org.apache.xmlbeans.SchemaType;
10 import org.apache.xmlbeans.XmlCursor;
11 import org.apache.xmlbeans.XmlDocumentProperties;
12 import org.apache.xmlbeans.XmlObject;
13 import org.apache.xmlbeans.XmlOptions;
14 import org.apache.xmlbeans.xml.stream.XMLInputStream;
15 import org.w3c.dom.Node JavaDoc;
16 import org.xml.sax.ContentHandler JavaDoc;
17 import org.xml.sax.ext.LexicalHandler JavaDoc;
18
19 import com.tc.exception.ImplementMe;
20 import com.tc.test.UniqueSequenceGenerator;
21 import com.terracottatech.config.Application;
22 import com.terracottatech.config.DsoApplication;
23 import com.terracottatech.config.Modules;
24 import com.terracottatech.config.SpringApplication;
25
26 import java.io.File JavaDoc;
27 import java.io.InputStream JavaDoc;
28 import java.io.OutputStream JavaDoc;
29 import java.io.Reader JavaDoc;
30 import java.io.Writer JavaDoc;
31
32 import javax.xml.namespace.QName JavaDoc;
33 import javax.xml.stream.XMLStreamReader;
34
35 /**
36  * A mock {@link Application}, for use in tests.
37  */

38 public class MockApplication implements Application {
39
40   private final int identity;
41
42   public MockApplication() {
43     this(UniqueSequenceGenerator.getInstance().getNextInt());
44   }
45
46   public MockApplication(int identity) {
47     this.identity = identity;
48   }
49
50   public boolean equals(Object JavaDoc that) {
51     return ((that instanceof MockApplication) && ((MockApplication) that).identity == this.identity);
52   }
53
54   public int hashCode() {
55     return new HashCodeBuilder().append(this.identity).toHashCode();
56   }
57
58   public DsoApplication getDso() {
59     return null;
60   }
61
62   public boolean isSetDso() {
63     return true;
64   }
65
66   public void setDso(DsoApplication arg0) {
67   // nothing here
68
}
69
70   public DsoApplication addNewDso() {
71     return null;
72   }
73
74   public void unsetDso() {
75   // nothing here
76
}
77
78   public SchemaType schemaType() {
79     return null;
80   }
81
82   public boolean validate() {
83     return true;
84   }
85
86   public boolean validate(XmlOptions arg0) {
87     return true;
88   }
89
90   public XmlObject[] selectPath(String JavaDoc arg0) {
91     return null;
92   }
93
94   public XmlObject[] selectPath(String JavaDoc arg0, XmlOptions arg1) {
95     return null;
96   }
97
98   public XmlObject[] execQuery(String JavaDoc arg0) {
99     return null;
100   }
101
102   public XmlObject[] execQuery(String JavaDoc arg0, XmlOptions arg1) {
103     return null;
104   }
105
106   public XmlObject changeType(SchemaType arg0) {
107     return null;
108   }
109
110   public XmlObject substitute(QName JavaDoc arg0, SchemaType arg1) {
111     return null;
112   }
113
114   public boolean isNil() {
115     return false;
116   }
117
118   public void setNil() {
119   // nothing here
120
}
121
122   public boolean isImmutable() {
123     return false;
124   }
125
126   public XmlObject set(XmlObject arg0) {
127     return null;
128   }
129
130   public XmlObject copy() {
131     return null;
132   }
133
134   public boolean valueEquals(XmlObject arg0) {
135     return false;
136   }
137
138   public int valueHashCode() {
139     return 0;
140   }
141
142   public int compareTo(Object JavaDoc arg0) {
143     return 0;
144   }
145
146   public int compareValue(XmlObject arg0) {
147     return 0;
148   }
149
150   public XmlObject[] selectChildren(QName JavaDoc arg0) {
151     return null;
152   }
153
154   public XmlObject[] selectChildren(String JavaDoc arg0, String JavaDoc arg1) {
155     return null;
156   }
157
158   public XmlObject[] selectChildren(QNameSet arg0) {
159     return null;
160   }
161
162   public XmlObject selectAttribute(QName JavaDoc arg0) {
163     return null;
164   }
165
166   public XmlObject selectAttribute(String JavaDoc arg0, String JavaDoc arg1) {
167     return null;
168   }
169
170   public XmlObject[] selectAttributes(QNameSet arg0) {
171     return null;
172   }
173
174   public Object JavaDoc monitor() {
175     return null;
176   }
177
178   public XmlDocumentProperties documentProperties() {
179     return null;
180   }
181
182   public XmlCursor newCursor() {
183     return null;
184   }
185
186   public XMLInputStream newXMLInputStream() {
187     return null;
188   }
189
190   public XMLStreamReader newXMLStreamReader() {
191     return null;
192   }
193
194   public String JavaDoc xmlText() {
195     return null;
196   }
197
198   public InputStream newInputStream() {
199     return null;
200   }
201
202   public Reader JavaDoc newReader() {
203     return null;
204   }
205
206   public Node JavaDoc newDomNode() {
207     return null;
208   }
209
210   public Node JavaDoc getDomNode() {
211     return null;
212   }
213
214   public void save(ContentHandler JavaDoc arg0, LexicalHandler JavaDoc arg1) {
215   // nothing here
216
}
217
218   public void save(File JavaDoc arg0) {
219   // nothing here
220
}
221
222   public void save(OutputStream JavaDoc arg0) {
223   // nothing here
224
}
225
226   public void save(Writer JavaDoc arg0) {
227   // nothing here
228
}
229
230   public XMLInputStream newXMLInputStream(XmlOptions arg0) {
231     return null;
232   }
233
234   public XMLStreamReader newXMLStreamReader(XmlOptions arg0) {
235     return null;
236   }
237
238   public String JavaDoc xmlText(XmlOptions arg0) {
239     return null;
240   }
241
242   public InputStream newInputStream(XmlOptions arg0) {
243     return null;
244   }
245
246   public Reader JavaDoc newReader(XmlOptions arg0) {
247     return null;
248   }
249
250   public Node JavaDoc newDomNode(XmlOptions arg0) {
251     return null;
252   }
253
254   public void save(ContentHandler JavaDoc arg0, LexicalHandler JavaDoc arg1, XmlOptions arg2) {
255   // nothing here
256
}
257
258   public void save(File JavaDoc arg0, XmlOptions arg1) {
259   // nothing here
260
}
261
262   public void save(OutputStream JavaDoc arg0, XmlOptions arg1) {
263   // nothing here
264
}
265
266   public void save(Writer JavaDoc arg0, XmlOptions arg1) {
267   // nothing here
268
}
269
270   public void dump() {
271   // nothing here
272
}
273
274   public String JavaDoc toString() {
275     return "<MockApplication: " + this.identity + ">";
276   }
277
278   public SpringApplication addNewSpring() {
279     throw new ImplementMe();
280   }
281
282   public SpringApplication getSpring() {
283     throw new ImplementMe();
284   }
285
286   public boolean isSetSpring() {
287     throw new ImplementMe();
288   }
289
290   public void setSpring(SpringApplication arg0) {
291     throw new ImplementMe();
292   }
293
294   public void unsetSpring() {
295     throw new ImplementMe();
296   }
297
298   public Modules addNewModules() {
299     throw new ImplementMe();
300   }
301
302   public Modules getModules() {
303     throw new ImplementMe();
304   }
305
306   public boolean isSetModules() {
307     throw new ImplementMe();
308   }
309
310   public void setModules(Modules arg0) {
311     throw new ImplementMe();
312   }
313
314   public void unsetModules() {
315     throw new ImplementMe();
316   }
317
318 }
319
Popular Tags