Package it.unimi.dsi.mg4j.index.payload

Source Code of it.unimi.dsi.mg4j.index.payload.DatePayloadTest

package it.unimi.dsi.mg4j.index.payload;

import it.unimi.dsi.mg4j.index.payload.DatePayload;

import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;

public class DatePayloadTest extends PayloadTestCase {
 
  public void testReadWrite() throws IOException, ParseException {
    DatePayload datePayload = new DatePayload();
    Date date = DateFormat.getDateInstance( DateFormat.SHORT ).parse( "1/1/2001" );
    datePayload.set( date );
    testWriteAndRead( datePayload );
    assertEquals( date, datePayload.get() );

    date = DateFormat.getDateInstance( DateFormat.SHORT ).parse( "1/1/1901" );
    datePayload.set( date );
    testWriteAndRead( datePayload );
    assertEquals( date, datePayload.get() );
  }

}
TOP

Related Classes of it.unimi.dsi.mg4j.index.payload.DatePayloadTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.