directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r473665 - /directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java
Date Sat, 11 Nov 2006 08:02:32 GMT
Author: trustin
Date: Sat Nov 11 00:02:31 2006
New Revision: 473665

URL: http://svn.apache.org/viewvc?view=rev&rev=473665
Log:
Incomplete - issue 12355335: DIRSERVER-780: Create an integration test that tests various
conflict resolution scenarios. 
http://issues.apache.org/jira/browse/DIRSERVER-780
* Finished implementing ReplicationServiceIntegrationTest.  The first test case is for one-way
bind operation.  More tests will be added later.

Modified:
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java?view=diff&rev=473665&r1=473664&r2=473665
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java
Sat Nov 11 00:02:31 2006
@@ -30,9 +30,12 @@
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttributes;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
+import junit.framework.Assert;
 import junit.framework.TestCase;
 
 import org.apache.commons.io.FileUtils;
@@ -45,6 +48,8 @@
 import org.apache.directory.server.core.configuration.ShutdownConfiguration;
 import org.apache.directory.server.core.jndi.CoreContextFactory;
 import org.apache.mina.util.AvailablePortFinder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A test case for {@link ReplicationServiceIntegrationTest}
@@ -54,6 +59,8 @@
  */
 public class ReplicationServiceIntegrationTest extends TestCase
 {
+	private final Logger log = LoggerFactory.getLogger( ReplicationServiceIntegrationTest.class
);
+
 	private Map contexts = new HashMap();
 
 	protected void setUp() throws Exception
@@ -66,8 +73,22 @@
 		destroyAllReplicas();
 	}
 	
-	public void testModify() throws Exception
+	public void testOneWayBind() throws Exception
 	{
+		LdapContext ctxA = getReplicaContext( "A" );
+		
+		Attributes entry = new BasicAttributes( true );
+		entry.put( "cn", "test" );
+		entry.put( "objectClass", "top" );
+		ctxA.bind( "cn=test,ou=system", entry );
+		
+		Thread.sleep( 5000 );
+		
+		LdapContext ctxB = getReplicaContext( "B" );
+		Assert.assertNotNull( ctxB.lookup( "cn=test,ou=system" ) );
+		
+		LdapContext ctxC = getReplicaContext( "C" );
+		Assert.assertNotNull( ctxC.lookup( "cn=test,ou=system" ) );
 	}
 	
 	private void createReplicas(String[] names) throws Exception



Mime
View raw message