| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | |
| | | private final static String TIME_ATTR = "test-time-attribute"; |
| | | |
| | | |
| | | GregorianCalendar cal = null; |
| | | |
| | | /** |
| | | * Ensures that the Directory Server is running before executing the |
| | | * testcases. |
| | |
| | | "objectclasses: ( oc-oid NAME 'testOC' SUP top AUXILIARY MUST test-time-attribute)" |
| | | ); |
| | | assertTrue(resultCode == 0); |
| | | //Get the current time. |
| | | cal = new GregorianCalendar(TimeZone.getTimeZone("UTC")); |
| | | cal.setLenient(false); |
| | | } |
| | | |
| | | |
| | |
| | | populateEntries(); |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | //Get the current time. |
| | | GregorianCalendar cal = |
| | | new GregorianCalendar(TimeZone.getTimeZone("UTC")); |
| | | cal.setLenient(false); |
| | | int month = cal.get(Calendar.MONTH)+1; //month starts from 0 in the Calendar. |
| | | String assertion = cal.get(Calendar.DATE)+"D"+month+"M"; |
| | | |
| | |
| | | {"12w-2d",false}, |
| | | {"1s2s",false}, |
| | | {"1d4s5d",false} |
| | | |
| | | |
| | | }; |
| | | } |
| | | |
| | |
| | | @DataProvider(name="partialDateTimeSyntaxes") |
| | | private Object[][] createPartialDateTimeSyntaxes() |
| | | { |
| | | //Get the current time. |
| | | GregorianCalendar cal = |
| | | new GregorianCalendar(TimeZone.getTimeZone("UTC")); |
| | | cal.setLenient(false); |
| | | |
| | | //Get the date today. |
| | | int second = cal.get(Calendar.SECOND); |
| | | int minute = cal.get(Calendar.MINUTE); |
| | |
| | | int date = cal.get(Calendar.DATE); |
| | | int month = cal.get(Calendar.MONTH) + 1; |
| | | int year = cal.get(Calendar.YEAR); |
| | | |
| | | |
| | | return new Object[][] { |
| | | {"20MM30DD1978YY",false}, |
| | | {"02MM29DD2009YY",false}, |
| | |
| | | {year+"Y",true}, |
| | | {month+"M"+date+"D",true}, |
| | | {year+"Y"+date+"D",true}, |
| | | {month+"M"+year+"Y"+date+"D",true} |
| | | {month+"M"+year+"Y"+date+"D",true} |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //validate if the args are found in the entries list. |
| | | private boolean dnFoundInEntryList( List<SearchResultEntry> entries,DN ... dns) |
| | | { |