* Test parsing of a request with a (optional) Control element
*/
@Test
public void testRequestWith1Control()
{
Dsmlv2Parser parser = null;
try
{
parser = newParser();
parser.setInput( ExtendedRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
ExtendedRequestDsml<?, ?> extendedRequest =
( ExtendedRequestDsml<?, ?> ) parser.getBatchRequest().getCurrentRequest();
Map<String, Control> controls = extendedRequest.getControls();
assertEquals( 1, extendedRequest.getControls().size() );
Control control = controls.get( "1.2.840.113556.1.4.643" );