package de.interseroh.report.formatters;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

import java.sql.Date;
import java.util.Locale;

import org.junit.Test;

/**
 * @author Ingo Düppe (Crowdcode)
 */
public class DateFormatterTest {

	private static final Date testDate = new Date(1449961200000L);

    private static final DateFormatter formatter = new DateFormatter();

	@Test
	public void testParse() throws Exception {
		Date date = formatter.parse("12/13/15", Locale.US);
		assertThat(date, is(testDate));
	}

	@Test
	public void testPrint() throws Exception {
        String print = formatter.print(testDate, Locale.US);
		assertThat(print, is("12/13/15"));
    }

    @Test
    public void testParseGermanDate() throws Exception {
        Date date = formatter.parse("13.12.2015", Locale.GERMAN);
        assertThat(date, is(testDate));
    }

    @Test
    public void testPrintGermanDate() throws Exception {
        String print = formatter.print(testDate, Locale.GERMAN);
        assertThat(print, is("13.12.15"));

    }
}
@@ -34,32 +34,104 @@
 atters;%0A%0Aimport 
+java.sql.Date;%0Aimport java.util.Locale;%0A%0Aimport org.junit.Test;%0A%0Aimport 
 static org.hamcr
@@ -190,80 +190,8 @@
 tTha
-t;%0A%0Aimport java.sql.Date;%0Aimport java.util.Locale;%0A%0Aimport org.junit.Tes
 t;%0A%0A
@@ -317,22 +317,20 @@
 ate(
-1449961200000L
+2015, 12, 13
 );%0A%0A

fix test