directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1343588 - /directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/dsml/engine/Dsmlv2EngineTest.java
Date Tue, 29 May 2012 07:44:09 GMT
Author: kayyagari
Date: Tue May 29 07:44:08 2012
New Revision: 1343588

URL: http://svn.apache.org/viewvc?rev=1343588&view=rev
Log:
test case for parsing batch response present in a soap envelope

Modified:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/dsml/engine/Dsmlv2EngineTest.java

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/dsml/engine/Dsmlv2EngineTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/dsml/engine/Dsmlv2EngineTest.java?rev=1343588&r1=1343587&r2=1343588&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/dsml/engine/Dsmlv2EngineTest.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/dsml/engine/Dsmlv2EngineTest.java
Tue May 29 07:44:08 2012
@@ -99,4 +99,34 @@ public class Dsmlv2EngineTest extends Ab
 
         assertEquals( 5, searchResp.getSearchResultEntryList().size() );
     }
+    
+    
+    @Test
+    public void testEngineWithSearchResponseInSoapEnvelope() throws Exception
+    {
+        InputStream dsmlIn = getClass().getClassLoader().getResourceAsStream( "dsml-search-req.xml"
);
+
+        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
+        
+        engine.setGenerateSoapResp( true );
+        
+        engine.processDSML( dsmlIn, byteOut );
+
+        engine.setGenerateSoapResp( false );
+        
+        String resp = byteOut.toString();
+
+        Dsmlv2ResponseParser respParser = new Dsmlv2ResponseParser( LdapApiServiceFactory.getSingleton()
);
+        respParser.setInput( resp );
+
+        respParser.parseAllResponses();
+
+        BatchResponseDsml batchResp = respParser.getBatchResponse();
+
+        assertNotNull( batchResp );
+
+        SearchResponse searchResp = ( SearchResponse ) batchResp.getCurrentResponse().getDecorated();
+
+        assertEquals( 5, searchResp.getSearchResultEntryList().size() );
+    }
 }



Mime
View raw message