Package org.apache.directory.shared.util

Examples of org.apache.directory.shared.util.GeneralizedTime


     * when TimeZone has hours < 10 and minutes > 10).
     */
    public void testDIRSHARED29() throws ParseException
    {
        String gt = "20090312123456+0130";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }
View Full Code Here


    {
        try
        {
            String prepared = PrepareString.normalize( value, PrepareString.StringType.DIRECTORY_STRING );

            GeneralizedTime time = new GeneralizedTime( prepared );
            String normalized = time.toGeneralizedTime( Format.YEAR_MONTH_DAY_HOUR_MIN_SEC_FRACTION,
                FractionDelimiter.DOT, 3, TimeZoneFormat.Z );

            return normalized;
        }
        catch ( IOException ioe )
View Full Code Here

            return ( backendValue == null ? -1 : 1 );
        }

        // Both objects must be stored as String for generalized tim.
        // But we need to normalize the values first.
        GeneralizedTime backendTime;
        try
        {
            String prepared = PrepareString.normalize( backendValue, PrepareString.StringType.DIRECTORY_STRING );
            backendTime = new GeneralizedTime( prepared );
        }
        catch ( IOException ioe )
        {
            throw new IllegalArgumentException( I18n.err( I18n.ERR_04224, backendValue ) );
        }
        catch ( ParseException pe )
        {
            throw new IllegalArgumentException( I18n.err( I18n.ERR_04224, backendValue ) );
        }

        GeneralizedTime assertTime;
        try
        {
            String prepared = PrepareString.normalize( assertValue, PrepareString.StringType.DIRECTORY_STRING );
            assertTime = new GeneralizedTime( prepared );
        }
        catch ( IOException ioe )
        {
            throw new IllegalArgumentException( I18n.err( I18n.ERR_04224, assertValue ) );
        }
View Full Code Here

     */
    @Test
    public void testYearMonthDayHourMinDotFractionMinusHourMin() throws ParseException
    {
        String gt = "200801021213.987-1030";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }
View Full Code Here

     */
    @Test
    public void testYearMonthDayHourMinCommaFractionZulu() throws ParseException
    {
        String gt = "200801021213,987Z";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }
View Full Code Here

     */
    @Test
    public void testYearMonthDayHourMinCommaFractionPlusHour() throws ParseException
    {
        String gt = "200801021213,987+0100";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }
View Full Code Here

     */
    @Test
    public void testYearMonthDayHourMinCommaFractionMinusHourMin() throws ParseException
    {
        String gt = "200801021213,987-1030";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }
View Full Code Here

     */
    @Test
    public void testYearMonthDayHourZulu() throws ParseException
    {
        String gt = "2008010212Z";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }
View Full Code Here

     */
    @Test
    public void testYearMonthDayHourPlusHour() throws ParseException
    {
        String gt = "2008010212+04";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }
View Full Code Here

     */
    @Test
    public void testYearMonthDayHourMinusHourMin() throws ParseException
    {
        String gt = "2008010212-1030";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.util.GeneralizedTime

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.