@@ -0,0 +1,1329 @@
+/*%0D%0A * To change this template, choose Tools %7C Templates%0D%0A * and open the template in the editor.%0D%0A */%0D%0Apackage org.epics.util.text;%0D%0A%0D%0Aimport java.text.NumberFormat;%0D%0Aimport org.junit.Test;%0D%0Aimport static org.junit.Assert.*;%0D%0Aimport static org.hamcrest.Matchers.*;%0D%0A%0D%0A/**%0D%0A *%0D%0A * @author carcassi%0D%0A */%0D%0Apublic class NumberFormatsTest %7B%0D%0A    %0D%0A    public NumberFormatsTest() %7B%0D%0A    %7D%0D%0A%0D%0A    @Test%0D%0A    public void format() %7B%0D%0A        NumberFormat format = NumberFormats.format(2);%0D%0A        assertThat(format.format(2.0), equalTo(%222.00%22));%0D%0A        assertThat(format.format(Double.NaN), equalTo(%22NaN%22));%0D%0A        assertThat(format.format(Double.POSITIVE_INFINITY), equalTo(%22Infinity%22));%0D%0A        assertThat(format.format(Double.NEGATIVE_INFINITY), equalTo(%22-Infinity%22));%0D%0A        assertThat(NumberFormats.format(2), sameInstance(format));%0D%0A    %7D%0D%0A%0D%0A    @Test%0D%0A    public void toStringFormat() %7B%0D%0A        NumberFormat format = NumberFormats.toStringFormat();%0D%0A        assertThat(format.format(2.0), equalTo(%222.0%22));%0D%0A        assertThat(format.format(Double.NaN), equalTo(%22NaN%22));%0D%0A        assertThat(format.format(Double.POSITIVE_INFINITY), equalTo(%22Infinity%22));%0D%0A        assertThat(format.format(Double.NEGATIVE_INFINITY), equalTo(%22-Infinity%22));%0D%0A        assertThat(NumberFormats.toStringFormat(), sameInstance(format));%0D%0A    %7D%0D%0A%7D

testing the number formats