* Test parsing of a response with a (optional) Control element with empty value
*/
@Test
public void testResponseWith1ControlEmptyValue()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_control_empty_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( 1, searchResultEntry.getControls().size() );