Package com.microsoft.windowsazure.core

Examples of com.microsoft.windowsazure.core.ISO8601DateConverter


*/
public class ContainerACLDateAdapter extends XmlAdapter<String, Date> {

    @Override
    public Date unmarshal(String arg0) throws Exception {
        return new ISO8601DateConverter().parse(arg0);
    }
View Full Code Here


        return new ISO8601DateConverter().parse(arg0);
    }

    @Override
    public String marshal(Date arg0) throws Exception {
        return new ISO8601DateConverter().shortFormat(arg0);
    }
View Full Code Here

public class ISO8601DateConverterTests {
    @Test
    public void shortFormatWorks() throws Exception {
        // Arrange
        ISO8601DateConverter converter = new ISO8601DateConverter();
        String value = "2012-01-12T00:35:58Z";

        // Act
        Date result = converter.parse(value);
        String value2 = converter.format(result);

        // Assert
        assertNotNull(result);

        Calendar calendar = Calendar.getInstance();
View Full Code Here

    }

    @Test
    public void longFormatWorks() throws Exception {
        // Arrange
        ISO8601DateConverter converter = new ISO8601DateConverter();
        String value = "2012-01-12T00:35:58.1234567Z";

        // Act
        Date result = converter.parse(value);
        String value2 = converter.format(result);

        // Assert
        assertNotNull(result);

        Calendar calendar = Calendar.getInstance();
View Full Code Here

    }

    @Test
    public void mixedFormatWorks() throws Exception {
        // Arrange
        ISO8601DateConverter converter = new ISO8601DateConverter();
        String value = "2012-01-12T00:35:58.12Z";

        // Act
        Date result = converter.parse(value);
        String value2 = converter.format(result);

        // Assert
        assertNotNull(result);

        Calendar calendar = Calendar.getInstance();
View Full Code Here

    }

    @Test
    public void shortFormatRoundTrips() throws Exception {
        // Arrange
        ISO8601DateConverter converter = new ISO8601DateConverter();
        String value = "2012-01-12T00:35:58Z";

        // Act
        Date result = converter.parse(value);
        String value2 = converter.shortFormat(result);
        String value3 = converter.format(result);

        // Assert
        assertNotNull(result);
        assertEquals(value, value2);
        assertEquals("2012-01-12T00:35:58.000Z", value3);
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.core.ISO8601DateConverter

Copyright © 2018 www.massapicom. 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.