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 LicenseTest
30 extends TestCase
31 {
32
33 public void testHashCodeNullSafe()
34 {
35 new License().hashCode();
36 }
37
38 public void testEqualsNullSafe()
39 {
40 assertFalse( new License().equals( null ) );
41
42 new License().equals( new License() );
43 }
44
45 public void testEqualsIdentity()
46 {
47 License thing = new License();
48 assertTrue( thing.equals( thing ) );
49 }
50
51 public void testToStringNullSafe()
52 {
53 assertNotNull( new License().toString() );
54 }
55
56 public void testToStringNotNonsense()
57 {
58 License license = new License();
59 license.setName( "Unlicense" );
60 license.setUrl( "http://lic.localdomain" );
61
62 String s = license.toString();
63
64 assert "License {name=Unlicense, url=http://lic.localdomain}".equals( s ) : s;
65 }
66 }