/**
* Test parsing of a response with a (optional) Control element with empty value
*/
public void testResponseWith1ControlEmptyValue()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser();
parser.setInputFile( SearchResultEntryTest.class.getResource( "response_with_1_control_empty_value.xml" )
.getFile() );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
.getCurrentSearchResultEntry();
Control control = searchResultEntry.getCurrentControl();
assertEquals( 1, searchResultEntry.getControls().size() );
assertTrue( control.getCriticality() );