directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1064401 - in /directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2: compareRequest/CompareRequestTest.java compareResponse/CompareResponseTest.java
Date Fri, 28 Jan 2011 01:10:54 GMT
Author: elecharny
Date: Fri Jan 28 01:10:53 2011
New Revision: 1064401

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

Modified:
    directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java
    directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java?rev=1064401&r1=1064400&r2=1064401&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java
(original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java
Fri Jan 28 01:10:53 2011
@@ -23,10 +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.Map;
+
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
@@ -143,15 +146,15 @@ public class CompareRequestTest extends 
         }
 
         CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
+        Map<String, Control> controls = compareRequest.getControls();
 
         assertEquals( 1, compareRequest.getControls().size() );
 
-        Control control = compareRequest.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()) );
     }
 
@@ -178,15 +181,15 @@ public class CompareRequestTest extends 
         }
 
         CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
+        Map<String, Control> controls = compareRequest.getControls();
 
         assertEquals( 1, compareRequest.getControls().size() );
 
-        Control control = compareRequest.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()) );
     }
 
@@ -213,15 +216,15 @@ public class CompareRequestTest extends 
         }
 
         CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
+        Map<String, Control> controls = compareRequest.getControls();
 
         assertEquals( 1, compareRequest.getControls().size() );
 
-        Control control = compareRequest.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() );
-
         assertFalse( control.hasValue() );
     }
 
@@ -248,15 +251,15 @@ public class CompareRequestTest extends 
         }
 
         CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
+        Map<String, Control> controls = compareRequest.getControls();
 
         assertEquals( 2, compareRequest.getControls().size() );
 
-        Control control = compareRequest.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())
);
     }
 
@@ -283,15 +286,15 @@ public class CompareRequestTest extends 
         }
 
         CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();
+        Map<String, Control> controls = compareRequest.getControls();
 
         assertEquals( 3, compareRequest.getControls().size() );
 
-        Control control = compareRequest.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() );
     }
 

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java?rev=1064401&r1=1064400&r2=1064401&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java
(original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java
Fri Jan 28 01:10:53 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 CompareResponseTest extends
         }
 
         CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = compareResponse.getControls();
 
         assertEquals( 1, compareResponse.getControls().size() );
 
-        Control control = compareResponse.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 CompareResponseTest extends
         }
 
         CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
-        Control control = compareResponse.getCurrentControl();
+        Map<String, Control> controls = compareResponse.getControls();
 
         assertEquals( 1, compareResponse.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 CompareResponseTest extends
         }
 
         CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = compareResponse.getControls();
 
         assertEquals( 2, compareResponse.getControls().size() );
 
-        Control control = compareResponse.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 CompareResponseTest extends
         }
 
         CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
+        Map<String, Control> controls = compareResponse.getControls();
 
         assertEquals( 3, compareResponse.getControls().size() );
 
-        Control control = compareResponse.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