1 package org.apache.maven.plugin.assembly.io;
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 import org.apache.maven.shared.io.location.Location;
25 import org.apache.maven.shared.io.location.LocatorStrategy;
26 import org.apache.maven.shared.io.logging.DefaultMessageHolder;
27 import org.apache.maven.shared.io.logging.MessageHolder;
28
29
30
31
32 public class PrefixedClasspathLocatorStrategyTest
33 extends TestCase
34 {
35
36 public void testResolvePrefixWithLeadingSlashAndWithTrailingSlash()
37 {
38 MessageHolder mh = new DefaultMessageHolder();
39
40 LocatorStrategy ls = new PrefixedClasspathLocatorStrategy( "/assemblies/" );
41 Location location = ls.resolve( "empty.xml", mh );
42
43 assertNotNull( location );
44 assertEquals( 0, mh.size() );
45 }
46
47 public void testResolvePrefixWithLeadingSlashAndWithoutTrailingSlash()
48 {
49 MessageHolder mh = new DefaultMessageHolder();
50
51 LocatorStrategy ls = new PrefixedClasspathLocatorStrategy( "/assemblies" );
52 Location location = ls.resolve( "empty.xml", mh );
53
54 assertNotNull( location );
55 assertEquals( 0, mh.size() );
56 }
57
58 public void testResolvePrefixWithoutLeadingSlashAndWithTrailingSlash()
59 {
60 MessageHolder mh = new DefaultMessageHolder();
61
62 LocatorStrategy ls = new PrefixedClasspathLocatorStrategy( "assemblies/" );
63 Location location = ls.resolve( "empty.xml", mh );
64
65 assertNotNull( location );
66 assertEquals( 0, mh.size() );
67 }
68
69 public void testResolvePrefixWithoutLeadingSlashAndWithoutTrailingSlash()
70 {
71 MessageHolder mh = new DefaultMessageHolder();
72
73 LocatorStrategy ls = new PrefixedClasspathLocatorStrategy( "assemblies" );
74 Location location = ls.resolve( "empty.xml", mh );
75
76 assertNotNull( location );
77 assertEquals( 0, mh.size() );
78 }
79
80 }