You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/01/24 17:22:36 UTC
svn commit: r1235328 [2/12] - in /directory/apacheds/trunk:
server-annotations/src/main/java/org/apache/directory/server/annotations/
server-annotations/src/main/java/org/apache/directory/server/factory/
server-annotations/src/test/java/org/apache/dire...
Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DelegatingAuthenticatorBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DelegatingAuthenticatorBean.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DelegatingAuthenticatorBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DelegatingAuthenticatorBean.java Tue Jan 24 16:22:33 2012
@@ -19,8 +19,10 @@
*/
package org.apache.directory.server.config.beans;
+
import org.apache.directory.server.config.ConfigurationElement;
+
/**
* A class used to store the Delegating Authenticator configuration.
*
@@ -28,17 +30,16 @@ import org.apache.directory.server.confi
*/
public class DelegatingAuthenticatorBean extends AuthenticatorBean
{
-
+
/** The delegate host */
@ConfigurationElement(attributeType = "ads-delegateHost")
private String delegateHost;
-
+
/** The delegate port */
@ConfigurationElement(attributeType = "ads-delegatePort")
private int delegatePort;
-
/**
* @return the delegateHost
*/
@@ -81,7 +82,7 @@ public class DelegatingAuthenticatorBean
public String toString( String tabs )
{
StringBuilder sb = new StringBuilder();
-
+
sb.append( tabs ).append( "Delegating Authenticator :\n" );
sb.append( super.toString( tabs + " " ) );
@@ -90,8 +91,8 @@ public class DelegatingAuthenticatorBean
return sb.toString();
}
-
-
+
+
/**
* {@inheritDoc}
*/
Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java Tue Jan 24 16:22:33 2012
@@ -39,7 +39,7 @@ public class DirectoryServiceBean extend
private String directoryServiceId;
/** The directory instance replication ID */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_DS_REPLICA_ID )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_DS_REPLICA_ID)
private int dsReplicaId;
/** The flag that tells if the AccessControl system is activated */
@@ -90,6 +90,7 @@ public class DirectoryServiceBean extend
@ConfigurationElement(attributeType = "ads-partitions", container = "partitions")
private List<PartitionBean> partitions = new ArrayList<PartitionBean>();
+
/**
* Create a new DnsServerBean instance
*/
Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java Tue Jan 24 16:22:33 2012
@@ -80,7 +80,7 @@ public class LdapServerBean extends DSBa
/** The list of supported extended operation handlers */
@ConfigurationElement(attributeType = "ads-extendedOpHandlers", container = "extendedOpHandlers")
private List<ExtendedOpHandlerBean> extendedOpHandlers = new ArrayList<ExtendedOpHandlerBean>();
-
+
/**
* Create a new LdapServerBean instance
@@ -307,7 +307,6 @@ public class LdapServerBean extends DSBa
}
-
/**
* @param extendedOps the extendedOps to set
*/
@@ -352,12 +351,12 @@ public class LdapServerBean extends DSBa
*/
public void addReplConsumers( ReplConsumerBean... replConsumers )
{
- for( ReplConsumerBean bean : replConsumers )
+ for ( ReplConsumerBean bean : replConsumers )
{
this.replConsumers.add( bean );
}
}
-
+
/**
* {@inheritDoc}
@@ -416,7 +415,7 @@ public class LdapServerBean extends DSBa
sb.append( replConsumer.toString( tabs + " " ) );
}
}
-
+
return sb.toString();
}
Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java (original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java Tue Jan 24 16:22:33 2012
@@ -35,81 +35,82 @@ import org.apache.directory.shared.ldap.
public class ReplConsumerBean extends AdsBaseBean
{
/** The consumer id */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_CONSUMER_ID, isRdn = true )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_CONSUMER_ID, isRdn = true)
private String replConsumerId;
/** The Search Base Dn */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_SEARCH_BASE_DN )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_SEARCH_BASE_DN)
private String searchBaseDn;
/** The replication provider host name */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_PROV_HOST_NAME )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_PROV_HOST_NAME)
private String replProvHostName;
/** The replication provider port */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_PROV_PORT )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_PROV_PORT)
private int replProvPort;
/** The Alias Dereferencing mode */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_ALIAS_DEREF_MODE )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_ALIAS_DEREF_MODE)
private String replAliasDerefMode;
/** The replication provider attribute */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_ATTRIBUTES )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_ATTRIBUTES)
private List<String> replAttributes = new ArrayList<String>();
/** The refresh interval */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_REFRESH_INTERVAL )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_REFRESH_INTERVAL)
private long replRefreshInterval;
/** Tells if we should persist */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_REFRESH_N_PERSIST )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_REFRESH_N_PERSIST)
private boolean replRefreshNPersist;
/** The search scope */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_SEARCH_SCOPE )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_SEARCH_SCOPE)
private String replSearchScope;
/** The replication search filter */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_SEARCH_FILTER )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_SEARCH_FILTER)
private String replSearchFilter;
/** The search size limit */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_SEARCH_SIZE_LIMIT )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_SEARCH_SIZE_LIMIT)
private int replSearchSizeLimit;
/** The search time limit */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_SEARCH_TIMEOUT )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_SEARCH_TIMEOUT)
private int replSearchTimeout;
/** The replication user Dn */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_USER_DN )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_USER_DN)
private String replUserDn;
/** The replication user password */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_USER_PASSWORD )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_USER_PASSWORD)
private byte[] replUserPassword;
/** The replication cookie */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_COOKIE )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_COOKIE)
private String replCookie;
/** Tells if TLS should be used during replication */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_USE_TLS )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_USE_TLS)
private boolean replUseTls;
/** Tells if the certificate validation should be strict or not */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_STRICT_CERT_VALIDATION )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_STRICT_CERT_VALIDATION)
private boolean replStrictCertValidation;
/** The peer certificate */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_PEER_CERTIFICATE )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_PEER_CERTIFICATE)
private byte[] replPeerCertificate;
/** The FQCN of replication client implementation */
- @ConfigurationElement( attributeType = SchemaConstants.ADS_REPL_CONSUMER_IMPL )
+ @ConfigurationElement(attributeType = SchemaConstants.ADS_REPL_CONSUMER_IMPL)
private String replConsumerImpl;
+
/**
* Create a new Replication Consumer instance
*/
@@ -241,7 +242,7 @@ public class ReplConsumerBean extends Ad
}
}
-
+
/**
* @return the replRefreshInterval
*/
@@ -498,11 +499,11 @@ public class ReplConsumerBean extends Ad
sb.append( toString( tabs, " search filter", replSearchFilter ) );
sb.append( tabs ).append( " search size limit : " ).append( replSearchSizeLimit ).append( '\n' );
sb.append( tabs ).append( " search time limit : " ).append( replSearchTimeout ).append( '\n' );
- sb.append( toString( tabs, " user Dn", replUserDn) );
+ sb.append( toString( tabs, " user Dn", replUserDn ) );
sb.append( toString( tabs, " user password", String.valueOf( replUserPassword ) ) ); // do not reveal the password, just null or not
sb.append( toString( tabs, " cookie", replCookie ) );
sb.append( tabs ).append( " consumer implementation's FQCN : " ).append( replConsumerImpl ).append( '\n' );
-
+
// a hex dump would be good but printing the address is better to just know null or not
sb.append( toString( tabs, " peer certificate", String.valueOf( replPeerCertificate ) ) );
Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ChangePasswordConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ChangePasswordConfigReaderTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ChangePasswordConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ChangePasswordConfigReaderTest.java Tue Jan 24 16:22:33 2012
@@ -64,14 +64,15 @@ public class ChangePasswordConfigReaderT
@BeforeClass
public static void readConfig() throws Exception
{
- workDir = new File( System.getProperty( "java.io.tmpdir" ) + "/server-work-" + ChangePasswordConfigReaderTest.class.getSimpleName() );
+ workDir = new File( System.getProperty( "java.io.tmpdir" ) + "/server-work-"
+ + ChangePasswordConfigReaderTest.class.getSimpleName() );
FileUtils.deleteDirectory( workDir );
workDir.mkdir();
String workingDirectory = workDir.getPath();
// Extract the schema on disk (a brand new one) and load the registries
File schemaRepository = new File( workingDirectory, "schema" );
-
+
if ( schemaRepository.exists() )
{
FileUtils.deleteDirectory( schemaRepository );
@@ -92,18 +93,18 @@ public class ChangePasswordConfigReaderT
if ( errors.size() != 0 )
{
- throw new Exception( "Schema load failed : " + Exceptions.printErrors(errors) );
+ throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
}
}
-
+
@AfterClass
public static void cleanup() throws Exception
{
FileUtils.deleteDirectory( workDir );
}
-
+
@Test
public void testChangePasswordServer() throws Exception
{
@@ -115,14 +116,17 @@ public class ChangePasswordConfigReaderT
configPartition.setPartitionPath( new File( configFile ).toURI() );
configPartition.setSuffixDn( new Dn( "ou=config" ) );
configPartition.setSchemaManager( schemaManager );
-
+
configPartition.initialize();
ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
-
- ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager, "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_CHANGE_PASSWORD_SERVER_OC.getValue() );
+
+ ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager,
+ "ou=servers,ads-directoryServiceId=default,ou=config" ),
+ ConfigSchemaConstants.ADS_CHANGE_PASSWORD_SERVER_OC.getValue() );
assertNotNull( configBean );
- ChangePasswordServerBean changePasswordServerBean = (ChangePasswordServerBean)configBean.getDirectoryServiceBeans().get( 0 );
+ ChangePasswordServerBean changePasswordServerBean = ( ChangePasswordServerBean ) configBean
+ .getDirectoryServiceBeans().get( 0 );
assertNotNull( changePasswordServerBean );
configPartition.destroy();
Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java Tue Jan 24 16:22:33 2012
@@ -91,7 +91,7 @@ public class ConfigPartitionReaderTest
if ( errors.size() != 0 )
{
- throw new Exception( "Schema load failed : " + Exceptions.printErrors(errors) );
+ throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
}
}
Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigWriterTest.java Tue Jan 24 16:22:33 2012
@@ -97,7 +97,7 @@ public class ConfigWriterTest
if ( errors.size() != 0 )
{
- throw new Exception( "Schema load failed : " + Exceptions.printErrors(errors) );
+ throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
}
}
@@ -128,12 +128,12 @@ public class ConfigWriterTest
// Reading the original config file
LdifReader ldifReader = new LdifReader( configFile );
List<LdifEntry> originalConfigEntries = new ArrayList<LdifEntry>();
-
+
while ( ldifReader.hasNext() )
{
originalConfigEntries.add( ldifReader.next() );
}
-
+
ldifReader.close();
// Getting the list of entries of generated config
Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/DhcpServerConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/DhcpServerConfigReaderTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/DhcpServerConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/DhcpServerConfigReaderTest.java Tue Jan 24 16:22:33 2012
@@ -71,7 +71,7 @@ public class DhcpServerConfigReaderTest
String workingDirectory = workDir.getPath();
// Extract the schema on disk (a brand new one) and load the registries
File schemaRepository = new File( workingDirectory, "schema" );
-
+
if ( schemaRepository.exists() )
{
FileUtils.deleteDirectory( schemaRepository );
@@ -92,7 +92,7 @@ public class DhcpServerConfigReaderTest
if ( errors.size() != 0 )
{
- throw new Exception( "Schema load failed : " + Exceptions.printErrors(errors) );
+ throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
}
}
@@ -108,14 +108,16 @@ public class DhcpServerConfigReaderTest
configPartition.setPartitionPath( new File( configFile ).toURI() );
configPartition.setSuffixDn( new Dn( "ou=config" ) );
configPartition.setSchemaManager( schemaManager );
-
+
configPartition.initialize();
ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
-
- ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager, "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_DHCP_SERVER_OC.getValue() );
+
+ ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager,
+ "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_DHCP_SERVER_OC
+ .getValue() );
assertNotNull( configBean );
- DhcpServerBean dhcpServerBean = (DhcpServerBean)configBean.getDirectoryServiceBeans().get( 0 );
+ DhcpServerBean dhcpServerBean = ( DhcpServerBean ) configBean.getDirectoryServiceBeans().get( 0 );
assertNotNull( dhcpServerBean );
configPartition.destroy();
Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/DnsServerConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/DnsServerConfigReaderTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/DnsServerConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/DnsServerConfigReaderTest.java Tue Jan 24 16:22:33 2012
@@ -69,7 +69,7 @@ public class DnsServerConfigReaderTest
String workingDirectory = workDir.getPath();
// Extract the schema on disk (a brand new one) and load the registries
File schemaRepository = new File( workingDirectory, "schema" );
-
+
if ( schemaRepository.exists() )
{
FileUtils.deleteDirectory( schemaRepository );
@@ -90,7 +90,7 @@ public class DnsServerConfigReaderTest
if ( errors.size() != 0 )
{
- throw new Exception( "Schema load failed : " + Exceptions.printErrors(errors) );
+ throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
}
}
@@ -106,14 +106,16 @@ public class DnsServerConfigReaderTest
configPartition.setPartitionPath( new File( configFile ).toURI() );
configPartition.setSuffixDn( new Dn( "ou=config" ) );
configPartition.setSchemaManager( schemaManager );
-
+
configPartition.initialize();
ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
-
- ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager, "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_DNS_SERVER_OC.getValue() );
+
+ ConfigBean configBean = cpReader
+ .readConfig( new Dn( schemaManager, "ou=servers,ads-directoryServiceId=default,ou=config" ),
+ ConfigSchemaConstants.ADS_DNS_SERVER_OC.getValue() );
assertNotNull( configBean );
- DnsServerBean dnsServerBean = (DnsServerBean)configBean.getDirectoryServiceBeans().get( 0 );
+ DnsServerBean dnsServerBean = ( DnsServerBean ) configBean.getDirectoryServiceBeans().get( 0 );
assertNotNull( dnsServerBean );
configPartition.destroy();
Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/HttpServerConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/HttpServerConfigReaderTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/HttpServerConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/HttpServerConfigReaderTest.java Tue Jan 24 16:22:33 2012
@@ -69,7 +69,7 @@ public class HttpServerConfigReaderTest
String workingDirectory = workDir.getPath();
// Extract the schema on disk (a brand new one) and load the registries
File schemaRepository = new File( workingDirectory, "schema" );
-
+
if ( schemaRepository.exists() )
{
FileUtils.deleteDirectory( schemaRepository );
@@ -90,7 +90,7 @@ public class HttpServerConfigReaderTest
if ( errors.size() != 0 )
{
- throw new Exception( "Schema load failed : " + Exceptions.printErrors(errors) );
+ throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
}
}
@@ -106,15 +106,17 @@ public class HttpServerConfigReaderTest
configPartition.setPartitionPath( new File( configFile ).toURI() );
configPartition.setSuffixDn( new Dn( "ou=config" ) );
configPartition.setSchemaManager( schemaManager );
-
+
configPartition.initialize();
-
+
ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
-
- ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager, "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_HTTP_SERVER_OC.getValue() );
+
+ ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager,
+ "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_HTTP_SERVER_OC
+ .getValue() );
assertNotNull( configBean );
- HttpServerBean httpServerBean = (HttpServerBean)configBean.getDirectoryServiceBeans().get( 0 );
+ HttpServerBean httpServerBean = ( HttpServerBean ) configBean.getDirectoryServiceBeans().get( 0 );
assertNotNull( httpServerBean );
configPartition.destroy();
Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/KerberosServerConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/KerberosServerConfigReaderTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/KerberosServerConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/KerberosServerConfigReaderTest.java Tue Jan 24 16:22:33 2012
@@ -70,7 +70,7 @@ public class KerberosServerConfigReaderT
String workingDirectory = workDir.getPath();
// Extract the schema on disk (a brand new one) and load the registries
File schemaRepository = new File( workingDirectory, "schema" );
-
+
if ( schemaRepository.exists() )
{
FileUtils.deleteDirectory( schemaRepository );
@@ -91,7 +91,7 @@ public class KerberosServerConfigReaderT
if ( errors.size() != 0 )
{
- throw new Exception( "Schema load failed : " + Exceptions.printErrors(errors) );
+ throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
}
}
@@ -107,14 +107,16 @@ public class KerberosServerConfigReaderT
configPartition.setPartitionPath( new File( configFile ).toURI() );
configPartition.setSuffixDn( new Dn( "ou=config" ) );
configPartition.setSchemaManager( schemaManager );
-
+
configPartition.initialize();
ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
-
- ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager, "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_KERBEROS_SERVER_OC.getValue() );
+
+ ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager,
+ "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_KERBEROS_SERVER_OC
+ .getValue() );
assertNotNull( configBean );
- KdcServerBean kdcServerBean = (KdcServerBean)configBean.getDirectoryServiceBeans().get( 0 );
+ KdcServerBean kdcServerBean = ( KdcServerBean ) configBean.getDirectoryServiceBeans().get( 0 );
assertNotNull( kdcServerBean );
configPartition.destroy();
Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/LdapServerConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/LdapServerConfigReaderTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/LdapServerConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/LdapServerConfigReaderTest.java Tue Jan 24 16:22:33 2012
@@ -70,7 +70,7 @@ public class LdapServerConfigReaderTest
String workingDirectory = workDir.getPath();
// Extract the schema on disk (a brand new one) and load the registries
File schemaRepository = new File( workingDirectory, "schema" );
-
+
if ( schemaRepository.exists() )
{
FileUtils.deleteDirectory( schemaRepository );
@@ -91,7 +91,7 @@ public class LdapServerConfigReaderTest
if ( errors.size() != 0 )
{
- throw new Exception( "Schema load failed : " + Exceptions.printErrors(errors) );
+ throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
}
}
@@ -107,14 +107,16 @@ public class LdapServerConfigReaderTest
configPartition.setPartitionPath( new File( configFile ).toURI() );
configPartition.setSuffixDn( new Dn( "ou=config" ) );
configPartition.setSchemaManager( schemaManager );
-
+
configPartition.initialize();
ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
-
- ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager, "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_LDAP_SERVER_OC.getValue() );
+
+ ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager,
+ "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_LDAP_SERVER_OC
+ .getValue() );
assertNotNull( configBean );
- LdapServerBean ldapServerBean = (LdapServerBean)configBean.getDirectoryServiceBeans().get( 0 );
+ LdapServerBean ldapServerBean = ( LdapServerBean ) configBean.getDirectoryServiceBeans().get( 0 );
assertNotNull( ldapServerBean );
configPartition.destroy();
Modified: directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/NtpServerConfigReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/NtpServerConfigReaderTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/NtpServerConfigReaderTest.java (original)
+++ directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/NtpServerConfigReaderTest.java Tue Jan 24 16:22:33 2012
@@ -69,7 +69,7 @@ public class NtpServerConfigReaderTest
String workingDirectory = workDir.getPath();
// Extract the schema on disk (a brand new one) and load the registries
File schemaRepository = new File( workingDirectory, "schema" );
-
+
if ( schemaRepository.exists() )
{
FileUtils.deleteDirectory( schemaRepository );
@@ -90,7 +90,7 @@ public class NtpServerConfigReaderTest
if ( errors.size() != 0 )
{
- throw new Exception( "Schema load failed : " + Exceptions.printErrors(errors) );
+ throw new Exception( "Schema load failed : " + Exceptions.printErrors( errors ) );
}
}
@@ -106,14 +106,16 @@ public class NtpServerConfigReaderTest
configPartition.setPartitionPath( new File( configFile ).toURI() );
configPartition.setSuffixDn( new Dn( "ou=config" ) );
configPartition.setSchemaManager( schemaManager );
-
+
configPartition.initialize();
ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
-
- ConfigBean configBean = cpReader.readConfig( new Dn( schemaManager, "ou=servers,ads-directoryServiceId=default,ou=config" ), ConfigSchemaConstants.ADS_NTP_SERVER_OC.getValue() );
+
+ ConfigBean configBean = cpReader
+ .readConfig( new Dn( schemaManager, "ou=servers,ads-directoryServiceId=default,ou=config" ),
+ ConfigSchemaConstants.ADS_NTP_SERVER_OC.getValue() );
assertNotNull( configBean );
- NtpServerBean ntpServerBean = (NtpServerBean)configBean.getDirectoryServiceBeans().get( 0 );
+ NtpServerBean ntpServerBean = ( NtpServerBean ) configBean.getDirectoryServiceBeans().get( 0 );
assertNotNull( ntpServerBean );
configPartition.destroy();
Modified: directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java (original)
+++ directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java Tue Jan 24 16:22:33 2012
@@ -84,7 +84,7 @@ public class ServerIntegrationUtils exte
env.put( Context.SECURITY_PRINCIPAL, principalDn );
env.put( Context.SECURITY_CREDENTIALS, password );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
-
+
return new InitialLdapContext( env, null );
}
@@ -107,7 +107,7 @@ public class ServerIntegrationUtils exte
env.put( Context.SECURITY_PRINCIPAL, ServerDNConstants.ADMIN_SYSTEM_DN );
env.put( Context.SECURITY_CREDENTIALS, "secret" );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
- return new InitialLdapContext( env, JndiUtils.toJndiControls(
+ return new InitialLdapContext( env, JndiUtils.toJndiControls(
ldapServer.getDirectoryService().getLdapCodecService(), controls ) );
}
@@ -206,7 +206,7 @@ public class ServerIntegrationUtils exte
LdapConnection conn = new LdapNetworkConnection( host, port );
conn.bind( admin, password );
-
+
return conn;
}
@@ -236,7 +236,7 @@ public class ServerIntegrationUtils exte
LDAPConnection conn = new LDAPConnection();
conn.connect( 3, host, port, admin, password );
-
+
return conn;
}
@@ -255,7 +255,7 @@ public class ServerIntegrationUtils exte
{
LdapConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
connection.bind( principalDn, password );
-
+
return connection;
}
@@ -270,7 +270,7 @@ public class ServerIntegrationUtils exte
public static LdapConnection getLdapConnection( LdapServer ldapServer ) throws Exception
{
LdapConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
-
+
return connection;
}
@@ -289,7 +289,7 @@ public class ServerIntegrationUtils exte
{
LDAPConnection connection = new LDAPConnection();
connection.connect( 3, "localhost", ldapServer.getPort(), principalDn, password );
-
+
return connection;
}
@@ -305,7 +305,7 @@ public class ServerIntegrationUtils exte
{
LdapConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
connection.bind( ServerDNConstants.ADMIN_SYSTEM_DN, "secret" );
-
+
return connection;
}
}
Modified: directory/apacheds/trunk/server-integ/src/test/java/MultiThreadedTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/MultiThreadedTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/MultiThreadedTest.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/MultiThreadedTest.java Tue Jan 24 16:22:33 2012
@@ -36,54 +36,62 @@ import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.SimpleLayout;
+
//import com.telelogic.tds.common.TDSConstants;
//import com.telelogic.tds.common.TDSProperties;
//import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
-public class MultiThreadedTest extends Thread {
+public class MultiThreadedTest extends Thread
+{
private Logger _logger;
private FileAppender _appender;
- public MultiThreadedTest(int i) {
+ public MultiThreadedTest( int i )
+ {
super();
- this.setName("Worker-Thread" + i);
+ this.setName( "Worker-Thread" + i );
}
+
@Override
- public void run() {
+ public void run()
+ {
- try {
- _logger = Logger.getLogger(this.getName());
+ try
+ {
+ _logger = Logger.getLogger( this.getName() );
_appender =
- new FileAppender(new SimpleLayout(), "C:\\threadlog\\"
- + this.getName() + ".txt", false);
- _logger.addAppender(_appender);
- _logger.setLevel((Level) Level.ERROR);
+ new FileAppender( new SimpleLayout(), "C:\\threadlog\\"
+ + this.getName() + ".txt", false );
+ _logger.addAppender( _appender );
+ _logger.setLevel( ( Level ) Level.ERROR );
LdapContext tdsContext = getContext();
LdapContext cntx;
// Create the initial context
Map<String, Object> hMap = new HashMap<String, Object>();
- hMap.put("data", "dsfdfd");
+ hMap.put( "data", "dsfdfd" );
// authenticate user
- for (int i = 0; i < 100000; i++) {
+ for ( int i = 0; i < 100000; i++ )
+ {
if ( i % 100 == 0 )
{
System.out.println( "Thread[" + getName() + "]:" + i );
}
- try {
+ try
+ {
//System.out.println(" Ops started " + getName());
- cntx = tdsContext.newInstance(null);
+ cntx = tdsContext.newInstance( null );
- setUserPreferences(cntx, "adsadminPref_" + getName(), hMap,
- i);
+ setUserPreferences( cntx, "adsadminPref_" + getName(), hMap,
+ i );
/*System.out.println(" Preferences SET "
+ getName()
@@ -98,121 +106,152 @@ public class MultiThreadedTest extends T
//System.out.println(" Ops conducted successfully "
// + getName());
- } catch (NamingException e) {
+ }
+ catch ( NamingException e )
+ {
//System.out.println(new Date() + " NAMING EXCETPION"
// + getName() + " " + getId());
- _logger.log(Level.ERROR, this.getName() + " : loop " + i);
+ _logger.log( Level.ERROR, this.getName() + " : loop " + i );
break;
//e.printStackTrace();
- } catch (Exception ex) {
+ }
+ catch ( Exception ex )
+ {
//System.out.println(new Date() + " NAMING EXCETPION"
// + getName() + " " + getId());
- _logger.log(Level.ERROR, this.getName() + " : loop " + i);
+ _logger.log( Level.ERROR, this.getName() + " : loop " + i );
break;
//ex.printStackTrace();
}
//Thread.sleep(delay);
}
- } catch (Throwable e) {
+ }
+ catch ( Throwable e )
+ {
e.printStackTrace();
}
-
- System.out.println( "Thread[" + getName() + "] ended at " + (System.currentTimeMillis() % 1000 ) );
-
+
+ System.out.println( "Thread[" + getName() + "] ended at " + ( System.currentTimeMillis() % 1000 ) );
+
}
- public static String getStackTrace(Throwable t) {
+
+ public static String getStackTrace( Throwable t )
+ {
StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw, true);
- t.printStackTrace(pw);
+ PrintWriter pw = new PrintWriter( sw, true );
+ t.printStackTrace( pw );
pw.flush();
sw.flush();
return sw.toString();
}
- private static LdapContext getContext() {
+
+ private static LdapContext getContext()
+ {
Hashtable<String, String> env = new Hashtable<String, String>();
LdapContext context = null;
String adminName = "uid=admin,ou=system";
String adminPassword = "secret";
- env.put(Context.INITIAL_CONTEXT_FACTORY,
- "com.sun.jndi.ldap.LdapCtxFactory");
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, adminName);
- env.put(Context.SECURITY_CREDENTIALS, adminPassword);
+ env.put( Context.INITIAL_CONTEXT_FACTORY,
+ "com.sun.jndi.ldap.LdapCtxFactory" );
+ env.put( Context.SECURITY_AUTHENTICATION, "simple" );
+ env.put( Context.SECURITY_PRINCIPAL, adminName );
+ env.put( Context.SECURITY_CREDENTIALS, adminPassword );
//env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
- env.put(Context.PROVIDER_URL, "ldap://localhost:10389");
+ env.put( Context.PROVIDER_URL, "ldap://localhost:10389" );
//env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
// .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
- env.put("com.sun.jndi.ldap.connect.pool", "true");
+ env.put( "com.sun.jndi.ldap.connect.pool", "true" );
- try {
- context = new InitialLdapContext(env, null);
- } catch (NamingException ne) {
- System.exit(1);
+ try
+ {
+ context = new InitialLdapContext( env, null );
+ }
+ catch ( NamingException ne )
+ {
+ System.exit( 1 );
}
return context;
}
- public void setUserPreferences(LdapContext context, String userName,
- Map<String, Object> attributes, int count) throws NamingException {
+
+ public void setUserPreferences( LdapContext context, String userName,
+ Map<String, Object> attributes, int count ) throws NamingException
+ {
LdapContext derivedContext = context;
String bindOp = "cn=" + userName + "," + "ou=system";
- try {
+ try
+ {
- try {
+ try
+ {
// Step 1: Unbind the user preferences data
//System.out.println("Unbind[" + count + "]" + bindOp);
- _logger.info("Unbind[" + count + "]" + bindOp);
- derivedContext.unbind(bindOp);
- } catch (CommunicationException ce) {
- System.out.println("Trying to re-connect to RDS");
- _logger.info("Trying to re-connect to RDS");
+ _logger.info( "Unbind[" + count + "]" + bindOp );
+ derivedContext.unbind( bindOp );
+ }
+ catch ( CommunicationException ce )
+ {
+ System.out.println( "Trying to re-connect to RDS" );
+ _logger.info( "Trying to re-connect to RDS" );
//Impl reconnect logic
- } catch (NameNotFoundException nnf) {
- System.out.println("User: " + userName
- + " cannot be found in the Ldap server");
- _logger.info("User: " + userName
- + " cannot be found in the Ldap server");
+ }
+ catch ( NameNotFoundException nnf )
+ {
+ System.out.println( "User: " + userName
+ + " cannot be found in the Ldap server" );
+ _logger.info( "User: " + userName
+ + " cannot be found in the Ldap server" );
}
- try {
+ try
+ {
// Step 2: Bind the user preferences data
//System.out.println("Bind[" + count + "]" + bindOp);
- derivedContext.bind(bindOp, attributes);
- } catch (CommunicationException ce) {
- System.out.println("Trying to re-connect to RDS");
- } catch (NameAlreadyBoundException nab) {
- System.out.println("User: " + userName
- + " already exists in the Ldap server");
+ derivedContext.bind( bindOp, attributes );
+ }
+ catch ( CommunicationException ce )
+ {
+ System.out.println( "Trying to re-connect to RDS" );
+ }
+ catch ( NameAlreadyBoundException nab )
+ {
+ System.out.println( "User: " + userName
+ + " already exists in the Ldap server" );
}
//derivedContext.rebind(bindOp, attributes);
- } catch (NamingException ne) {
+ }
+ catch ( NamingException ne )
+ {
//System.out.println("Could not set user profile for user: "
// + userName);
//ne.printStackTrace();
- _logger.log(Level.ERROR, count);
+ _logger.log( Level.ERROR, count );
throw ne;
}
}
+
/**
* @param args
*/
- public static void main(String[] args) {
+ public static void main( String[] args )
+ {
Thread t1 = null;
-
+
System.out.println( System.currentTimeMillis() % 1000 );
- for (int i = 0; i < 20; ++i) {
- t1 = new MultiThreadedTest(i);
+ for ( int i = 0; i < 20; ++i )
+ {
+ t1 = new MultiThreadedTest( i );
t1.start();
}
}
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/IndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/IndexTest.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/IndexTest.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/IndexTest.java Tue Jan 24 16:22:33 2012
@@ -19,6 +19,7 @@
*/
package org.apache.directory;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -44,13 +45,11 @@ import org.junit.BeforeClass;
import org.junit.Test;
-
-
public class IndexTest
{
private static File dbFileDir;
private static SchemaManager schemaManager;
-
+
private JdbmIndex<String, Entry> jdbmIndex;
private AvlIndex<String, Entry> avlIndex;
@@ -77,7 +76,7 @@ public class IndexTest
if ( !loaded )
{
- fail( "Schema load failed : " + Exceptions.printErrors(schemaManager.getErrors()) );
+ fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
}
}
@@ -90,61 +89,65 @@ public class IndexTest
tmpIndexFile.deleteOnExit();
dbFileDir = new File( tmpIndexFile.getParentFile(), IndexTest.class.getSimpleName() );
dbFileDir.mkdirs();
-
+
AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OU_AT );
jdbmIndex = new JdbmIndex<String, Entry>();
jdbmIndex.setWkDirPath( dbFileDir.toURI() );
jdbmIndex.init( schemaManager, attributeType );
-
+
avlIndex = new AvlIndex<String, Entry>();
avlIndex.init( schemaManager, attributeType );
}
+
@Test
public void testAvlIndex() throws Exception
{
doTest( avlIndex );
}
+
@Test
public void testJdbmIndex() throws Exception
{
doTest( jdbmIndex );
}
-
- private void doTest(Index<String, Entry, Long> idx) throws Exception
+
+
+ private void doTest( Index<String, Entry, Long> idx ) throws Exception
{
String alphabet = "abcdefghijklmnopqrstuvwxyz";
for ( long i = 0L; i < 26L; i++ )
{
- String val = alphabet.substring( (int)i, (int)(i+1) );
+ String val = alphabet.substring( ( int ) i, ( int ) ( i + 1 ) );
idx.add( val, i + 1 );
}
assertEquals( 26, idx.count() );
-
+
IndexCursor<String, Entry, Long> cursor1 = idx.forwardCursor();
cursor1.beforeFirst();
- assertHasNext(cursor1, 1L);
- assertHasNext(cursor1, 2L);
-
+ assertHasNext( cursor1, 1L );
+ assertHasNext( cursor1, 2L );
+
idx.drop( "c", 3L );
for ( long i = 4L; i < 27L; i++ )
{
- assertHasNext(cursor1, i);
+ assertHasNext( cursor1, i );
}
-
- assertFalse(cursor1.next());
+
+ assertFalse( cursor1.next() );
}
+
private void assertHasNext( IndexCursor<String, Entry, Long> cursor1, long expectedId ) throws Exception
{
- assertTrue(cursor1.next());
+ assertTrue( cursor1.next() );
//System.out.println(cursor1.get());
- assertEquals(expectedId, cursor1.get().getId().longValue());
+ assertEquals( expectedId, cursor1.get().getId().longValue() );
}
}
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointAddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointAddIT.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointAddIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointAddIT.java Tue Jan 24 16:22:33 2012
@@ -130,295 +130,296 @@ import org.junit.runner.RunWith;
"ObjectClass: organizationalUnit",
"ou: entry",
""
- })
+})
public class AdministrativePointAddIT extends AbstractLdapTestUnit
{
- // The shared LDAP connection
- private static LdapConnection connection;
+// The shared LDAP connection
+private static LdapConnection connection;
- // A reference to the schema manager
- private static SchemaManager schemaManager;
+// A reference to the schema manager
+private static SchemaManager schemaManager;
- @Before
- public void init() throws Exception
- {
- connection = IntegrationUtils.getAdminConnection( getService() );
- schemaManager = getLdapServer().getDirectoryService().getSchemaManager();
- }
+@Before
+public void init() throws Exception
+{
+ connection = IntegrationUtils.getAdminConnection( getService() );
+ schemaManager = getLdapServer().getDirectoryService().getSchemaManager();
+}
- @After
- public void shutdown() throws Exception
- {
- connection.close();
- }
+@After
+public void shutdown() throws Exception
+{
+ connection.close();
+}
- private Attribute getAdminRole( String dn ) throws Exception
- {
- Entry lookup = connection.lookup( dn, "administrativeRole" );
- assertNotNull( lookup );
+private Attribute getAdminRole( String dn ) throws Exception
+{
+ Entry lookup = connection.lookup( dn, "administrativeRole" );
- return lookup.get( "administrativeRole" );
- }
+ assertNotNull( lookup );
+ return lookup.get( "administrativeRole" );
+}
- // -------------------------------------------------------------------
- // Test the Add operation
- // -------------------------------------------------------------------
- /**
- * Test the addition of IAPs
- */
- @Test
- public void testAddIAP() throws Exception
- {
- assertTrue( getLdapServer().isStarted() );
- // First check that we can't add an IAP in the DIT if there is no
- // parent AAP or SAP with the same role
- Entry entry = new DefaultEntry(
- "ou=IAP-CANew,ou=entry,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CANew",
- "administrativeRole: collectiveAttributeInnerArea"
- );
-
- try
- {
- connection.add( entry );
- fail();
- }
- catch ( LdapUnwillingToPerformException lutpe )
- {
- assertTrue( true );
- }
-
- // Add the entry under a SAP with the same role which has no parent AAP
- entry = new DefaultEntry(
- "ou=IAP-CANew,ou=SAP-CA2,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CANew",
- "administrativeRole: collectiveAttributeInnerArea"
+// -------------------------------------------------------------------
+// Test the Add operation
+// -------------------------------------------------------------------
+/**
+ * Test the addition of IAPs
+ */
+@Test
+public void testAddIAP() throws Exception
+{
+ assertTrue( getLdapServer().isStarted() );
+
+ // First check that we can't add an IAP in the DIT if there is no
+ // parent AAP or SAP with the same role
+ Entry entry = new DefaultEntry(
+ "ou=IAP-CANew,ou=entry,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CANew",
+ "administrativeRole: collectiveAttributeInnerArea"
);
+ try
+ {
connection.add( entry );
+ fail();
+ }
+ catch ( LdapUnwillingToPerformException lutpe )
+ {
+ assertTrue( true );
+ }
+
+ // Add the entry under a SAP with the same role which has no parent AAP
+ entry = new DefaultEntry(
+ "ou=IAP-CANew,ou=SAP-CA2,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CANew",
+ "administrativeRole: collectiveAttributeInnerArea"
+ );
+
+ connection.add( entry );
- // It should succeed
- assertTrue( connection.exists( "ou=IAP-CANew,ou=SAP-CA2,ou=system" ) );
+ // It should succeed
+ assertTrue( connection.exists( "ou=IAP-CANew,ou=SAP-CA2,ou=system" ) );
- // Add the entry under a SAP with a different role which has no parent AAP
- entry = new DefaultEntry(
- "ou=IAP-CANew,ou=SAP-AC2,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CANew",
- "administrativeRole: collectiveAttributeInnerArea"
- );
-
- try
- {
- connection.add( entry );
- fail();
- }
- catch ( LdapUnwillingToPerformException lutpe )
- {
- assertTrue( true );
- }
-
- // Add the entry under an AAP
- entry = new DefaultEntry(
- "ou=IAP-CANew,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CANew",
- "administrativeRole: collectiveAttributeInnerArea"
- );
+ // Add the entry under a SAP with a different role which has no parent AAP
+ entry = new DefaultEntry(
+ "ou=IAP-CANew,ou=SAP-AC2,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CANew",
+ "administrativeRole: collectiveAttributeInnerArea"
+ );
+ try
+ {
connection.add( entry );
+ fail();
+ }
+ catch ( LdapUnwillingToPerformException lutpe )
+ {
+ assertTrue( true );
+ }
- // It should succeed
- assertTrue( connection.exists( "ou=IAP-CANew,ou=AAP1,ou=system" ) );
+ // Add the entry under an AAP
+ entry = new DefaultEntry(
+ "ou=IAP-CANew,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CANew",
+ "administrativeRole: collectiveAttributeInnerArea"
+ );
- // Add the entry under an IAP with the same role which has a parent AAP
- entry = new DefaultEntry(
- "ou=IAP-CANew,ou=IAP-CA1,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CANew",
- "administrativeRole: collectiveAttributeInnerArea"
- );
+ connection.add( entry );
- connection.add( entry );
+ // It should succeed
+ assertTrue( connection.exists( "ou=IAP-CANew,ou=AAP1,ou=system" ) );
- // It should succeed
- assertTrue( connection.exists( "ou=IAP-CANew,ou=IAP-CA1,ou=AAP1,ou=system" ) );
+ // Add the entry under an IAP with the same role which has a parent AAP
+ entry = new DefaultEntry(
+ "ou=IAP-CANew,ou=IAP-CA1,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CANew",
+ "administrativeRole: collectiveAttributeInnerArea"
+ );
- // Add the entry under an IAP with a different role which has a parent AAP
- entry = new DefaultEntry(
- "ou=IAP-CANew,ou=IAP-AC1,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CANew",
- "administrativeRole: collectiveAttributeInnerArea"
- );
+ connection.add( entry );
- connection.add( entry );
+ // It should succeed
+ assertTrue( connection.exists( "ou=IAP-CANew,ou=IAP-CA1,ou=AAP1,ou=system" ) );
+
+ // Add the entry under an IAP with a different role which has a parent AAP
+ entry = new DefaultEntry(
+ "ou=IAP-CANew,ou=IAP-AC1,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CANew",
+ "administrativeRole: collectiveAttributeInnerArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=IAP-CANew,ou=IAP-AC1,ou=AAP1,ou=system" ) );
+ connection.add( entry );
- // Add the entry under an SAP with the same role which has a parent AAP
- entry = new DefaultEntry(
- "ou=IAP-CANew,ou=SAP-CA1,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CANew",
- "administrativeRole: collectiveAttributeInnerArea"
- );
+ // It should succeed
+ assertTrue( connection.exists( "ou=IAP-CANew,ou=IAP-AC1,ou=AAP1,ou=system" ) );
- connection.add( entry );
+ // Add the entry under an SAP with the same role which has a parent AAP
+ entry = new DefaultEntry(
+ "ou=IAP-CANew,ou=SAP-CA1,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CANew",
+ "administrativeRole: collectiveAttributeInnerArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=IAP-CANew,ou=SAP-CA1,ou=AAP1,ou=system" ) );
+ connection.add( entry );
- // Add the entry under an SAP with a different role which has a parent AAP
- entry = new DefaultEntry(
- "ou=IAP-CANew,ou=SAP-AC1,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CANew",
- "administrativeRole: collectiveAttributeInnerArea"
- );
+ // It should succeed
+ assertTrue( connection.exists( "ou=IAP-CANew,ou=SAP-CA1,ou=AAP1,ou=system" ) );
- connection.add( entry );
+ // Add the entry under an SAP with a different role which has a parent AAP
+ entry = new DefaultEntry(
+ "ou=IAP-CANew,ou=SAP-AC1,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CANew",
+ "administrativeRole: collectiveAttributeInnerArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=IAP-CANew,ou=SAP-AC1,ou=AAP1,ou=system" ) );
- }
+ connection.add( entry );
+ // It should succeed
+ assertTrue( connection.exists( "ou=IAP-CANew,ou=SAP-AC1,ou=AAP1,ou=system" ) );
+}
- /**
- * Test the addition of SAPs
- */
- @Test
- public void testAddSAP() throws Exception
- {
- assertTrue( getLdapServer().isStarted() );
- // First check that we can add a SAP in the DIT if there is no
- // parent AAP or SAP
- Entry entry = new DefaultEntry(
- "ou=SAP-CANew,ou=entry,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CANew",
- "administrativeRole: collectiveAttributeSpecificArea"
- );
+/**
+ * Test the addition of SAPs
+ */
+@Test
+public void testAddSAP() throws Exception
+{
+ assertTrue( getLdapServer().isStarted() );
- connection.add( entry );
+ // First check that we can add a SAP in the DIT if there is no
+ // parent AAP or SAP
+ Entry entry = new DefaultEntry(
+ "ou=SAP-CANew,ou=entry,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CANew",
+ "administrativeRole: collectiveAttributeSpecificArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=SAP-CANew,ou=entry,ou=system" ) );
+ connection.add( entry );
- // Add the entry under a SAP with the same role which has no parent AAP
- entry = new DefaultEntry(
- "ou=SAP-CANew,ou=SAP-CA2,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CANew",
- "administrativeRole: collectiveAttributeSpecificArea"
- );
+ // It should succeed
+ assertTrue( connection.exists( "ou=SAP-CANew,ou=entry,ou=system" ) );
- connection.add( entry );
+ // Add the entry under a SAP with the same role which has no parent AAP
+ entry = new DefaultEntry(
+ "ou=SAP-CANew,ou=SAP-CA2,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CANew",
+ "administrativeRole: collectiveAttributeSpecificArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=SAP-CANew,ou=SAP-CA2,ou=system" ) );
+ connection.add( entry );
- // Add the entry under a SAP with a different role which has no parent AAP
- entry = new DefaultEntry(
- "ou=SAP-CANew,ou=SAP-AC2,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CANew",
- "administrativeRole: collectiveAttributeSpecificArea"
- );
+ // It should succeed
+ assertTrue( connection.exists( "ou=SAP-CANew,ou=SAP-CA2,ou=system" ) );
- connection.add( entry );
+ // Add the entry under a SAP with a different role which has no parent AAP
+ entry = new DefaultEntry(
+ "ou=SAP-CANew,ou=SAP-AC2,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CANew",
+ "administrativeRole: collectiveAttributeSpecificArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=SAP-CANew,ou=SAP-AC2,ou=system" ) );
+ connection.add( entry );
- // Add the entry under an AAP
- entry = new DefaultEntry(
- "ou=SAP-CANew,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CANew",
- "administrativeRole: collectiveAttributeSpecificArea"
- );
+ // It should succeed
+ assertTrue( connection.exists( "ou=SAP-CANew,ou=SAP-AC2,ou=system" ) );
- connection.add( entry );
+ // Add the entry under an AAP
+ entry = new DefaultEntry(
+ "ou=SAP-CANew,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CANew",
+ "administrativeRole: collectiveAttributeSpecificArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=SAP-CANew,ou=AAP1,ou=system" ) );
+ connection.add( entry );
- // Add the entry under an IAP with the same role which has a parent AAP
- entry = new DefaultEntry(
- "ou=SAP-CANew,ou=IAP-CA1,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CANew",
- "administrativeRole: collectiveAttributeSpecificArea"
- );
+ // It should succeed
+ assertTrue( connection.exists( "ou=SAP-CANew,ou=AAP1,ou=system" ) );
- connection.add( entry );
+ // Add the entry under an IAP with the same role which has a parent AAP
+ entry = new DefaultEntry(
+ "ou=SAP-CANew,ou=IAP-CA1,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CANew",
+ "administrativeRole: collectiveAttributeSpecificArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=SAP-CANew,ou=IAP-CA1,ou=AAP1,ou=system" ) );
+ connection.add( entry );
- // Add the entry under an IAP with a different role which has a parent AAP
- entry = new DefaultEntry(
- "ou=SAP-CANew,ou=IAP-AC1,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CANew",
- "administrativeRole: collectiveAttributeSpecificArea"
- );
+ // It should succeed
+ assertTrue( connection.exists( "ou=SAP-CANew,ou=IAP-CA1,ou=AAP1,ou=system" ) );
- connection.add( entry );
+ // Add the entry under an IAP with a different role which has a parent AAP
+ entry = new DefaultEntry(
+ "ou=SAP-CANew,ou=IAP-AC1,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CANew",
+ "administrativeRole: collectiveAttributeSpecificArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=SAP-CANew,ou=IAP-AC1,ou=AAP1,ou=system" ) );
+ connection.add( entry );
- // Add the entry under an SAP with the same role which has a parent AAP
- entry = new DefaultEntry(
- "ou=SAP-CANew,ou=SAP-CA1,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CANew",
- "administrativeRole: collectiveAttributeSpecificArea"
- );
+ // It should succeed
+ assertTrue( connection.exists( "ou=SAP-CANew,ou=IAP-AC1,ou=AAP1,ou=system" ) );
- connection.add( entry );
+ // Add the entry under an SAP with the same role which has a parent AAP
+ entry = new DefaultEntry(
+ "ou=SAP-CANew,ou=SAP-CA1,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CANew",
+ "administrativeRole: collectiveAttributeSpecificArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=SAP-CANew,ou=SAP-CA1,ou=AAP1,ou=system" ) );
+ connection.add( entry );
- // Add the entry under an SAP with a different role which has a parent AAP
- entry = new DefaultEntry(
- "ou=SAP-CANew,ou=SAP-AC1,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CANew",
- "administrativeRole: collectiveAttributeSpecificArea"
- );
+ // It should succeed
+ assertTrue( connection.exists( "ou=SAP-CANew,ou=SAP-CA1,ou=AAP1,ou=system" ) );
- connection.add( entry );
+ // Add the entry under an SAP with a different role which has a parent AAP
+ entry = new DefaultEntry(
+ "ou=SAP-CANew,ou=SAP-AC1,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CANew",
+ "administrativeRole: collectiveAttributeSpecificArea"
+ );
- // It should succeed
- assertTrue( connection.exists( "ou=SAP-CANew,ou=SAP-AC1,ou=AAP1,ou=system" ) );
- }
+ connection.add( entry );
+
+ // It should succeed
+ assertTrue( connection.exists( "ou=SAP-CANew,ou=SAP-AC1,ou=AAP1,ou=system" ) );
+}
}
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointModifyDelIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointModifyDelIT.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointModifyDelIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointModifyDelIT.java Tue Jan 24 16:22:33 2012
@@ -112,83 +112,83 @@ import org.junit.runner.RunWith;
"ou: SAP-AC",
"administrativeRole: accessControlSpecificArea",
"",
- // Entry # 2
- "dn: ou=SAP-CA,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CA",
- "administrativeRole: collectiveAttributeSpecificArea",
- "",
- // Entry # 3
- "dn: ou=AAP,ou=SAP-CA,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: AAP",
- "administrativeRole: autonomousArea",
- "",
- // Entry # 4
- "dn: ou=IAP-CA,ou=AAP,ou=SAP-CA,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CA",
- "administrativeRole: collectiveAttributeInnerArea",
- "",
- // Entry # 5
- "dn: ou=IAP-AC,ou=AAP,ou=SAP-CA,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-AC",
- "administrativeRole: accessControlInnerArea",
- "",
- // Entry # 6
- "dn: ou=IAP-TE,ou=AAP,ou=SAP-CA,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-TE",
- "administrativeRole: triggerExecutionInnerArea",
- "",
- // Entry # 7
- "dn: ou=AAP,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: AAP",
- "administrativeRole: autonomousArea",
- "",
- // Entry # 8
- "dn: ou=AAP,ou=AAP,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: AAP",
- "administrativeRole: autonomousArea",
- "",
- // Entry # 9
- "dn: ou=SAP-AC,ou=AAP,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-AC",
- "administrativeRole: accessControlSpecificArea",
- "",
- // Entry # 10
- "dn: ou=SAP-CA,ou=AAP,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CA",
- "administrativeRole: collectiveAttributeSpecificArea",
- "",
- // Entry # 11
- "dn: ou=IAP-AC,ou=AAP,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-AC",
- "administrativeRole: accessControlInnerArea",
- "",
- // Entry # 12
- "dn: ou=IAP-CA,ou=AAP,ou=SAP-AC,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CA",
- "administrativeRole: collectiveAttributeInnerArea",
- "",
+ // Entry # 2
+ "dn: ou=SAP-CA,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CA",
+ "administrativeRole: collectiveAttributeSpecificArea",
+ "",
+ // Entry # 3
+ "dn: ou=AAP,ou=SAP-CA,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: AAP",
+ "administrativeRole: autonomousArea",
+ "",
+ // Entry # 4
+ "dn: ou=IAP-CA,ou=AAP,ou=SAP-CA,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CA",
+ "administrativeRole: collectiveAttributeInnerArea",
+ "",
+ // Entry # 5
+ "dn: ou=IAP-AC,ou=AAP,ou=SAP-CA,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-AC",
+ "administrativeRole: accessControlInnerArea",
+ "",
+ // Entry # 6
+ "dn: ou=IAP-TE,ou=AAP,ou=SAP-CA,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-TE",
+ "administrativeRole: triggerExecutionInnerArea",
+ "",
+ // Entry # 7
+ "dn: ou=AAP,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: AAP",
+ "administrativeRole: autonomousArea",
+ "",
+ // Entry # 8
+ "dn: ou=AAP,ou=AAP,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: AAP",
+ "administrativeRole: autonomousArea",
+ "",
+ // Entry # 9
+ "dn: ou=SAP-AC,ou=AAP,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-AC",
+ "administrativeRole: accessControlSpecificArea",
+ "",
+ // Entry # 10
+ "dn: ou=SAP-CA,ou=AAP,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CA",
+ "administrativeRole: collectiveAttributeSpecificArea",
+ "",
+ // Entry # 11
+ "dn: ou=IAP-AC,ou=AAP,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-AC",
+ "administrativeRole: accessControlInnerArea",
+ "",
+ // Entry # 12
+ "dn: ou=IAP-CA,ou=AAP,ou=SAP-AC,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CA",
+ "administrativeRole: collectiveAttributeInnerArea",
+ "",
// Entry # 13
"dn: ou=AAP,ou=system",
"ObjectClass: top",
@@ -196,34 +196,34 @@ import org.junit.runner.RunWith;
"ou: AAP",
"administrativeRole: autonomousArea",
"",
- // Entry # 14
- "dn: ou=AAP,ou=AAP,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: AAP",
- "administrativeRole: autonomousArea",
- "",
- // Entry # 15
- "dn: ou=AAP,ou=AAP,ou=AAP,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: AAP",
- "administrativeRole: autonomousArea",
- "",
- // Entry # 16
- "dn: ou=SAP-CA,ou=AAP,ou=AAP,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CA",
- "administrativeRole: collectiveAttributeSpecificArea",
- "",
- // Entry # 17
- "dn: ou=IAP-CA,ou=AAP,ou=AAP,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CA",
- "administrativeRole: collectiveAttributeInnerArea",
- "",
+ // Entry # 14
+ "dn: ou=AAP,ou=AAP,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: AAP",
+ "administrativeRole: autonomousArea",
+ "",
+ // Entry # 15
+ "dn: ou=AAP,ou=AAP,ou=AAP,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: AAP",
+ "administrativeRole: autonomousArea",
+ "",
+ // Entry # 16
+ "dn: ou=SAP-CA,ou=AAP,ou=AAP,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CA",
+ "administrativeRole: collectiveAttributeSpecificArea",
+ "",
+ // Entry # 17
+ "dn: ou=IAP-CA,ou=AAP,ou=AAP,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CA",
+ "administrativeRole: collectiveAttributeInnerArea",
+ "",
// Entry # 18
"dn: ou=AAP1,ou=system",
"ObjectClass: top",
@@ -231,106 +231,107 @@ import org.junit.runner.RunWith;
"ou: AAP1",
"administrativeRole: autonomousArea",
"",
- // Entry # 19
- "dn: ou=AAP,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: AAP",
- "administrativeRole: autonomousArea",
- "",
- // Entry # 20
- "dn: ou=SAP-CA,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: SAP-CA",
- "administrativeRole: collectiveAttributeSpecificArea",
- "",
- "",
- // Entry # 21
- "dn: ou=IAP-CA,ou=AAP1,ou=system",
- "ObjectClass: top",
- "ObjectClass: organizationalUnit",
- "ou: IAP-CA",
- "administrativeRole: collectiveAttributeInnerArea",
- ""
- })
+ // Entry # 19
+ "dn: ou=AAP,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: AAP",
+ "administrativeRole: autonomousArea",
+ "",
+ // Entry # 20
+ "dn: ou=SAP-CA,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: SAP-CA",
+ "administrativeRole: collectiveAttributeSpecificArea",
+ "",
+ "",
+ // Entry # 21
+ "dn: ou=IAP-CA,ou=AAP1,ou=system",
+ "ObjectClass: top",
+ "ObjectClass: organizationalUnit",
+ "ou: IAP-CA",
+ "administrativeRole: collectiveAttributeInnerArea",
+ ""
+})
public class AdministrativePointModifyDelIT extends AbstractLdapTestUnit
{
- // The shared LDAP connection
- private static LdapConnection connection;
+// The shared LDAP connection
+private static LdapConnection connection;
- // A reference to the schema manager
- private static SchemaManager schemaManager;
+// A reference to the schema manager
+private static SchemaManager schemaManager;
- @Before
- public void init() throws Exception
- {
- connection = IntegrationUtils.getAdminConnection( getService() );
- schemaManager = getLdapServer().getDirectoryService().getSchemaManager();
- }
+@Before
+public void init() throws Exception
+{
+ connection = IntegrationUtils.getAdminConnection( getService() );
+ schemaManager = getLdapServer().getDirectoryService().getSchemaManager();
+}
- @After
- public void shutdown() throws Exception
- {
- connection.close();
- }
+@After
+public void shutdown() throws Exception
+{
+ connection.close();
+}
- private Attribute getAdminRole( String dn ) throws Exception
- {
- Entry lookup = connection.lookup( dn, "administrativeRole" );
- assertNotNull( lookup );
+private Attribute getAdminRole( String dn ) throws Exception
+{
+ Entry lookup = connection.lookup( dn, "administrativeRole" );
- return lookup.get( "administrativeRole" );
- }
+ assertNotNull( lookup );
+ return lookup.get( "administrativeRole" );
+}
- // -------------------------------------------------------------------
- // Test the Delete operation
- // -------------------------------------------------------------------
- /**
- * Test the deletion of the AAP role
- */
- @Test
- @Ignore
- public void testModifyRemoveAAP() throws Exception
- {
- assertTrue( getLdapServer().isStarted() );
- // Remove the AAP
- Modification modification = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
- new DefaultAttribute( "administrativeRole" ) );
-
- try
- {
- connection.modify( "ou=AAP,ou=SAP-CA,ou=SAP-AC,ou=system", modification );
- fail();
- }
- catch ( LdapUnwillingToPerformException lutpe )
- {
- assertTrue( true );
- }
- }
+// -------------------------------------------------------------------
+// Test the Delete operation
+// -------------------------------------------------------------------
+/**
+ * Test the deletion of the AAP role
+ */
+@Test
+@Ignore
+public void testModifyRemoveAAP() throws Exception
+{
+ assertTrue( getLdapServer().isStarted() );
+ // Remove the AAP
+ Modification modification = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
+ new DefaultAttribute( "administrativeRole" ) );
- /**
- * Test the addition of SAPs
- */
- @Test
- public void testDeleteSAP() throws Exception
+ try
{
- assertTrue( getLdapServer().isStarted() );
+ connection.modify( "ou=AAP,ou=SAP-CA,ou=SAP-AC,ou=system", modification );
+ fail();
}
-
-
- /**
- * Test the deletion of IAPs
- */
- @Test
- public void testDeleteIAP() throws Exception
+ catch ( LdapUnwillingToPerformException lutpe )
{
- assertTrue( getLdapServer().isStarted() );
+ assertTrue( true );
}
}
+
+
+/**
+ * Test the addition of SAPs
+ */
+@Test
+public void testDeleteSAP() throws Exception
+{
+ assertTrue( getLdapServer().isStarted() );
+}
+
+
+/**
+ * Test the deletion of IAPs
+ */
+@Test
+public void testDeleteIAP() throws Exception
+{
+ assertTrue( getLdapServer().isStarted() );
+}
+}