| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | * Portions Copyright 2015-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.schema; |
| | | |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.ServerConstants.TIME_ZONE_UTC; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.GregorianCalendar; |
| | | import java.util.TimeZone; |
| | | |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.DirectoryServerTestCase; |
| | | import org.opends.server.util.RemoveOnceSDKSchemaIsUsed; |
| | | import org.testng.Assert; |
| | | import org.testng.annotations.DataProvider; |
| | |
| | | * Test the GeneralizedTimeSyntax. |
| | | */ |
| | | @RemoveOnceSDKSchemaIsUsed |
| | | public class GeneralizedTimeSyntaxTest extends AttributeSyntaxTest |
| | | public class GeneralizedTimeSyntaxTest extends DirectoryServerTestCase |
| | | { |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected AttributeSyntax getRule() |
| | | { |
| | | return new GeneralizedTimeSyntax(); |
| | | } |
| | | |
| | | @Override |
| | | @DataProvider(name="acceptableValues") |
| | | public Object[][] createAcceptableValues() |
| | | { |
| | | return new Object [][] { |
| | | {"2006090613Z", true}, |
| | | {"20060906135030+01", true}, |
| | | {"200609061350Z", true}, |
| | | {"20060906135030Z", true}, |
| | | {"20061116135030Z", true}, |
| | | {"20061126135030Z", true}, |
| | | {"20061231235959Z", true}, |
| | | {"20060906135030+0101", true}, |
| | | {"20060906135030+2359", true}, |
| | | {"20060906135030+3359", false}, |
| | | {"20060906135030+2389", false}, |
| | | {"20060906135030+2361", false}, |
| | | {"20060906135030+", false}, |
| | | {"20060906135030+0", false}, |
| | | {"20060906135030+010", false}, |
| | | {"20061200235959Z", false}, |
| | | {"2006121a235959Z", false}, |
| | | {"2006122a235959Z", false}, |
| | | {"20060031235959Z", false}, |
| | | {"20061331235959Z", false}, |
| | | {"20062231235959Z", false}, |
| | | {"20061232235959Z", false}, |
| | | {"2006123123595aZ", false}, |
| | | {"200a1231235959Z", false}, |
| | | {"2006j231235959Z", false}, |
| | | {"200612-1235959Z", false}, |
| | | {"20061231#35959Z", false}, |
| | | {"2006", false}, |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Create data for format(...) tests. |
| | | * |