directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1064411 - in /directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2: modifyRequest/ModifyRequestTest.java modifyResponse/ModifyResponseTest.java
Date Fri, 28 Jan 2011 01:22:56 GMT
Author: elecharny
Date: Fri Jan 28 01:22:56 2011
New Revision: 1064411

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

Modified:
    directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java
    directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java?rev=1064411&r1=1064410&r2=1064411&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java
(original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java
Fri Jan 28 01:22:56 2011
@@ -23,12 +23,14 @@ 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.io.UnsupportedEncodingException;
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.Map;
 
 import javax.naming.NamingException;
 
@@ -113,9 +115,13 @@ public class ModifyRequestTest extends A
         }
 
         ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = modifyRequest.getCurrentControl();
+        Map<String, Control> controls = modifyRequest.getControls();
 
         assertEquals( 1, modifyRequest.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()) );
@@ -144,9 +150,13 @@ public class ModifyRequestTest extends A
         }
 
         ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = modifyRequest.getCurrentControl();
+        Map<String, Control> controls = modifyRequest.getControls();
 
         assertEquals( 1, modifyRequest.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())
);
@@ -175,9 +185,13 @@ public class ModifyRequestTest extends A
         }
 
         ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = modifyRequest.getCurrentControl();
+        Map<String, Control> controls = modifyRequest.getControls();
 
         assertEquals( 1, modifyRequest.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() );
@@ -206,9 +220,13 @@ public class ModifyRequestTest extends A
         }
 
         ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = modifyRequest.getCurrentControl();
+        Map<String, Control> controls = modifyRequest.getControls();
 
         assertEquals( 2, modifyRequest.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())
);
@@ -237,9 +255,13 @@ public class ModifyRequestTest extends A
         }
 
         ModifyRequest modifyRequest = ( ModifyRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = modifyRequest.getCurrentControl();
+        Map<String, Control> controls = modifyRequest.getControls();
 
         assertEquals( 3, modifyRequest.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/modifyResponse/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java?rev=1064411&r1=1064410&r2=1064411&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java
(original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java
Fri Jan 28 01:22:56 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 ModifyResponseTest extends 
         }
 
         ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = modifyResponse.getControls();
 
         assertEquals( 1, modifyResponse.getControls().size() );
 
-        Control control = modifyResponse.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 ModifyResponseTest extends 
         }
 
         ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
-        Control control = modifyResponse.getCurrentControl();
+        Map<String, Control> controls = modifyResponse.getControls();
 
         assertEquals( 1, modifyResponse.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 ModifyResponseTest extends 
         }
 
         ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = modifyResponse.getControls();
 
         assertEquals( 2, modifyResponse.getControls().size() );
 
-        Control control = modifyResponse.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 ModifyResponseTest extends 
         }
 
         ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = modifyResponse.getControls();
 
         assertEquals( 3, modifyResponse.getControls().size() );
 
-        Control control = modifyResponse.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