KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > dlog4j > beans > RefererBeanTest


1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU Library General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  */

16 package dlog4j.beans;
17
18 import junit.framework.TestCase;
19
20 /**
21  * RefererBeanµÄ²âÊÔÀà
22  * @author Winter Lau
23  */

24 public class RefererBeanTest extends TestCase {
25
26     RefererBean bean;
27     /*
28      * @see TestCase#setUp()
29      */

30     protected void setUp() throws Exception JavaDoc {
31         super.setUp();
32         bean = new RefererBean();
33     }
34
35     /*
36      * @see TestCase#tearDown()
37      */

38     protected void tearDown() throws Exception JavaDoc {
39         super.tearDown();
40         bean = null;
41     }
42
43     public void testGetReqUrl() {
44         bean.setRequestURL("http://www.javayou.com/main.jspe?main=/main.jsp");
45         assertEquals(bean.getRequestURL(),"http://www.javayou.com/main.jspe");
46         bean.setRequestURL("http://www.javayou.com/comment_list.jspe?main=/comment_list.jsp&userid=9");
47         assertEquals(bean.getRequestURL(),"http://www.javayou.com/comment_list.jspe?userid=9");
48         bean.setRequestURL(null);
49         assertNull(bean.getRequestURL());
50     }
51
52 }
53
Popular Tags