1 package org.apache.maven.plugin.war.util;
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 import org.apache.maven.model.Dependency;
24
25
26
27
28
29
30
31 public class WarUtilsTest
32 extends TestCase
33 {
34
35
36
37 public void testDependencyEquals()
38 {
39 Dependency firstDependency = new Dependency();
40 firstDependency.setGroupId( "1" );
41 firstDependency.setArtifactId( "a" );
42 Dependency secondDependency = new Dependency();
43 secondDependency.setGroupId( "2" );
44 secondDependency.setArtifactId( "b" );
45 Dependency thirdDependency = new Dependency();
46 thirdDependency.setGroupId( "1" );
47 thirdDependency.setArtifactId( "c" );
48 Dependency fourthDependency = new Dependency();
49 fourthDependency.setGroupId( "4" );
50 fourthDependency.setArtifactId( "a" );
51
52 assertFalse( "dependencies 1:a and 2:b should not be equal", WarUtils.dependencyEquals( firstDependency,
53 secondDependency ) );
54 assertFalse( "dependencies 1:a and 1:c should not be equal", WarUtils.dependencyEquals( firstDependency,
55 thirdDependency ) );
56 assertFalse( "dependencies 1:a and 4:a should not be equal", WarUtils.dependencyEquals( firstDependency,
57 fourthDependency ) );
58 assertFalse( "dependencies 2:b and 1:c should not be equal", WarUtils.dependencyEquals( secondDependency,
59 thirdDependency ) );
60 assertFalse( "dependencies 2:b and 4:a should not be equal", WarUtils.dependencyEquals( secondDependency,
61 fourthDependency ) );
62 assertFalse( "dependencies 1:c and 4:a should not be equal", WarUtils.dependencyEquals( thirdDependency,
63 fourthDependency ) );
64 }
65 }