/** * Verifies that an entry exists in the directory with the * specified attributes. * * @param entry the entry to verify * @throws NamingException if there are problems accessing the entry */ protected void verify( LdifEntry entry ) throws Exception { Entry readEntry = rootDSE.lookup( entry.getDn() ); for ( EntryAttribute readAttribute:readEntry ) { String id = readAttribute.getId(); EntryAttribute origAttribute = entry.getEntry().get( id ); for ( Value<?> value:origAttribute ) { if ( ! readAttribute.contains( value ) ) { LOG.error( "Failed to verify entry addition of {}. {} attribute in original " + "entry missing from read entry.", entry.getDn(), id ); throw new AssertionFailedError( "Failed to verify entry addition of " + entry.getDn() ); } } } }
/** * Verifies that an entry exists in the directory with the specified attributes. * * @param entry the entry to verify * @throws NamingException if there are problems accessing the entry */ protected void verify( LdifEntry entry ) throws Exception { Entry readEntry = rootDSE.lookup( entry.getDn() ); for ( EntryAttribute readAttribute : readEntry ) { String id = readAttribute.getId(); EntryAttribute origAttribute = entry.getEntry().get( id ); for ( Value<?> value : origAttribute ) { if ( !readAttribute.contains( value ) ) { logger.error( "Failed to verify entry addition of " + entry.getDn() + ". " + id + " attribute in original " + "entry missing from read entry." ); throw new AssertionFailedError( "Failed to verify entry addition of " + entry.getDn() ); } } } }
String updn = entry.getDn().getName();
private static void injectEntry(LdifEntry entry) throws Exception { if (entry.isChangeAdd()) { service.getAdminSession().add( new DefaultServerEntry(service.getSchemaManager(), entry.getEntry())); } else if (entry.isChangeModify()) { service.getAdminSession().modify(entry.getDn(), entry.getModificationItems()); } else { String message = I18n.err(I18n.ERR_117, entry.getChangeType()); throw new NamingException(message); } }
DN dnEntry = otherEntry.getDn();
private static void injectEntry(LdifEntry entry) throws Exception { if (entry.isChangeAdd()) { service.getAdminSession().add( new DefaultServerEntry(service.getSchemaManager(), entry.getEntry())); } else if (entry.isChangeModify()) { service.getAdminSession().modify(entry.getDn(), entry.getModificationItems()); } else { String message = I18n.err(I18n.ERR_117, entry.getChangeType()); throw new NamingException(message); } } }