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 [3/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/jndi/AddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/AddIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/AddIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/AddIT.java Tue Jan 24 16:42:44 2012
@@ -107,9 +107,9 @@ public class AddIT extends AbstractLdapT
LdapContext sysRoot = getSystemContext( getService() );
Attributes attrs = LdifUtils.createJndiAttributes(
- "ObjectClass: top",
- "cn: kevin Spacey",
- "dc: ke");
+ "ObjectClass: top",
+ "cn: kevin Spacey",
+ "dc: ke" );
String base = "uid=kevin";
@@ -136,12 +136,12 @@ public class AddIT extends AbstractLdapT
{
LdapContext sysRoot = getSystemContext( getService() );
- Attributes attrs = LdifUtils.createJndiAttributes(
+ Attributes attrs = LdifUtils.createJndiAttributes(
"ObjectClass: top",
"ObjectClass: person",
"cn: kevin Spacey",
"sn: ke",
- "telephoneNumber: 0123456abc");
+ "telephoneNumber: 0123456abc" );
String base = "sn=kevin";
@@ -164,39 +164,39 @@ public class AddIT extends AbstractLdapT
@Test
public void testAddAttributeWithEscapedPlusCharacter() throws Exception
{
- Attributes entry = LdifUtils.createJndiAttributes(
+ Attributes entry = LdifUtils.createJndiAttributes(
"ObjectClass: top",
"ObjectClass: inetorgperson",
"cn: John+Doe",
"sn: +Name+" );
-
+
LdapContext sysRoot = getSystemContext( getService() );
DirContext dc = sysRoot.createSubcontext( "cn=John\\+Doe", entry );
-
+
ServerLdapContext sc = ( ServerLdapContext ) dc;
-
+
assertTrue( sc.getDn().toString().contains( "+" ) );
try
{
- Object obj = sysRoot.lookup( "cn=John\\+Doe" );
- assertNotNull( obj );
+ Object obj = sysRoot.lookup( "cn=John\\+Doe" );
+ assertNotNull( obj );
}
- catch( Exception e )
+ catch ( Exception e )
{
fail( e.getMessage() );
}
-
+
try
{
- Attributes result = sysRoot.getAttributes( "cn=John\\+Doe" );
- assertNotNull( result );
-
- Attribute cn = result.get( "cn" );
- assertNotNull( cn );
- assertEquals( 1, cn.size() );
+ Attributes result = sysRoot.getAttributes( "cn=John\\+Doe" );
+ assertNotNull( result );
+
+ Attribute cn = result.get( "cn" );
+ assertNotNull( cn );
+ assertEquals( 1, cn.size() );
}
- catch( Exception e )
+ catch ( Exception e )
{
fail( e.getMessage() );
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/CreateContextIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/CreateContextIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/CreateContextIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/CreateContextIT.java Tue Jan 24 16:42:44 2012
@@ -53,17 +53,17 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@CreateDS(name = "CreateContextIT")
public class CreateContextIT extends AbstractLdapTestUnit
{
protected Attributes getPersonAttributes( String sn, String cn ) throws Exception
{
Attributes attrs = LdifUtils.createJndiAttributes(
- "objectClass: top",
- "objectClass: person",
- "cn", cn,
- "sn", sn);
+ "objectClass: top",
+ "objectClass: person",
+ "cn", cn,
+ "sn", sn );
return attrs;
}
@@ -90,7 +90,7 @@ public class CreateContextIT extends Abs
String base = "";
NamingEnumeration<SearchResult> enm = sysRoot.search( base, filter, sctls );
-
+
while ( enm.hasMore() )
{
SearchResult sr = enm.next();
@@ -266,8 +266,8 @@ public class CreateContextIT extends Abs
assertNull( ctx );
}
-
-
+
+
@Test
public void testCreateContextWithCompositeName() throws Exception
{
@@ -301,10 +301,10 @@ public class CreateContextIT extends Abs
* create ou=testing00,ou=system
*/
Attributes attributes = new BasicAttributes( true );
- attributes.put("objectClass", "organizationalUnit");
- attributes.put("description", "Test OU");
- attributes.put("OU", "Test");
-
+ attributes.put( "objectClass", "organizationalUnit" );
+ attributes.put( "description", "Test OU" );
+ attributes.put( "OU", "Test" );
+
DirContext ctx = sysRoot.createSubcontext( "ou=Test", attributes );
assertNotNull( ctx );
@@ -403,7 +403,7 @@ public class CreateContextIT extends Abs
try
{
sysRoot.createSubcontext( "ou=subtest", attrs );// should Fails!
- fail( "It is not allowed to create a context with a bad entry");
+ fail( "It is not allowed to create a context with a bad entry" );
}
catch ( NamingException e )
{
@@ -416,13 +416,13 @@ public class CreateContextIT extends Abs
public void testCreateJavaContainer() throws Exception
{
LdapContext sysRoot = getSystemContext( getService() );
-
- DirContext ctx = (DirContext)sysRoot.createSubcontext( "cn=subtest" );
+
+ DirContext ctx = ( DirContext ) sysRoot.createSubcontext( "cn=subtest" );
assertNotNull( ctx );
-
+
Attributes attributes = ctx.getAttributes( "" );
assertNotNull( attributes );
-
+
assertEquals( "subtest", attributes.get( "cn" ).get() );
Attribute attribute = attributes.get( "objectClass" );
assertNotNull( attribute );
@@ -439,7 +439,7 @@ public class CreateContextIT extends Abs
try
{
sysRoot.createSubcontext( "ou=subtest" );
- fail( "It is not allowed to create a context with a bad Rdn. CN is mandatory");
+ fail( "It is not allowed to create a context with a bad Rdn. CN is mandatory" );
}
catch ( NamingException ne )
{
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java Tue Jan 24 16:42:44 2012
@@ -52,8 +52,8 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
-@CreateDS( allowAnonAccess=true, name = "DIRSERVER169IT" )
+@RunWith(FrameworkRunner.class)
+@CreateDS(allowAnonAccess = true, name = "DIRSERVER169IT")
public class DIRSERVER169IT extends AbstractLdapTestUnit
{
@@ -98,7 +98,7 @@ public class DIRSERVER169IT extends Abst
LdapContext sysRoot = getSystemContext( getService() );
- Hashtable<String,Object> env = new Hashtable<String,Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
env.put( Context.PROVIDER_URL, "ou=system" );
@@ -126,7 +126,7 @@ public class DIRSERVER169IT extends Abst
userDn.append( "," );
userDn.append( ctx.getNameInNamespace() );
}
-
+
assertEquals( "uid=bob,ou=people," + sysRoot.getNameInNamespace(), userDn.toString() );
}
@@ -143,7 +143,7 @@ public class DIRSERVER169IT extends Abst
// @todo replace with ldif tags
createData();
- Hashtable<String,Object> env = new Hashtable<String,Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
env.put( Context.PROVIDER_URL, "ou=system" );
@@ -154,8 +154,9 @@ public class DIRSERVER169IT extends Abst
ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
String filter = "(userPassword={0})";
- NamingEnumeration<SearchResult> results =
- ctx.search( "uid=bob,ou=people", filter, new Object[] { "bobspassword" }, ctls );
+ NamingEnumeration<SearchResult> results =
+ ctx.search( "uid=bob,ou=people", filter, new Object[]
+ { "bobspassword" }, ctls );
// We should have a match
assertTrue( results.hasMore() );
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER783IT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER783IT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER783IT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER783IT.java Tue Jan 24 16:42:44 2012
@@ -46,14 +46,15 @@ import org.apache.directory.server.core.
import org.junit.Test;
import org.junit.runner.RunWith;
+
/**
* Tries to demonstrate DIRSERVER-783 ("Adding another value to an attribute
* results in the value to be added twice").
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
-@CreateDS( allowAnonAccess=true, name = "DIRSERVER783IT" )
+@RunWith(FrameworkRunner.class)
+@CreateDS(allowAnonAccess = true, name = "DIRSERVER783IT")
public class DIRSERVER783IT extends AbstractLdapTestUnit
{
@@ -67,17 +68,17 @@ public class DIRSERVER783IT extends Abst
{
// create a person without sn
Attributes attrs = new BasicAttributes( true );
- Attribute ocls = new BasicAttribute("objectClass");
+ Attribute ocls = new BasicAttribute( "objectClass" );
- ocls.add("top");
- ocls.add("person");
- attrs.put(ocls);
- attrs.put("cn", "Fiona Apple");
- attrs.put("sn", "Apple");
+ ocls.add( "top" );
+ ocls.add( "person" );
+ attrs.put( ocls );
+ attrs.put( "cn", "Fiona Apple" );
+ attrs.put( "sn", "Apple" );
String rdn = "cn=Fiona Apple";
- Hashtable<String,Object> env = new Hashtable<String, Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
env.put( Context.PROVIDER_URL, "ou=system" );
@@ -89,22 +90,25 @@ public class DIRSERVER783IT extends Abst
// Add the first value for description
String description1 = "an American singer-songwriter";
Attribute firstDescr = new BasicAttribute( "description", description1 );
- ModificationItem modification = new ModificationItem(DirContext.ADD_ATTRIBUTE, firstDescr);
- ctx.modifyAttributes(rdn, new ModificationItem[] { modification });
+ ModificationItem modification = new ModificationItem( DirContext.ADD_ATTRIBUTE, firstDescr );
+ ctx.modifyAttributes( rdn, new ModificationItem[]
+ { modification } );
// Add a second value to description
String description2 = "Grammy award winning";
Attribute otherDescr = new BasicAttribute( "description", description2 );
- modification = new ModificationItem(DirContext.ADD_ATTRIBUTE, otherDescr );
- ctx.modifyAttributes(rdn, new ModificationItem[] { modification } );
-
+ modification = new ModificationItem( DirContext.ADD_ATTRIBUTE, otherDescr );
+ ctx.modifyAttributes( rdn, new ModificationItem[]
+ { modification } );
+
// Add a third value to description
String description3 = "MTV Music Award winning";
Attribute thirdDescr = new BasicAttribute( "description", description3 );
- modification = new ModificationItem(DirContext.ADD_ATTRIBUTE, thirdDescr );
- ctx.modifyAttributes(rdn, new ModificationItem[] { modification });
+ modification = new ModificationItem( DirContext.ADD_ATTRIBUTE, thirdDescr );
+ ctx.modifyAttributes( rdn, new ModificationItem[]
+ { modification } );
// Search Entry
SearchControls sctls = new SearchControls();
@@ -113,22 +117,21 @@ public class DIRSERVER783IT extends Abst
String base = "";
// Check entry
- NamingEnumeration<SearchResult> enm = ctx.search(base, filter, sctls);
- assertTrue(enm.hasMore());
+ NamingEnumeration<SearchResult> enm = ctx.search( base, filter, sctls );
+ assertTrue( enm.hasMore() );
- while (enm.hasMore())
+ while ( enm.hasMore() )
{
SearchResult sr = enm.next();
- Attribute desc = sr.getAttributes().get("description");
- assertNotNull(desc);
- assertTrue(desc.contains(description1));
- assertTrue(desc.contains(description2));
- assertTrue(desc.contains(description3));
- assertEquals(3, desc.size());
+ Attribute desc = sr.getAttributes().get( "description" );
+ assertNotNull( desc );
+ assertTrue( desc.contains( description1 ) );
+ assertTrue( desc.contains( description2 ) );
+ assertTrue( desc.contains( description3 ) );
+ assertEquals( 3, desc.size() );
}
// Remove the person entry
- ctx.destroySubcontext(rdn);
+ ctx.destroySubcontext( rdn );
}
}
-
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java Tue Jan 24 16:42:44 2012
@@ -55,7 +55,7 @@ import org.junit.runner.RunWith;
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
@RunWith(FrameworkRunner.class)
-@CreateDS( allowAnonAccess=true, name = "DIRSERVER791IT" )
+@CreateDS(allowAnonAccess = true, name = "DIRSERVER791IT")
public class DIRSERVER791IT extends AbstractLdapTestUnit
{
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DestroyContextIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DestroyContextIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DestroyContextIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/DestroyContextIT.java Tue Jan 24 16:42:44 2012
@@ -40,101 +40,102 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@CreateDS(name = "DestroyContextIT")
-@ApplyLdifs({
- "dn: ou=testing00,ou=system",
- "objectclass: top",
- "objectclass: organizationalUnit",
- "ou: testing00",
- "",
- "dn: ou=testing01,ou=system",
- "objectclass: top",
- "objectclass: organizationalUnit",
- "ou: testing01",
- "",
- "dn: ou=testing02,ou=system",
- "objectclass: top",
- "objectclass: organizationalUnit",
- "ou: testing02",
- "",
- "dn: ou=subtest,ou=testing01,ou=system",
- "objectclass: top",
- "objectclass: organizationalUnit",
- "ou: subtest"
+@ApplyLdifs(
+ {
+ "dn: ou=testing00,ou=system",
+ "objectclass: top",
+ "objectclass: organizationalUnit",
+ "ou: testing00",
+ "",
+ "dn: ou=testing01,ou=system",
+ "objectclass: top",
+ "objectclass: organizationalUnit",
+ "ou: testing01",
+ "",
+ "dn: ou=testing02,ou=system",
+ "objectclass: top",
+ "objectclass: organizationalUnit",
+ "ou: testing02",
+ "",
+ "dn: ou=subtest,ou=testing01,ou=system",
+ "objectclass: top",
+ "objectclass: organizationalUnit",
+ "ou: subtest"
})
public class DestroyContextIT extends AbstractLdapTestUnit
{
- /**
- * Tests the creation and subsequent read of a new JNDI context under the
- * system context root.
- *
- * @throws NamingException if there are failures
+/**
+ * Tests the creation and subsequent read of a new JNDI context under the
+ * system context root.
+ *
+ * @throws NamingException if there are failures
+ */
+@Test
+public void testDestroyContext() throws Exception
+{
+ LdapContext sysRoot = getSystemContext( getService() );
+
+ /*
+ * delete ou=testing00,ou=system
*/
- @Test
- public void testDestroyContext() throws Exception
+ sysRoot.destroySubcontext( "ou=testing00" );
+
+ try
+ {
+ sysRoot.lookup( "ou=testing00" );
+ fail( "ou=testing00, ou=system should not exist" );
+ }
+ catch ( Exception e )
{
- LdapContext sysRoot = getSystemContext( getService() );
+ assertTrue( e instanceof NamingException );
+ }
+
+ /*
+ * delete ou=subtest,ou=testing01,ou=system
+ */
+ sysRoot.destroySubcontext( "ou=subtest,ou=testing01" );
- /*
- * delete ou=testing00,ou=system
- */
- sysRoot.destroySubcontext( "ou=testing00" );
-
- try
- {
- sysRoot.lookup( "ou=testing00" );
- fail( "ou=testing00, ou=system should not exist" );
- }
- catch ( Exception e )
- {
- assertTrue( e instanceof NamingException );
- }
-
- /*
- * delete ou=subtest,ou=testing01,ou=system
- */
- sysRoot.destroySubcontext( "ou=subtest,ou=testing01" );
-
- try
- {
- sysRoot.lookup( "ou=subtest,ou=testing01" );
- fail( "ou=subtest,ou=testing01,ou=system should not exist" );
- }
- catch ( NamingException e )
- {
- assertTrue( e instanceof NamingException );
- }
-
- /*
- * delete ou=testing01,ou=system
- */
- sysRoot.destroySubcontext( "ou=testing01" );
-
- try
- {
- sysRoot.lookup( "ou=testing01" );
- fail( "ou=testing01, ou=system should not exist" );
- }
- catch ( NamingException e )
- {
- assertTrue( e instanceof NamingException );
- }
-
- /*
- * delete ou=testing01,ou=system
- */
- sysRoot.destroySubcontext( "ou=testing02" );
-
- try
- {
- sysRoot.lookup( "ou=testing02" );
- fail( "ou=testing02, ou=system should not exist" );
- }
- catch ( NamingException e )
- {
- assertTrue( e instanceof NamingException );
- }
+ try
+ {
+ sysRoot.lookup( "ou=subtest,ou=testing01" );
+ fail( "ou=subtest,ou=testing01,ou=system should not exist" );
}
+ catch ( NamingException e )
+ {
+ assertTrue( e instanceof NamingException );
+ }
+
+ /*
+ * delete ou=testing01,ou=system
+ */
+ sysRoot.destroySubcontext( "ou=testing01" );
+
+ try
+ {
+ sysRoot.lookup( "ou=testing01" );
+ fail( "ou=testing01, ou=system should not exist" );
+ }
+ catch ( NamingException e )
+ {
+ assertTrue( e instanceof NamingException );
+ }
+
+ /*
+ * delete ou=testing01,ou=system
+ */
+ sysRoot.destroySubcontext( "ou=testing02" );
+
+ try
+ {
+ sysRoot.lookup( "ou=testing02" );
+ fail( "ou=testing02, ou=system should not exist" );
+ }
+ catch ( NamingException e )
+ {
+ assertTrue( e instanceof NamingException );
+ }
+}
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ExtensibleObjectIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ExtensibleObjectIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ExtensibleObjectIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ExtensibleObjectIT.java Tue Jan 24 16:42:44 2012
@@ -45,8 +45,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="ExtensibleObjectIT-class" )
+@RunWith(FrameworkRunner.class)
+@CreateDS(factory = DefaultDirectoryServiceFactory.class, name = "ExtensibleObjectIT-class")
public class ExtensibleObjectIT extends AbstractLdapTestUnit
{
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java Tue Jan 24 16:42:44 2012
@@ -57,8 +57,8 @@ public class ListIT extends AbstractLdap
public void testListSystemAsNonAdmin() throws Exception
{
LdifEntry akarasulu = getUserAddLdif();
- getService().getAdminSession().add(
- new DefaultEntry( getService().getSchemaManager(), akarasulu.getEntry() ) );
+ getService().getAdminSession().add(
+ new DefaultEntry( getService().getSchemaManager(), akarasulu.getEntry() ) );
LdapContext sysRoot = getContext( akarasulu.getDn().getName(), getService(), "ou=system" );
HashSet<String> set = new HashSet<String>();
@@ -80,7 +80,7 @@ public class ListIT extends AbstractLdap
public void testListUsersAsNonAdmin() throws Exception
{
LdifEntry akarasulu = getUserAddLdif();
- getService().getAdminSession().add(
+ getService().getAdminSession().add(
new DefaultEntry( getService().getSchemaManager(), akarasulu.getEntry() ) );
LdapContext sysRoot = getContext( akarasulu.getDn().getName(), getService(), "ou=system" );
@@ -123,12 +123,11 @@ public class ListIT extends AbstractLdap
LdapContext sysRoot = getSystemContext( getService() );
HashSet<String> set = new HashSet<String>();
LdifEntry akarasulu = getUserAddLdif();
- getService().getAdminSession().add(
- new DefaultEntry( getService().getSchemaManager(), akarasulu.getEntry() ) );
-
+ getService().getAdminSession().add(
+ new DefaultEntry( getService().getSchemaManager(), akarasulu.getEntry() ) );
NamingEnumeration<NameClassPair> list = sysRoot.list( "ou=users" );
-
+
while ( list.hasMore() )
{
NameClassPair ncp = list.next();
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseIT.java Tue Jan 24 16:42:44 2012
@@ -61,25 +61,25 @@ import org.junit.runner.RunWith;
@CreatePartition(
name = "apache",
suffix = "dc=Apache,dc=Org",
- contextEntry = @ContextEntry(
+ contextEntry = @ContextEntry(
entryLdif =
- "dn: dc=Apache,dc=Org\n" +
+ "dn: dc=Apache,dc=Org\n" +
"dc: Apache\n" +
"objectClass: top\n" +
- "objectClass: domain\n\n" ),
- indexes =
- {
- @CreateIndex( attribute = "objectClass" ),
- @CreateIndex( attribute = "ou" ),
- @CreateIndex( attribute = "uid" )
- } )
- } )
+ "objectClass: domain\n\n"),
+ indexes =
+ {
+ @CreateIndex(attribute = "objectClass"),
+ @CreateIndex(attribute = "ou"),
+ @CreateIndex(attribute = "uid")
+ })
+ })
public class MixedCaseIT extends AbstractLdapTestUnit
{
private static final String SUFFIX_DN = "dc=Apache,dc=Org";
-
+
@Test
public void testSearch() throws Exception
{
@@ -130,8 +130,8 @@ public class MixedCaseIT extends Abstrac
String dn = "ou=Test";
String description = "New Value";
- Attributes attributes = LdifUtils.createJndiAttributes("objectClass: top", "objectClass: organizationalUnit",
- "ou: Test", "description: Old Value");
+ Attributes attributes = LdifUtils.createJndiAttributes( "objectClass: top", "objectClass: organizationalUnit",
+ "ou: Test", "description: Old Value" );
DirContext ctx = ctxRoot.createSubcontext( dn, attributes );
assertNotNull( ctx );
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java Tue Jan 24 16:42:44 2012
@@ -52,8 +52,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="ModifyContextIT-class" )
+@RunWith(FrameworkRunner.class)
+@CreateDS(factory = DefaultDirectoryServiceFactory.class, name = "ModifyContextIT-class")
public class ModifyContextIT extends AbstractLdapTestUnit
{
@@ -65,7 +65,7 @@ public class ModifyContextIT extends Abs
protected void createData() throws Exception
{
LdifEntry akarasulu = getUserAddLdif();
- getService().getAdminSession().add(
+ getService().getAdminSession().add(
new DefaultEntry( getService().getSchemaManager(), akarasulu.getEntry() ) );
LdapContext sysRoot = getSystemContext( getService() );
@@ -199,7 +199,6 @@ public class ModifyContextIT extends Abs
}
-
@Test
public void testModifyOperation() throws Exception
{
@@ -242,7 +241,7 @@ public class ModifyContextIT extends Abs
LdapContext sysRoot = getSystemContext( getService() );
Attributes attributes = new BasicAttributes( true );
attributes.put( "ou", "testCases" );
-
+
try
{
sysRoot.modifyAttributes( "ou=testing00", DirContext.REMOVE_ATTRIBUTE, attributes );
@@ -255,8 +254,8 @@ public class ModifyContextIT extends Abs
}
}
-
- @Test( expected = NamingException.class )
+
+ @Test(expected = NamingException.class)
public void testRemoveNonExistingValue() throws Exception
{
createData();
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java Tue Jan 24 16:42:44 2012
@@ -55,7 +55,7 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
public class ObjStateFactoryIT extends AbstractLdapTestUnit
{
@@ -63,10 +63,9 @@ public class ObjStateFactoryIT extends A
public void testObjectFactory() throws Exception
{
LdifEntry akarasulu = getUserAddLdif();
- getService().getAdminSession().add(
+ getService().getAdminSession().add(
new DefaultEntry( getService().getSchemaManager(), akarasulu.getEntry() ) );
-
LdapContext sysRoot = getSystemContext( getService() );
sysRoot.addToEnvironment( Context.OBJECT_FACTORIES, PersonObjectFactory.class.getName() );
Object obj = sysRoot.lookup( "uid=akarasulu, ou=users" );
@@ -75,7 +74,7 @@ public class ObjStateFactoryIT extends A
Person me = ( Person ) obj;
assertEquals( attrs.get( "sn" ).get(), me.getLastname() );
assertEquals( attrs.get( "cn" ).get(), me.getCn() );
- assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), Strings.getBytesUtf8("test") ) );
+ assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), Strings.getBytesUtf8( "test" ) ) );
assertEquals( attrs.get( "telephonenumber" ).get(), me.getTelephoneNumber() );
assertNull( me.getSeealso() );
assertNull( me.getDescription() );
@@ -93,13 +92,12 @@ public class ObjStateFactoryIT extends A
Attributes attrs = sysRoot.getAttributes( "sn=Rodriguez, ou=users" );
assertEquals( "Rodriguez", attrs.get( "sn" ).get() );
assertEquals( "Mr. Kerberos", attrs.get( "cn" ).get() );
- assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), Strings.getBytesUtf8("noices") ) );
+ assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), Strings.getBytesUtf8( "noices" ) ) );
assertEquals( "555-1212", attrs.get( "telephonenumber" ).get() );
assertEquals( "sn=erodriguez", attrs.get( "seealso" ).get() );
assertEquals( "committer", attrs.get( "description" ).get() );
}
-
public static class PersonStateFactory implements DirStateFactory
{
public Result getStateToBind( Object obj, Name name, Context nameCtx, Hashtable environment, Attributes inAttrs )
@@ -181,7 +179,6 @@ public class ObjStateFactoryIT extends A
}
}
-
public static class PersonObjectFactory implements DirObjectFactory
{
public Object getObjectInstance( Object obj, Name name, Context nameCtx, Hashtable environment, Attributes attrs )
@@ -227,7 +224,7 @@ public class ObjStateFactoryIT extends A
private String sn, cn, pwd, tele, seealso, desc;
- public Person(String sn, String cn, String pwd, String tele, String seealso, String desc)
+ public Person( String sn, String cn, String pwd, String tele, String seealso, String desc )
{
this.sn = sn;
this.cn = cn;
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java Tue Jan 24 16:42:44 2012
@@ -44,7 +44,7 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@CreateDS(name = "RFC2713IT")
public class RFC2713IT extends AbstractLdapTestUnit
{
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java Tue Jan 24 16:42:44 2012
@@ -68,13 +68,12 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@CreateDS(name = "ReferralIT")
public class ReferralIT extends AbstractLdapTestUnit
{
private TestData td = new TestData();
-
/*
* NOTE: We may encounter conflicting circumstances where the ManageDsaIT control
* is included in the request controls yet the Context.REFERRAL is set to
@@ -103,8 +102,8 @@ public class ReferralIT extends Abstract
td.rootCtx = getSystemContext( getService() );
LdifEntry akarasulu = getUserAddLdif();
- getService().getAdminSession().add(
- new DefaultEntry( getService().getSchemaManager(), akarasulu.getEntry() ), true );
+ getService().getAdminSession().add(
+ new DefaultEntry( getService().getSchemaManager(), akarasulu.getEntry() ), true );
// -------------------------------------------------------------------
// Adds a referral entry regardless of referral handling settings
@@ -258,7 +257,7 @@ public class ReferralIT extends Abstract
// -------------------------------------------------------------------
td.refCtx.addToEnvironment( Context.REFERRAL, "ignore" );
-
+
Attributes userEntry = new BasicAttributes( "objectClass", "top", true );
userEntry.get( "objectClass" ).add( "person" );
userEntry.put( "sn", "karasulu" );
@@ -294,7 +293,7 @@ public class ReferralIT extends Abstract
// -------------------------------------------------------------------
td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
-
+
Attributes userEntry = new BasicAttributes( "objectClass", "top", true );
userEntry.get( "objectClass" ).add( "person" );
userEntry.put( "sn", "karasulu" );
@@ -329,9 +328,9 @@ public class ReferralIT extends Abstract
// encounter referral errors with referral setting set to throw.
// -------------------------------------------------------------------
Dn userDn = new Dn( "cn=alex karasulu,ou=apache,ou=users,ou=system" );
- Entry userEntry = new DefaultEntry( getService().getSchemaManager(), userDn);
-
- userEntry.add( "ObjectClass", "top", "person" );
+ Entry userEntry = new DefaultEntry( getService().getSchemaManager(), userDn );
+
+ userEntry.add( "ObjectClass", "top", "person" );
userEntry.add( "sn", "karasulu" );
userEntry.add( "cn", "alex karasulu" );
@@ -438,7 +437,7 @@ public class ReferralIT extends Abstract
// abort the test because we're using the sun jdni provider
return;
}
-
+
fail( "Should fail here throwing a PartialResultException" );
}
catch ( ReferralException e )
@@ -890,7 +889,7 @@ public class ReferralIT extends Abstract
}
catch ( NamingException e )
{
- // assertTrue( e.getResultCode() == ResultCodeEnum.AFFECTS_MULTIPLE_DSAS );
+ // assertTrue( e.getResultCode() == ResultCodeEnum.AFFECTS_MULTIPLE_DSAS );
}
}
@@ -945,7 +944,7 @@ public class ReferralIT extends Abstract
catch ( NameNotFoundException e )
{
}
-
+
try
{
userCtx = ( LdapContext ) td.rootCtx.createSubcontext( "cn=akarasulu", referral );
@@ -954,7 +953,7 @@ public class ReferralIT extends Abstract
{
userCtx = ( LdapContext ) td.rootCtx.lookup( "cn=akarasulu" );
}
-
+
referral = userCtx.getAttributes( "" );
assertTrue( referral.get( "cn" ).contains( "akarasulu" ) );
assertTrue( referral.get( "sn" ).contains( "karasulu" ) );
@@ -1073,7 +1072,8 @@ public class ReferralIT extends Abstract
}
catch ( ReferralException e )
{
- assertEquals( "ldap://fermi:10389/cn=alex%20karasulu,ou=apache,ou=users,ou=system??base", e.getReferralInfo() );
+ assertEquals( "ldap://fermi:10389/cn=alex%20karasulu,ou=apache,ou=users,ou=system??base",
+ e.getReferralInfo() );
assertTrue( e.skipReferral() );
assertEquals( "ldap://hertz:10389/cn=alex%20karasulu,ou=apache,ou=users,dc=example,dc=com??base", e
.getReferralInfo() );
@@ -1094,7 +1094,7 @@ public class ReferralIT extends Abstract
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
NamingEnumeration<SearchResult> list = td.rootCtx.search( "", "(objectClass=*)", controls );
Map<String, SearchResult> results = new HashMap<String, SearchResult>();
-
+
while ( list.hasMore() )
{
SearchResult result = list.next();
@@ -1175,7 +1175,7 @@ public class ReferralIT extends Abstract
oc.add( "extensibleObject" );
oc.add( "referral" );
attrs.put( oc );
-
+
attrs.put( "ref", "ldap://" );
attrs.put( "cn", "refWithEmptyDN" );
@@ -1210,7 +1210,7 @@ public class ReferralIT extends Abstract
oc.add( "extensibleObject" );
oc.add( "referral" );
attrs.put( oc );
-
+
Attribute ref = new BasicAttribute( "ref", "ldap://localhost/cn=RefWithAttributes?cn" );
attrs.put( ref );
@@ -1246,7 +1246,7 @@ public class ReferralIT extends Abstract
oc.add( "extensibleObject" );
oc.add( "referral" );
attrs.put( oc );
-
+
Attribute ref = new BasicAttribute( "ref", "ldap://localhost/cn=RefWithScope??sub" );
attrs.put( ref );
@@ -1282,7 +1282,7 @@ public class ReferralIT extends Abstract
oc.add( "extensibleObject" );
oc.add( "referral" );
attrs.put( oc );
-
+
Attribute ref = new BasicAttribute( "ref", "ldap://localhost/cn=RefWithFilter???(cn=*)" );
attrs.put( ref );
@@ -1318,7 +1318,7 @@ public class ReferralIT extends Abstract
oc.add( "extensibleObject" );
oc.add( "referral" );
attrs.put( oc );
-
+
Attribute ref = new BasicAttribute( "ref", "ldap://localhost/cn=RefWithExtension????x-extension=1.2.3.4" );
attrs.put( ref );
@@ -1354,8 +1354,9 @@ public class ReferralIT extends Abstract
oc.add( "extensibleObject" );
oc.add( "referral" );
attrs.put( oc );
-
- Attribute ref = new BasicAttribute( "ref", "ldap://localhost/cn=RefWithCriticalExtension????!x-extension=1.2.3.4" );
+
+ Attribute ref = new BasicAttribute( "ref",
+ "ldap://localhost/cn=RefWithCriticalExtension????!x-extension=1.2.3.4" );
attrs.put( ref );
attrs.put( "cn", "RefWithCriticalExtension" );
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java Tue Jan 24 16:42:44 2012
@@ -48,7 +48,7 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@CreateDS(name = "RootDSEIT")
public class RootDSEIT extends AbstractLdapTestUnit
{
@@ -62,7 +62,7 @@ public class RootDSEIT extends AbstractL
@Test
public void testGetInitialContext() throws NamingException
{
- Hashtable<String,Object> env = new Hashtable<String,Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.PROVIDER_URL, "" );
env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -84,7 +84,7 @@ public class RootDSEIT extends AbstractL
@Test
public void testGetInitialContextLookupAttributes() throws NamingException
{
- Hashtable<String,Object> env = new Hashtable<String,Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.PROVIDER_URL, "" );
env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -111,7 +111,7 @@ public class RootDSEIT extends AbstractL
@Test
public void testGetInitialContextLookupAttributesByName() throws NamingException
{
- Hashtable<String,Object> env = new Hashtable<String,Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.PROVIDER_URL, "" );
env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -139,7 +139,7 @@ public class RootDSEIT extends AbstractL
@Test
public void testGetInitialContextLookupAttributesByNameWithOC() throws NamingException
{
- Hashtable<String,Object> env = new Hashtable<String,Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.PROVIDER_URL, "" );
env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -167,7 +167,7 @@ public class RootDSEIT extends AbstractL
@Test
public void testDelete() throws NamingException
{
- Hashtable<String,Object> env = new Hashtable<String,Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.PROVIDER_URL, "" );
env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -202,7 +202,7 @@ public class RootDSEIT extends AbstractL
@Test
public void testRename() throws NamingException
{
- Hashtable<String,Object> env = new Hashtable<String,Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.PROVIDER_URL, "" );
env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -237,7 +237,7 @@ public class RootDSEIT extends AbstractL
@Test
public void testModify() throws NamingException
{
- Hashtable<String,Object> env = new Hashtable<String,Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.PROVIDER_URL, "" );
env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -272,7 +272,7 @@ public class RootDSEIT extends AbstractL
@Test
public void testModify2() throws NamingException
{
- Hashtable<String,Object> env = new Hashtable<String,Object>();
+ Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, getService() );
env.put( Context.PROVIDER_URL, "" );
env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java Tue Jan 24 16:42:44 2012
@@ -57,11 +57,11 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@CreateDS(name = "UniqueMemeberIT")
public class UniqueMemberIT extends AbstractLdapTestUnit
{
-
+
/**
* Test a valid entry
*
@@ -79,7 +79,7 @@ public class UniqueMemberIT extends Abst
Attribute dc = new BasicAttribute( "uniqueMember", "cn=kevin spacey, dc=example, dc=org" );
attrs.put( oc );
attrs.put( cn );
- attrs.put( dc);
+ attrs.put( dc );
String base = "cn=kevin Spacey";
@@ -92,40 +92,40 @@ public class UniqueMemberIT extends Abst
{
fail();
}
-
+
Attributes returned = sysRoot.getAttributes( "cn=kevin Spacey" );
-
+
NamingEnumeration<? extends Attribute> attrList = returned.getAll();
-
+
while ( attrList.hasMore() )
{
Attribute attr = attrList.next();
-
+
if ( attr.getID().equalsIgnoreCase( "cn" ) )
{
assertEquals( "kevin Spacey", attr.get() );
continue;
}
-
+
if ( attr.getID().equalsIgnoreCase( "objectClass" ) )
{
NamingEnumeration<?> values = attr.getAll();
Set<String> expectedValues = new HashSet<String>();
-
+
expectedValues.add( "top" );
expectedValues.add( "groupofuniquenames" );
-
+
while ( values.hasMoreElements() )
{
- String value = Strings.toLowerCase( ( (String)values.nextElement() ) );
+ String value = Strings.toLowerCase( ( ( String ) values.nextElement() ) );
assertTrue( expectedValues.contains( value ) );
expectedValues.remove( value );
}
-
+
assertEquals( 0, expectedValues.size() );
continue;
}
-
+
if ( attr.getID().equalsIgnoreCase( "uniqueMember" ) )
{
assertEquals( "cn=kevin spacey, dc=example, dc=org", attr.get() );
@@ -151,7 +151,7 @@ public class UniqueMemberIT extends Abst
Attribute dc = new BasicAttribute( "uniqueMember", "cn=kevin spacey 2, dc=example, dc=org#'010101'B" );
attrs.put( oc );
attrs.put( cn );
- attrs.put( dc);
+ attrs.put( dc );
String base = "cn=kevin Spacey 2";
@@ -164,40 +164,40 @@ public class UniqueMemberIT extends Abst
{
fail();
}
-
+
Attributes returned = sysRoot.getAttributes( "cn=kevin Spacey 2" );
-
+
NamingEnumeration<? extends Attribute> attrList = returned.getAll();
-
+
while ( attrList.hasMore() )
{
Attribute attr = attrList.next();
-
+
if ( attr.getID().equalsIgnoreCase( "cn" ) )
{
assertEquals( "kevin Spacey 2", attr.get() );
continue;
}
-
+
if ( attr.getID().equalsIgnoreCase( "objectClass" ) )
{
NamingEnumeration<?> values = attr.getAll();
Set<String> expectedValues = new HashSet<String>();
-
+
expectedValues.add( "top" );
expectedValues.add( "groupofuniquenames" );
-
+
while ( values.hasMoreElements() )
{
- String value = Strings.toLowerCase( ( (String)values.nextElement() ) );
+ String value = Strings.toLowerCase( ( ( String ) values.nextElement() ) );
assertTrue( expectedValues.contains( value ) );
expectedValues.remove( value );
}
-
+
assertEquals( 0, expectedValues.size() );
continue;
}
-
+
if ( attr.getID().equalsIgnoreCase( "uniqueMember" ) )
{
assertEquals( "cn=kevin spacey 2, dc=example, dc=org#'010101'B", attr.get() );
@@ -223,7 +223,7 @@ public class UniqueMemberIT extends Abst
Attribute dc = new BasicAttribute( "uniqueMember", "kevin spacey bad, dc=example, dc=org#'010101'B" );
attrs.put( oc );
attrs.put( cn );
- attrs.put( dc);
+ attrs.put( dc );
String base = "cn=kevin Spacey bad";
@@ -257,7 +257,7 @@ public class UniqueMemberIT extends Abst
Attribute dc = new BasicAttribute( "uniqueMember", "cn=kevin spacey bad 2, dc=example, dc=org#'010101'" );
attrs.put( oc );
attrs.put( cn );
- attrs.put( dc);
+ attrs.put( dc );
String base = "cn=kevin Spacey bad 2";
@@ -272,7 +272,7 @@ public class UniqueMemberIT extends Abst
assertTrue( true );
}
}
-
+
@Test
public void testSearchUniqueMemberFilter() throws Exception
@@ -286,7 +286,7 @@ public class UniqueMemberIT extends Abst
Attribute dc = new BasicAttribute( "uniqueMember", "cn=kevin spacey, dc=example, dc=org" );
attrs.put( oc );
attrs.put( cn );
- attrs.put( dc);
+ attrs.put( dc );
String base = "cn=kevin Spacey";
@@ -303,13 +303,15 @@ public class UniqueMemberIT extends Abst
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
controls.setDerefLinkFlag( false );
- controls.setReturningAttributes( new String[] { "*" } );
+ controls.setReturningAttributes( new String[]
+ { "*" } );
sysRoot.addToEnvironment( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES,
- AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
+ AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
HashMap<String, Attributes> map = new HashMap<String, Attributes>();
- NamingEnumeration<SearchResult> list = sysRoot.search( "", "(uniqueMember=cn = kevin spacey, dc=example, dc=org)", controls );
-
+ NamingEnumeration<SearchResult> list = sysRoot.search( "",
+ "(uniqueMember=cn = kevin spacey, dc=example, dc=org)", controls );
+
while ( list.hasMore() )
{
SearchResult result = list.next();
@@ -317,9 +319,9 @@ public class UniqueMemberIT extends Abst
}
assertEquals( "Expected number of results returned was incorrect!", 1, map.size() );
-
+
attrs = map.get( "cn=kevin spacey,ou=system" );
-
+
assertNotNull( attrs.get( "objectClass" ) );
assertNotNull( attrs.get( "cn" ) );
assertNotNull( attrs.get( "uniqueMember" ) );
@@ -338,7 +340,7 @@ public class UniqueMemberIT extends Abst
Attribute dc = new BasicAttribute( "uniqueMember", "cn=kevin spacey,dc=example,dc=org" );
attrs.put( oc );
attrs.put( cn );
- attrs.put( dc);
+ attrs.put( dc );
String base = "cn=kevin Spacey";
@@ -355,13 +357,15 @@ public class UniqueMemberIT extends Abst
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
controls.setDerefLinkFlag( false );
- controls.setReturningAttributes( new String[] { "*" } );
+ controls.setReturningAttributes( new String[]
+ { "*" } );
sysRoot.addToEnvironment( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES,
- AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
+ AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
HashMap<String, Attributes> map = new HashMap<String, Attributes>();
- NamingEnumeration<SearchResult> list = sysRoot.search( "", "(uniqueMember=cn = Kevin Spacey , dc = example , dc = ORG)", controls );
-
+ NamingEnumeration<SearchResult> list = sysRoot.search( "",
+ "(uniqueMember=cn = Kevin Spacey , dc = example , dc = ORG)", controls );
+
while ( list.hasMore() )
{
SearchResult result = list.next();
@@ -369,9 +373,9 @@ public class UniqueMemberIT extends Abst
}
assertEquals( "Expected number of results returned was incorrect!", 1, map.size() );
-
+
attrs = map.get( "cn=kevin spacey,ou=system" );
-
+
assertNotNull( attrs.get( "objectClass" ) );
assertNotNull( attrs.get( "cn" ) );
assertNotNull( attrs.get( "uniqueMember" ) );
@@ -390,7 +394,7 @@ public class UniqueMemberIT extends Abst
Attribute dc = new BasicAttribute( "uniqueMember", "cn=kevin spacey,dc=example,dc=org" );
attrs.put( oc );
attrs.put( cn );
- attrs.put( dc);
+ attrs.put( dc );
String base = "cn=kevin Spacey";
@@ -407,12 +411,14 @@ public class UniqueMemberIT extends Abst
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
controls.setDerefLinkFlag( false );
- controls.setReturningAttributes( new String[] { "*" } );
+ controls.setReturningAttributes( new String[]
+ { "*" } );
sysRoot.addToEnvironment( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES,
- AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
+ AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
+
+ NamingEnumeration<SearchResult> list = sysRoot.search( "", "(uniqueMember=cn=cevin spacey,dc=example,dc=org)",
+ controls );
- NamingEnumeration<SearchResult> list = sysRoot.search( "", "(uniqueMember=cn=cevin spacey,dc=example,dc=org)", controls );
-
assertFalse( list.hasMore() );
}
@@ -429,7 +435,7 @@ public class UniqueMemberIT extends Abst
Attribute dc = new BasicAttribute( "uniqueMember", "cn=kevin spacey,dc=example,dc=org#'010101'B" );
attrs.put( oc );
attrs.put( cn );
- attrs.put( dc);
+ attrs.put( dc );
String base = "cn=kevin Spacey";
@@ -446,13 +452,15 @@ public class UniqueMemberIT extends Abst
SearchControls controls = new SearchControls();
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
controls.setDerefLinkFlag( false );
- controls.setReturningAttributes( new String[] { "*" } );
+ controls.setReturningAttributes( new String[]
+ { "*" } );
sysRoot.addToEnvironment( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES,
- AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
+ AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
HashMap<String, Attributes> map = new HashMap<String, Attributes>();
- NamingEnumeration<SearchResult> list = sysRoot.search( "", "(uniqueMember=cn= Kevin Spacey, dc=example, dc=org #'010101'B)", controls );
-
+ NamingEnumeration<SearchResult> list = sysRoot.search( "",
+ "(uniqueMember=cn= Kevin Spacey, dc=example, dc=org #'010101'B)", controls );
+
while ( list.hasMore() )
{
SearchResult result = list.next();
@@ -460,9 +468,9 @@ public class UniqueMemberIT extends Abst
}
assertEquals( "Expected number of results returned was incorrect!", 1, map.size() );
-
+
attrs = map.get( "cn=kevin spacey,ou=system" );
-
+
assertNotNull( attrs.get( "objectClass" ) );
assertNotNull( attrs.get( "cn" ) );
assertNotNull( attrs.get( "uniqueMember" ) );
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java Tue Jan 24 16:42:44 2012
@@ -37,13 +37,12 @@ import org.junit.Test;
import org.junit.runner.RunWith;
-
/**
* Test cases for the normalization service.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@CreateDS(name = "NormalizationServiceIT")
public final class NormalizationServiceIT extends AbstractLdapTestUnit
{
@@ -55,13 +54,13 @@ public final class NormalizationServiceI
Use @Ldif to load this data but for now we can do it with code.
-dn: ou=direct report view,ou=system
-objectClass: organizationalUnit
-ou: direct report view
-
-dn: ou=corporate category\, operations,ou=direct report view,ou=system
-objectClass: organizationalUnit
-ou: corporate category\, operations
+ dn: ou=direct report view,ou=system
+ objectClass: organizationalUnit
+ ou: direct report view
+
+ dn: ou=corporate category\, operations,ou=direct report view,ou=system
+ objectClass: organizationalUnit
+ ou: corporate category\, operations
*/
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java Tue Jan 24 16:42:44 2012
@@ -75,12 +75,12 @@ public class OperationalAttributeService
// add this entry before each test because we want
// to check that operational attributes are added
Entry entry = new DefaultEntry(
- DN_KATE_BUSH,
- "objectClass: top",
- "objectClass: person",
- "cn: Kate Bush",
- "sn: Bush");
-
+ DN_KATE_BUSH,
+ "objectClass: top",
+ "objectClass: person",
+ "cn: Kate Bush",
+ "sn: Bush" );
+
connection.add( entry );
}
@@ -102,14 +102,14 @@ public class OperationalAttributeService
@Test
public void testBinaryAttributeFilterExtension() throws Exception
{
- Entry entry = new DefaultEntry(
- "ou=test,ou=system",
- "objectClass: top",
+ Entry entry = new DefaultEntry(
+ "ou=test,ou=system",
+ "objectClass: top",
"objectClass: person",
- "objectClass: organizationalPerson",
- "objectClass: inetOrgPerson",
- "ou", "test",
- "cn", "test",
+ "objectClass: organizationalPerson",
+ "objectClass: inetOrgPerson",
+ "ou", "test",
+ "cn", "test",
"sn", "test" );
connection.add( entry );
@@ -136,7 +136,7 @@ public class OperationalAttributeService
value = jpegPhoto.getBytes();
assertTrue( value instanceof byte[] );
assertEquals( "0xFF 0xD8 0xFF 0xE0 0x01 0x02 0x4A 0x46 0x49 0x46 0x00 0x45 0x23 0x7D 0x7F ", Strings
- .dumpBytes((byte[]) value) );
+ .dumpBytes( ( byte[] ) value ) );
}
@@ -146,10 +146,10 @@ public class OperationalAttributeService
/*
* create ou=testing00,ou=system
*/
- Entry entry = new DefaultEntry(
- "ou=testing00,ou=system",
+ Entry entry = new DefaultEntry(
+ "ou=testing00,ou=system",
"objectClass: top",
- "objectClass: organizationalUnit",
+ "objectClass: organizationalUnit",
"ou", "testing00" );
connection.add( entry );
@@ -229,23 +229,23 @@ public class OperationalAttributeService
@Test
public void testConfirmNonAdminUserDnIsCreatorsName() throws Exception
{
- Entry entry = new DefaultEntry(
- "uid=akarasulu,ou=users,ou=system",
+ Entry entry = new DefaultEntry(
+ "uid=akarasulu,ou=users,ou=system",
"objectClass: top",
- "objectClass: person",
- "objectClass: organizationalPerson",
+ "objectClass: person",
+ "objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
- "ou: Engineering",
- "ou: People",
- "uid: akarasulu",
- "l", "Bogusville",
- "cn: Alex Karasulu",
+ "ou: Engineering",
+ "ou: People",
+ "uid: akarasulu",
+ "l", "Bogusville",
+ "cn: Alex Karasulu",
"sn: Karasulu",
- "givenName: Alex",
- "mail: akarasulu@apache.org",
+ "givenName: Alex",
+ "mail: akarasulu@apache.org",
"telephoneNumber: +1 408 555 4798",
- "facsimileTelephoneNumber: +1 408 555 9751",
- "roomnumber: 4612",
+ "facsimileTelephoneNumber: +1 408 555 9751",
+ "roomnumber: 4612",
"userPassword: test" );
connection.add( entry );
@@ -344,7 +344,7 @@ public class OperationalAttributeService
*
* @throws NamingException on error
*/
- @Test( expected = LdapNoPermissionException.class )
+ @Test(expected = LdapNoPermissionException.class)
public void testModifyOperationalAttributeRemove() throws Exception
{
Modification modifyOp = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
@@ -359,7 +359,7 @@ public class OperationalAttributeService
*
* @throws NamingException on error
*/
- @Test( expected = LdapNoPermissionException.class )
+ @Test(expected = LdapNoPermissionException.class)
public void testModifyOperationalAttributeReplace() throws Exception
{
Modification modifyOp = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
@@ -392,7 +392,7 @@ public class OperationalAttributeService
assertNotNull( entry.get( "modifyTimestamp" ) );
connection.rename( DN_KB, "cn=Kate Bush" );
-}
+ }
/**
@@ -416,9 +416,9 @@ public class OperationalAttributeService
assertNotNull( entry.get( "createTimestamp" ) );
assertNotNull( entry.get( "modifiersName" ) );
assertNotNull( entry.get( "modifyTimestamp" ) );
-
+
connection.delete( "cn=Kate Bush,ou=users,ou=system" );
- }
+ }
/**
@@ -442,7 +442,7 @@ public class OperationalAttributeService
assertNotNull( entry.get( "createTimestamp" ) );
assertNotNull( entry.get( "modifiersName" ) );
assertNotNull( entry.get( "modifyTimestamp" ) );
-
+
connection.delete( "cn=KB,ou=users,ou=system" );
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java Tue Jan 24 16:42:44 2012
@@ -55,45 +55,45 @@ import org.slf4j.LoggerFactory;
* Creates a DirectoryService configured with two separate dc=com based
* domains to test multiple partitions.
*/
-@CreateDS( name = "PartitionIT-class",
+@CreateDS(name = "PartitionIT-class",
partitions =
- {
- @CreatePartition(
- name = "foo",
- suffix = "dc=foo,dc=com",
- contextEntry = @ContextEntry(
- entryLdif =
+ {
+ @CreatePartition(
+ name = "foo",
+ suffix = "dc=foo,dc=com",
+ contextEntry = @ContextEntry(
+ entryLdif =
"dn: dc=foo,dc=com\n" +
- "dc: foo\n" +
- "objectClass: top\n" +
- "objectClass: domain\n\n" ),
- indexes =
- {
- @CreateIndex( attribute = "objectClass" ),
- @CreateIndex( attribute = "dc" ),
- @CreateIndex( attribute = "ou" )
- } ),
+ "dc: foo\n" +
+ "objectClass: top\n" +
+ "objectClass: domain\n\n"),
+ indexes =
+ {
+ @CreateIndex(attribute = "objectClass"),
+ @CreateIndex(attribute = "dc"),
+ @CreateIndex(attribute = "ou")
+ }),
@CreatePartition(
name = "bar",
suffix = "dc=bar,dc=com",
- contextEntry = @ContextEntry(
+ contextEntry = @ContextEntry(
entryLdif =
- "dn: dc=bar,dc=com\n" +
+ "dn: dc=bar,dc=com\n" +
"dc: bar\n" +
"objectClass: top\n" +
- "objectClass: domain\n\n" ),
- indexes =
- {
- @CreateIndex( attribute = "objectClass" ),
- @CreateIndex( attribute = "dc" ),
- @CreateIndex( attribute = "ou" )
- } )
- } )
+ "objectClass: domain\n\n"),
+ indexes =
+ {
+ @CreateIndex(attribute = "objectClass"),
+ @CreateIndex(attribute = "dc"),
+ @CreateIndex(attribute = "ou")
+ })
+ })
public final class PartitionIT extends AbstractLdapTestUnit
{
private static final Logger LOG = LoggerFactory.getLogger( PartitionIT.class );
-
+
/**
* Test case to weed out issue in DIRSERVER-1118.
*
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/prefs/PreferencesIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/prefs/PreferencesIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/prefs/PreferencesIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/prefs/PreferencesIT.java Tue Jan 24 16:42:44 2012
@@ -39,7 +39,7 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@CreateDS(name = "PreferencesIT")
public class PreferencesIT extends AbstractLdapTestUnit
{
@@ -118,7 +118,6 @@ public class PreferencesIT extends Abstr
}
*/
-
/**
* Tests the creation and use of a new preferences node.
*
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java Tue Jan 24 16:42:44 2012
@@ -19,6 +19,7 @@
*/
package org.apache.directory.server.core.schema;
+
import java.io.File;
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -27,6 +28,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.util.Strings;
import org.junit.Before;
+
/**
* A common class for all the MetaXXXHandler test classes
*
@@ -36,6 +38,7 @@ public abstract class AbstractMetaSchema
{
protected static String workingDir;
+
@Before
public void init() throws Exception
{
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java Tue Jan 24 16:42:44 2012
@@ -57,7 +57,7 @@ import org.junit.runner.RunWith;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith ( FrameworkRunner.class )
+@RunWith(FrameworkRunner.class)
@CreateDS(name = "MetaAttributeTypeHandlerIT")
public class MetaAttributeTypeHandlerIT extends AbstractMetaSchemaObjectHandler
{
@@ -71,7 +71,7 @@ public class MetaAttributeTypeHandlerIT
private static LdapConnection connection;
private SchemaManager schemaManager;
-
+
@Before
public void init() throws Exception
{
@@ -80,6 +80,7 @@ public class MetaAttributeTypeHandlerIT
schemaManager = getService().getSchemaManager();
}
+
// ----------------------------------------------------------------------
// Test all core methods with normal operational pathways
// ----------------------------------------------------------------------
@@ -103,7 +104,7 @@ public class MetaAttributeTypeHandlerIT
"m-name: attributeCertificateAttribute",
"m-syntax: 1.3.6.1.4.1.1466.115.121.1.8",
"m-description: attribute certificate use ;binary"
- );
+ );
// Pre-checks
assertFalse( isOnDisk( dn ) );
@@ -170,7 +171,7 @@ public class MetaAttributeTypeHandlerIT
connection.add( entry );
fail( "Should not be there" );
}
- catch( LdapException nnfe )
+ catch ( LdapException nnfe )
{
// Expected result.
}
@@ -233,7 +234,7 @@ public class MetaAttributeTypeHandlerIT
"m-syntax: 1.3.6.1.4.1.1466.115.121.1.8",
"m-length: 0",
"m-singleValue: TRUE"
- );
+ );
// Pre-checks
assertFalse( isOnDisk( dn ) );
@@ -323,7 +324,7 @@ public class MetaAttributeTypeHandlerIT
connection.delete( dn );
fail( "should not be able to delete a attributeType in use" );
}
- catch( LdapException e )
+ catch ( LdapException e )
{
}
@@ -382,7 +383,7 @@ public class MetaAttributeTypeHandlerIT
new DefaultAttribute( "m-description", DESCRIPTION1 ) );
Modification mod2 = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
- new DefaultAttribute( "m-syntax", SchemaConstants.DIRECTORY_STRING_SYNTAX ) );
+ new DefaultAttribute( "m-syntax", SchemaConstants.DIRECTORY_STRING_SYNTAX ) );
connection.modify( dn, mod1, mod2 );
@@ -410,7 +411,7 @@ public class MetaAttributeTypeHandlerIT
Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
Rdn rdn = new Rdn( "m-oid=" + NEW_OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
-
+
connection.rename( dn, rdn );
assertFalse( "old attributeType OID should be removed from the registry after being renamed",
@@ -439,7 +440,7 @@ public class MetaAttributeTypeHandlerIT
connection.rename( dn, rdn );
fail( "should not be able to rename a attributeType in use" );
}
- catch( LdapUnwillingToPerformException e )
+ catch ( LdapUnwillingToPerformException e )
{
assertEquals( e.getResultCode(), ResultCodeEnum.UNWILLING_TO_PERFORM );
}
@@ -465,7 +466,7 @@ public class MetaAttributeTypeHandlerIT
connection.move( dn, newDn );
assertTrue( "attributeType OID should still be present",
- schemaManager.getAttributeTypeRegistry().contains( OID ) );
+ schemaManager.getAttributeTypeRegistry().contains( OID ) );
assertEquals( "attributeType schema should be set to apache not apachemeta",
schemaManager.getAttributeTypeRegistry().getSchemaName( OID ), "apache" );
@@ -511,7 +512,7 @@ public class MetaAttributeTypeHandlerIT
connection.move( dn, top );
fail( "should not be able to move a attributeType up to ou=schema" );
}
- catch( LdapInvalidDnException e )
+ catch ( LdapInvalidDnException e )
{
assertEquals( e.getResultCode(), ResultCodeEnum.NAMING_VIOLATION );
}
@@ -536,7 +537,7 @@ public class MetaAttributeTypeHandlerIT
connection.move( dn, newDn );
fail( "should not be able to move a attributeType into comparators container" );
}
- catch( LdapInvalidDnException e )
+ catch ( LdapInvalidDnException e )
{
assertEquals( e.getResultCode(), ResultCodeEnum.NAMING_VIOLATION );
}
@@ -580,7 +581,7 @@ public class MetaAttributeTypeHandlerIT
connection.move( dn, newDn );
fail( "should not be able to move a attributeType in use" );
}
- catch( LdapUnwillingToPerformException e )
+ catch ( LdapUnwillingToPerformException e )
{
assertEquals( e.getResultCode(), ResultCodeEnum.UNWILLING_TO_PERFORM );
}
@@ -606,7 +607,7 @@ public class MetaAttributeTypeHandlerIT
connection.move( dn, newDn );
fail( "should not be able to move a attributeType in use" );
}
- catch( LdapUnwillingToPerformException e )
+ catch ( LdapUnwillingToPerformException e )
{
assertEquals( e.getResultCode(), ResultCodeEnum.UNWILLING_TO_PERFORM );
}
@@ -641,7 +642,6 @@ public class MetaAttributeTypeHandlerIT
assertEquals( schemaManager.getAttributeTypeRegistry().getSchemaName( DEPENDEE_OID ), "apachemeta" );
}
-
// ----------------------------------------------------------------------
// Let's try some freaky stuff
// ----------------------------------------------------------------------
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java?rev=1235347&r1=1235346&r2=1235347&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java Tue Jan 24 16:42:44 2012
@@ -79,7 +79,6 @@ public class MetaComparatorHandlerIT ext
}
-
@Before
public void init() throws Exception
{
@@ -163,7 +162,7 @@ public class MetaComparatorHandlerIT ext
"objectClass: metaTop",
"objectClass: metaComparator",
"m-fqcn", StringComparator.class.getName(),
- "m-oid", OID,
+ "m-oid", OID,
"m-description: A test comparator" );
// Pre-checks
@@ -658,7 +657,7 @@ public class MetaComparatorHandlerIT ext
// nis is inactive by default
Dn newDn = new Dn( "m-oid=" + OID + ",ou=comparators,cn=nis,ou=schema" );
- connection.move( dn, newDn);
+ connection.move( dn, newDn );
assertFalse( "comparator OID should no longer be present", schemaManager.getComparatorRegistry().contains( OID ) );
}