[
https://issues.apache.org/jira/browse/DIRSHARED-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alex Karasulu deleted DIRSHARED-131:
------------------------------------
> GeneralizedTime parser does not preserve milliseconds
> -----------------------------------------------------
>
> Key: DIRSHARED-131
> URL: https://issues.apache.org/jira/browse/DIRSHARED-131
> Project: Directory Shared
> Issue Type: Bug
> Reporter: Alex Karasulu
> Assignee: Alex Karasulu
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> 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