Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit a219104

Browse files
committed
123: Typos in the 1.0 final spec pdf
Task-Url: https://github.com/JavaMoney/jsr354-api/issues/issues/123
1 parent 886c78f commit a219104

File tree

4 files changed

+111
-2
lines changed

4 files changed

+111
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<moduleDir>.</moduleDir>
4545
<basedir>.</basedir>
4646
<!-- dependency versions -->
47-
<testng.version>6.9.12</testng.version>
47+
<testng.version>6.13.1</testng.version>
4848
<revapi.version>0.5.2</revapi.version>
4949
<!-- OSGO support -->
5050
<osgi.version>5.0.0</osgi.version>

src/etc/jsr354-ri-bp test.launch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
3+
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
4+
<stringAttribute key="M2_GOALS" value="test"/>
5+
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
6+
<booleanAttribute key="M2_OFFLINE" value="false"/>
7+
<stringAttribute key="M2_PROFILES" value=""/>
8+
<listAttribute key="M2_PROPERTIES"/>
9+
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
10+
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
11+
<intAttribute key="M2_THREADS" value="1"/>
12+
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
13+
<stringAttribute key="M2_USER_SETTINGS" value=""/>
14+
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
15+
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
16+
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
17+
</listAttribute>
18+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
19+
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
20+
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="C:/Users/Werner/git/jsr354-ri-bp"/>
21+
</launchConfiguration>

src/test/java/org/javamoney/moneta/format/MonetaryAmountDecimalFormatTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2014, Credit Suisse (Anatole Tresch), Werner Keil and others by the @author tag.
2+
* Copyright (c) 2012, 2019, Anatole Tresch, Werner Keil and others by the @author tag.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (c) 2012, 2019, 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+
package org.javamoney.moneta.format;
17+
18+
import static org.testng.Assert.assertEquals;
19+
20+
import java.math.BigDecimal;
21+
import java.util.Locale;
22+
23+
import javax.money.MonetaryAmount;
24+
import javax.money.format.AmountFormatQueryBuilder;
25+
import javax.money.format.MonetaryAmountFormat;
26+
import javax.money.format.MonetaryFormats;
27+
28+
import org.javamoney.moneta.Money;
29+
import org.testng.annotations.Ignore;
30+
import org.testng.annotations.Test;
31+
32+
public class MonetaryFormatsParseTest {
33+
public static final Locale INDIA = new Locale("en, IN");
34+
35+
/**
36+
* Test related to parsing currency symbols.
37+
*/
38+
@Test
39+
@Ignore("see https://github.com/JavaMoney/jsr354-ri/issues/274")
40+
public void testParseCurrencySymbol1() {
41+
MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(
42+
AmountFormatQueryBuilder.of(Locale.GERMANY)
43+
.set(CurrencyStyle.SYMBOL)
44+
.build());
45+
Money money = Money.of(new BigDecimal("1234567.89"), "EUR");
46+
String expectedFormattedString = "1.234.567,89 €";
47+
assertEquals(expectedFormattedString, format.format(money));
48+
assertEquals(money, Money.parse(expectedFormattedString, format));
49+
50+
money = Money.of(new BigDecimal("1234567.89"), "INR");
51+
expectedFormattedString = "1.234.567,89 ₹";
52+
assertEquals(expectedFormattedString, format.format(money));
53+
assertEquals(money, Money.parse(expectedFormattedString, format));
54+
}
55+
56+
/**
57+
* Test related to parsing currency symbols.
58+
*/
59+
@Test
60+
@Ignore("see https://github.com/JavaMoney/jsr354-ri/issues/274")
61+
public void testParseCurrencySymbol2() {
62+
MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(
63+
AmountFormatQueryBuilder.of(INDIA)
64+
.set(CurrencyStyle.SYMBOL)
65+
.build());
66+
Money money = Money.of(new BigDecimal("1234567.89"), "EUR");
67+
String expectedFormattedString = "€ 1,234,567.89";
68+
assertEquals(expectedFormattedString, format.format(money));
69+
assertEquals(money, Money.parse(expectedFormattedString, format));
70+
71+
money = Money.of(new BigDecimal("1234567.89"), "INR");
72+
expectedFormattedString = "₹ 1,234,567.89";
73+
assertEquals(expectedFormattedString, format.format(money));
74+
assertEquals(money, Money.parse(expectedFormattedString, format));
75+
}
76+
77+
78+
private void assertMoneyParse(MonetaryAmountFormat format, String text, double expected, String currencyCode) {
79+
MonetaryAmount amountInt = format.parse(text);
80+
assertEquals(amountInt.getNumber().doubleValueExact(), expected);
81+
assertEquals(amountInt.getCurrency().getCurrencyCode(), currencyCode);
82+
}
83+
84+
private void assertMoneyFormat(MonetaryAmountFormat format, MonetaryAmount amount, String expected) {
85+
String formatted = format.format(amount);
86+
assertEquals(formatted, expected);
87+
}
88+
}

0 commit comments

Comments
 (0)