KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > modules > changelog > ChangeLogTest


1 /*
2 Copyright (c) 2003 eInnovation Inc. All rights reserved
3
4 This library is free software; you can redistribute it and/or modify it under the terms
5 of the GNU Lesser General Public License as published by the Free Software Foundation;
6 either version 2.1 of the License, or (at your option) any later version.
7
8 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the GNU Lesser General Public License for more details.
11 */

12
13 /*
14  * Created on Jun 18, 2003
15  *
16  */

17 package com.openedit.modules.changelog;
18
19 import org.openedit.repository.ContentItem;
20 import org.openedit.repository.filesystem.StringItem;
21
22 import com.openedit.BaseTestCase;
23 import com.openedit.WebPageRequest;
24
25
26 /**
27  * DOCUMENT ME!
28  *
29  * @author cburkey
30  */

31 public class ChangeLogTest extends BaseTestCase
32 {
33     /**
34      * Constructor for ChangeLogTest.
35      *
36      * @param arg0
37      */

38     public ChangeLogTest(String JavaDoc arg0)
39     {
40         super(arg0);
41     }
42     public void testTimeZone()
43     {
44 /* String[] vals = TimeZone.getAvailableIDs();
45         for (int i = 0; i < vals.length; i++)
46         {
47             System.out.println( vals[i] + ";");
48             
49         }
50 */

51         //TimeZone zone = TimeZone.getDefault();
52
//assertEquals( TimeZone.getTimeZone("America/New_York"), zone);
53
}
54     public void testNotify() throws Exception JavaDoc
55     {
56         ChangeLogModule module = (ChangeLogModule)getModule("ChangeLog");
57         ChangeLog log = module.getChangeLog();
58         
59         log.init();
60
61         StringItem revi = new StringItem();
62         revi.setAuthor("test");
63         revi.setAuthor("admin");
64         revi.setMessage("Added page");
65         revi.setType(ContentItem.TYPE_ADDED);
66         revi.setPath("/index.html");
67
68         log.getNewChanges().add(revi);
69
70         WebPageRequest context = getFixture().createPageRequest();
71         context.setRequestParameter("notifyall", "true");
72         
73         context.setRequestParameter( "from","notify-test@einnovation.com");
74         context.setRequestParameter( "smtp_server","mail.einnovation.com");
75         context.setRequestParameter( "subject","testing");
76         context.setRequestParameter( "to","test@einnovation.com");
77
78         module.setSMTPServer("mail.einnovation.com");
79         module.setFromAddress("cburkey@einnovation.com");
80
81         module.notifyUsers(context);
82         
83     }
84 }
85
Popular Tags