* Test parsing of a response with 3 (optional) Control elements without value
*/
@Test
public void testResponseWith3ControlsWithoutValue()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( SearchResultEntryTest.class.getResource( "response_with_3_controls_without_value.xml" )
.openStream(), "UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
SearchResponse searchResponse = ( SearchResponse )
parser.getBatchResponse().getCurrentResponse().getDecorated();
SearchResultEntry searchResultEntry =
searchResponse.getCurrentSearchResultEntry();
Map<String, Control> controls = searchResultEntry.getControls();
assertEquals( 3, searchResultEntry.getControls().size() );