1 package org.apache.maven.model;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import junit.framework.TestCase;
23
24
25
26
27
28
29 public class OrganizationTest
30 extends TestCase
31 {
32
33 public void testHashCodeNullSafe()
34 {
35 new Organization().hashCode();
36 }
37
38 public void testEqualsNullSafe()
39 {
40 assertFalse( new Organization().equals( null ) );
41
42 new Organization().equals( new Organization() );
43 }
44
45 public void testEqualsIdentity()
46 {
47 Organization thing = new Organization();
48 assertTrue( thing.equals( thing ) );
49 }
50
51 public void testToStringNullSafe()
52 {
53 assertNotNull( new Organization().toString() );
54 }
55
56
57 public void testToStringNotNonsense11()
58 {
59 Organization org = new Organization();
60 org.setName( "Testing Maven Unit" );
61 org.setUrl( "https://maven.localdomain" );
62
63 assertEquals( "Organization {name=Testing Maven Unit, url=https://maven.localdomain}", org.toString() );
64 }
65
66 public void testToStringNotNonsense10()
67 {
68 Organization org = new Organization();
69 org.setName( "Testing Maven Unit" );
70
71 assertEquals( "Organization {name=Testing Maven Unit, url=null}", org.toString() );
72 }
73
74 public void testToStringNotNonsense01()
75 {
76 Organization org = new Organization();
77 org.setUrl( "https://maven.localdomain" );
78
79 assertEquals( "Organization {name=null, url=https://maven.localdomain}", org.toString() );
80 }
81
82 public void testToStringNotNonsense00()
83 {
84 Organization org = new Organization();
85
86 assertEquals( "Organization {name=null, url=null}", org.toString() );
87 }
88 }