1
- package org .springframework .format .number ;
1
+ /*
2
+ * Copyright 2002-2009 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
2
16
3
- import static org .junit . Assert . assertEquals ;
17
+ package org .springframework . format . number ;
4
18
5
19
import java .math .BigDecimal ;
6
20
import java .util .Locale ;
7
21
8
22
import org .junit .After ;
23
+ import static org .junit .Assert .*;
9
24
import org .junit .Before ;
10
25
import org .junit .Test ;
26
+
11
27
import org .springframework .beans .MutablePropertyValues ;
12
28
import org .springframework .context .i18n .LocaleContextHolder ;
29
+ import org .springframework .core .convert .support .ConversionServiceFactory ;
13
30
import org .springframework .format .annotation .NumberFormat ;
14
31
import org .springframework .format .annotation .NumberFormat .Style ;
15
32
import org .springframework .format .support .FormattingConversionService ;
16
33
import org .springframework .validation .DataBinder ;
17
34
35
+ /**
36
+ * @author Keith Donald
37
+ * @author Juergen Hoeller
38
+ */
18
39
public class NumberFormattingTests {
19
40
20
41
private FormattingConversionService conversionService = new FormattingConversionService ();
@@ -23,6 +44,7 @@ public class NumberFormattingTests {
23
44
24
45
@ Before
25
46
public void setUp () {
47
+ ConversionServiceFactory .addDefaultConverters (conversionService );
26
48
conversionService .addFormatterForFieldType (Number .class , new NumberFormatter ());
27
49
conversionService .addFormatterForFieldAnnotation (new NumberFormatAnnotationFormatterFactory ());
28
50
LocaleContextHolder .setLocale (Locale .US );
0 commit comments