01: /* PAT: Persistent Applications Toolkit (patsystem.sf.net)
02: * Copyright (C) 2004, 2005 Tomasz Nazar, nthx at irc dot pl
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: * Full version of the license is /docs/LICENSE.txt
19: */
20: package org.nthx.pat.tests;
21:
22: import org.nthx.pat.demo.Forum;
23: import org.nthx.pat.demo.Users;
24: import org.nthx.pat.demo.User;
25: import org.nthx.pat.Pat;
26:
27: /**
28: * @version $Id: OtherThanDefaultRootConstructorsTest.java 3725 2005-06-09 23:57:03Z nthx $
29: * @author nthx@users.sourceforge.net
30: */
31: public class OtherThanDefaultRootConstructorsTest extends PatTestCase {
32:
33: public void setUp() {
34: Pat.unload();
35: cleanPrevaylersRepo();
36: }
37:
38: public void testDefaultConstructorWorks() {
39: Forum forum = new Forum();
40: assertNotNull(forum.getUsers());
41: assertNotNull(forum.getTopics());
42: }
43:
44: public void testOtherConstructorWorks() {
45: Users users = new Users();
46: users.addUser(new User("Tomasz", "Nazar", "nthx", "www"));
47: Forum forum = new Forum(users);
48: assertNotNull(forum.getUsers());
49: assertNotNull(forum.getTopics());
50: assertEquals("Should be one user: ", 1, forum.getUsers().size());
51: }
52:
53: //-----Test suite internals---------------------
54: public OtherThanDefaultRootConstructorsTest(String arg0) {
55: super (arg0);
56: }
57:
58: public static void main(String[] args) {
59: junit.textui.TestRunner
60: .run(OtherThanDefaultRootConstructorsTest.class);
61: }
62: }
|