1 package org.apache.maven.plugins.shade.relocation;
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 java.util.Collections;
25
26 public class SimpleRelocatorParameterTest
27 extends TestCase
28 {
29
30
31 protected void setUp()
32 throws Exception
33 {
34 super.setUp();
35 }
36
37 public void testThatNullPatternInConstructorShouldNotThrowNullPointerException()
38 {
39 constructThenFailOnNullPointerException( null, "" );
40 }
41
42 public void testThatNullShadedPatternInConstructorShouldNotThrowNullPointerException()
43 {
44 constructThenFailOnNullPointerException( "", null );
45 }
46
47 private void constructThenFailOnNullPointerException( String pattern, String shadedPattern )
48 {
49 try
50 {
51 new SimpleRelocator( pattern, shadedPattern, Collections.EMPTY_LIST, Collections.EMPTY_LIST );
52 }
53 catch ( NullPointerException e )
54 {
55 fail( "Constructor should not throw null pointer exceptions" );
56 }
57 }
58 }