KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mockobjects > servlet > MockBodyContent


1 package com.mockobjects.servlet;
2
3 import com.mockobjects.util.AssertMo;
4 import com.mockobjects.Verifiable;
5 import com.mockobjects.ExpectationValue;
6 import com.mockobjects.ReturnValue;
7
8 import javax.servlet.jsp.JspWriter JavaDoc;
9 import javax.servlet.jsp.tagext.BodyContent JavaDoc;
10 import java.io.IOException JavaDoc;
11 import java.io.Reader JavaDoc;
12 import java.io.Writer JavaDoc;
13
14 public class MockBodyContent extends BodyContent JavaDoc implements Verifiable{
15     private final ReturnValue myEnclosingWriter = new ReturnValue("enclosing writer");
16     private final ExpectationValue myWriter = new ExpectationValue("writer");
17
18     public int getBufferSize() {
19         notImplemented();
20         return super.getBufferSize();
21     }
22
23     public MockBodyContent() {
24         super(null);
25     }
26
27     public void write(int c) throws IOException JavaDoc {
28         notImplemented();
29         super.write(c);
30     }
31
32     public void flush() throws IOException JavaDoc {
33         notImplemented();
34         super.flush();
35     }
36
37     public boolean isAutoFlush() {
38         notImplemented();
39         return super.isAutoFlush();
40     }
41
42     public void write(char cbuf[]) throws IOException JavaDoc {
43         notImplemented();
44         super.write(cbuf);
45     }
46
47     public boolean equals(Object JavaDoc obj) {
48         notImplemented();
49         return super.equals(obj);
50     }
51
52     public void clearBody() {
53         notImplemented();
54         super.clearBody();
55     }
56
57     public void write(String JavaDoc str) throws IOException JavaDoc {
58         notImplemented();
59         super.write(str);
60     }
61
62     public void setupGetEnclosingWriter(JspWriter JavaDoc aJspWriter){
63         myEnclosingWriter.setValue(aJspWriter);
64     }
65
66     public JspWriter JavaDoc getEnclosingWriter() {
67         return (JspWriter JavaDoc)myEnclosingWriter.getValue();
68     }
69
70     private void notImplemented() {
71         AssertMo.notImplemented(MockBodyContent.class.getName());
72     }
73
74     public Reader JavaDoc getReader() {
75         notImplemented();
76         return null;
77     }
78
79     public void newLine() throws IOException JavaDoc {
80         notImplemented();
81     }
82
83     public void write(char cbuf[], int off, int len) throws IOException JavaDoc {
84         notImplemented();
85     }
86
87     public void print(boolean b) throws IOException JavaDoc {
88         notImplemented();
89     }
90
91     public void setExpectedWriteOut(Writer JavaDoc aWriter){
92         myWriter.setExpected(aWriter);
93     }
94
95     public void writeOut(Writer JavaDoc aWriter) throws IOException JavaDoc {
96         myWriter.setActual(aWriter);
97     }
98
99     public void print(char c) throws IOException JavaDoc {
100         notImplemented();
101     }
102
103     public void print(int i) throws IOException JavaDoc {
104         notImplemented();
105     }
106
107     public void print(long l) throws IOException JavaDoc {
108         notImplemented();
109     }
110
111     public void print(float v) throws IOException JavaDoc {
112         notImplemented();
113     }
114
115     public void print(double v) throws IOException JavaDoc {
116         notImplemented();
117     }
118
119     public void print(char[] chars) throws IOException JavaDoc {
120         notImplemented();
121     }
122
123     public void print(String JavaDoc s) throws IOException JavaDoc {
124         notImplemented();
125     }
126
127     public void print(Object JavaDoc o) throws IOException JavaDoc {
128         notImplemented();
129     }
130
131     public void println() throws IOException JavaDoc {
132         notImplemented();
133     }
134
135     public void println(boolean b) throws IOException JavaDoc {
136         notImplemented();
137     }
138
139     public void println(char c) throws IOException JavaDoc {
140         notImplemented();
141     }
142
143     public void println(int i) throws IOException JavaDoc {
144         notImplemented();
145     }
146
147     public void println(long l) throws IOException JavaDoc {
148         notImplemented();
149     }
150
151     public void println(float v) throws IOException JavaDoc {
152         notImplemented();
153     }
154
155     public void println(double v) throws IOException JavaDoc {
156         notImplemented();
157     }
158
159     public void println(char[] chars) throws IOException JavaDoc {
160         notImplemented();
161     }
162
163     public void println(String JavaDoc s) throws IOException JavaDoc {
164         notImplemented();
165     }
166
167     public void println(Object JavaDoc o) throws IOException JavaDoc {
168         notImplemented();
169     }
170
171     public void clear() throws IOException JavaDoc {
172         notImplemented();
173     }
174
175     public void clearBuffer() throws IOException JavaDoc {
176         notImplemented();
177     }
178
179     public void close() throws IOException JavaDoc {
180         notImplemented();
181     }
182
183     public int getRemaining() {
184         notImplemented();
185         return 0;
186     }
187
188     public void write(String JavaDoc str, int off, int len) throws IOException JavaDoc {
189         notImplemented();
190         super.write(str, off, len);
191     }
192
193     public String JavaDoc getString() {
194         notImplemented();
195         return null;
196     }
197
198     public void verify() {
199     }
200 }
201
Popular Tags