Class<?> clazz = Class.forName( className );
URL url = clazz.getResource( ldifFile );
URI uri = url.toURI();
File file = new File( uri );
LdifReader ldifReader = new LdifReader( file );
for ( LdifEntry entry : ldifReader )
{
service.getAdminSession().add(
new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
LOG.debug( "Successfully injected LDIF enry for test {}: {}", settings.getDescription(), entry );
}
}
catch ( Exception e )
{
LOG.error( "Cannot inject the following entry : {}. Error : {}.", ldifFile, e.getMessage() );
}
}
}
ldifs = settings.getLdifs( ldifs );
if ( ldifs.size() != 0 )
{
for ( String ldif:ldifs )
{
try
{
StringReader in = new StringReader( ldif );
LdifReader ldifReader = new LdifReader( in );
for ( LdifEntry entry : ldifReader )
{
service.getAdminSession().add(
new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );