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