KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > modules > admin > TimeCopyModuleTest


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 package com.openedit.modules.admin;
14
15 import com.openedit.BaseTestCase;
16 import com.openedit.WebPageRequest;
17 import com.openedit.modules.admin.filemanager.TimeCopyModule;
18 import com.openedit.page.Page;
19 import com.openedit.page.manage.PageManager;
20
21
22 /**
23  * DOCUMENT ME!
24  *
25  * @author cburkey
26  */

27 public class TimeCopyModuleTest extends BaseTestCase
28 {
29
30     public TimeCopyModuleTest(String JavaDoc inName)
31     {
32         super(inName);
33     }
34     
35     public void testTimeCopy() throws Exception JavaDoc
36     {
37         PageManager pageManager = getFixture().getPageManager();
38         //Get a new copy.xml to work with
39
Page copytestxml = getPage("/openedit/scheduler/copytest.xml");
40         Page copyxml = getPage("/openedit/scheduler/copy.xml");
41         getFixture().getPageManager().copyPage(copytestxml, copyxml);
42         
43         //Delete the to page, if it exists
44
Page to = getPage("/openedit/scheduler/to.html");
45         if (to.exists())
46         {
47             pageManager.removePage(to);
48         }
49         
50         
51         WebPageRequest context = getFixture().createPageRequest();
52         TimeCopyModule mod = (TimeCopyModule) getFixture().getModuleManager().getModule("TimeCopy");
53         mod.check(context);
54         assertTrue(to.exists());
55     }
56 }
57
Popular Tags