| | |
| | | |
| | | final SearchResultEntry searchResultEntry = |
| | | Responses.newSearchResultEntry(srvResultEntry.getName().toString()); |
| | | for (org.opends.server.types.Attribute a : srvResultEntry.getAttributes()) { |
| | | for (org.opends.server.types.Attribute a : srvResultEntry.getAllAttributes()) { |
| | | searchResultEntry.addAttribute(from(a)); |
| | | } |
| | | for (org.opends.server.types.Control c : srvResultEntry.getControls()) { |
| | |
| | | |
| | | final org.forgerock.opendj.ldap.Entry entry = new LinkedHashMapEntry(srvResultEntry.getName().toString()); |
| | | entry.addAttribute(from(srvResultEntry.getObjectClassAttribute())); |
| | | for (org.opends.server.types.Attribute a : srvResultEntry.getAttributes()) { |
| | | for (org.opends.server.types.Attribute a : srvResultEntry.getAllAttributes()) { |
| | | entry.addAttribute(from(a)); |
| | | } |
| | | return entry; |
| | |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | | import static org.opends.server.util.CollectionUtils.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.config.server.ConfigChangeResult; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.config.server.ConfigurationChangeListener; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.ConditionResult; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.config.server.ConfigurationChangeListener; |
| | | import org.forgerock.opendj.server.config.server.EntityTagVirtualAttributeCfg; |
| | | import org.opends.server.api.VirtualAttributeProvider; |
| | | import org.opends.server.core.SearchOperation; |
| | |
| | | import org.opends.server.types.VirtualAttributeRule; |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | | |
| | | /** |
| | | * This class implements a virtual attribute provider which ensures that all |
| | | * entries contain an "entity tag" or "Etag" as defined in section 3.11 of RFC |
| | |
| | | |
| | | // The attribute order may vary between replicas so we need to make sure |
| | | // that we always process them in the same order. |
| | | final List<Attribute> attributes = entry.getAttributes(); |
| | | final List<Attribute> attributes = collect(entry.getAllAttributes(), new ArrayList<Attribute>()); |
| | | Collections.sort(attributes, ATTRIBUTE_COMPARATOR); |
| | | for (final Attribute attribute : attributes) |
| | | { |
| | |
| | | final Set<String> expandedNames = getExpandedNames(names); |
| | | final Entry filteredEntry = |
| | | entry.filterEntry(expandedNames, false, false, false); |
| | | return filteredEntry.getAttributes(); |
| | | return collect(filteredEntry.getAllAttributes(), new ArrayList<Attribute>()); |
| | | } |
| | | } |
| | | |
| | |
| | | import static org.forgerock.opendj.ldap.schema.CoreSchema.*; |
| | | import static org.opends.server.replication.protocol.OperationContext.*; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.zip.DataFormatException; |
| | |
| | | String uniqueId, |
| | | String parentId, |
| | | Attribute objectClass, |
| | | Collection<Attribute> userAttributes, |
| | | Collection<Attribute> operationalAttributes) |
| | | Iterable<Attribute> userAttributes, |
| | | Iterable<Attribute> operationalAttributes) |
| | | { |
| | | super (csn, uniqueId, dn); |
| | | |
| | |
| | | |
| | | private byte[] encodeAttributes( |
| | | Attribute objectClass, |
| | | Collection<Attribute> userAttributes, |
| | | Collection<Attribute> operationalAttributes) |
| | | Iterable<Attribute> userAttributes, |
| | | Iterable<Attribute> operationalAttributes) |
| | | { |
| | | ByteStringBuilder byteBuilder = new ByteStringBuilder(); |
| | | ASN1Writer writer = ASN1.getWriter(byteBuilder); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the entire set of attributes for this entry. This will |
| | | * include both user and operational attributes. The caller must |
| | | * not modify the contents of this list. Also note that this method |
| | | * is less efficient than calling either (or both) |
| | | * <CODE>getUserAttributes</CODE> or |
| | | * <CODE>getOperationalAttributes</CODE>, so it should only be used |
| | | * when calls to those methods are not appropriate. |
| | | * |
| | | * @return The entire set of attributes for this entry. |
| | | */ |
| | | public List<Attribute> getAttributes() |
| | | { |
| | | // Estimate the size. |
| | | int size = userAttributes.size() + operationalAttributes.size(); |
| | | |
| | | final List<Attribute> attributes = new ArrayList<>(size); |
| | | for (List<Attribute> attrs : userAttributes.values()) |
| | | { |
| | | attributes.addAll(attrs); |
| | | } |
| | | for (List<Attribute> attrs : operationalAttributes.values()) |
| | | { |
| | | attributes.addAll(attrs); |
| | | } |
| | | return attributes; |
| | | } |
| | | |
| | | /** Iterator over a {@code Collection<List<Attribute>>}. */ |
| | | private static final class CollectionListIterator implements Iterator<Attribute> |
| | | { |
| | |
| | | // Process collective attributes. |
| | | if (this.isCollective) |
| | | { |
| | | List<Attribute> subAttrList = entry.getAttributes(); |
| | | for (Attribute subAttr : subAttrList) |
| | | for (Attribute subAttr : entry.getAllAttributes()) |
| | | { |
| | | AttributeType attrType = subAttr.getAttributeDescription().getAttributeType(); |
| | | if (attrType.isCollective()) |
| | |
| | | * Header, with the fields enclosed by brackets [] replaced by your own identifying |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2014-2015 ForgeRock AS. |
| | | * Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.util; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collection; |
| | | import java.util.HashSet; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.LinkedList; |
| | | import java.util.TreeSet; |
| | | |
| | | /** |
| | | * Utility class for {@link Collection}s. |
| | |
| | | { |
| | | return new TreeSet<>(Arrays.asList(elements)); |
| | | } |
| | | |
| | | /** |
| | | * Collects all the elements from the provided iterable into the provided collection. |
| | | * |
| | | * @param <C> |
| | | * The type of the collection |
| | | * @param <E> |
| | | * The type of the iterable's elements |
| | | * @param iterable |
| | | * the iterable from which to read elements |
| | | * @param outputCollection |
| | | * the collection where to add the iterable's elements |
| | | * @return the provided collection |
| | | */ |
| | | public static <C extends Collection<E>, E> C collect(Iterable<E> iterable, C outputCollection) |
| | | { |
| | | for (E e : iterable) |
| | | { |
| | | outputCollection.add(e); |
| | | } |
| | | return outputCollection; |
| | | } |
| | | } |
| | |
| | | SearchResultEntry result = to(entry); |
| | | assertThat(result.getName().toString()).isEqualTo(entry.getName().toString()); |
| | | assertThat(result.getControls()).hasSize(entry.getControls().size()); |
| | | assertThat(result.getAttributes()).hasSize(2); |
| | | assertThat(result.getAllAttributes()).hasSize(2); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | org.opends.server.types.Entry result = to(entry); |
| | | assertThat(result.getName().toString()).isEqualTo(entry.getName().toString()); |
| | | assertThat(result.getAttributes()).hasSize(2); |
| | | assertThat(result.getAllAttributes()).hasSize(2); |
| | | } |
| | | |
| | | @Test |
| | |
| | | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.HashSet; |
| | | import java.util.LinkedHashSet; |
| | |
| | | if ("delete".equals(changeType)) |
| | | { |
| | | // We are using "*" for deletes so should get back 4 attributes. |
| | | assertThat(targetEntry.getAttributes()).hasSize(4); |
| | | assertThat(targetEntry.getAllAttributes()).hasSize(4); |
| | | assertAttributeValue(targetEntry, "uid", "robert"); |
| | | assertAttributeValue(targetEntry, "cn", "Robert Hue2"); |
| | | assertAttributeValue(targetEntry, "telephonenumber", "555555"); |
| | |
| | | } |
| | | else |
| | | { |
| | | assertThat(targetEntry.getAttributes()).isEmpty(); |
| | | assertThat(targetEntry.getAllAttributes()).isEmpty(); |
| | | } |
| | | } |
| | | else if (targetdn.endsWith("cn=fiona jensen,o=" + backendId4)) |
| | | { |
| | | Entry targetEntry = parseIncludedAttributes(resultEntry, targetdn); |
| | | |
| | | assertThat(targetEntry.getAttributes()).hasSize(2); |
| | | assertThat(targetEntry.getAllAttributes()).hasSize(2); |
| | | assertAttributeValue(targetEntry,"sn","jensen"); |
| | | assertAttributeValue(targetEntry,"cn","Fiona Jensen"); |
| | | } |
| | |
| | | user1entryUUID, |
| | | baseUUID, |
| | | entry.getObjectClassAttribute(), |
| | | entry.getAttributes(), |
| | | Collections.<Attribute> emptyList()); |
| | | entry.getAllAttributes(), |
| | | null); |
| | | } |
| | | |
| | | private UpdateMsg generateModMsg(ReplicaId replicaId, CSN csn, String testName) throws Exception |
| | |
| | | entryAfter = id2entry.entryFromDatabase(bytes, DirectoryServer.getDefaultCompressedSchema()); |
| | | |
| | | // check DN and number of attributes |
| | | assertEquals(entryBefore.getAttributes().size(), entryAfter |
| | | .getAttributes().size()); |
| | | |
| | | assertThat(entryBefore.getAllAttributes()).hasSameSizeAs(entryAfter.getAllAttributes()); |
| | | assertEquals(entryBefore.getName(), entryAfter.getName()); |
| | | |
| | | // check the object classes were not changed |
| | |
| | | import org.forgerock.opendj.ldap.DereferenceAliasesPolicy; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.ldap.SearchScope; |
| | | import org.forgerock.opendj.ldap.schema.ObjectClass; |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.controls.MatchedValuesControl; |
| | | import org.opends.server.controls.MatchedValuesFilter; |
| | |
| | | import org.opends.server.types.Control; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | | import org.forgerock.opendj.ldap.schema.ObjectClass; |
| | | import org.opends.server.types.Operation; |
| | | import org.opends.server.types.SearchResultEntry; |
| | | import org.opends.server.types.SearchResultReference; |
| | |
| | | |
| | | // Calculate the total number of LDAP attributes in this entry. |
| | | ldapAttrCount = 1; // For the objectclass attribute. |
| | | for (Attribute a : testEntry.getAttributes()) |
| | | for (Attribute a : testEntry.getAllAttributes()) |
| | | { |
| | | ldapAttrCount += a.size(); |
| | | } |
| | |
| | | private Set<String> getAttributeNames(Entry entry) |
| | | { |
| | | Set<String> actualNames = new HashSet<>(); |
| | | for (Attribute attribute : entry.getAttributes()) |
| | | for (Attribute attribute : entry.getAllAttributes()) |
| | | { |
| | | actualNames.add(attribute.getAttributeDescription().toString()); |
| | | } |
| | |
| | | List<SearchResultEntry> entries = searchOperation.getSearchEntries(); |
| | | SearchResultEntry e = entries.get(0); |
| | | assertNotNull(e); |
| | | assertThat(e.getAttributes()).isEmpty(); |
| | | assertThat(e.getAllAttributes()).isEmpty(); |
| | | } |
| | | |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | | import org.opends.server.types.*; |
| | | import static org.opends.server.protocols.ldap.LDAPConstants.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | import org.forgerock.opendj.io.ASN1; |
| | | import org.forgerock.opendj.io.ASN1Reader; |
| | | import org.forgerock.opendj.io.ASN1Writer; |
| | | import org.forgerock.opendj.ldap.ByteStringBuilder; |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.forgerock.opendj.io.*; |
| | | import static org.opends.server.protocols.ldap.LDAPConstants. |
| | | OP_TYPE_SEARCH_RESULT_ENTRY; |
| | | import static org.testng.Assert.*; |
| | | import org.testng.annotations.Test; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.LDAPException; |
| | | import org.opends.server.types.SearchResultEntry; |
| | | import org.testng.annotations.BeforeClass; |
| | | import org.testng.annotations.DataProvider; |
| | | import org.testng.annotations.Test; |
| | | |
| | | public class TestSearchResultEntryProtocolOp extends LdapTestCase |
| | | { |
| | |
| | | { |
| | | SearchResultEntryProtocolOp protocolOp = |
| | | new SearchResultEntryProtocolOp(new SearchResultEntry(from)); |
| | | Entry to = protocolOp.toSearchResultEntry(); |
| | | protocolOp.toSearchResultEntry(); |
| | | |
| | | // FIXME Issue 660: Need to provide Entry.equals(Object) |
| | | // assertEquals(to, from); |
| | |
| | | new SearchResultEntryProtocolOp(new SearchResultEntry(from)); |
| | | StringBuilder builder = new StringBuilder(); |
| | | protocolOp.toLDIF(builder, wrapColumn); |
| | | Entry to = TestCaseUtils.entryFromLdifString(builder.toString()); |
| | | TestCaseUtils.entryFromLdifString(builder.toString()); |
| | | |
| | | // FIXME Issue 660: Need to provide Entry.equals(Object) |
| | | // assertEquals(to, from); |
| | |
| | | } |
| | | } |
| | | |
| | | Entry to = TestCaseUtils.entryFromLdifString(builder.toString()); |
| | | TestCaseUtils.entryFromLdifString(builder.toString()); |
| | | |
| | | // FIXME Issue 660: Need to provide Entry.equals(Object) |
| | | // assertEquals(to, from); |
| | |
| | | writer.writeOctetString(entry.getName().toString()); |
| | | |
| | | writer.writeStartSequence(); |
| | | for(Attribute attr : entry.getAttributes()) |
| | | for (Attribute attr : entry.getAllAttributes()) |
| | | { |
| | | new LDAPAttribute(attr).write(writer); |
| | | } |
| | |
| | | writer.writeStartSequence(OP_TYPE_SEARCH_RESULT_ENTRY); |
| | | |
| | | writer.writeStartSequence(); |
| | | for(Attribute attr : entry.getAttributes()) |
| | | for (Attribute attr : entry.getAllAttributes()) |
| | | { |
| | | new LDAPAttribute(attr).write(writer); |
| | | } |
| | |
| | | */ |
| | | package org.opends.server.replication; |
| | | |
| | | import static org.forgerock.opendj.ldap.schema.CoreSchema.*; |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.opends.server.util.CollectionUtils.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.util.LinkedList; |
| | |
| | | import org.testng.annotations.BeforeClass; |
| | | import org.testng.annotations.Test; |
| | | |
| | | import static org.forgerock.opendj.ldap.schema.CoreSchema.*; |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.opends.server.util.CollectionUtils.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | /** |
| | | * Test that the dependencies are computed correctly when replaying |
| | | * sequences of operations that requires to follow a given order |
| | |
| | | private AddMsg addMsg(DN addDN, Entry entry, int uniqueId, int parentId, CSNGenerator gen) |
| | | { |
| | | return new AddMsg(gen.newCSN(), addDN, stringUID(uniqueId), stringUID(parentId), |
| | | entry.getObjectClassAttribute(), entry.getAttributes(), null); |
| | | entry.getObjectClassAttribute(), entry.getAllAttributes(), null); |
| | | } |
| | | |
| | | private ModifyMsg modifyMsg(DN dn, int entryUUID, List<Modification> mods, CSNGenerator gen) |
| | |
| | | |
| | | import java.io.File; |
| | | import java.net.SocketTimeoutException; |
| | | import java.util.ArrayList; |
| | | import java.util.SortedSet; |
| | | import java.util.TreeSet; |
| | | import java.util.UUID; |
| | |
| | | user1entryUUID, |
| | | null, |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | | personWithUUIDEntry.getAttributes(), new ArrayList<Attribute>()); |
| | | personWithUUIDEntry.getAllAttributes(), null); |
| | | } |
| | | |
| | | /** Check that the expected number of changes are in the replication server database. */ |
| | |
| | | private AddMsg addMsg(CSNGenerator gen, Entry entry, String uniqueId, String parentId) |
| | | { |
| | | return new AddMsg(gen.newCSN(), entry.getName(), uniqueId, parentId, |
| | | entry.getObjectClassAttribute(), entry.getAttributes(), |
| | | new ArrayList<Attribute>()); |
| | | entry.getObjectClassAttribute(), entry.getAllAttributes(), null); |
| | | } |
| | | |
| | | /** |
| | |
| | | user1entryUUID, |
| | | baseUUID, |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | | personWithUUIDEntry.getAttributes(), new ArrayList<Attribute>()); |
| | | personWithUUIDEntry.getAllAttributes(), null); |
| | | updateMonitorCount(baseDN, resolvedMonitorAttr); |
| | | alertCount = DummyAlertHandler.getAlertCount(); |
| | | broker.publish(addMsg); |
| | |
| | | user1entryUUID, |
| | | getEntryUUID(baseDN1), |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | | personWithUUIDEntry.getAttributes(), new ArrayList<Attribute>()); |
| | | personWithUUIDEntry.getAllAttributes(), null); |
| | | |
| | | // - MODDN parent entry 1 to baseDn2 in the LDAP server |
| | | ModifyDNRequest modifyDNRequest = newModifyDNRequest(baseDN1.toString(), "ou=baseDn2") |
| | |
| | | { |
| | | AddMsg addMsg = new AddMsg( |
| | | gen.newCSN(), entry.getName(), UUID.randomUUID().toString(), |
| | | parentUid, entry.getObjectClassAttribute(), entry.getAttributes(), null); |
| | | parentUid, entry.getObjectClassAttribute(), entry.getAllAttributes(), null); |
| | | |
| | | // Send add message in assured mode |
| | | addMsg.setAssured(isAssured); |
| | |
| | | |
| | | private AddMsg newAddMsg(Entry e, String entryUUID) |
| | | { |
| | | return new AddMsg(gen.newCSN(), e.getName(), entryUUID, null, e.getObjectClassAttribute(), e.getAttributes(), null); |
| | | return new AddMsg(gen.newCSN(), e.getName(), entryUUID, null, |
| | | e.getObjectClassAttribute(), e.getAllAttributes(), null); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | | import static org.assertj.core.api.Assertions.*; |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.opends.server.core.DirectoryServer.*; |
| | | import static org.opends.server.protocols.internal.InternalClientConnection.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.TreeSet; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | |
| | |
| | | import org.opends.server.replication.protocol.LDAPUpdateMsg; |
| | | import org.opends.server.replication.protocol.ModifyDNMsg; |
| | | import org.opends.server.replication.protocol.UpdateMsg; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.Entry; |
| | | import org.testng.annotations.AfterMethod; |
| | | import org.testng.annotations.BeforeMethod; |
| | | import org.testng.annotations.Test; |
| | | |
| | | import static org.assertj.core.api.Assertions.*; |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.opends.server.core.DirectoryServer.*; |
| | | import static org.opends.server.protocols.internal.InternalClientConnection.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | /** Test the naming conflict resolution code. */ |
| | | @SuppressWarnings("javadoc") |
| | | public class NamingConflictTest extends ReplicationTestCase |
| | |
| | | childUUID, |
| | | parentUUID, |
| | | childEntry.getObjectClassAttribute(), |
| | | childEntry.getAttributes(), |
| | | new ArrayList<Attribute>()); |
| | | childEntry.getAllAttributes(), null); |
| | | |
| | | // Put the message in the replay queue |
| | | replayMsg(addMsg); |
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.net.SocketTimeoutException; |
| | | import java.util.ArrayList; |
| | | import java.util.SortedSet; |
| | | import java.util.TreeSet; |
| | | import java.util.concurrent.Callable; |
| | |
| | | import org.opends.server.replication.server.ReplServerFakeConfiguration; |
| | | import org.opends.server.replication.server.ReplicationServer; |
| | | import org.opends.server.replication.service.ReplicationBroker; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.util.TestTimer; |
| | | import org.testng.annotations.AfterClass; |
| | |
| | | userEntryUUID, |
| | | null, |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | | personWithUUIDEntry.getAttributes(), new ArrayList<Attribute>()); |
| | | personWithUUIDEntry.getAllAttributes(), null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.net.SocketException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.SortedSet; |
| | | import java.util.TreeSet; |
| | |
| | | import org.opends.server.replication.service.DSRSShutdownSync; |
| | | import org.opends.server.replication.service.ReplicationBroker; |
| | | import org.opends.server.tools.LDAPSearch; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.Entry; |
| | | import org.testng.annotations.BeforeClass; |
| | | import org.testng.annotations.Test; |
| | |
| | | user1entryUUID, |
| | | baseUUID, |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | | personWithUUIDEntry.getAttributes(), new ArrayList<Attribute>()); |
| | | personWithUUIDEntry.getAllAttributes(), null); |
| | | } |
| | | |
| | | @Test(enabled=true) |
| | |
| | | import org.opends.server.replication.protocol.WindowMsg; |
| | | import org.opends.server.replication.protocol.WindowProbeMsg; |
| | | import org.opends.server.replication.service.ReplicationBroker; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.Attributes; |
| | | import org.opends.server.types.DirectoryConfig; |
| | | import org.opends.server.types.DirectoryException; |
| | |
| | | "objectClass: domain", |
| | | "entryUUID: " + user1entryUUID); |
| | | return new AddMsg(csnGen.newCSN(), EXAMPLE_DN, user1entryUUID, baseUUID, |
| | | entry.getObjectClassAttribute(), entry.getAttributes(), new ArrayList<Attribute>()); |
| | | entry.getObjectClassAttribute(), entry.getAllAttributes(), null); |
| | | } |
| | | |
| | | private List<ReplicationMsg> receiveReplicationMsgs(ReplicationBroker broker2, int nbMessagesExpected) |
| | |
| | | package org.opends.server.tools; |
| | | |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.opends.server.util.CollectionUtils.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.PrintStream; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.forgerock.opendj.server.config.server.RootCfg; |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.tasks.TaskUtils; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.Attributes; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.testng.annotations.AfterClass; |
| | | import org.testng.annotations.BeforeClass; |
| | |
| | | assertNotNull(entry); |
| | | for (Attribute a : attrs) |
| | | { |
| | | assertEquals(entry.getAttributes().contains(a), attrsShouldExistInEntry); |
| | | final List<Attribute> attributes = collect(entry.getAllAttributes(), new ArrayList<Attribute>()); |
| | | assertEquals(attributes.contains(a), attrsShouldExistInEntry); |
| | | } |
| | | } |
| | | } |