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/10/06 20:14:38 UTC
svn commit: r1395140 - in
/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core:
changelog/DefaultChangeLogIT.java suites/MigratedStockCoreISuite.java
suites/StockCoreISuite.java
Author: elecharny
Date: Sat Oct 6 18:14:38 2012
New Revision: 1395140
URL: http://svn.apache.org/viewvc?rev=1395140&view=rev
Log:
Migrated the tests to use the API instead of JNDI
Modified:
directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/MigratedStockCoreISuite.java
directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/StockCoreISuite.java
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java?rev=1395140&r1=1395139&r2=1395140&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java Sat Oct 6 18:14:38 2012
@@ -34,7 +34,6 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
import org.apache.directory.server.core.integ.IntegrationUtils;
-import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
import org.apache.directory.shared.ldap.model.entry.Entry;
@@ -76,9 +75,10 @@ public class DefaultChangeLogIT extends
long revision = getService().getChangeLog().getCurrentRevision();
// add new test entry
- Entry entry = new DefaultEntry( "ou=test0,ou=system" );
- entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
- entry.add( SchemaConstants.OU_AT, "test0" );
+ Entry entry = new DefaultEntry( "ou=test0,ou=system",
+ "objectClass: organizationalUnit",
+ "ou: test0" );
+
sysRoot.add( entry );
assertEquals( revision + 1, getService().getChangeLog().getCurrentRevision() );
@@ -89,9 +89,10 @@ public class DefaultChangeLogIT extends
assertEquals( revision + 1, t0.getRevision() );
// add another test entry
- entry = new DefaultEntry( "ou=test1,ou=system" );
- entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
- entry.put( SchemaConstants.OU_AT, "test1" );
+ entry = new DefaultEntry( "ou=test1,ou=system",
+ "objectClass: organizationalUnit",
+ "ou: test1" );
+
sysRoot.add( entry );
assertEquals( revision + 2, getService().getChangeLog().getCurrentRevision() );
@@ -109,9 +110,10 @@ public class DefaultChangeLogIT extends
assertEquals( revision + 2, t1.getRevision() );
// add third test entry
- entry = new DefaultEntry( "ou=test2,ou=system" );
- entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
- entry.put( SchemaConstants.OU_AT, "test2" );
+ entry = new DefaultEntry( "ou=test2,ou=system",
+ "objectClass: organizationalUnit",
+ "ou: test2" );
+
sysRoot.add( entry );
assertEquals( revision + 3, getService().getChangeLog().getCurrentRevision() );
@@ -160,9 +162,10 @@ public class DefaultChangeLogIT extends
assertEquals( revision, getService().getChangeLog().getCurrentRevision() );
// add new test entry
- Entry entry = new DefaultEntry( "ou=test,ou=system" );
- entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
- entry.put( SchemaConstants.OU_AT, "test" );
+ Entry entry = new DefaultEntry( "ou=test,ou=system",
+ "objectClass: organizationalUnit",
+ "ou: test" );
+
sysRoot.add( entry );
assertEquals( revision + 1, getService().getChangeLog().getCurrentRevision() );
@@ -185,9 +188,10 @@ public class DefaultChangeLogIT extends
{
LdapConnection sysRoot = getAdminConnection( getService() );
Tag t0 = getService().getChangeLog().tag();
- Entry entry = new DefaultEntry( "ou=test,ou=system" );
- entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
- entry.put( SchemaConstants.OU_AT, "test" );
+ Entry entry = new DefaultEntry( "ou=test,ou=system",
+ "objectClass: organizationalUnit",
+ "ou: test" );
+
sysRoot.add( entry );
assertPresent( sysRoot, "ou=test,ou=system" );
@@ -204,9 +208,10 @@ public class DefaultChangeLogIT extends
Tag t0 = getService().getChangeLog().tag();
// add new test entry
- Entry entry = new DefaultEntry( "ou=test,ou=system" );
- entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
- entry.put( SchemaConstants.OU_AT, "test" );
+ Entry entry = new DefaultEntry( "ou=test,ou=system",
+ "objectClass: organizationalUnit",
+ "ou: test" );
+
sysRoot.add( entry );
// assert presence
@@ -226,9 +231,10 @@ public class DefaultChangeLogIT extends
public void testRevertDeleteOperations() throws Exception
{
LdapConnection sysRoot = getAdminConnection( getService() );
- Entry entry = new DefaultEntry( "ou=test,ou=system" );
- entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
- entry.put( SchemaConstants.OU_AT, "test" );
+ Entry entry = new DefaultEntry( "ou=test,ou=system",
+ "objectClass: organizationalUnit",
+ "ou: test" );
+
sysRoot.add( entry );
// tag after the addition before deletion
@@ -249,9 +255,10 @@ public class DefaultChangeLogIT extends
public void testRevertRenameOperations() throws Exception
{
LdapConnection sysRoot = getAdminConnection( getService() );
- Entry entry = new DefaultEntry( "ou=oldname,ou=system" );
- entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
- entry.put( SchemaConstants.OU_AT, "oldname" );
+ Entry entry = new DefaultEntry( "ou=oldname,ou=system",
+ "objectClass: organizationalUnit",
+ "ou: oldname" );
+
sysRoot.add( entry );
// tag after the addition before rename
@@ -275,9 +282,10 @@ public class DefaultChangeLogIT extends
public void testRevertModifyOperations() throws Exception
{
LdapConnection sysRoot = getAdminConnection( getService() );
- Entry entry = new DefaultEntry( "ou=test5,ou=system" );
- entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
- entry.put( SchemaConstants.OU_AT, "test5" );
+ Entry entry = new DefaultEntry( "ou=test5,ou=system",
+ "objectClass: organizationalUnit",
+ "ou: test5" );
+
sysRoot.add( entry );
// -------------------------------------------------------------------
@@ -298,7 +306,7 @@ public class DefaultChangeLogIT extends
assertNotNull( resusitated );
Attribute description = resusitated.get( "description" );
assertNotNull( description );
- assertEquals( "a desc value", description.getString() );
+ assertTrue( description.contains( "a desc value" ) );
// now revert and assert that the added entry re-appears
getService().revert( t0.getRevision() );
@@ -319,7 +327,7 @@ public class DefaultChangeLogIT extends
assertNotNull( resusitated );
description = resusitated.get( "description" );
assertNotNull( description );
- assertEquals( description.getString(), "old value" );
+ assertTrue( description.contains( "old value" ) );
// now tag then replace the value to "new value" and confirm
Tag t1 = getService().getChangeLog().tag();
@@ -330,9 +338,10 @@ public class DefaultChangeLogIT extends
resusitated = sysRoot.lookup( "ou=test5,ou=system" );
assertNotNull( resusitated );
+ assertTrue( resusitated.containsAttribute( "description" ) );
description = resusitated.get( "description" );
assertNotNull( description );
- assertEquals( description.getString(), "new value" );
+ assertTrue( description.contains( "new value" ) );
// now revert and assert the old value is now reverted
getService().revert( t1.getRevision() );
@@ -340,7 +349,7 @@ public class DefaultChangeLogIT extends
assertNotNull( resusitated );
description = resusitated.get( "description" );
assertNotNull( description );
- assertEquals( description.getString(), "old value" );
+ assertTrue( description.contains( "old value" ) );
// -------------------------------------------------------------------
// Modify REMOVE Test
@@ -363,7 +372,7 @@ public class DefaultChangeLogIT extends
assertNotNull( resusitated );
description = resusitated.get( "description" );
assertNotNull( description );
- assertEquals( description.getString(), "old value" );
+ assertTrue( description.contains( "old value" ) );
// -------------------------------------------------------------------
// Modify Multi Operation Test
@@ -395,7 +404,7 @@ public class DefaultChangeLogIT extends
assertPassword( resusitated, "a replaced value" );
Attribute seeAlso = resusitated.get( "seeAlso" );
assertNotNull( seeAlso );
- assertEquals( seeAlso.getString(), "ou=added" );
+ assertTrue( seeAlso.contains( "ou=added" ) );
// now we revert and make sure the old values are as they were
getService().revert( t3.getRevision() );
@@ -403,7 +412,7 @@ public class DefaultChangeLogIT extends
assertNotNull( resusitated );
description = resusitated.get( "description" );
assertNotNull( description );
- assertEquals( description.getString(), "old value" );
+ assertTrue( description.contains( "old value" ) );
assertPassword( resusitated, "to be replaced" );
seeAlso = resusitated.get( "seeAlso" );
assertNull( seeAlso );
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=1395140&r1=1395139&r2=1395140&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 Sat Oct 6 18:14:38 2012
@@ -34,6 +34,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.authz.ModifyAuthorizationIT;
import org.apache.directory.server.core.authz.MoveRenameAuthorizationIT;
import org.apache.directory.server.core.authz.SearchAuthorizationIT;
+import org.apache.directory.server.core.changelog.DefaultChangeLogIT;
import org.apache.directory.server.core.event.EventServiceIT;
import org.apache.directory.server.core.exception.ExceptionServiceIT;
import org.apache.directory.server.core.integ.FrameworkSuite;
@@ -72,6 +73,9 @@ import org.junit.runners.Suite;
MoveRenameAuthorizationIT.class,
SearchAuthorizationIT.class,
+ // changelog
+ DefaultChangeLogIT.class,
+
// event
EventServiceIT.class,
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=1395140&r1=1395139&r2=1395140&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 Sat Oct 6 18:14:38 2012
@@ -19,7 +19,6 @@
package org.apache.directory.server.core.suites;
-import org.apache.directory.server.core.changelog.DefaultChangeLogIT;
import org.apache.directory.server.core.collective.CollectiveAttributeServiceIT;
import org.apache.directory.server.core.configuration.PartitionConfigurationIT;
import org.apache.directory.server.core.integ.FrameworkSuite;
@@ -99,9 +98,6 @@ import org.junit.runners.Suite;
// ap
//AdministrativePointServiceIT.class,
- // changelog
- DefaultChangeLogIT.class,
-
// collective
CollectiveAttributeServiceIT.class,