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:42:46 UTC
svn commit: r1235347 [5/5] - in /directory/apacheds/trunk/core-integ/src:
main/java/org/apache/directory/server/core/integ/
test/java/org/apache/directory/server/core/admin/
test/java/org/apache/directory/server/core/authn/
test/java/org/apache/directo...
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Tue Jan 24 16:42:44 2012
@@ -108,7 +108,7 @@ public class SubschemaSubentryIT extends
private String subschemaSubentryDn;
private Entry subschemaSubentry;
-
+
@Before
public void init() throws Exception
{
@@ -120,7 +120,7 @@ public class SubschemaSubentryIT extends
subschemaSubentryDn = subschemaSubentryAT.getString();
updateSSSE();
}
-
+
/**
* Test for DIRSHARED-60.
@@ -157,7 +157,7 @@ public class SubschemaSubentryIT extends
*
* @throws NamingException on error
*/
- @Test( expected = LdapException.class )
+ @Test(expected = LdapException.class)
public void testSSSEDeleteRejection() throws Exception
{
connection.delete( subschemaSubentryDn );
@@ -170,7 +170,7 @@ public class SubschemaSubentryIT extends
*
* @throws NamingException on error
*/
- @Test( expected = LdapException.class )
+ @Test(expected = LdapException.class)
public void testSSSEAddRejection() throws Exception
{
connection.add( subschemaSubentry );
@@ -183,7 +183,7 @@ public class SubschemaSubentryIT extends
*
* @throws NamingException on error
*/
- @Test( expected = LdapException.class )
+ @Test(expected = LdapException.class)
public void testSSSERenameRejection() throws Exception
{
connection.rename( subschemaSubentryDn, "cn=schema,ou=system" );
@@ -579,7 +579,7 @@ public class SubschemaSubentryIT extends
else
{
entry = connection.lookup( "m-oid=" + oid + ",ou=normalizers,cn=" + schemaName + ",ou=schema" );
-
+
assertNull( entry );
}
@@ -688,7 +688,7 @@ public class SubschemaSubentryIT extends
// -------------------------------------------------------------------
// get the subschemaSubentry again
updateSSSE();
-
+
Attribute attrTypes = subschemaSubentry.get( "ldapSyntaxes" );
LdapSyntax ldapSyntax = null;
@@ -727,7 +727,7 @@ public class SubschemaSubentryIT extends
else
{
entry = connection.lookup( "m-oid=" + oid + ",ou=syntaxes,cn=" + schemaName + ",ou=schema" );
-
+
assertNull( entry );
}
@@ -889,7 +889,7 @@ public class SubschemaSubentryIT extends
else
{
entry = connection.lookup( "m-oid=" + oid + ",ou=matchingRules,cn=" + schemaName + ",ou=schema" );
-
+
assertNull( entry );
}
@@ -1052,7 +1052,7 @@ public class SubschemaSubentryIT extends
// -------------------------------------------------------------------
// get the subschemaSubentry again
updateSSSE();
-
+
Attribute attrTypes = subschemaSubentry.get( "attributeTypes" );
AttributeType attributeType = null;
@@ -1539,7 +1539,7 @@ public class SubschemaSubentryIT extends
else
{
entry = connection.lookup( "m-oid=" + oid + ",ou=objectClasses,cn=" + schemaName + ",ou=schema" );
-
+
assertNull( entry );
}
@@ -1820,7 +1820,7 @@ public class SubschemaSubentryIT extends
* @throws NamingException on error
*/
@Test
- @Ignore( "The test is failing when run in conjonction with other tests" )
+ @Ignore("The test is failing when run in conjonction with other tests")
// @TODO as we can't modify a schema element, the end of this test has been commented
public void testTimestampAndModifierUpdates() throws Exception, InterruptedException
{
@@ -1842,7 +1842,7 @@ public class SubschemaSubentryIT extends
Calendar cal = Calendar.getInstance( tz );
String modifyTimestampStr = modifyTimestampAttr.getString();
- Date modifyTimestamp = DateUtils.getDate(modifyTimestampStr);
+ Date modifyTimestamp = DateUtils.getDate( modifyTimestampStr );
Date currentTimestamp = cal.getTime();
assertFalse( modifyTimestamp.after( currentTimestamp ) );
@@ -1887,7 +1887,7 @@ public class SubschemaSubentryIT extends
"sn: bogus",
"cn: bogus user",
"userPassword: secret" );
-
+
connection.add( user );
// now let's get a context for this user
@@ -1979,11 +1979,12 @@ public class SubschemaSubentryIT extends
return new String( Base64.encode( out.toByteArray() ) );
}
-
-
+
+
private void updateSSSE() throws Exception
{
- subschemaSubentry = connection.lookup( subschemaSubentryDn, "*", "attributeTypes", "objectClasses", "ldapSyntaxes", "matchingRules",
+ subschemaSubentry = connection.lookup( subschemaSubentryDn, "*", "attributeTypes", "objectClasses",
+ "ldapSyntaxes", "matchingRules",
"syntaxCheckers", "normalizers", "comparators" );
}
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderIT.java Tue Jan 24 16:42:44 2012
@@ -47,8 +47,8 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
-@CreateDS( factory=DefaultDirectoryServiceFactory.class, name="LdapClassLoaderIT-class" )
+@RunWith(FrameworkRunner.class)
+@CreateDS(factory = DefaultDirectoryServiceFactory.class, name = "LdapClassLoaderIT-class")
public class LdapClassLoaderIT extends AbstractLdapTestUnit
{
private static final String HELLOWORLD_CLASS_BASE64 = "yv66vgAAADEAHQoABgAPCQAQABEIABIKABMAFAcAFQcAFgEABjxpbml0PgEAAygpV"
@@ -60,7 +60,7 @@ public class LdapClassLoaderIT extends A
+ "AAkAAAAdAAEAAQAAAAUqtwABsQAAAAEACgAAAAYAAQAAAAEACQALAAwAAQAJAAAAJQACAAEAAAA"
+ "JsgACEgO2AASxAAAAAQAKAAAACgACAAAABQAIAAYAAQANAAAAAgAO";
- private static final byte[] HELLOWORLD_CLASS_BYTES = Base64.decode(HELLOWORLD_CLASS_BASE64.toCharArray());
+ private static final byte[] HELLOWORLD_CLASS_BYTES = Base64.decode( HELLOWORLD_CLASS_BASE64.toCharArray() );
@Test
@@ -103,7 +103,7 @@ public class LdapClassLoaderIT extends A
Attribute objectClass = new BasicAttribute( "objectClass" );
objectClass.add( "top" );
objectClass.add( "javaContainer" );
-
+
// We need to ad this extensibleObject OC in order to avoid an error
// with the classLoaderDefaultSearchContext AT used later (no OC contains
// this AT)
@@ -114,7 +114,8 @@ public class LdapClassLoaderIT extends A
classLoaderDefaultSearchContextConfig.put( new BasicAttribute( "cn", "classLoaderDefaultSearchContext" ) );
// add a default search context to the configuration
- classLoaderDefaultSearchContextConfig.put( new BasicAttribute( "classLoaderDefaultSearchContext", "ou=system" ) );
+ classLoaderDefaultSearchContextConfig
+ .put( new BasicAttribute( "classLoaderDefaultSearchContext", "ou=system" ) );
// add the configuration entry to the DIT
ServerLdapContext configContext = ( ServerLdapContext ) defaultContext.lookup( "ou=configuration" );
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceIT.java Tue Jan 24 16:42:44 2012
@@ -53,8 +53,8 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
-@CreateDS( name="BadSubentryServiceIT-class" )
+@RunWith(FrameworkRunner.class)
+@CreateDS(name = "BadSubentryServiceIT-class")
public class BadSubentryServiceIT extends AbstractLdapTestUnit
{
@@ -84,8 +84,8 @@ public class BadSubentryServiceIT extend
subentry.put( "cn", cn );
return subentry;
}
-
-
+
+
public Attributes getAccessControlTestSubentry( String cn )
{
Attributes subentry = new BasicAttributes( true );
@@ -97,34 +97,34 @@ public class BadSubentryServiceIT extend
subentry.put( "subtreeSpecification", "{ }" );
subentry.put( "prescriptiveACI",
"{ " +
- "identificationTag \"alllUsersFullAccessACI\", " +
- "precedence 14, " +
- "authenticationLevel none, " +
- "itemOrUserFirst userFirst: " +
- "{ " +
- "userClasses " +
- "{ " +
+ "identificationTag \"alllUsersFullAccessACI\", " +
+ "precedence 14, " +
+ "authenticationLevel none, " +
+ "itemOrUserFirst userFirst: " +
+ "{ " +
+ "userClasses " +
+ "{ " +
"allUsers " +
- "}, " +
- "userPermissions " +
- "{ " +
- "{ " +
- "protectedItems " +
- "{ " +
- "entry, allUserAttributeTypesAndValues " +
- "}, " +
- "grantsAndDenials " +
- "{ " +
- "grantAdd, grantDiscloseOnError, grantRead, " +
- "grantRemove, grantBrowse, grantExport, grantImport, " +
- "grantModify, grantRename, grantReturnDN, " +
- "grantCompare, grantFilterMatch, grantInvoke " +
- "} " +
+ "}, " +
+ "userPermissions " +
+ "{ " +
+ "{ " +
+ "protectedItems " +
+ "{ " +
+ "entry, allUserAttributeTypesAndValues " +
+ "}, " +
+ "grantsAndDenials " +
+ "{ " +
+ "grantAdd, grantDiscloseOnError, grantRead, " +
+ "grantRemove, grantBrowse, grantExport, grantImport, " +
+ "grantModify, grantRename, grantReturnDN, " +
+ "grantCompare, grantFilterMatch, grantInvoke " +
+ "} " +
+ "} " +
"} " +
- "} " +
- "} " +
- "} "
- );
+ "} " +
+ "} "
+ );
subentry.put( "cn", cn );
return subentry;
}
@@ -137,7 +137,8 @@ public class BadSubentryServiceIT extend
attribute.add( "collectiveAttributeSpecificArea" );
attribute.add( "accessControlSpecificArea" );
ModificationItem item = new ModificationItem( DirContext.ADD_ATTRIBUTE, attribute );
- sysRoot.modifyAttributes( "", new ModificationItem[] { item } );
+ sysRoot.modifyAttributes( "", new ModificationItem[]
+ { item } );
}
@@ -147,18 +148,19 @@ public class BadSubentryServiceIT extend
Map<String, Attributes> resultMap = new HashMap<String, Attributes>();
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
- controls.setReturningAttributes( new String[] { "+", "*" } );
+ controls.setReturningAttributes( new String[]
+ { "+", "*" } );
NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=*)", controls );
-
+
while ( results.hasMore() )
{
SearchResult result = results.next();
resultMap.put( result.getName(), result.getAttributes() );
}
-
+
return resultMap;
}
-
+
@Test
public void testTrackingOfSubentryOperationals() throws Exception
@@ -170,33 +172,33 @@ public class BadSubentryServiceIT extend
sysRoot.createSubcontext( "cn=accessControlTestSubentry",
getAccessControlTestSubentry( "accessControlTestSubentry" ) );
sysRoot.createSubcontext( "cn=testEntry", getTestEntry( "testEntry" ) );
-
+
Map<String, Attributes> results = getAllEntries();
Attributes testEntry = results.get( "cn=testEntry,ou=system" );
-
+
//----------------------------------------------------------------------
-
+
Attribute collectiveAttributeSubentries = testEntry.get( "collectiveAttributeSubentries" );
-
+
assertTrue( collectiveAttributeSubentries.contains( "2.5.4.3=collectiveattributetestsubentry,2.5.4.11=system" ) );
-
- assertFalse( "'collectiveAttributeSubentries' operational attribute SHOULD NOT " +
- "contain references to non-'collectiveAttributeSubentry's like 'accessControlSubentry's",
+
+ assertFalse( "'collectiveAttributeSubentries' operational attribute SHOULD NOT " +
+ "contain references to non-'collectiveAttributeSubentry's like 'accessControlSubentry's",
collectiveAttributeSubentries.contains( "2.5.4.3=accesscontroltestsubentry,2.5.4.11=system" ) );
-
+
assertEquals( 1, collectiveAttributeSubentries.size() );
-
+
//----------------------------------------------------------------------
-
+
Attribute accessControlSubentries = testEntry.get( "accessControlSubentries" );
-
+
assertTrue( accessControlSubentries.contains( "2.5.4.3=accesscontroltestsubentry,2.5.4.11=system" ) );
-
- assertFalse( "'accessControlSubentries' operational attribute SHOULD NOT " +
- "contain references to non-'accessControlSubentry's like 'collectiveAttributeSubentry's",
+
+ assertFalse( "'accessControlSubentries' operational attribute SHOULD NOT " +
+ "contain references to non-'accessControlSubentry's like 'collectiveAttributeSubentry's",
accessControlSubentries.contains( "2.5.4.3=collectiveattributetestsubentry,2.5.4.11=system" ) );
-
+
assertEquals( 1, accessControlSubentries.size() );
-
+
}
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceEntryModificationHandlingIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceEntryModificationHandlingIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceEntryModificationHandlingIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceEntryModificationHandlingIT.java Tue Jan 24 16:42:44 2012
@@ -56,8 +56,8 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
-@CreateDS( factory=DefaultDirectoryServiceFactory.class, name="SubentryServiceEntryModificationHandlingIT-class" )
+@RunWith(FrameworkRunner.class)
+@CreateDS(factory = DefaultDirectoryServiceFactory.class, name = "SubentryServiceEntryModificationHandlingIT-class")
public class SubentryServiceEntryModificationHandlingIT extends AbstractLdapTestUnit
{
@@ -109,16 +109,16 @@ public class SubentryServiceEntryModific
controls.setReturningAttributes( new String[]
{ "+", "*" } );
NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=*)", controls );
-
+
while ( results.hasMore() )
{
SearchResult result = results.next();
resultMap.put( result.getName(), result.getAttributes() );
}
-
+
return resultMap;
}
-
+
@Test
public void testTrackingOfEntryModificationsInSubentryServiceModifyRoutine() throws Exception
@@ -140,10 +140,11 @@ public class SubentryServiceEntryModific
//----------------------------------------------------------------------
- Attribute attr = new BasicAttribute( "sn", "changedSn");
- ModificationItem mod = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, attr);
- ModificationItem[] mods = new ModificationItem[] { mod };
-
+ Attribute attr = new BasicAttribute( "sn", "changedSn" );
+ ModificationItem mod = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
+ ModificationItem[] mods = new ModificationItem[]
+ { mod };
+
sysRoot.modifyAttributes( "cn=testEntry", mods );
results = getAllEntries();
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java Tue Jan 24 16:42:44 2012
@@ -178,16 +178,20 @@ public class SubentryServiceIT extends A
{
private static final long serialVersionUID = -5773336005348321396L;
+
public boolean isCritical()
{
return false;
}
+
public byte[] getEncodedValue()
{
- return new byte[]{0x01, 0x01, (byte)0xFF};
+ return new byte[]
+ { 0x01, 0x01, ( byte ) 0xFF };
}
+
public String getID()
{
return "1.3.6.1.4.1.4203.1.10.1";
@@ -225,13 +229,13 @@ public class SubentryServiceIT extends A
public Entry getSubentry( String dn ) throws Exception
{
- Entry subentry = new DefaultEntry(
- dn,
- "objectClass: top",
+ Entry subentry = new DefaultEntry(
+ dn,
+ "objectClass: top",
"objectClass: subentry",
- "objectClass: collectiveAttributeSubentry",
+ "objectClass: collectiveAttributeSubentry",
"subtreeSpecification: { base \"ou=configuration\" }",
- "c-o: Test Org",
+ "c-o: Test Org",
"cn: testsubentry" );
return subentry;
@@ -256,7 +260,7 @@ public class SubentryServiceIT extends A
public Entry getTestSubentryWithExclusion( String dn ) throws LdapException
{
- Entry subentry = new DefaultEntry(
+ Entry subentry = new DefaultEntry(
dn,
"objectClass: top",
"objectClass: subentry",
@@ -264,7 +268,7 @@ public class SubentryServiceIT extends A
"subtreeSpecification: { base \"ou=configuration\", specificExclusions { chopBefore:\"cn=unmarked\" } }",
"c-o: Test Org",
"cn: testsubentry" );
-
+
return subentry;
}
@@ -408,13 +412,13 @@ public class SubentryServiceIT extends A
LdapConnection connection = IntegrationUtils.getAdminConnection( getService() );
// Add the subentry
- Entry subEntryA = new DefaultEntry(
+ Entry subEntryA = new DefaultEntry(
"cn=testsubentryA,dc=AP-A,dc=test,ou=system",
- "objectClass: top",
- "objectClass: subentry",
+ "objectClass: top",
+ "objectClass: subentry",
"objectClass: collectiveAttributeSubentry",
"subtreeSpecification: {}", // All the entry from the AP, including the AP
- "c-o: Test Org",
+ "c-o: Test Org",
"cn: testsubentryA" );
connection.add( subEntryA );
@@ -456,12 +460,12 @@ public class SubentryServiceIT extends A
// Add the subentry
Entry subEntryB = new DefaultEntry(
"cn=testsubentryB,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system",
- "objectClass: top",
- "objectClass: subentry",
+ "objectClass: top",
+ "objectClass: subentry",
"objectClass: collectiveAttributeSubentry",
"subtreeSpecification: {}", // All the entry from the AP, including the AP
- "c-o: Test Org",
- "cn: testsubentryB");
+ "c-o: Test Org",
+ "cn: testsubentryB" );
connection.add( subEntryB );
assertTrue( connection.exists( "cn=testsubentryB,dc=AP-B,cn=A2,dc=AP-A,dc=test,ou=system" ) );
@@ -537,7 +541,7 @@ public class SubentryServiceIT extends A
LdapConnection connection = IntegrationUtils.getAdminConnection( getService() );
Entry subEntry = getSubentry( "cn=testsubentry,ou=system" );
-
+
try
{
connection.add( subEntry );
@@ -1297,13 +1301,13 @@ public class SubentryServiceIT extends A
// now add the control with visibility set to true where all entries
// except subentries disappear
LdapApiService codec = LdapApiServiceFactory.getSingleton();
-
+
SubentriesDecorator decorator = new SubentriesDecorator( codec );
Subentries ctl = ( Subentries ) decorator.getDecorated();
ctl.setVisibility( true );
decorator.getValue();
- sysRoot.setRequestControls( JndiUtils.toJndiControls(codec, new Control[]
- {ctl}) );
+ sysRoot.setRequestControls( JndiUtils.toJndiControls( codec, new Control[]
+ { ctl } ) );
list = sysRoot.search( "", "(objectClass=*)", searchControls );
SearchResult result = list.next();
assertFalse( list.hasMore() );
@@ -1369,7 +1373,8 @@ public class SubentryServiceIT extends A
sysRoot.createSubcontext( "cn=testsubentry", getTestSubentryWithExclusion() );
SearchControls searchControls = new SearchControls();
searchControls.setSearchScope( SearchControls.SUBTREE_SCOPE );
- sysRoot.setRequestControls( new javax.naming.ldap.Control[]{ new JndiSubentriesControl() } );
+ sysRoot.setRequestControls( new javax.naming.ldap.Control[]
+ { new JndiSubentriesControl() } );
Map<String, SearchResult> entries = new HashMap<String, SearchResult>();
NamingEnumeration<SearchResult> list = sysRoot.search( "cn=testsubentry", "(objectClass=subentry)",
searchControls );
@@ -1392,9 +1397,11 @@ public class SubentryServiceIT extends A
LdapContext sysRoot = getSystemContext( getService() );
addAdministrativeRole( "collectiveAttributeSpecificArea" );
sysRoot.createSubcontext( "cn=testsubentry", getTestSubentryWithExclusion() );
-
- sysRoot.setRequestControls( new javax.naming.ldap.Control[]{ new JndiSubentriesControl() } );
- Attributes attributes = sysRoot.getAttributes( "cn=testsubentry", new String[]{"subtreeSpecification"} );
+
+ sysRoot.setRequestControls( new javax.naming.ldap.Control[]
+ { new JndiSubentriesControl() } );
+ Attributes attributes = sysRoot.getAttributes( "cn=testsubentry", new String[]
+ { "subtreeSpecification" } );
assertNotNull( attributes );
javax.naming.directory.Attribute ss = attributes.get( "SubtreeSpecification" );
@@ -1410,9 +1417,10 @@ public class SubentryServiceIT extends A
addAdministrativeRole( "collectiveAttributeSpecificArea" );
connection.add( getTestSubentryWithExclusion( "cn=testsubentry,ou=system" ) );
-
- Entry result = connection.lookup( "cn=testsubentry,ou=system", new Control[]{
- new SubentriesDecorator(connection.getCodecService())},"subtreeSpecification" );
+
+ Entry result = connection.lookup( "cn=testsubentry,ou=system", new Control[]
+ {
+ new SubentriesDecorator( connection.getCodecService() ) }, "subtreeSpecification" );
assertNotNull( result );
String ss = result.get( "SubtreeSpecification" ).getString();
@@ -1428,7 +1436,7 @@ public class SubentryServiceIT extends A
addAdministrativeRole( "collectiveAttributeSpecificArea" );
connection.add( getTestSubentryWithExclusion( "cn=testsubentry,ou=system" ) );
-
+
Entry result = connection.lookup( "cn=testsubentry,ou=system", "subtreeSpecification" );
assertNotNull( result );
@@ -1437,7 +1445,7 @@ public class SubentryServiceIT extends A
}
- @Test( expected = LdapNoPermissionException.class )
+ @Test(expected = LdapNoPermissionException.class)
@Ignore
public void testUserInjectAccessControlSubentries() throws Exception
{
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceObjectClassChangeHandlingIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceObjectClassChangeHandlingIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceObjectClassChangeHandlingIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceObjectClassChangeHandlingIT.java Tue Jan 24 16:42:44 2012
@@ -54,9 +54,9 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
-@CreateDS( factory=DefaultDirectoryServiceFactory.class, name="SubentryServiceObjectClassChangeHandlingIT-class" )
-public class SubentryServiceObjectClassChangeHandlingIT extends AbstractLdapTestUnit
+@RunWith(FrameworkRunner.class)
+@CreateDS(factory = DefaultDirectoryServiceFactory.class, name = "SubentryServiceObjectClassChangeHandlingIT-class")
+public class SubentryServiceObjectClassChangeHandlingIT extends AbstractLdapTestUnit
{
public Attributes getTestEntry( String cn )
@@ -107,7 +107,7 @@ public class SubentryServiceObjectClassC
controls.setReturningAttributes( new String[]
{ "+", "*" } );
NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=*)", controls );
-
+
while ( results.hasMore() )
{
SearchResult result = results.next();
@@ -115,7 +115,7 @@ public class SubentryServiceObjectClassC
}
return resultMap;
}
-
+
@Test
public void testTrackingOfOCChangesInSubentryServiceModifyRoutine() throws Exception
@@ -133,7 +133,7 @@ public class SubentryServiceObjectClassC
Attributes testEntry = results.get( "cn=testEntry,ou=system" );
Attribute collectiveAttributeSubentries = testEntry.get( "collectiveAttributeSubentries" );
-
+
assertNull( collectiveAttributeSubentries );
//----------------------------------------------------------------------
@@ -142,7 +142,7 @@ public class SubentryServiceObjectClassC
modItems[0] = new ModificationItem( DirContext.ADD_ATTRIBUTE, objectClass );
Attribute ou = new BasicAttribute( "ou", "Test Organizational Unit" );
modItems[1] = new ModificationItem( DirContext.ADD_ATTRIBUTE, ou );
-
+
sysRoot.modifyAttributes( "cn=testEntry", modItems );
results = getAllEntries();
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/MigratedStockCoreISuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/MigratedStockCoreISuite.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/MigratedStockCoreISuite.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/MigratedStockCoreISuite.java Tue Jan 24 16:42:44 2012
@@ -46,9 +46,10 @@ import org.junit.runners.Suite;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkSuite.class )
-@CreateDS( enableAccessControl=true, name="MigratedStockCoreISuite-DS" )
-@Suite.SuiteClasses ( {
+@RunWith(FrameworkSuite.class)
+@CreateDS(enableAccessControl = true, name = "MigratedStockCoreISuite-DS")
+@Suite.SuiteClasses(
+ {
// authn
SimpleAuthenticationIT.class,
@@ -72,7 +73,7 @@ import org.junit.runners.Suite;
// exception
ExceptionServiceIT.class
- } )
+})
public class MigratedStockCoreISuite
{
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/StockCoreISuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/StockCoreISuite.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/StockCoreISuite.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/StockCoreISuite.java Tue Jan 24 16:42:44 2012
@@ -93,14 +93,15 @@ import org.junit.runners.Suite;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkSuite.class )
-@Suite.SuiteClasses ( {
+@RunWith(FrameworkSuite.class)
+@Suite.SuiteClasses(
+ {
// ap
//AdministrativePointServiceIT.class,
// changelog
- DefaultChangeLogIT.class,
+ DefaultChangeLogIT.class,
// collective
CollectiveAttributeServiceIT.class,
@@ -178,7 +179,7 @@ import org.junit.runners.Suite;
// prefs
PreferencesIT.class,
-
+
// schema
MetaAttributeTypeHandlerIT.class,
MetaComparatorHandlerIT.class,
@@ -206,7 +207,7 @@ import org.junit.runners.Suite;
SubentryServiceForTriggersIT.class,
TriggerInterceptorIT.class
- } )
+})
public class StockCoreISuite
{
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilities.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilities.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilities.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilities.java Tue Jan 24 16:42:44 2012
@@ -19,6 +19,7 @@
*/
package org.apache.directory.server.core.trigger;
+
import javax.naming.Name;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
@@ -37,7 +38,7 @@ public class BackupUtilities
public static void backupDeleted( LdapContext ctx, Name deletedEntryName,
- Name operationPrincipal, Attributes deletedEntry ) throws NamingException
+ Name operationPrincipal, Attributes deletedEntry ) throws NamingException
{
LOG.info( "User \"" + operationPrincipal + "\" has deleted entry \"" + deletedEntryName + "\"" );
LOG.info( "Entry content was: " + deletedEntry );
@@ -45,11 +46,12 @@ public class BackupUtilities
String deletedEntryRdn = deletedEntryName.get( deletedEntryName.size() - 1 );
backupCtx.createSubcontext( deletedEntryRdn, deletedEntry );
LOG.info( "Backed up deleted entry to \"" +
- ( ( LdapContext ) backupCtx.lookup( deletedEntryRdn ) ).getNameInNamespace() + "\"" );
+ ( ( LdapContext ) backupCtx.lookup( deletedEntryRdn ) ).getNameInNamespace() + "\"" );
}
-
+
+
public static void duplicateDeletedEntry( LdapContext ctx, Name deletedEntryName, Name operationPrincipal,
- Attributes deletedEntry ) throws NamingException
+ Attributes deletedEntry ) throws NamingException
{
LdapContext backupCtx = ( LdapContext ) ctx.lookup( "ou=backupContext,ou=system" );
String deletedEntryRdn = deletedEntryName.get( deletedEntryName.size() - 1 );
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java Tue Jan 24 16:42:44 2012
@@ -51,7 +51,7 @@ public class BackupUtilitiesSP
LOG.info( "User \"" + session.getEffectivePrincipal() + "\" has deleted entry \"" + deletedEntry + "\"" );
Dn backupDn = new Dn( "ou=backupContext,ou=system" );
String deletedEntryRdn = deletedEntry.getDn().getRdn().getName();
- Entry entry = (( ClonedServerEntry ) deletedEntry).getOriginalEntry().clone();
+ Entry entry = ( ( ClonedServerEntry ) deletedEntry ).getOriginalEntry().clone();
backupDn = backupDn.add( deletedEntryRdn );
entry.setDn( backupDn );
session.add( deletedEntry );
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/ListUtilsSP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/ListUtilsSP.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/ListUtilsSP.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/ListUtilsSP.java Tue Jan 24 16:42:44 2012
@@ -19,6 +19,7 @@
*/
package org.apache.directory.server.core.trigger;
+
import javax.naming.NamingException;
import javax.naming.directory.BasicAttributes;
import javax.naming.directory.DirContext;
@@ -43,8 +44,8 @@ public class ListUtilsSP
public static void subscribeToGroup( Dn addedEntryName, LdapContext groupCtx ) throws NamingException
{
LOG.info( "User \"" + addedEntryName + "\" will be subscribed to \"" + groupCtx + "\"" );
- groupCtx.modifyAttributes("", DirContext.ADD_ATTRIBUTE,
- new BasicAttributes( SchemaConstants.UNIQUE_MEMBER_AT, addedEntryName.toString(), true ) );
+ groupCtx.modifyAttributes( "", DirContext.ADD_ATTRIBUTE,
+ new BasicAttributes( SchemaConstants.UNIQUE_MEMBER_AT, addedEntryName.toString(), true ) );
LOG.info( "Subscription OK." );
}
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/LoggingUtilities.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/LoggingUtilities.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/LoggingUtilities.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/LoggingUtilities.java Tue Jan 24 16:42:44 2012
@@ -33,9 +33,10 @@ import org.slf4j.LoggerFactory;
public class LoggingUtilities
{
private static final Logger LOG = LoggerFactory.getLogger( LoggingUtilities.class );
-
+
+
public static void logWarningForDeletedEntry( Name deletedEntryName,
- Name operationPrincipal ) throws NamingException
+ Name operationPrincipal ) throws NamingException
{
LOG.info( "User \"" + operationPrincipal + "\" is about to delete entry \"" + deletedEntryName + "\"." );
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersIT.java Tue Jan 24 16:42:44 2012
@@ -54,9 +54,9 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@Ignore("Reverts are failing to delete marked entries. Fixing this " +
- "problem in testEntryAdd() will fix it all over.")
+ "problem in testEntryAdd() will fix it all over.")
public class SubentryServiceForTriggersIT extends AbstractLdapTestUnit
{
@@ -86,7 +86,8 @@ public class SubentryServiceForTriggersI
subentry.put( "cn", "testsubentry" );
return subentry;
}
-
+
+
public Attributes getTestSubentryWithExclusion()
{
Attributes subentry = new BasicAttributes( true );
@@ -110,7 +111,8 @@ public class SubentryServiceForTriggersI
attribute.add( "autonomousArea" );
attribute.add( "triggerSpecificArea" );
ModificationItem item = new ModificationItem( DirContext.ADD_ATTRIBUTE, attribute );
- sysRoot.modifyAttributes( "", new ModificationItem[] { item } );
+ sysRoot.modifyAttributes( "", new ModificationItem[]
+ { item } );
}
@@ -123,7 +125,7 @@ public class SubentryServiceForTriggersI
controls.setReturningAttributes( new String[]
{ "+", "*" } );
NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=*)", controls );
-
+
while ( results.hasMore() )
{
SearchResult result = results.next();
@@ -137,7 +139,7 @@ public class SubentryServiceForTriggersI
public void testEntryAdd() throws Exception
{
LdapContext sysRoot = getSystemContext( getService() );
- addTheAdministrativeRole();
+ addTheAdministrativeRole();
sysRoot.createSubcontext( "cn=testsubentry", getTestSubentry() );
sysRoot.createSubcontext( "cn=unmarked", getTestEntry( "unmarked" ) );
sysRoot.createSubcontext( "cn=marked,ou=configuration", getTestEntry( "marked" ) );
@@ -209,7 +211,8 @@ public class SubentryServiceForTriggersI
assertNull( "ou=system should not be marked", system.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
Attributes users = results.get( "ou=users,ou=system" );
- assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
+ assertNull( "ou=users,ou=system should not be marked",
+ users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
}
@@ -245,16 +248,19 @@ public class SubentryServiceForTriggersI
assertNull( "ou=system should not be marked", system.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
Attributes users = results.get( "ou=users,ou=system" );
- assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
+ assertNull( "ou=users,ou=system should not be marked",
+ users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
// --------------------------------------------------------------------
// Now modify the subentry by introducing an exclusion
// --------------------------------------------------------------------
Attribute subtreeSpecification = new BasicAttribute( "subtreeSpecification" );
- subtreeSpecification.add( "{ base \"ou=configuration\", specificExclusions { chopBefore:\"ou=interceptors\" } }" );
+ subtreeSpecification
+ .add( "{ base \"ou=configuration\", specificExclusions { chopBefore:\"ou=interceptors\" } }" );
ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, subtreeSpecification );
- sysRoot.modifyAttributes( "cn=testsubentry", new ModificationItem[] { item } );
+ sysRoot.modifyAttributes( "cn=testsubentry", new ModificationItem[]
+ { item } );
results = getAllEntries();
// --------------------------------------------------------------------
@@ -275,13 +281,15 @@ public class SubentryServiceForTriggersI
assertNull( "ou=system should not be marked", system.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
users = results.get( "ou=users,ou=system" );
- assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
+ assertNull( "ou=users,ou=system should not be marked",
+ users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
interceptors = results.get( "ou=interceptors,ou=configuration,ou=system" );
triggerSubentries = interceptors.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
if ( triggerSubentries != null )
{
- assertEquals( "ou=interceptors,ou=configuration,ou=system should not be marked", 0, triggerSubentries.size() );
+ assertEquals( "ou=interceptors,ou=configuration,ou=system should not be marked", 0,
+ triggerSubentries.size() );
}
}
@@ -310,14 +318,16 @@ public class SubentryServiceForTriggersI
triggerSubentries = interceptors.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
if ( triggerSubentries != null )
{
- assertEquals( "ou=interceptors,ou=configuration,ou=system should not be marked", 0, triggerSubentries.size() );
+ assertEquals( "ou=interceptors,ou=configuration,ou=system should not be marked", 0,
+ triggerSubentries.size() );
}
Attributes system = results.get( "ou=system" );
assertNull( "ou=system should not be marked", system.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
Attributes users = results.get( "ou=users,ou=system" );
- assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
+ assertNull( "ou=users,ou=system should not be marked",
+ users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
}
@@ -354,7 +364,8 @@ public class SubentryServiceForTriggersI
assertNull( "ou=system should not be marked", system.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
Attributes users = results.get( "ou=users,ou=system" );
- assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
+ assertNull( "ou=users,ou=system should not be marked",
+ users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
}
@@ -398,7 +409,8 @@ public class SubentryServiceForTriggersI
assertNull( "ou=system should not be marked", system.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
Attributes users = results.get( "ou=users,ou=system" );
- assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
+ assertNull( "ou=users,ou=system should not be marked",
+ users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
Attributes unmarked = results.get( "cn=unmarked,ou=configuration,ou=system" );
assertNull( "cn=unmarked,ou=configuration,ou=system should not be marked", unmarked
@@ -473,7 +485,8 @@ public class SubentryServiceForTriggersI
assertNull( "ou=system should not be marked", system.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
Attributes users = results.get( "ou=users,ou=system" );
- assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
+ assertNull( "ou=users,ou=system should not be marked",
+ users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
Attributes unmarked = results.get( "cn=unmarked,ou=system" );
assertNull( "cn=unmarked,ou=system should not be marked", unmarked
@@ -548,7 +561,8 @@ public class SubentryServiceForTriggersI
assertNull( "ou=system should not be marked", system.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
Attributes users = results.get( "ou=users,ou=system" );
- assertNull( "ou=users,ou=system should not be marked", users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
+ assertNull( "ou=users,ou=system should not be marked",
+ users.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
Attributes unmarked = results.get( "cn=unmarked,ou=system" );
assertNull( "cn=unmarked,ou=system should not be marked", unmarked
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/TriggerInterceptorIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/TriggerInterceptorIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/TriggerInterceptorIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/TriggerInterceptorIT.java Tue Jan 24 16:42:44 2012
@@ -46,7 +46,7 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@Ignore
public class TriggerInterceptorIT extends AbstractLdapTestUnit
{
@@ -63,55 +63,55 @@ public class TriggerInterceptorIT extend
spContainer.put( "ou", "Stored Procedures" );
spCtx = ( LdapContext ) ctx.createSubcontext( "ou=Stored Procedures", spContainer );
}
-
+
@Test
public void testAfterDeleteBackupDeletedEntryEntryTrigger() throws Exception
{
- String ldif =
+ String ldif =
"version: 1\n" +
- "\n" +
- "dn: ou=backupContext, ou=system\n"+
- "objectClass: top\n" +
- "objectClass: organizationalUnit\n" +
- "ou: backupContext\n" +
- "\n" +
- "dn: ou=testEntry, ou=system\n" +
- "objectClass: top\n" +
- "objectClass: organizationalUnit\n" +
- "ou: testEntry\n";
+ "\n" +
+ "dn: ou=backupContext, ou=system\n" +
+ "objectClass: top\n" +
+ "objectClass: organizationalUnit\n" +
+ "ou: backupContext\n" +
+ "\n" +
+ "dn: ou=testEntry, ou=system\n" +
+ "objectClass: top\n" +
+ "objectClass: organizationalUnit\n" +
+ "ou: testEntry\n";
LdapContext sysRoot = getSystemContext( getService() );
createData( sysRoot );
// Inject the ldif file into the server.
injectEntries( getService(), ldif );
-
+
// Load the stored procedure unit which has the stored procedure to be triggered.
JavaStoredProcUtils.loadStoredProcedureClass( spCtx, BackupUtilitiesSP.class );
-
+
// Create the Entry Trigger Specification.
TriggerUtils.defineTriggerExecutionSpecificPoint( sysRoot );
LdapContext entry = ( LdapContext ) sysRoot.lookup( "ou=testEntry" );
-
+
// TODO - change the spec to make this pass
-
+
String triggerSpec = "AFTER Delete CALL \"" + BackupUtilitiesSP.class.getName() +
":backupDeleted\" ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry );";
TriggerUtils.loadEntryTriggerSpecification( entry, triggerSpec );
-
+
// Delete the test entry in order to fire the Trigger.
sysRoot.destroySubcontext( "ou=testEntry" );
-
+
// ------------------------------------------
// The trigger should be fired at this point.
// ------------------------------------------
-
+
// Check if the Trigger really worked (backed up the deleted entry).
assertNotNull( sysRoot.lookup( "ou=testEntry,ou=backupContext" ) );
}
-
-
+
+
public void testAfterDeleteBackupDeletedEntryPrescriptiveTrigger() throws Exception
{
LdapContext sysRoot = getSystemContext( getService() );
@@ -119,27 +119,27 @@ public class TriggerInterceptorIT extend
// Load the stored procedure unit which has the stored procedure to be triggered.
JavaStoredProcUtils.loadStoredProcedureClass( spCtx, BackupUtilitiesSP.class );
-
+
// Create a container for backing up deleted entries.
- String ldif =
+ String ldif =
"version: 1\n" +
- "\n" +
- "dn: ou=backupContext, ou=system\n"+
- "objectClass: top\n" +
- "objectClass: organizationalUnit\n" +
- "ou: backupContext\n";
-
+ "\n" +
+ "dn: ou=backupContext, ou=system\n" +
+ "objectClass: top\n" +
+ "objectClass: organizationalUnit\n" +
+ "ou: backupContext\n";
+
// Inject the ldif file into the server.
injectEntries( getService(), ldif );
-
+
// Create the Trigger Specification within a Trigger Subentry.
TriggerUtils.defineTriggerExecutionSpecificPoint( sysRoot );
TriggerUtils.createTriggerExecutionSubentry( sysRoot,
- "triggerSubentry1",
- "{}",
- "AFTER Delete " +
- "CALL \"" + BackupUtilitiesSP.class.getName() + ":backupDeleted\" " +
- " ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry );" );
+ "triggerSubentry1",
+ "{}",
+ "AFTER Delete " +
+ "CALL \"" + BackupUtilitiesSP.class.getName() + ":backupDeleted\" " +
+ " ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry );" );
/**
* The Trigger Specification without Java clutter:
@@ -147,73 +147,74 @@ public class TriggerInterceptorIT extend
* AFTER Delete
* CALL "BackupUtilitiesSP.backupDeleted" ( $ldapContext "", $name, $operationPrincipal, $deletedEntry );
*
- */
-
+ */
+
// Create a test entry which is selected by the Trigger Subentry.
- String ldif2 =
+ String ldif2 =
"version: 1\n" +
- "\n" +
- "dn: ou=testou, ou=system\n" +
- "objectClass: top\n" +
- "objectClass: organizationalUnit\n" +
- "ou: testou\n";
-
+ "\n" +
+ "dn: ou=testou, ou=system\n" +
+ "objectClass: top\n" +
+ "objectClass: organizationalUnit\n" +
+ "ou: testou\n";
+
// Inject the ldif file into the server.
injectEntries( getService(), ldif2 );
-
+
// Delete the test entry in order to fire the Trigger.
sysRoot.destroySubcontext( "ou=testou" );
-
+
// ------------------------------------------
// The trigger should be fired at this point.
// ------------------------------------------
-
+
// Check if the Trigger really worked (backed up the deleted entry).
assertNotNull( sysRoot.lookup( "ou=testou,ou=backupContext" ) );
}
-
-
+
+
public void testAfterAddSubscribeUserToSomeGroupsPrescriptiveTrigger() throws Exception
{
LdapContext sysRoot = getSystemContext( getService() );
createData( sysRoot );
// Create two groups to be subscribed to : staff and teachers.
- String ldif =
+ String ldif =
"version: 1\n" +
- "\n" +
- "dn: cn=staff, ou=system\n"+
- "objectClass: top\n" +
- "objectClass: groupOfUniqueNames\n" +
- "uniqueMember: cn=dummy\n"+
- "cn: staff\n" +
- "\n" +
- "dn: cn=teachers, ou=system\n"+
- "objectClass: top\n" +
- "objectClass: groupOfUniqueNames\n" +
- "uniqueMember: cn=dummy\n"+
- "cn: teachers\n";
-
+ "\n" +
+ "dn: cn=staff, ou=system\n" +
+ "objectClass: top\n" +
+ "objectClass: groupOfUniqueNames\n" +
+ "uniqueMember: cn=dummy\n" +
+ "cn: staff\n" +
+ "\n" +
+ "dn: cn=teachers, ou=system\n" +
+ "objectClass: top\n" +
+ "objectClass: groupOfUniqueNames\n" +
+ "uniqueMember: cn=dummy\n" +
+ "cn: teachers\n";
+
// Load the stored procedure unit which has the stored procedure to be triggered.
JavaStoredProcUtils.loadStoredProcedureClass( spCtx, ListUtilsSP.class );
// Inject the ldif file into the server
injectEntries( getService(), ldif );
-
+
// Create the Trigger Specification within a Trigger Subentry.
String staffDN = "cn=staff, ou=system";
String teachersDN = "cn=teachers, ou=system";
-
// Create the Triger Specification within a Trigger Subentry.
TriggerUtils.defineTriggerExecutionSpecificPoint( sysRoot );
TriggerUtils.createTriggerExecutionSubentry( sysRoot,
- "triggerSubentry1",
- "{}",
- "AFTER Add " +
- "CALL \"" + ListUtilsSP.class.getName() + ":subscribeToGroup\" ( $entry , $ldapContext \"" + staffDN + "\" ); " +
- "CALL \"" + ListUtilsSP.class.getName() + ":subscribeToGroup\" ( $entry , $ldapContext \"" + teachersDN + "\" );" );
-
+ "triggerSubentry1",
+ "{}",
+ "AFTER Add " +
+ "CALL \"" + ListUtilsSP.class.getName() + ":subscribeToGroup\" ( $entry , $ldapContext \"" + staffDN
+ + "\" ); " +
+ "CALL \"" + ListUtilsSP.class.getName() + ":subscribeToGroup\" ( $entry , $ldapContext \"" + teachersDN
+ + "\" );" );
+
/**
* The Trigger Specification without Java clutter:
*
@@ -224,14 +225,14 @@ public class TriggerInterceptorIT extend
*/
// Create a test entry which is selected by the Trigger Subentry.
- String testEntry =
+ String testEntry =
"version: 1\n" +
- "\n" +
- "dn: cn=The Teacher of All Times, ou=system\n"+
- "objectClass: top\n" +
- "objectClass: inetOrgPerson\n" +
- "cn: The Teacher of All Times\n" +
- "sn: TheTeacher";
+ "\n" +
+ "dn: cn=The Teacher of All Times, ou=system\n" +
+ "objectClass: top\n" +
+ "objectClass: inetOrgPerson\n" +
+ "cn: The Teacher of All Times\n" +
+ "sn: TheTeacher";
// Inject the entry into the server
injectEntries( getService(), testEntry );
@@ -239,13 +240,13 @@ public class TriggerInterceptorIT extend
// ------------------------------------------
// The trigger should be fired at this point.
// ------------------------------------------
-
+
// Check if the Trigger really worked (subscribed the user to the groups).
Attributes staff = sysRoot.getAttributes( "cn=staff" );
Attributes teachers = sysRoot.getAttributes( "cn=teachers" );
- String testEntryName = ( ( LdapContext )sysRoot.lookup( "cn=The Teacher of All Times" ) ).getNameInNamespace();
- assertTrue( AttributeUtils.containsValueCaseIgnore(staff.get("uniqueMember"), testEntryName) );
+ String testEntryName = ( ( LdapContext ) sysRoot.lookup( "cn=The Teacher of All Times" ) ).getNameInNamespace();
+ assertTrue( AttributeUtils.containsValueCaseIgnore( staff.get( "uniqueMember" ), testEntryName ) );
assertTrue( AttributeUtils.containsValueCaseIgnore( teachers.get( "uniqueMember" ), testEntryName ) );
}
-
+
}