| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
package org.apache.commons.beanutils.locale.converters; |
| 19 |
|
|
| 20 |
|
|
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
@author |
| 25 |
|
@version |
| 26 |
|
|
| 27 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (70) |
Complexity: 12 |
Complexity Density: 0.21 |
|
| 28 |
|
public class LongLocaleConverterTestCase extends BaseLocaleConverterTestCase { |
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 34 |
10
|
public LongLocaleConverterTestCase(String name) {... |
| 35 |
10
|
super(name); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 43 |
10
|
public void setUp() throws Exception {... |
| 44 |
|
|
| 45 |
10
|
super.setUp(); |
| 46 |
|
|
| 47 |
10
|
defaultValue = new Long("999"); |
| 48 |
10
|
expectedValue = new Long(expectedIntegerValue); |
| 49 |
|
|
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 55 |
10
|
public void tearDown() {... |
| 56 |
10
|
super.tearDown(); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
|
| 62 |
|
|
| 63 |
|
|
| 64 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
1
PASS
|
|
| 65 |
1
|
public void testConstructorMain() {... |
| 66 |
|
|
| 67 |
|
|
| 68 |
1
|
converter = new LongLocaleConverter(defaultValue, |
| 69 |
|
localizedLocale, |
| 70 |
|
localizedIntegerPattern, |
| 71 |
|
true); |
| 72 |
|
|
| 73 |
|
|
| 74 |
1
|
convertValueNoPattern(converter, "(A)", localizedIntegerValue, expectedValue); |
| 75 |
1
|
convertValueWithPattern(converter, "(A)", localizedIntegerValue, localizedIntegerPattern, expectedValue); |
| 76 |
1
|
convertInvalid(converter, "(A)", defaultValue); |
| 77 |
1
|
convertNull(converter, "(A)", defaultValue); |
| 78 |
|
|
| 79 |
|
|
| 80 |
|
|
| 81 |
|
|
| 82 |
|
|
| 83 |
|
|
| 84 |
|
|
| 85 |
|
|
| 86 |
1
|
convertValueNoPattern(converter, "(B)", defaultIntegerValue, new Long("1")); |
| 87 |
|
|
| 88 |
|
|
| 89 |
|
|
| 90 |
|
|
| 91 |
|
|
| 92 |
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
1
|
convertValueWithPattern(converter, "(B)", localizedIntegerValue, defaultIntegerPattern, new Long("1")); |
| 96 |
|
|
| 97 |
|
|
| 98 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
| 103 |
|
|
| 104 |
|
|
| 105 |
1
|
convertValueToType(converter, "(B)", Double.class, localizedIntegerValue, localizedIntegerPattern, expectedValue); |
| 106 |
|
|
| 107 |
|
|
| 108 |
|
|
| 109 |
1
|
converter = new LongLocaleConverter(defaultValue, |
| 110 |
|
localizedLocale, |
| 111 |
|
defaultIntegerPattern, |
| 112 |
|
false); |
| 113 |
|
|
| 114 |
|
|
| 115 |
1
|
convertValueNoPattern(converter, "(C)", localizedIntegerValue, expectedValue); |
| 116 |
1
|
convertValueWithPattern(converter, "(C)", localizedIntegerValue, defaultIntegerPattern, expectedValue); |
| 117 |
1
|
convertInvalid(converter, "(C)", defaultValue); |
| 118 |
1
|
convertNull(converter, "(C)", defaultValue); |
| 119 |
|
|
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
|
| 123 |
|
|
| 124 |
|
|
| 125 |
|
|
| 126 |
|
|
| 127 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1
PASS
|
|
| 128 |
1
|
public void testConstructor_2() {... |
| 129 |
|
|
| 130 |
|
|
| 131 |
1
|
converter = new LongLocaleConverter(); |
| 132 |
|
|
| 133 |
|
|
| 134 |
1
|
convertValueNoPattern(converter, defaultIntegerValue, expectedValue); |
| 135 |
1
|
convertValueWithPattern(converter, defaultIntegerValue, defaultIntegerPattern, expectedValue); |
| 136 |
1
|
convertInvalid(converter, null); |
| 137 |
1
|
convertNull(converter, null); |
| 138 |
|
|
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
|
| 145 |
|
|
| 146 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1
PASS
|
|
| 147 |
1
|
public void testConstructor_3() {... |
| 148 |
|
|
| 149 |
|
|
| 150 |
1
|
converter = new LongLocaleConverter(true); |
| 151 |
|
|
| 152 |
|
|
| 153 |
1
|
convertValueNoPattern(converter, defaultIntegerValue, expectedValue); |
| 154 |
1
|
convertValueWithPattern(converter, defaultIntegerValue, defaultIntegerPattern, expectedValue); |
| 155 |
1
|
convertInvalid(converter, null); |
| 156 |
1
|
convertNull(converter, null); |
| 157 |
|
|
| 158 |
|
|
| 159 |
|
} |
| 160 |
|
|
| 161 |
|
|
| 162 |
|
|
| 163 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1
PASS
|
|
| 164 |
1
|
public void testConstructor_4() {... |
| 165 |
|
|
| 166 |
|
|
| 167 |
1
|
converter = new LongLocaleConverter(localizedLocale); |
| 168 |
|
|
| 169 |
|
|
| 170 |
1
|
convertValueNoPattern(converter, localizedIntegerValue, expectedValue); |
| 171 |
1
|
convertValueWithPattern(converter, localizedIntegerValue, defaultIntegerPattern, expectedValue); |
| 172 |
1
|
convertInvalid(converter, null); |
| 173 |
1
|
convertNull(converter, null); |
| 174 |
|
|
| 175 |
|
|
| 176 |
|
} |
| 177 |
|
|
| 178 |
|
|
| 179 |
|
|
| 180 |
|
|
| 181 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1
PASS
|
|
| 182 |
1
|
public void testConstructor_5() {... |
| 183 |
|
|
| 184 |
|
|
| 185 |
1
|
converter = new LongLocaleConverter(localizedLocale, true); |
| 186 |
|
|
| 187 |
|
|
| 188 |
1
|
convertValueNoPattern(converter, localizedIntegerValue, expectedValue); |
| 189 |
1
|
convertValueWithPattern(converter, localizedIntegerValue, localizedIntegerPattern, expectedValue); |
| 190 |
1
|
convertInvalid(converter, null); |
| 191 |
1
|
convertNull(converter, null); |
| 192 |
|
|
| 193 |
|
|
| 194 |
|
} |
| 195 |
|
|
| 196 |
|
|
| 197 |
|
|
| 198 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1
PASS
|
|
| 199 |
1
|
public void testConstructor_6() {... |
| 200 |
|
|
| 201 |
|
|
| 202 |
1
|
converter = new LongLocaleConverter(localizedLocale, defaultIntegerPattern); |
| 203 |
|
|
| 204 |
|
|
| 205 |
1
|
convertValueNoPattern(converter, localizedIntegerValue, expectedValue); |
| 206 |
1
|
convertValueWithPattern(converter, localizedIntegerValue, defaultIntegerPattern, expectedValue); |
| 207 |
1
|
convertInvalid(converter, null); |
| 208 |
1
|
convertNull(converter, null); |
| 209 |
|
|
| 210 |
|
} |
| 211 |
|
|
| 212 |
|
|
| 213 |
|
|
| 214 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1
PASS
|
|
| 215 |
1
|
public void testConstructor_7() {... |
| 216 |
|
|
| 217 |
|
|
| 218 |
1
|
converter = new LongLocaleConverter(localizedLocale, localizedIntegerPattern, true); |
| 219 |
|
|
| 220 |
|
|
| 221 |
1
|
convertValueNoPattern(converter, localizedIntegerValue, expectedValue); |
| 222 |
1
|
convertValueWithPattern(converter, localizedIntegerValue, localizedIntegerPattern, expectedValue); |
| 223 |
1
|
convertInvalid(converter, null); |
| 224 |
1
|
convertNull(converter, null); |
| 225 |
|
|
| 226 |
|
} |
| 227 |
|
|
| 228 |
|
|
| 229 |
|
|
| 230 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1
PASS
|
|
| 231 |
1
|
public void testConstructor_8() {... |
| 232 |
|
|
| 233 |
|
|
| 234 |
1
|
converter = new LongLocaleConverter(defaultValue); |
| 235 |
|
|
| 236 |
|
|
| 237 |
1
|
convertValueNoPattern(converter, defaultIntegerValue, expectedValue); |
| 238 |
1
|
convertValueWithPattern(converter, defaultIntegerValue, defaultIntegerPattern, expectedValue); |
| 239 |
1
|
convertInvalid(converter, defaultValue); |
| 240 |
1
|
convertNull(converter, defaultValue); |
| 241 |
|
|
| 242 |
|
} |
| 243 |
|
|
| 244 |
|
|
| 245 |
|
|
| 246 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1
PASS
|
|
| 247 |
1
|
public void testConstructor_9() {... |
| 248 |
|
|
| 249 |
|
|
| 250 |
1
|
converter = new LongLocaleConverter(defaultValue, true); |
| 251 |
|
|
| 252 |
|
|
| 253 |
1
|
convertValueNoPattern(converter, defaultIntegerValue, expectedValue); |
| 254 |
1
|
convertValueWithPattern(converter, defaultIntegerValue, defaultIntegerPattern, expectedValue); |
| 255 |
1
|
convertInvalid(converter, defaultValue); |
| 256 |
1
|
convertNull(converter, defaultValue); |
| 257 |
|
|
| 258 |
|
} |
| 259 |
|
|
| 260 |
|
|
| 261 |
|
|
| 262 |
|
} |
| 263 |
|
|