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 private static String PRIVATE_STATIC_STRING = "private static string";
28 static String PACKAGE_STATIC_STRING = "package static string";
29 protected static String PROTECTED_STATIC_STRING = "protected static string";
30 public static String PUBLIC_STATIC_STRING = "public static string";
31
32 private ReflectorTestHelper()
33 {
34 }
35
36 ReflectorTestHelper( Boolean throwSomething )
37 {
38 if ( Boolean.TRUE.equals( throwSomething ) )
39 {
40 throw new HelperException( "Something" );
41 }
42 }
43
44 protected ReflectorTestHelper( Integer throwCount )
45 {
46 if ( throwCount != null && throwCount.intValue() > 0 )
47 {
48 throw new HelperException( "Something" );
49 }
50 }
51
52 public ReflectorTestHelper( String throwMessage )
53 {
54 if ( throwMessage != null && throwMessage.length() > 0 )
55 {
56 throw new HelperException( throwMessage );
57 }
58 }
59
60 private static ReflectorTestHelper getInstance()
61 {
62 return new ReflectorTestHelper();
63 }
64
65 static ReflectorTestHelper getInstance( Boolean throwSomething )
66 {
67 if ( Boolean.TRUE.equals( throwSomething ) )
68 {
69 throw new HelperException( "Something" );
70 }
71 return new ReflectorTestHelper();
72 }
73
74 protected static ReflectorTestHelper getInstance( Integer throwCount )
75 {
76 if ( throwCount != null && throwCount.intValue() > 0 )
77 {
78 throw new HelperException( "Something" );
79 }
80 return new ReflectorTestHelper();
81 }
82
83 public static ReflectorTestHelper getInstance( String throwMessage )
84 {
85 if ( throwMessage != null && throwMessage.length() > 0 )
86 {
87 throw new HelperException( throwMessage );
88 }
89 return new ReflectorTestHelper();
90 }
91
92 public ReflectorTestHelper getInstance( String aString, Boolean aBoolean )
93 {
94 return new ReflectorTestHelper();
95 }
96
97 public static class HelperException
98 extends RuntimeException
99 {
100 public HelperException()
101 {
102 super();
103 }
104
105 public HelperException( String message )
106 {
107 super( message );
108 }
109
110 public HelperException( String message, Throwable cause )
111 {
112 super( message, cause );
113 }
114
115 public HelperException( Throwable cause )
116 {
117 super( cause );
118 }
119 }
120 }