TestRebuildJob.java revision 85fa1db655ec75262d9042259f86e7b9ce5c312b
/*
* 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
* 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
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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
*
*
* Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
public class TestRebuildJob extends JebTestCase
{
//Attribute type in stat entry containing error count
private BackendImpl be;
public Object[][] systemIndexes() {
return new Object[][] {
{ "id2subtree" },
{ "id2children" },
{ "dn2id" },
{ "dn2uri" }
};
}
public Object[][] attributeIndexes() {
return new Object[][] {
{ "mail" },
{ "mail.presence" },
{ "mail.substring" },
{ "mail.ordering" },
{ "mail.equality" },
{ "mail.approximate" }
};
}
public Object[][] badIndexes() {
return new Object[][] {
{ "id2entry" },
{ "nonindex" },
{ "mail.nonindex" }
};
}
"define suffix="+suffix,
"define maildomain=example.com",
"define numusers= #numEntries#",
"",
"branch: [suffix]",
"",
"branch: " + vBranch,
"subordinateTemplate: person:[numusers]",
"",
"template: person",
"rdnAttr: uid",
"objectClass: top",
"objectClass: person",
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
"givenName: ABOVE LIMIT",
"sn: <last>",
"cn: {givenName} {sn}",
"initials: {givenName:1}<random:chars:" +
"ABCDEFGHIJKLMNOPQRSTUVWXYZ:1>{sn:1}",
"employeeNumber: <sequential:0>",
"uid: user.{employeeNumber}",
"mail: {uid}@[maildomain]",
"userPassword: password",
"telephoneNumber: <random:telephone>",
"homePhone: <random:telephone>",
"pager: <random:telephone>",
"mobile: <random:telephone>",
"street: <random:numeric:5> <file:streets> Street",
"l: <file:cities>",
"st: <file:states>",
"postalCode: <random:numeric:5>",
"postalAddress: {cn}${street}${l}, {st} {postalCode}",
"description: This is the description for {cn}.",
""};
};
}
}
/**
* Cleans verify backend and loads some number of entries.
* @param numEntries number of entries to load into the backend.
* @throws Exception if the entries are not loaded or created.
*/
template[2]=
}
/**
* Runs rebuild against the system indexes.
*
* @throws Exception if
*/
{
cleanAndLoad(10);
}
expectedExceptions = DirectoryException.class)
{
}
expectedExceptions = DirectoryException.class)
{
cleanAndLoad(10);
}
{
cleanAndLoad(10);
//TODO: Verify dn2uri database as well.
{
}
}
@Test
public void testRebuildDependentIndexes() throws Exception
{
cleanAndLoad(10);
}
@Test
public void testRebuildRedundentIndexes() throws Exception
{
}
@Test
public void testRebuildMultipleJobs() throws Exception
{
rebuildConfig = new RebuildConfig();
rebuildConfig2 = new RebuildConfig();
}
{
{
}
}
/**
* Builds an entry suitable for using in the verify job to gather statistics about
* the verify.
* @param dn to put into the entry.
* @return a suitable entry.
* @throws DirectoryException if the cannot be created.
*/
}
if (extensibleObjectOC == null) {
}
}
/**
* Gets information from the stat entry and returns that value as a Long.
* @param e entry to search.
* @param type attribute type
* @return Long
* @throws NumberFormatException if the attribute value cannot be parsed.
*/
throws NumberFormatException {
return (retVal);
}
}