Clover Coverage Report - Pebble 2.5-SNAPSHOT
Coverage timestamp: Sat Jun 12 2010 09:39:29 EST
223   556   43   5,19
0   322   0,19   43
43     1  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  BlogTest       Line # 50 223 0% 43 4 98,5% 0.9849624
 
  (78)
 
1    /*
2    * Copyright (c) 2003-2006, Simon Brown
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions are met:
7    *
8    * - Redistributions of source code must retain the above copyright
9    * notice, this list of conditions and the following disclaimer.
10    *
11    * - Redistributions in binary form must reproduce the above copyright
12    * notice, this list of conditions and the following disclaimer in
13    * the documentation and/or other materials provided with the
14    * distribution.
15    *
16    * - Neither the name of Pebble nor the names of its contributors may
17    * be used to endorse or promote products derived from this software
18    * without specific prior written permission.
19    *
20    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22    * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23    * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24    * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25    * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26    * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27    * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28    * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29    * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30    * POSSIBILITY OF SUCH DAMAGE.
31    */
32    package net.sourceforge.pebble.domain;
33   
34    import net.sourceforge.pebble.Constants;
35    import net.sourceforge.pebble.PebbleContext;
36    import net.sourceforge.pebble.event.DefaultEventDispatcher;
37    import net.sourceforge.pebble.api.event.blog.BlogEvent;
38    import net.sourceforge.pebble.api.event.blog.BlogListener;
39    import net.sourceforge.pebble.logging.CombinedLogFormatLogger;
40    import net.sourceforge.pebble.permalink.DefaultPermalinkProvider;
41   
42    import java.io.File;
43    import java.util.*;
44   
45    /**
46    * Tests for the Blog class.
47    *
48    * @author Simon Brown
49    */
 
