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 2011/01/28 02:07:39 UTC
svn commit: r1064400 -
/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java
Author: elecharny
Date: Fri Jan 28 01:07:39 2011
New Revision: 1064400
URL: http://svn.apache.org/viewvc?rev=1064400&view=rev
Log:
Some more DSML BindResponse fixes
Modified:
directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java
Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java?rev=1064400&r1=1064399&r2=1064400&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java Fri Jan 28 01:07:39 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 AuthResponseTest extends Ab
}
BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
+ Map<String, Control> controls = bindResponse.getControls();
assertEquals( 1, bindResponse.getControls().size() );
- Control control = bindResponse.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 AuthResponseTest extends Ab
}
BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
- Control control = bindResponse.getCurrentControl();
+ Map<String, Control> controls = bindResponse.getControls();
assertEquals( 1, bindResponse.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() );
@@ -178,15 +184,15 @@ public class AuthResponseTest extends Ab
}
BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
+ Map<String, Control> controls = bindResponse.getControls();
assertEquals( 2, bindResponse.getControls().size() );
- Control control = bindResponse.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()) );
}
@@ -213,15 +219,15 @@ public class AuthResponseTest extends Ab
}
BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();
+ Map<String, Control> controls = bindResponse.getControls();
assertEquals( 3, bindResponse.getControls().size() );
- Control control = bindResponse.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() );
}