directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1064406 - in /directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2: delRequest/DelRequestTest.java delResponse/DelResponseTest.java
Date Fri, 28 Jan 2011 01:14:38 GMT
Author: elecharny
Date: Fri Jan 28 01:14:38 2011
New Revision: 1064406

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

Modified:
    directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java
    directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java?rev=1064406&r1=1064405&r2=1064406&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java
(original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java
Fri Jan 28 01:14:38 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;
@@ -140,9 +143,13 @@ public class DelRequestTest extends Abst
         }
 
         DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = delRequest.getCurrentControl();
+        Map<String, Control> controls = delRequest.getControls();
 
         assertEquals( 1, delRequest.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()) );
@@ -171,9 +178,13 @@ public class DelRequestTest extends Abst
         }
 
         DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = delRequest.getCurrentControl();
+        Map<String, Control> controls = delRequest.getControls();
 
         assertEquals( 1, delRequest.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())
);
@@ -202,9 +213,13 @@ public class DelRequestTest extends Abst
         }
 
         DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = delRequest.getCurrentControl();
+        Map<String, Control> controls = delRequest.getControls();
 
         assertEquals( 1, delRequest.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() );
@@ -232,9 +247,13 @@ public class DelRequestTest extends Abst
         }
 
         DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = delRequest.getCurrentControl();
+        Map<String, Control> controls = delRequest.getControls();
 
         assertEquals( 2, delRequest.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())
);
@@ -263,9 +282,13 @@ public class DelRequestTest extends Abst
         }
 
         DeleteRequest delRequest = ( DeleteRequest ) parser.getBatchRequest().getCurrentRequest();
-        Control control = delRequest.getCurrentControl();
+        Map<String, Control> controls = delRequest.getControls();
 
         assertEquals( 3, delRequest.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/delResponse/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java?rev=1064406&r1=1064405&r2=1064406&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java
(original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java
Fri Jan 28 01:14:38 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;
@@ -112,15 +114,15 @@ public class DelResponseTest extends Abs
         }
 
         DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = delResponse.getControls();
 
         assertEquals( 1, delResponse.getControls().size() );
 
-        Control control = delResponse.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()) );
     }
 
@@ -147,9 +149,13 @@ public class DelResponseTest extends Abs
         }
 
         DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
-        Control control = delResponse.getCurrentControl();
+        Map<String, Control> controls = delResponse.getControls();
 
         assertEquals( 1, delResponse.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() );
@@ -177,15 +183,15 @@ public class DelResponseTest extends Abs
         }
 
         DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = delResponse.getControls();
 
         assertEquals( 2, delResponse.getControls().size() );
 
-        Control control = delResponse.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())
);
     }
 
@@ -212,15 +218,15 @@ public class DelResponseTest extends Abs
         }
 
         DeleteResponse delResponse = ( DeleteResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = delResponse.getControls();
 
         assertEquals( 3, delResponse.getControls().size() );
 
-        Control control = delResponse.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