directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1064410 - in /directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2: modDNRequest/ModifyDNRequestTest.java modDNResponse/ModifyDNResponseTest.java
Date Fri, 28 Jan 2011 01:20:06 GMT
Author: elecharny
Date: Fri Jan 28 01:20:05 2011
New Revision: 1064410

URL: http://svn.apache.org/viewvc?rev=1064410&view=rev
Log:
Fixed DSML ModifyDnRequest/Response tests

Modified:
    directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java
    directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java?rev=1064410&r1=1064409&r2=1064410&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java
(original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java
Fri Jan 28 01:20:05 2011
@@ -23,9 +23,12 @@ package org.apache.directory.shared.dsml
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.util.Map;
+
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
@@ -105,9 +108,13 @@ public class ModifyDNRequestTest extends
         }
 
         ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = modifyDNRequest.getCurrentControl();
+        Map<String, Control> controls = modifyDNRequest.getControls();
 
         assertEquals( 1, modifyDNRequest.getControls().size() );
+
+        Control control = controls.get( "1.2.840.113556.1.4.643" );
+
+        assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
         assertEquals( "Some text", Strings.utf8ToString((byte[]) control.getValue()) );
@@ -136,9 +143,13 @@ public class ModifyDNRequestTest extends
         }
 
         ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = modifyDNRequest.getCurrentControl();
+        Map<String, Control> controls = modifyDNRequest.getControls();
 
         assertEquals( 1, modifyDNRequest.getControls().size() );
+
+        Control control = controls.get( "1.2.840.113556.1.4.643" );
+
+        assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
         assertEquals( "DSMLv2.0 rocks!!", Strings.utf8ToString((byte[]) control.getValue())
);
@@ -167,9 +178,13 @@ public class ModifyDNRequestTest extends
         }
 
         ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = modifyDNRequest.getCurrentControl();
+        Map<String, Control> controls = modifyDNRequest.getControls();
 
         assertEquals( 1, modifyDNRequest.getControls().size() );
+
+        Control control = controls.get( "1.2.840.113556.1.4.643" );
+
+        assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
         assertFalse( control.hasValue() );
@@ -198,9 +213,13 @@ public class ModifyDNRequestTest extends
         }
 
         ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = modifyDNRequest.getCurrentControl();
+        Map<String, Control> controls = modifyDNRequest.getControls();
 
         assertEquals( 2, modifyDNRequest.getControls().size() );
+
+        Control control = controls.get( "1.2.840.113556.1.4.789" );
+
+        assertNotNull( control );
         assertFalse( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
         assertEquals( "Some other text", Strings.utf8ToString((byte[]) control.getValue())
);
@@ -229,9 +248,13 @@ public class ModifyDNRequestTest extends
         }
 
         ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = modifyDNRequest.getCurrentControl();
+        Map<String, Control> controls = modifyDNRequest.getControls();
 
         assertEquals( 3, modifyDNRequest.getControls().size() );
+
+        Control control = controls.get( "1.2.840.113556.1.4.456" );
+
+        assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
         assertFalse( control.hasValue() );

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java?rev=1064410&r1=1064409&r2=1064410&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java
(original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java
Fri Jan 28 01:20:05 2011
@@ -23,11 +23,13 @@ package org.apache.directory.shared.dsml
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.Collection;
+import java.util.Map;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
@@ -113,15 +115,15 @@ public class ModifyDNResponseTest extend
         }
 
         ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = modifyDNResponse.getControls();
 
         assertEquals( 1, modifyDNResponse.getControls().size() );
 
-        Control control = modifyDNResponse.getCurrentControl();
+        Control control = controls.get( "1.2.840.113556.1.4.643" );
 
+        assertNotNull( control );
         assertTrue( control.isCritical() );
-
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-
         assertEquals( "Some text", Strings.utf8ToString((byte[]) control.getValue()) );
     }
 
@@ -148,9 +150,13 @@ public class ModifyDNResponseTest extend
         }
 
         ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
-        Control control = modifyDNResponse.getCurrentControl();
+        Map<String, Control> controls = modifyDNResponse.getControls();
 
         assertEquals( 1, modifyDNResponse.getControls().size() );
+
+        Control control = controls.get( "1.2.840.113556.1.4.643" );
+
+        assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
         assertFalse( control.hasValue() );
@@ -179,15 +185,15 @@ public class ModifyDNResponseTest extend
         }
 
         ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = modifyDNResponse.getControls();
 
         assertEquals( 2, modifyDNResponse.getControls().size() );
 
-        Control control = modifyDNResponse.getCurrentControl();
+        Control control = controls.get( "1.2.840.113556.1.4.789" );
 
+        assertNotNull( control );
         assertFalse( control.isCritical() );
-
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-
         assertEquals( "Some other text", Strings.utf8ToString((byte[]) control.getValue())
);
     }
 
@@ -214,15 +220,15 @@ public class ModifyDNResponseTest extend
         }
 
         ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = modifyDNResponse.getControls();
 
         assertEquals( 3, modifyDNResponse.getControls().size() );
 
-        Control control = modifyDNResponse.getCurrentControl();
+        Control control = controls.get( "1.2.840.113556.1.4.456" );
 
+        assertNotNull( control );
         assertTrue( control.isCritical() );
-
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-
         assertFalse( control.hasValue() );
     }
 



Mime
View raw message