1 package org.apache.maven.shared.utils.reflection;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 class ReflectorTestHelper
26 {
27 static String PACKAGE_STATIC_STRING = "package static string";
28 protected static String PROTECTED_STATIC_STRING = "protected static string";
29 public static String PUBLIC_STATIC_STRING = "public static string";
30
31 private ReflectorTestHelper()
32 {
33 }
34
35 ReflectorTestHelper( Boolean throwSomething )
36 {
37 if ( Boolean.TRUE.equals( throwSomething ) )
38 {
39 throw new HelperException( "Something" );
40 }
41 }
42
43 protected ReflectorTestHelper( Integer throwCount )
44 {
45 if ( throwCount != null && throwCount > 0 )
46 {
47 throw new HelperException( "Something" );
48 }
49 }
50
51 public ReflectorTestHelper( String throwMessage )
52 {
53 if ( throwMessage != null && throwMessage.length() > 0 )
54 {
55 throw new HelperException( throwMessage );
56 }
57 }
58
59 static ReflectorTestHelper getInstance( Boolean throwSomething )
60 {
61 if ( Boolean.TRUE.equals( throwSomething ) )
62 {
63 throw new HelperException( "Something" );
64 }
65 return new ReflectorTestHelper();
66 }
67
68 protected static ReflectorTestHelper getInstance( Integer throwCount )
69 {
70 if ( throwCount != null && throwCount > 0 )
71 {
72 throw new HelperException( "Something" );
73 }
74 return new ReflectorTestHelper();
75 }
76
77 public static ReflectorTestHelper getInstance( String throwMessage )
78 {
79 if ( throwMessage != null && throwMessage.length() > 0 )
80 {
81 throw new HelperException( throwMessage );
82 }
83 return new ReflectorTestHelper();
84 }
85
86 public ReflectorTestHelper getInstance( String aString, Boolean aBoolean )
87 {
88 return new ReflectorTestHelper();
89 }
90
91 public static class HelperException
92 extends RuntimeException
93 {
94
95
96
97 private static final long serialVersionUID = -3395757415194358525L;
98
99 public HelperException()
100 {
101 super();
102 }
103
104 public HelperException( String message )
105 {
106 super( message );
107 }
108
109 public HelperException( String message, Throwable cause )
110 {
111 super( message, cause );
112 }
113
114 public HelperException( Throwable cause )
115 {
116 super( cause );
117 }
118 }
119 }