50    public class BlogTest extends SingleBlogTestCase {
51   
 
52  2 toggle public void testConstructionOfDefaultInstance() {
53  2 assertEquals(new File(TEST_BLOG_LOCATION, "blogs/default").getAbsolutePath(), blog.getRoot());
54  2 assertNull(blog.getBlog());
55  2 assertEquals("My blog", blog.getName());
56  2 assertEquals("", blog.getDescription());
57  2 assertEquals("Blog Owner", blog.getAuthor());
58  2 assertEquals("blog@yourdomain.com", blog.getEmail());
59  2 assertEquals(TimeZone.getTimeZone("Europe/London"), blog.getTimeZone());
60  2 assertEquals("en", blog.getLanguage());
61  2 assertEquals("GB", blog.getCountry());
62  2 assertEquals("UTF-8", blog.getCharacterEncoding());
63  2 assertEquals(3, blog.getRecentBlogEntriesOnHomePage());
64  2 assertEquals(3, blog.getRecentResponsesOnHomePage());
65  2 assertTrue(blog.isPublic());
66  2 assertFalse(blog.isPrivate());
67  2 assertEquals("net.sourceforge.pebble.permalink.DefaultPermalinkProvider", blog.getPermalinkProviderName());
68  2 assertTrue(blog.getPermalinkProvider() instanceof DefaultPermalinkProvider);
69  2 assertEquals("net.sourceforge.pebble.event.DefaultEventDispatcher", blog.getEventDispatcherName());
70  2 assertTrue(blog.getEventDispatcher() instanceof DefaultEventDispatcher);
71  2 assertEquals("net.sourceforge.pebble.logging.CombinedLogFormatLogger", blog.getLoggerName());
72  2 assertTrue(blog.getLogger() instanceof CombinedLogFormatLogger);
73    }
74   
75    /**
76    * Tests that we can get a specific property.
77    */
 
78  2 toggle public void testGetProperty() {
79  2 assertEquals(blog.getName(), blog.getProperty(Blog.NAME_KEY));
80    }
81   
82    /**
83    * Tests that we can get a specific property.
84    */
 
85  2 toggle public void testGetProperties() {
86  2 Properties props = blog.getProperties();
87  2 assertNotNull(props);
88  2 assertEquals(blog.getName(), props.getProperty(Blog.NAME_KEY));
89    }
90   
91    /**
92    * Tests that we can set a specific property.
93    */
 
94  2 toggle public void testSetProperty() {
95  2 blog.setProperty(Blog.NAME_KEY, "New name");
96  2 assertEquals("New name", blog.getProperty(Blog.NAME_KEY));
97  2 assertEquals("New name", blog.getName());
98   
99    // and a new property
100  2 blog.setProperty("aNewPropertyKey", "A new property value");
101  2 assertEquals("A new property value", blog.getProperty("aNewPropertyKey"));
102    }
103   
104    /**
105    * Tests that we can store properties.
106    public void testStoreProperties() {
107    blog.setProperty("aNewPropertyKey", "A new property value");
108    try {
109    blog.storeProperties();
110   
111    blog = new Blog(TEST_BLOG_LOCATION.getAbsolutePath());
112    assertEquals("A new property value", blog.getProperty("aNewPropertyKey"));
113   
114    // and clean up
115    blog.removeProperty("aNewPropertyKey");
116    blog.storeProperties();
117    } catch (BlogServiceException e) {
118    fail();
119    }
120    }
121    */
122   
123    /**
124    * Tests that we can remove a specific property.
125    */
 
126  2 toggle public void testRemoveProperty() {
127  2 blog.setProperty("aNewPropertyKey", "A new property value");
128  2 assertEquals("A new property value", blog.getProperty("aNewPropertyKey"));
129  2 blog.removeProperty("aNewPropertyKey");
130  2 assertNull(blog.getProperty("aNewPropertyKey"));
131    }
132   
133    /**
134    * Tests that the correct calendar (with timezone) is created.
135    */
 
136  2 toggle public void testCalendar() {
137  2 Calendar cal = blog.getCalendar();
138  2 assertEquals(blog.getTimeZone(), cal.getTimeZone());
139    }
140   
141    /**
142    * Tests that we can get a specific Year instance.
143    */
 
144  2 toggle public void testGetBlogForYear() {
145  2 Calendar cal = blog.getCalendar();
146  2 Year year = blog.getBlogForYear(cal.get(Calendar.YEAR));
147  2 assertNotNull(year);
148  2 assertEquals(cal.get(Calendar.YEAR), year.getYear());
149    }
150   
151    /**
152    * Tests that we can get a previous Year instance.
153    */
 
154  2 toggle public void testGetBlogForPreviousYear() {
155  2 Calendar cal = blog.getCalendar();
156  2 Year year = blog.getBlogForYear(cal.get(Calendar.YEAR));
157  2 year = blog.getBlogForPreviousYear(year);
158  2 assertNotNull(year);
159  2 assertEquals(cal.get(Calendar.YEAR)-1, year.getYear());
160    }
161   
162    /**
163    * Tests that we can get a next Year instance.
164    */
 
165  2 toggle public void testGetBlogForNextYear() {
166  2 Calendar cal = blog.getCalendar();
167  2 Year year = blog.getBlogForYear(cal.get(Calendar.YEAR));
168  2 year = blog.getBlogForNextYear(year);
169  2 assertNotNull(year);
170  2 assertEquals(cal.get(Calendar.YEAR)+1, year.getYear());
171    }
172   
173    /**
174    * Tests that we can get the first Month instance.
175    */
 
176  2 toggle public void testGetBlogForFirstMonth() {
177  2 Month month = blog.getBlogForFirstMonth();
178  2 assertNotNull(month);
179    // assertEquals(blog.getBlogForFirstYear(), month.getYear());
180  2 Calendar cal = blog.getCalendar();
181  2 assertEquals(cal.get(Calendar.MONTH)+1, month.getMonth());
182    }
183   
184    /**
185    * Tests that we can get a Month instance.
186    */
 
187  2 toggle public void testGetBlogForMonth() {
188  2 Month month = blog.getBlogForMonth(2003, 4);
189  2 assertNotNull(month);
190  2 assertEquals(2003, month.getYear().getYear());
191  2 assertEquals(4, month.getMonth());
192    }
193   
194    /**
195    * Tests that we can get the Month instance for this month.
196    */
 
197  2 toggle public void testGetBlogForThisMonth() {
198  2 Calendar cal = blog.getCalendar();
199  2 Month month = blog.getBlogForThisMonth();
200  2 assertNotNull(month);
201  2 assertEquals(cal.get(Calendar.YEAR), month.getYear().getYear());
202  2 assertEquals(cal.get(Calendar.MONTH) + 1, month.getMonth());
203    }
204   
205    /**
206    * Tests that we can get a Day instance.
207    */
 
208  2 toggle public void testGetBlogForDay() {
209  2 Day day = blog.getBlogForDay(2003, 7, 14);
210  2 assertNotNull(day);
211  2 assertEquals(2003, day.getMonth().getYear().getYear());
212  2 assertEquals(7, day.getMonth().getMonth());
213  2 assertEquals(14, day.getDay());
214    }
215   
216    /**
217    * Tests that we can get a Day instance.
218    */
 
219  2 toggle public void testGetBlogForDate() {
220  2 Calendar cal = blog.getCalendar();
221  2 cal.set(Calendar.YEAR, 2003);
222  2 cal.set(Calendar.MONTH, 6);
223  2 cal.set(Calendar.DAY_OF_MONTH, 14);
224  2 Day day = blog.getBlogForDay(cal.getTime());
225  2 assertNotNull(day);
226  2 assertEquals(2003, day.getMonth().getYear().getYear());
227  2 assertEquals(7, day.getMonth().getMonth());
228  2 assertEquals(14, day.getDay());
229    }
230   
231    /**
232    * Tests that we can get the Day instance for today.
233    */
 
234  2 toggle public void testGetBlogForToday() {
235  2 Calendar cal = blog.getCalendar();
236  2 Day day = blog.getBlogForToday();
237  2 assertNotNull(day);
238  2 assertEquals(cal.get(Calendar.YEAR), day.getMonth().getYear().getYear());
239  2 assertEquals(cal.get(Calendar.MONTH) + 1, day.getMonth().getMonth());
240  2 assertEquals(cal.get(Calendar.DAY_OF_MONTH), day.getDay());
241    }
242   
243    /**
244    * Tests that blog owners can be assigned.
245    */
 
246  2 toggle public void testAssignBlogOwners() {
247  2 blog.setProperty(Blog.BLOG_OWNERS_KEY, "user1");
248  2 assertEquals("user1", blog.getProperty(Blog.BLOG_OWNERS_KEY));
249  2 assertEquals("user1", blog.getBlogOwnersAsString());
250   
251  2 Collection users = blog.getUsersInRole(Constants.BLOG_OWNER_ROLE);
252  2 assertEquals(1, users.size());
253  2 assertTrue(users.contains("user1"));
254   
255  2 blog.setProperty(Blog.BLOG_OWNERS_KEY, "user1,user2");
256  2 assertEquals("user1,user2", blog.getProperty(Blog.BLOG_OWNERS_KEY));
257  2 assertEquals("user1,user2", blog.getBlogOwnersAsString());
258   
259  2 users = blog.getUsersInRole(Constants.BLOG_OWNER_ROLE);
260  2 assertEquals(2, users.size());
261  2 assertTrue(users.contains("user1"));
262  2 assertTrue(users.contains("user2"));
263    }
264   
265    /**
266    * Tests that blog owners can be assigned.
267    */
 
268  2 toggle public void testNullBlogOwners() {
269  2 blog.removeProperty(Blog.BLOG_OWNERS_KEY);
270  2 assertEquals(null, blog.getBlogOwnersAsString());
271   
272  2 Collection users = blog.getUsersInRole(Constants.BLOG_OWNER_ROLE);
273  2 assertEquals(0, users.size());
274    }
275   
276    /**
277    * Tests that it can be determined that a user is a blog owner.
278    */
 
279  2 toggle public void testUserIsBlogOwner() {
280  2 blog.setProperty(Blog.BLOG_OWNERS_KEY, "user1");
281  2 assertTrue(blog.isUserInRole(Constants.BLOG_OWNER_ROLE, "user1"));
282  2 assertFalse(blog.isUserInRole(Constants.BLOG_OWNER_ROLE, "user2"));
283    }
284   
285    /**
286    * Tests that when no blog contributors are specified, then everybody takes
287    * on that role.
288    */
 
289  2 toggle public void testUserIsBlogOwnerByDefault() {
290  2 blog.removeProperty(Blog.BLOG_OWNERS_KEY);
291  2 assertTrue(blog.isUserInRole(Constants.BLOG_OWNER_ROLE, "user1"));
292  2 assertTrue(blog.isUserInRole(Constants.BLOG_OWNER_ROLE, "usern"));
293    }
294   
295    /**
296    * Tests that blog contributors can be assigned.
297    */
 
298  2 toggle public void testAssignBlogContributors() {
299  2 blog.setProperty(Blog.BLOG_CONTRIBUTORS_KEY, "user1");
300  2 assertEquals("user1", blog.getProperty(Blog.BLOG_CONTRIBUTORS_KEY));
301  2 assertEquals("user1", blog.getBlogContributorsAsString());
302   
303  2 Collection users = blog.getUsersInRole(Constants.BLOG_CONTRIBUTOR_ROLE);
304  2 assertEquals(1, users.size());
305  2 assertTrue(users.contains("user1"));
306   
307  2 blog.setProperty(Blog.BLOG_CONTRIBUTORS_KEY, "user1,user2");
308  2 assertEquals("user1,user2", blog.getProperty(Blog.BLOG_CONTRIBUTORS_KEY));
309  2 assertEquals("user1,user2", blog.getBlogContributorsAsString());
310   
311  2 users = blog.getUsersInRole(Constants.BLOG_CONTRIBUTOR_ROLE);
312  2 assertEquals(2, users.size());
313  2 assertTrue(users.contains("user1"));
314  2 assertTrue(users.contains("user2"));
315   
316  2 blog.setProperty(Blog.BLOG_CONTRIBUTORS_KEY, "user1, user2");
317  2 assertEquals("user1, user2", blog.getProperty(Blog.BLOG_CONTRIBUTORS_KEY));
318  2 assertEquals("user1, user2", blog.getBlogContributorsAsString());
319   
320  2 users = blog.getUsersInRole(Constants.BLOG_CONTRIBUTOR_ROLE);
321  2 assertEquals(2, users.size());
322  2 assertTrue(users.contains("user1"));
323  2 assertTrue(users.contains("user2"));
324    }
325   
326    /**
327    * Tests that blog contributors can be assigned.
328    */
 
329  2 toggle public void testNullBlogContributors() {
330  2 blog.removeProperty(Blog.BLOG_CONTRIBUTORS_KEY);
331  2 assertEquals(null, blog.getBlogContributorsAsString());
332   
333  2 Collection users = blog.getUsersInRole(Constants.BLOG_CONTRIBUTOR_ROLE);
334  2 assertEquals(0, users.size());
335    }
336   
337    /**
338    * Tests that it can be determined that a user is a blog contributor.
339    */
 
340  2 toggle public void testUserIsBlogContributor() {
341  2 blog.setProperty(Blog.BLOG_CONTRIBUTORS_KEY, "user1");
342  2 assertTrue(blog.isUserInRole(Constants.BLOG_CONTRIBUTOR_ROLE, "user1"));
343  2 assertFalse(blog.isUserInRole(Constants.BLOG_CONTRIBUTOR_ROLE, "user2"));
344    }
345   
346    /**
347    * Tests that when no blog contributors are specified, then everybody takes
348    * on that role.
349    */
 
350  2 toggle public void testUserIsBlogContributorByDefault() {
351  2 blog.removeProperty(Blog.BLOG_CONTRIBUTORS_KEY);
352  2 assertTrue(blog.isUserInRole(Constants.BLOG_CONTRIBUTOR_ROLE, "user1"));
353  2 assertTrue(blog.isUserInRole(Constants.BLOG_CONTRIBUTOR_ROLE, "usern"));
354    }
355   
 
356  2 toggle public void testInvalidDayOfMonthAfterTimeZoneChanges() {
357  2 blog.getRecentBlogEntries();
358  2 blog.setProperty(Blog.TIMEZONE_KEY, "America/New_York");
359   
360    // this should not cause an exception to be thrown
361  2 blog.getRecentBlogEntries();
362    }
363   
 
364  2 toggle public void testGetRecentBlogEntriesFromEmptyBlog() {
365  2 assertTrue(blog.getRecentBlogEntries(3).isEmpty());
366    }
367   
 
368  2 toggle public void testGetRecentBlogEntries() throws BlogServiceException {
369  2 BlogService service = new BlogService();
370   
371  2 BlogEntry entry1 = new BlogEntry(blog);
372  2 entry1.setTitle("title1");
373  2 entry1.setBody("body1");
374  2 service.putBlogEntry(entry1);
375   
376  2 BlogEntry entry2 = new BlogEntry(blog);
377  2 entry2.setTitle("title2");
378  2 entry2.setBody("body2");
379  2 service.putBlogEntry(entry2);
380   
381  2 BlogEntry entry3 = new BlogEntry(blog);
382  2 entry3.setTitle("title3");
383  2 entry3.setBody("body3");
384  2 service.putBlogEntry(entry3);
385   
386  2 BlogEntry entry4 = new BlogEntry(blog);
387  2 entry4.setTitle("title4");
388  2 entry4.setBody("body4");
389  2 service.putBlogEntry(entry4);
390   
391  2 List entries = blog.getRecentBlogEntries(3);
392   
393  2 assertEquals(3, entries.size());
394  2 assertEquals(entry4, entries.get(0));
395    }
396   
397    /**
398    * Tests the images directory is correct and that it exists.
399    */
 
400  2 toggle public void testImagesDirectoryAccessible() {
401  2 File file = new File(blog.getRoot(), "images");
402  2 assertEquals(file, new File(blog.getImagesDirectory()));
403  2 assertTrue(file.exists());
404    }
405   
406    /**
407    * Tests the files directory is correct and that it exists.
408    */
 
409  2 toggle public void testFilesDirectoryAccessible() {
410  2 File file = new File(blog.getRoot(), "files");
411  2 assertEquals(file, new File(blog.getFilesDirectory()));
412  2 assertTrue(file.exists());
413    }
414   
415    /**
416    * Tests the theme directory is correct and that it doesn't exist by default
417    * - starting up Pebble creates a theme based on the template if the theme
418    * - directory doesn't exist.
419    */
 
420  2 toggle public void testThemeDirectoryAccessible() {
421  2 File file = new File(blog.getRoot(), "theme");
422  2 assertEquals(file, new File(blog.getThemeDirectory()));
423  2 assertTrue(file.exists());
424    }
425   
426    /**
427    * Tests setting a single e-mail address.
428    */
 
429  2 toggle public void testSingleEmailAddress() {
430  2 blog.setProperty(Blog.EMAIL_KEY, "me@mydomain.com");
431  2 assertEquals("me@mydomain.com", blog.getEmail());
432  2 assertEquals(1, blog.getEmailAddresses().size());
433  2 assertEquals("me@mydomain.com", blog.getEmailAddresses().iterator().next());
434    }
435   
436    /**
437    * Tests setting multiple e-mail address.
438    */
 
439  2 toggle public void testMultipleEmailAddresses() {
440  2 blog.setProperty(Blog.EMAIL_KEY, "me@mydomain.com,you@yourdomain.com");
441  2 assertEquals("me@mydomain.com,you@yourdomain.com", blog.getEmail());
442  2 assertEquals(2, blog.getEmailAddresses().size());
443  2 Iterator it = blog.getEmailAddresses().iterator();
444  2 assertEquals("me@mydomain.com", it.next());
445  2 assertEquals("you@yourdomain.com", it.next());
446    }
447   
448    /**
449    * Tests getting the first of multiple e-mail addresses.
450    */
 
451  2 toggle public void testFirstEmailAddress() {
452  2 blog.setProperty(Blog.EMAIL_KEY, "");
453  2 assertEquals("", blog.getFirstEmailAddress());
454  2 blog.setProperty(Blog.EMAIL_KEY, "me@mydomain.com");
455  2 assertEquals("me@mydomain.com", blog.getFirstEmailAddress());
456  2 blog.setProperty(Blog.EMAIL_KEY, "me@mydomain.com,you@yourdomain.com");
457  2 assertEquals("me@mydomain.com", blog.getFirstEmailAddress());
458    }
459   
460    /**
461    * Tests the domain.
462    */
 
463  2 toggle public void testDomain() {
464  2 assertEquals("www.yourdomain.com", blog.getDomainName());
465   
466  2 PebbleContext.getInstance().getConfiguration().setUrl("http://www.yourdomain.com:8080/blog");
467  2 assertEquals("www.yourdomain.com", blog.getDomainName());
468    }
469   
470    /**
471    * Tests the protocol.
472    */
 
473  2 toggle public void testProtocol() {
474  2 assertEquals("http://", blog.getProtocol());
475    }
476   
477    /**
478    * Tests the context.
479    */
 
480  2 toggle public void testContext() {
481  2 assertEquals("/blog/", blog.getContext());
482   
483  2 PebbleContext.getInstance().getConfiguration().setUrl("http://www.yourdomain.com:8080");
484  2 assertEquals("/", blog.getContext());
485   
486  2 PebbleContext.getInstance().getConfiguration().setUrl("http://www.yourdomain.com:8080/");
487  2 assertEquals("/", blog.getContext());
488    }
489   
490    /**
491    * Tests the logger can be accessed and is of the correct type.
492    */
 
493  2 toggle public void testLogger() {
494  2 assertNotNull(blog.getLogger());
495  2 assertTrue(blog.getLogger() instanceof CombinedLogFormatLogger);
496    }
497   
498    /**
499    * Tests that listeners are fired when the blog is started.
500    */
 
501  2 toggle public void testListenersFiredWhenBlogStarted() {
502  2 final StringBuffer buf = new StringBuffer("123");
503  2 BlogListener listener = new BlogListener() {
 
504  2 toggle public void blogStarted(BlogEvent event) {
505  2 assertEquals(blog, event.getSource());
506  2 buf.reverse();
507    }
508   
 
509  0 toggle public void blogStopped(BlogEvent event) {
510  0 fail();
511    }
512    };
513  2 blog.getEventListenerList().addBlogListener(listener);
514  2 blog.start();
515  2 assertEquals("321", buf.toString());
516  2 blog.getEventListenerList().removeBlogListener(listener);
517  2 blog.stop();
518    }
519   
520    /**
521    * Tests that listeners are fired when the blog is stopped.
522    */
 
523  2 toggle public void testListenersFiredWhenBlogStopped() {
524  2 final StringBuffer buf = new StringBuffer("123");
525  2 BlogListener listener = new BlogListener() {
 
526  0 toggle public void blogStarted(BlogEvent event) {
527  0 fail();
528    }
529   
 
530  4 toggle public void blogStopped(BlogEvent event) {
531  4 assertEquals(blog, event.getSource());
532  4 buf.reverse();
533    }
534    };
535  2 blog.getEventListenerList().addBlogListener(listener);
536  2 blog.stop();
537  2 assertEquals("321", buf.toString());
538    }
539   
 
540  2 toggle public void testApprovedCommentsForUnpublishedBlogEntriesDontShowUp() throws BlogServiceException {
541  2 BlogService service = new BlogService();
542   
543  2 BlogEntry blogEntry = new BlogEntry(blog);
544  2 blogEntry.setTitle("title1");
545  2 blogEntry.setBody("body1");
546  2 blogEntry.setPublished(false);
547  2 service.putBlogEntry(blogEntry);
548   
549  2 Comment comment = blogEntry.createComment("title", "body", "author", "email", "website", "127.0.0.1");
550  2 blogEntry.addComment(comment);
551  2 service.putBlogEntry(blogEntry);
552   
553  2 assertFalse(blog.getRecentApprovedResponses().contains(comment));
554    }
555   
556    }