/**
* Test parsing of a request with a (optional) Control element
*/
public void testRequestWith1Control()
{
Dsmlv2Parser parser = null;
try
{
parser = new Dsmlv2Parser();
parser.setInputFile( SearchRequestTest.class.getResource( "request_with_1_control.xml" ).getFile() );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();
Control control = searchRequest.getCurrentControl();
assertEquals( 1, searchRequest.getControls().size() );
assertTrue( control.getCriticality() );
assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );