1 package org.paneris.bibliomania.test;
2
3 import java.util.Enumeration;
4
5 import org.paneris.bibliomania.Author;
6 import org.paneris.bibliomania.BibliomaniaDatabase;
7 import org.paneris.bibliomania.Book;
8
9 /**
10 * @author timp
11 * @since 16 Jan 2007
12 *
13 */
14 public class AuthorTest extends BibliomaniaTestCase {
15
16 /**
17 * @param name
18 */
19 public AuthorTest(String name) {
20 super(name);
21 }
22
23 /**
24 * {@inheritDoc}
25 * @see junit.framework.TestCase#setUp()
26 */
27 protected void setUp() throws Exception {
28 super.setUp();
29 }
30
31 /**
32 * {@inheritDoc}
33 * @see junit.framework.TestCase#tearDown()
34 */
35 protected void tearDown() throws Exception {
36 super.tearDown();
37 }
38
39 /**
40 * Test method for {@link org.paneris.bibliomania.Author#ftiTextID_start()}.
41 */
42 public void testFtiTextID_start() {
43
44 }
45
46 /**
47 * Test method for {@link org.paneris.bibliomania.Author#ftiTextID_limit()}.
48 */
49 public void testFtiTextID_limit() {
50
51 }
52
53 /**
54 * Test method for {@link org.paneris.bibliomania.Author#getParentUnit()}.
55 */
56 public void testGetParentUnit() {
57
58 }
59
60 /**
61 * Test method for {@link org.paneris.bibliomania.Author#getChildren()}.
62 */
63 public void testGetChildren() {
64
65 }
66
67 /**
68 * Test method for {@link org.paneris.bibliomania.Author#getName()}.
69 */
70 public void testGetName() {
71
72 }
73
74 /**
75 * Test method for {@link org.paneris.bibliomania.Author#appendCacheSubpath(java.lang.StringBuffer)}.
76 */
77 public void testAppendCacheSubpath() {
78
79 }
80
81 /**
82 * Test method for {@link org.paneris.bibliomania.Author#getProductAssociations()}.
83 */
84 public void testGetProductAssociations() {
85
86 }
87
88 /**
89 * Test method for {@link org.paneris.bibliomania.Author#getMembersSlowly()}.
90 */
91 public void testGetMembersSlowly() {
92
93 }
94
95 /**
96 * Test method for {@link org.paneris.bibliomania.Author#getDisplayName()}.
97 */
98 public void testGetDisplayName() {
99
100 }
101
102 /**
103 * Test method for {@link org.paneris.bibliomania.Author#index()}.
104 */
105 public void testIndex() {
106
107 }
108
109 /**
110 * Test method for {@link org.paneris.bibliomania.Author#encache()}.
111 */
112 public void testEncache() {
113
114 }
115
116 /**
117 * Test method for {@link org.paneris.bibliomania.Author#getReadArea()}.
118 */
119 public void testGetReadArea() {
120
121 }
122
123 /**
124 * Test method for {@link org.paneris.bibliomania.Author#Author()}.
125 */
126 public void testAuthor() {
127
128 }
129
130 /**
131 * Test method for {@link org.paneris.bibliomania.Author#Author(java.lang.String)}.
132 */
133 public void testAuthorString() {
134
135 }
136
137 /**
138 * Test method for {@link org.paneris.bibliomania.Author#getLongname()}.
139 */
140 public void testGetLongname() {
141
142 }
143
144 /**
145 * Test method for {@link org.paneris.bibliomania.Author#getSortOrShortName()}.
146 */
147 public void testGetSortOrShortName() {
148
149 }
150
151 /**
152 * Test method for {@link org.paneris.bibliomania.Author#firstFreeAuthorsequence()}.
153 */
154 public void testFirstFreeAuthorsequence() {
155
156 }
157
158 /**
159 * Test method for {@link org.paneris.bibliomania.Author#getBooks()}.
160 */
161 public void testGetBooks() {
162
163 }
164
165 /**
166 * Test method for {@link org.paneris.bibliomania.Author#getBooksOrderedBySection()}.
167 */
168 public void testGetBooksOrderedBySection() {
169
170 }
171
172 /**
173 * Test method for {@link org.paneris.bibliomania.Author#booksInSection(org.paneris.bibliomania.Section)}.
174 */
175 public void testBooksInSection() {
176 Author shakespeare = ((BibliomaniaDatabase)getDb()).getShakespeare();
177 int hitCount = getDb().getQueryCount();
178 Enumeration them = shakespeare.booksInSection(((BibliomaniaDatabase)getDb()).getDrama());
179 int resultsCount = 0;
180 while (them.hasMoreElements()) {
181 resultsCount++;
182 //Book it = (Book)
183 them.nextElement();
184 //System.err.println(it);
185 }
186 assertEquals(37, resultsCount);
187 // assertEquals(hitCount + resultsCount, getDb().getQueryCount());
188 Enumeration books = ((BibliomaniaDatabase)getDb()).getBookTable().selection();
189 resultsCount = 0;
190 while(books.hasMoreElements()) {
191 //Book t = (Book)
192 books.nextElement();
193 resultsCount++;
194 //System.err.println(t.troid() + " - " + t.getDisplayName());
195 }
196 assertEquals(hitCount + resultsCount + 1, getDb().getQueryCount());
197 hitCount = getDb().getQueryCount();
198 them = shakespeare.booksInSection(((BibliomaniaDatabase)getDb()).getDrama());
199 assertEquals(hitCount, getDb().getQueryCount());
200
201 }
202
203 /**
204 * Test method for {@link org.paneris.bibliomania.Author#booksInSectionGroup
205 * (org.paneris.bibliomania.SectionGroup)}.
206 */
207 public void testBooksInSectionGroup() {
208 Author shakespeare = ((BibliomaniaDatabase)getDb()).getShakespeare();
209 int hitCount = getDb().getQueryCount();
210 Enumeration<Book> them = shakespeare.booksInSectionGroup(((BibliomaniaDatabase)getDb()).getReadSectionGroup());
211 int resultsCount = 0;
212 while (them.hasMoreElements()) {
213 resultsCount++;
214 //Book it = (Book)
215 them.nextElement();
216 //System.err.println(it);
217 }
218 assertEquals(37, resultsCount);
219 assertEquals(hitCount + 1, getDb().getQueryCount());
220 them = shakespeare.booksInSectionGroup(((BibliomaniaDatabase)getDb()).getReadSectionGroup());
221 assertEquals(hitCount + 1, getDb().getQueryCount());
222 getDb().setLogSQL(true);
223 shakespeare.setDisplayname(shakespeare.getDisplayName());
224 them = shakespeare.booksInSectionGroup(((BibliomaniaDatabase)getDb()).getReadSectionGroup());
225 assertEquals(hitCount + 1, getDb().getQueryCount());
226 getDb().setLogSQL(false);
227
228 }
229
230 /**
231 * Test method for {@link org.paneris.bibliomania.Author#ftiTextID()}.
232 */
233 public void testFtiTextID() {
234
235 }
236
237 /**
238 * Test method for {@link org.paneris.bibliomania.Author#body()}.
239 */
240 public void testBody() {
241
242 }
243
244 /**
245 * Test method for {@link org.paneris.bibliomania.Author#bodyForFragment()}.
246 */
247 public void testBodyForFragment() {
248
249 }
250
251 /**
252 * Test method for {@link org.paneris.bibliomania.Author#getFrontPageFile()}.
253 */
254 public void testGetFrontPageFile() {
255
256 }
257
258 /**
259 * Test method for {@link org.paneris.bibliomania.Author#getImageURL()}.
260 */
261 public void testGetImageURL() {
262
263 }
264
265 /**
266 * Test method for {@link org.paneris.bibliomania.Author#getLinks()}.
267 */
268 public void testGetLinks() {
269
270 }
271
272 /**
273 * Test method for {@link org.paneris.bibliomania.Author#adminHandle(org.melati.Melati, org.melati.template.MarkupLanguage)}.
274 */
275 public void testAdminHandle() {
276
277 }
278
279 /**
280 * Test method for {@link org.paneris.bibliomania.Author#adminSpecialFacilities(org.melati.Melati, org.melati.template.MarkupLanguage)}.
281 */
282 public void testAdminSpecialFacilities() {
283
284 }
285
286 /**
287 * Test method for {@link org.paneris.bibliomania.Unit#getBibliomaniaDatabase()}.
288 */
289 public void testGetBibliomaniaDatabase() {
290
291 }
292
293 /**
294 * Test method for {@link org.paneris.bibliomania.Unit#Unit()}.
295 */
296 public void testUnit() {
297
298 }
299
300 /**
301 * Test method for {@link org.paneris.bibliomania.Unit#getAncestors()}.
302 */
303 public void testGetAncestors() {
304
305 }
306
307 /**
308 * Test method for {@link org.paneris.bibliomania.Unit#getRelatedProducts()}.
309 */
310 public void testGetRelatedProducts() {
311
312 }
313
314 /**
315 * Test method for {@link org.paneris.bibliomania.Unit#appendCachePath(java.lang.StringBuffer)}.
316 */
317 public void testAppendCachePath() {
318
319 }
320
321 /**
322 * Test method for {@link org.paneris.bibliomania.Unit#getCachePath()}.
323 */
324 public void testGetCachePath() {
325
326 }
327
328 /**
329 * Test method for {@link org.paneris.bibliomania.Unit#getBoardName()}.
330 */
331 public void testGetBoardName() {
332
333 }
334
335 /**
336 * Test method for {@link org.paneris.bibliomania.Unit#getWMTemplet(java.lang.String)}.
337 */
338 public void testGetWMTemplet() {
339
340 }
341
342 /**
343 * Test method for {@link org.paneris.bibliomania.Unit#readKeyDotTxt()}.
344 */
345 public void testReadKeyDotTxt() {
346
347 }
348
349 /**
350 * Test method for {@link org.paneris.bibliomania.Unit#paginate()}.
351 */
352 public void testPaginate() {
353
354 }
355
356 /**
357 * Test method for {@link org.paneris.bibliomania.Unit#getURLSubpath()}.
358 */
359 public void testGetURLSubpath() {
360
361 }
362
363 /**
364 * Test method for {@link org.paneris.bibliomania.Unit#getURLSubpathReally()}.
365 */
366 public void testGetURLSubpathReally() {
367
368 }
369
370 }