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