PasswordExpirationTimeVirtualAttributeProviderTestCase.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2012 profiq, s.r.o.
* Portions Copyright 2014-2015 ForgeRock AS
*/
@SuppressWarnings("javadoc")
extends ExtensionsTestCase
{
private Entry notExpired;
public void startServer()
throws Exception
{
"objectClass: top",
"objectClass: person",
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
"uid: tuser",
"cn: Test User",
"sn: User",
"userPassword: password",
"createTimestamp: 20120315163235Z");
"objectClass: top",
"objectClass: person",
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
"uid: tuser",
"cn: Test User",
"sn: User",
"userPassword: password",
"createTimestamp: 20110315163235Z");
}
@Test
public void test30dPwPolicy() throws Exception
{
"objectClass: top",
"objectClass: subentry",
"objectClass: pwdPolicy",
"cn: Subentry Password Policy",
"pwdAttribute: userPassword",
"pwdLockout: TRUE",
"pwdMaxFailure: 3",
"pwdFailureCountInterval: 300",
"pwdLockoutDuration: 300",
"pwdAllowUserChange: TRUE",
"pwdSafeModify: TRUE",
"pwdMaxAge: 2592000", // 30 days
"subtreeSpecification: {minimum 1, specificationFilter \"(objectclass=*)\"}");
}
public void environmentSetup() throws Exception
{
true);
}
public void environmentCleanup() throws Exception
{
}
public void testNoExpiration() throws Exception
{
"objectClass: top",
"objectClass: subentry",
"objectClass: pwdPolicy",
"cn: Subentry Password Policy",
"pwdAttribute: userPassword",
"pwdLockout: TRUE",
"pwdMaxFailure: 3",
"pwdFailureCountInterval: 300",
"pwdLockoutDuration: 300",
"pwdAllowUserChange: TRUE",
"pwdSafeModify: TRUE",
"subtreeSpecification: {minimum 1, specificationFilter \"(objectclass=*)\"}");
getTimeValueFromAttribute("ds-pwp-password-expiration-time");
}
@Test
public void testPwPolicyExpiring() throws Exception
{
"objectClass: top",
"objectClass: subentry",
"objectClass: pwdPolicy",
"cn: Subentry Password Policy",
"pwdAttribute: userPassword",
"pwdLockout: TRUE",
"pwdMaxFailure: 3",
"pwdFailureCountInterval: 300",
"pwdLockoutDuration: 300",
"pwdAllowUserChange: TRUE",
"pwdSafeModify: TRUE",
"pwdMaxAge: 2592000", // 30 days
"subtreeSpecification: {minimum 1, specificationFilter \"(objectclass=*)\"}");
}
@Test
public void testPwPolicyExpired() throws Exception
{
"objectClass: top",
"objectClass: subentry",
"objectClass: pwdPolicy",
"cn: Subentry Password Policy",
"pwdAttribute: userPassword",
"pwdLockout: TRUE",
"pwdMaxFailure: 3",
"pwdFailureCountInterval: 300",
"pwdLockoutDuration: 300",
"pwdAllowUserChange: TRUE",
"pwdSafeModify: TRUE",
"pwdMaxAge: 648000", // 7.5 days
"subtreeSpecification: {minimum 1, specificationFilter \"(objectclass=*)\"}");
}
throws Exception
{
// Process the search request
}
}