source: tapas/service/test/com/ether/OtherTest.java @ 389

Last change on this file since 389 was 389, checked in by rboipsl, 12 years ago
File size: 1.1 KB
Line 
1package com.ether;
2
3import org.junit.Assert;
4import org.junit.Test;
5
6import java.text.DateFormat;
7import java.text.SimpleDateFormat;
8import java.util.ArrayList;
9import java.util.Calendar;
10import java.util.Date;
11import java.util.HashSet;
12import java.util.List;
13import java.util.Set;
14
15/**
16 * @author vmipsl
17 * @date 2011
18 */
19public class OtherTest
20{
21    @Test
22    public void testCreateXML()
23            throws Exception
24    {
25
26        final DateFormat shortDateFormat = new SimpleDateFormat( "MMyyyy" );
27        final DateFormat completDateFormat = new SimpleDateFormat( "dd-MM-yyyy" );
28        final Date firstMois = shortDateFormat.parse( "102008" );
29        final String firstMoisString = completDateFormat.format( firstMois );
30        Assert.assertEquals( firstMoisString, "01-10-2008" );
31
32        final Calendar calendar = Calendar.getInstance();
33        calendar.setTime( firstMois );
34        calendar.add( Calendar.MONTH, 1 );
35        final Date secondMois = calendar.getTime();
36        final String secondMoisString = completDateFormat.format( secondMois );
37        Assert.assertEquals( secondMoisString, "01-11-2008" );
38    }
39
40
41
42}
Note: See TracBrowser for help on using the repository browser.