SortedSet<String> replServers = new TreeSet<String>();
replServers.add("localhost:"+replicationServerPort);
DomainFakeCfg domainConf =
new DomainFakeCfg(baseDn2, 1602, replServers);
ExternalChangelogDomainFakeCfg eclCfg =
new ExternalChangelogDomainFakeCfg(true, null);
domainConf.setExternalChangelogDomain(eclCfg);
LDAPReplicationDomain domain2 =
MultimasterReplication.createNewDomain(domainConf);
domain2.start();
sleep(1000);
Entry e = createEntry(baseDn2);
addEntry(e);
// Search on ECL from start on all suffixes
String cookie = "";
ExternalChangelogRequestControl control =
new ExternalChangelogRequestControl(true,
new MultiDomainServerState(cookie));
ArrayList<Control> controls = new ArrayList<Control>(0);
controls.add(control);
LinkedHashSet<String> attributes = new LinkedHashSet<String>();
attributes.add("+");
attributes.add("*");
debugInfo(tn, "Search with cookie=" + cookie);
sleep(2000);
InternalSearchOperation searchOp = connection.processSearch(
ByteString.valueOf("cn=changelog"),
SearchScope.WHOLE_SUBTREE,
DereferencePolicy.NEVER_DEREF_ALIASES,
0, // Size limit
0, // Time limit
false, // Types only
LDAPFilter.decode("(targetDN=*)"),
attributes,
controls,
null);
// Expect SUCCESS and root entry returned
waitOpResult(searchOp, ResultCode.SUCCESS);
LinkedList<SearchResultEntry> entries = searchOp.getSearchEntries();
assertEquals(entries.size(),2, "Entries number returned by search");
assertTrue(entries != null);
if (entries != null)
{
int i = 0;
for (SearchResultEntry resultEntry : entries)
{
i++;
// Expect
debugInfo(tn, "Entry returned when test2 is public =" +
resultEntry.toLDIFString());
// Test entry attributes
//if (i==2)
//{
// checkPossibleValues(resultEntry,"targetobjectclass","top","organization");
//}
}
}
eclCfg =
new ExternalChangelogDomainFakeCfg(false, null);
domainConf.setExternalChangelogDomain(eclCfg);
domain2.applyConfigurationChange(domainConf);
debugInfo(tn, "Search with cookie=" + cookie);
searchOp = connection.processSearch(