1 package org.apache.commons.beanutils2.testbeans;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 public class ThrowingExceptionBean
24 {
25
26 public ThrowingExceptionBean()
27 {
28
29 }
30
31
32
33
34
35
36 public ThrowingExceptionBean( RuntimeException e )
37 {
38 throw e;
39 }
40
41 @SuppressWarnings( "unused" )
42 private ThrowingExceptionBean( Integer i )
43 {
44
45 }
46
47 protected ThrowingExceptionBean( Short s )
48 {
49
50 }
51
52 ThrowingExceptionBean( Byte b )
53 {
54
55 }
56
57 public String getExceptionProperty()
58 {
59 throw new RuntimeException();
60 }
61
62 public void setExceptionProperty( String string )
63 {
64 throw new RuntimeException();
65 }
66
67 @SuppressWarnings( "unused" )
68
69 private String getPrivateProperty()
70 {
71 return "";
72 }
73
74 @SuppressWarnings( "unused" )
75
76 private void setPrivateProperty()
77 {
78
79 }
80
81 protected String getProtectedProperty()
82 {
83 return "";
84 }
85
86 protected void setProtectedProperty()
87 {
88
89 }
90
91 String getDefaultProperty()
92 {
93 return "";
94 }
95
96 void setDefaultProperty()
97 {
98
99 }
100
101 public int getExceptionIndexed( int index )
102 {
103 throw new RuntimeException( "Get indexed always throws an exception!" );
104 }
105
106 public void setExceptionIndexed( int index, RuntimeException e )
107 {
108 throw e;
109 }
110
111 @SuppressWarnings( "unused" )
112 private int getPrivateIndexed( int index )
113 {
114 return 1;
115 }
116
117 @SuppressWarnings( "unused" )
118 private void setPrivateIndexed( int index, int value )
119 {
120
121 }
122
123 protected int getProtectedIndexed( int index )
124 {
125 return 1;
126 }
127
128 protected void setProtectedIndexed( int index, int value )
129 {
130
131 }
132
133 int getDefaultIndexed( int index )
134 {
135 return 1;
136 }
137
138 void setDefaultIndexed( int index, int value )
139 {
140
141 }
142
143 public RuntimeException getExceptionMapped( String key)
144 {
145 throw new RuntimeException( "Get indexed always throws an exception!" );
146 }
147
148 public void setExceptionMapped( String key, RuntimeException e )
149 {
150 throw e;
151 }
152
153 @SuppressWarnings( "unused" )
154 private String getPrivateMapped( String key )
155 {
156 return "A Value";
157 }
158
159 @SuppressWarnings( "unused" )
160 private void setPrivateMapped( String key, Object value )
161 {
162
163 }
164
165 protected String getProtectedMapped( String key )
166 {
167 return "A Value";
168 }
169
170 protected void setProtectedMapped( String key, String value)
171 {
172
173 }
174
175 String getDefaultMapped( String key )
176 {
177 return "A Value";
178 }
179
180 void setDefaultMapped( String key, String value )
181 {
182
183 }
184
185 public static void staticException( String message )
186 {
187 throw new RuntimeException( message );
188 }
189
190 }