ReferencesTestCase.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 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2015 ForgeRock AS
*/
/**
* Unit test to test ACI behavior and Named Subordinate References (RFC 3296).
* This test needs a jeb backend, the memory backend cannot be used.
*/
public class ReferencesTestCase extends AciTestCase{
private static final String smartReferralAdmin=
"uid=smart referral admin,uid=proxyuser,ou=admins," + suffix;
//Allow based on plus operator.
private static final
"(version 3.0;acl \"plus\";" +
"allow (search, read) " +
//Allow based on ref name.
private static final
"(version 3.0;acl \"ref name\";" +
"allow (search, read) " +
//Allow based on target keyword.
private static final
"(targetattr=\"objectclass || ref\")" +
"(version 3.0;acl \"target\";" +
"allow (search, read) " +
public void setupClass() throws Exception {
}
/**
* Test using ACI added to admin base containing "ref" attribute type name
* specified in targetattr keword.
*
* @throws Exception If results are unexpected.
*/
@Test
try {
} finally {
}
}
/**
* Test using ACI added to actual referral entry (added using ldifmodify
* passing manageDsaIT control).
*
* @throws Exception If results are unexpected.
*/
@Test
public void testRefAci() throws Exception {
try {
//Add the ACI passing the manageDsaIT control.
} finally {
//Delete the ACI passing the manageDsaIT control.
}
}
/**
* Test global ACI allowing the "ref" attribute type to be returned only if
* if the search is under the people base. A search under the admin base
* should not return a reference.
*
* @throws Exception If an unexpected result is returned.
*/
@Test
public void testGlobalTargetAci() throws Exception {
try {
//Fail, ACI only allows people references
//Pass, ACI allows people references
} finally {
}
}
/**
* Test global ACI allowing the "ref" attribute type specifed by the
* plus operator.
*
* @throws Exception If an unexpected result us returned.
*/
@Test
public void testGlobalAci() throws Exception {
try {
} finally {
}
}
/**
* Simple function that searches for the "SearchReference" string and returns
* true if it is seen.
*
* @param resultString The string containing the results from the search.
* @return True if the "SearchReference" string is seen in the results.
*/
protected boolean
boolean ret=false;
try {
while(true) {
if(s == null)
break;
if(s.startsWith("SearchReference")) {
ret=true;
break;
}
}
} catch (IOException e) {
}
return ret;
}
}