public void TestDecimalStringAttributeLocaleEffect_Double_DefaultLocale() throws Exception { double value1 = 39.76d; double value2 = -56356.457457d; double value3 = 0d; double value4 = 7.45345345e-21d; { Attribute a = new DecimalStringAttribute(TagFromName.ContourData); a.addValue(value1); a.addValue(value2); a.addValue(value3); a.addValue(value4); double[] returnedValues = a.getDoubleValues(); assertEquals("Default", value1, returnedValues[0]); assertEquals("Default", value2, returnedValues[1]); assertEquals("Default", value3, returnedValues[2]); assertEquals("Default", value4, returnedValues[3]); } }
public void TestDecimalStringAttributeLocaleEffect_Double_AllAvailableLocales() throws Exception { double value1 = 39.76d; double value2 = -56356.457457d; double value3 = 0d; double value4 = 7.45345345e-21d; Locale[] localesToTest = Locale.getAvailableLocales(); for (Locale l : localesToTest) { // System.err.println("Testing effect on DS getDoubleValues() of default locale "+l); Locale.setDefault(l); Attribute a = new DecimalStringAttribute(TagFromName.ContourData); a.addValue(value1); a.addValue(value2); a.addValue(value3); a.addValue(value4); double[] returnedValues = a.getDoubleValues(); assertEquals(l.toString(), value1, returnedValues[0]); assertEquals(l.toString(), value2, returnedValues[1]); assertEquals(l.toString(), value3, returnedValues[2]); assertEquals(l.toString(), value4, returnedValues[3]); } }