1+ /**
2+ * Copyright (c) 2012, 2014, Credit Suisse (Anatole Tresch), Werner Keil and others by the @author tag.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+ * use this file except in compliance with the License. You may obtain a copy of
6+ * 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, WITHOUT
12+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+ * License for the specific language governing permissions and limitations under
14+ * the License.
15+ */
16+
117import org .javamoney .moneta .FastMoney ;
218import org .javamoney .moneta .function .MonetaryFunctions ;
319import org .javamoney .tck .JSR354TestConfiguration ;
1329import java .util .List ;
1430
1531/**
16- * Created by Anatole on 14.06.2014.
32+ * JSR354TestConfiguration setup class. This is an example TCK setup class, that has to be written by
33+ * implementors to setup the JSR 354 TCK for running with their implementations.
34+ * <p>
35+ * Created by Anatole Tresch on 14.06.2014.
1736 */
18- public final class MonetaTCKSetup implements JSR354TestConfiguration {
37+ public final class MonetaTCKSetup implements JSR354TestConfiguration {
1938
39+ /**
40+ * Provide the MonetaryAmount implementation classes to be tested for immutability and other
41+ * implementation requirements.
42+ *
43+ * @return the monetary amount classes to be tested, not null and not empty.
44+ */
2045 @ Override
2146 public Collection <Class > getAmountClasses () {
2247 return Arrays
2348 .asList (new Class []{FastMoney .class , FastMoney .class });
2449 }
2550
51+ /**
52+ * Provide the CurrencyUnit implementation classes to be tested for immutability and other
53+ * implementation requirements.
54+ *
55+ * @return the currency unit classes to be tested, not null and not empty.
56+ */
2657 @ Override
2758 public Collection <Class > getCurrencyClasses () {
28- try {
59+ try {
2960 return Arrays
30- .asList (new Class [] { Class .forName ("org.javamoney.moneta.internal.JDKCurrencyAdapter" )});
31- }
32- catch (ClassNotFoundException e ){
61+ .asList (new Class []{Class .forName ("org.javamoney.moneta.internal.JDKCurrencyAdapter" )});
62+ } catch (ClassNotFoundException e ) {
3363 e .printStackTrace ();
3464 throw new RuntimeException ("Currency class not lodable: org.javamoney.moneta.internal.JDKCurrencyAdapter" );
3565 }
3666 }
3767
68+ /**
69+ * Provide the MonetaryOperator implementation classes to be tested for immutability and other
70+ * implementation requirements.
71+ *
72+ * @return the monetary operator classes to be tested, not null and not empty.
73+ */
3874 @ Override
39- public Collection <MonetaryOperator > getMonetaryOperators4Test (){
75+ public Collection <MonetaryOperator > getMonetaryOperators4Test () {
4076 List <MonetaryOperator > ops = new ArrayList <>();
4177 ops .add (MonetaryFunctions .majorPart ());
4278 ops .add (MonetaryFunctions .minorPart ());
@@ -46,7 +82,7 @@ public Collection<MonetaryOperator> getMonetaryOperators4Test(){
4682 ops .add (MonetaryFunctions .permil (BigDecimal .ONE ));
4783 ops .add (MonetaryFunctions .permil (10.5 , MathContext .DECIMAL32 ));
4884 ops .add (MonetaryFunctions .reciprocal ());
49- ops .add (MonetaryRoundings .getRounding ());
85+ ops .add (MonetaryRoundings .getDefaultRounding ());
5086 ops .add (MonetaryConversions .getConversion ("EUR" ));
5187 return ops ;
5288 }
0 commit comments