TimeBasedMatchingRuleTest.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
2852N/A * The contents of this file are subject to the terms of the 2852N/A * Common Development and Distribution License, Version 1.0 only 2852N/A * (the "License"). You may not use this file except in compliance 2852N/A * See the License for the specific language governing permissions 2852N/A * and limitations under the License. 2852N/A * When distributing Covered Code, include this CDDL HEADER in each 2852N/A * If applicable, add the following below this CDDL HEADER, with the 2852N/A * fields enclosed by brackets "[]" replaced with your own identifying 2852N/A * Portions Copyright [yyyy] [name of copyright owner] 2852N/A * Copyright 2009-2010 Sun Microsystems, Inc. 2852N/A * Portions Copyright 2010-2015 ForgeRock AS. 4618N/A * This class tests various time-based matching rules. 4618N/A //User DNs to be used in tests. 4618N/A * Ensures that the Directory Server is running before executing the 4618N/A * @throws Exception If an unexpected problem occurs. 4618N/A Extend the schema and add an attribute which is based on 4618N/A generalizedTimeSyntax. Since all the existing attributes based 4618N/A on that syntax are read-only, let us create a new attribute and 4618N/A "attributeTypes: ( test-time-oid NAME 'test-time' DESC 'Test time attribute' EQUALITY " +
4618N/A "generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )",
4618N/A "attributeTypes: ( test-date-oid NAME 'test-date' DESC 'Test date attribute' EQUALITY " +
4618N/A "generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )",
4618N/A "objectclasses: ( testoc-oid NAME 'testOC' SUP top AUXILIARY MUST test-time)",
4618N/A "objectclasses: ( testoc2-oid NAME 'testOC2' SUP top AUXILIARY MUST test-date)" 4618N/A * Test to search using the less-than relative time matching rule for expired events. 4618N/A * Test to search using the less-than relative time matching rule for future events. 4713N/A * Test to search using the greater-than relative time matching rule for expired events. 4713N/A * Test to search using the greater-than relative time matching rule for future events. 4618N/A * Test to search using the partial date and time matching rule 4618N/A * Dates for this test are hardcoded to avoid test failures depending 4618N/A * on when the tests are launched. 4618N/A * Test to match the attribute and the assertion values using a partial date and time 4618N/A * Tests the assertion syntax of the relative time matching rules. 4618N/A // An invalid value can't get away without throwing exception. 4618N/A //invalid values will throw an exception. 4618N/A * Tests the assertion syntax of the partial date and time matching rules. 4618N/A //invalid values will throw an exception. 4618N/A * Generates data for testing relative time matching rule assertion syntax. 4618N/A * Generates the data for testing partial time date and time values. 4618N/A * Generates data for testing partial date and time assertion syntax. 4618N/A {
"00s12m14h1M3D1978Y",
true},
4618N/A // validate if the args are found in the entries list. //Get the current time from the TimeThread. Using the current time from new // calendar may fail if the time thread using a stale time. "dn: cn=user1,dc=example,dc=com",
"dn: cn=user2,dc=example,dc=com",
"dn: cn=user3,dc=example,dc=com",
"dn: cn=user4,dc=example,dc=com",
"dn: cn=user5,dc=example,dc=com",
"dn: cn=user6,dc=example,dc=com",
DATE_ATTR +
": 19651101000000Z",
// Nov 1st 1965 "dn: cn=user7,dc=example,dc=com",
DATE_ATTR +
": 20101104000000Z",
// Nov 4th 2010 "dn: cn=user8,dc=example,dc=com",
DATE_ATTR +
": 20000101000000Z" // Jan 1st 2000