directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Karasulu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DIRSHARED-130) GeneralizedTime parser does not preserve milliseconds
Date Sun, 26 Jun 2011 11:46:47 GMT
GeneralizedTime parser does not preserve milliseconds
-----------------------------------------------------

                 Key: DIRSHARED-130
                 URL: https://issues.apache.org/jira/browse/DIRSHARED-130
             Project: Directory Shared
          Issue Type: Bug
    Affects Versions: 1.0.0-M5
            Reporter: Alex Karasulu
            Assignee: Alex Karasulu


The GeneralizedTime class in the o.a.d.s.util package of shared-util module does not seem
to preserve the milliseconds field of the time. Here's a test that shows the presence of the
bug. I will add this test after creating this JIRA issue.

    @Test
    public void testLoseofMilliseconds() throws Exception
    {
        Date date = new Date();
        long originalTime = date.getTime();
        LOG.info( "original time = {}", originalTime );
        Calendar calendar = Calendar.getInstance();
        calendar.setTime( date );
        GeneralizedTime gt = new GeneralizedTime( calendar );
        String gtStr = gt.toGeneralizedTime();
        
        GeneralizedTime recalculatedGt = new GeneralizedTime( gtStr );
        long recalculatedTime = recalculatedGt.getCalendar().getTime().getTime();
        
        assertEquals( "The original time after GeneralizedTime transformation should stick",

            originalTime, recalculatedTime );
    }




--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message