PersistentServerStateTest.java revision 0d397efc4b781ef5b60108708fa1131467d2c3c8
/*
* 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
*
*
* Copyright 2006-2009 Sun Microsystems, Inc.
*/
/**
* Test the PersistentServerState class.
*/
public class PersistentServerStateTest extends ReplicationTestCase
{
/**
* The suffix for which we want to test the PersistentServerState class.
*/
public Object[][] suffixData() {
return new Object[][] {
{"cn=schema"}
};
}
/**
* Test that the PersistentServerState class is able to store and
* retrieve ServerState to persistent storage.
*/
throws Exception
{
/*
* Create a new PersitentServerState,
* update it with 2 new ChangeNumbers with 2 different server Ids
* save it
*
* Then creates a new PersistentServerState and check that the
* 2 ChangeNumbers have been saved in this new PersistentServerState.
*/
"cn1 has not been saved or loaded correctly for " + dn);
"cn2 has not been saved or loaded correctly for " + dn);
"cn1 has not been saved after clear for " + dn);
}
/**
* Ensures that the Directory Server is able to
* translate a ruv entry to a sever state.
*
* @throws Exception If an unexpected problem occurs.
*/
@SuppressWarnings("unchecked")
@Test
public void translateRuvEntryTest()
throws Exception
{
try
{
"dn: nsuniqueid=ffffffff-ffffffff-ffffffff-ffffffff, o=test\n"
+"objectClass: top\n"
+"objectClass: ldapsubentry\n"
+"objectClass: extensibleobject\n"
+"nsds50ruv: {replicageneration} 49098853000000010000\n"
+"nsds50ruv: {replica 3 ldap://kawax:3389} 491d517b000000030000 "
+"491d564a000000030000\n"
+"nsds50ruv: {replica 1 ldap://kawax:1389} 490989e8000000010000 "
+"490989e8000000010000\n"
+"ds6ruv: {PRIO 3 ldap://kawax:3389}\n"
+"ds6ruv: {PRIO 1 ldap://kawax:1389}\n"
+"entryUUID: ffffffff-ffff-ffff-ffff-ffffffffffff\n";
addOp.setInternalOperation(true);
replicationPlugin = new MultimasterReplication();
// Then check serverSate and GenId
}
finally
{
if (replDomain != null)
if (replicationPlugin != null)
}
}
}