01: package com.ecyrd.jspwiki.auth.user;
02:
03: import java.io.IOException;
04: import java.util.Properties;
05:
06: import junit.framework.Test;
07: import junit.framework.TestCase;
08: import junit.framework.TestSuite;
09:
10: import org.apache.log4j.PropertyConfigurator;
11:
12: import com.ecyrd.jspwiki.TestEngine;
13:
14: /**
15: * Tests the DefaultUserProfile class.
16: * @author Janne Jalkanen
17: */
18: public class UserProfileTest extends TestCase {
19: public UserProfileTest(String s) {
20: super (s);
21: Properties props = new Properties();
22: try {
23: props.load(TestEngine.findTestProperties());
24: PropertyConfigurator.configure(props);
25: } catch (IOException e) {
26: }
27: }
28:
29: public void setUp() throws Exception {
30: }
31:
32: public void tearDown() {
33: }
34:
35: public void testEquals() {
36: UserProfile p = new DefaultUserProfile();
37: UserProfile p2 = new DefaultUserProfile();
38:
39: p.setFullname("Alice");
40: p2.setFullname("Bob");
41:
42: assertFalse(p.equals(p2));
43: }
44:
45: public void testEquals2() {
46: UserProfile p = new DefaultUserProfile();
47: UserProfile p2 = new DefaultUserProfile();
48:
49: p.setFullname("Alice");
50: p2.setFullname("Alice");
51:
52: assertTrue(p.equals(p2));
53: }
54:
55: public static Test suite() {
56: return new TestSuite(UserProfileTest.class);
57: }
58: }
|