### Question:
AnalysisImportDialogController extends AbstractXulDialogController<AnalysisImportDialogModel> implements
  IImportPerspective, IOverwritableController { protected boolean handleParam( StringBuilder name, StringBuilder value ) { if ( name.length() == 0 && value.length() == 0 ) { return false; } boolean hasParameters = false; boolean connectionFound = false; String paramName = name.toString(); String paramValue = DataSourceInfoUtil.unescapeQuotes( value.toString() ); if ( paramName.equalsIgnoreCase( "Datasource" ) ) { for ( IDatabaseConnection connection : importDialogModel.getConnectionList() ) { if ( connection.getName().equals( paramValue ) ) { importDialogModel.setConnection( connection ); connectionFound = true; } } importDialogModel.addParameter( paramName, paramValue ); hasParameters = !connectionFound; } else { if ( !paramName.equalsIgnoreCase( "overwrite" ) && !paramName.equalsIgnoreCase( "Provider" ) ) { importDialogModel.addParameter( paramName, paramValue ); if ( ( paramName.equalsIgnoreCase( "EnableXmla" ) && paramValue.equalsIgnoreCase( "true" ) ) ) { hasParameters = false; } else { hasParameters = true; } } } name.setLength( 0 ); value.setLength( 0 ); return hasParameters; }  void init(); @Bindable void setRelationalConnections( List<IDatabaseConnection> connections ); static String getBaseURL(); @Bindable void setAnalysisFile(); @Bindable void setSelectedFile( String name ); XulDialog getDialog(); AnalysisImportDialogModel getDialogResult(); void removeHiddenPanels(); boolean isValid(); void handleFormPanelEvent( SubmitCompleteEvent event ); String convertToNLSMessage( String results, String fileName ); void buildAndSetParameters(); void buildAndSetParameters( boolean isEditMode ); void concreteUploadCallback( String fileName, String uploadedFile ); void genericUploadCallback( String uploadedFile ); @Bindable void setPreference( Integer preference ); @Bindable void removeParameter(); @Bindable void addParameter(); @Bindable void closeParametersDialog(); @Bindable void editParameter(); @Bindable void overwriteFileDialog( int code ); @Bindable void openParametersDialog(); void showDialog(); void setBindingFactory( final BindingFactory bf ); String getName(); void setDatasourceMessages( DatasourceMessages datasourceMessages ); FormPanel getFormPanel(); String getFileName(); void setOverwrite( boolean overwrite ); void editDatasource( final IDatasourceInfo datasourceInfo ); static final String ATTRIBUTE_STANDARD_CONNECTION; }### Answer:
@Test public void testHandleParam() throws Exception { final StringBuilder dsInputName = new StringBuilder( "DataSource" ); final StringBuilder dsInputValue = new StringBuilder( "DS &quot;Test's&quot; & <Fun>" ); final String dsExpectedValue = "DS \"Test's\" & <Fun>"; final StringBuilder dspInputName = new StringBuilder( "DynamicSchemaProcessor" ); final StringBuilder dspInputValue = new StringBuilder( "DSP's & &quot;Other&quot; <stuff>" ); final String dspExpectedValueDSP = "DSP's & \"Other\" <stuff>"; AnalysisImportDialogController controller = new AnalysisImportDialogController(); AnalysisImportDialogModel importDialogModel = new AnalysisImportDialogModel(); importDialogModel.setAnalysisParameters( new ArrayList<>() ); importDialogModel.setParameterMode( true ); Field modelField = FieldUtils.getDeclaredField( AnalysisImportDialogController.class, "importDialogModel", true ); modelField.setAccessible( true ); FieldUtils.writeField( modelField, controller, importDialogModel ); controller.handleParam( dsInputName, dsInputValue ); controller.handleParam( dspInputName, dspInputValue ); ParameterDialogModel parameterFirst = controller.getDialogResult().getAnalysisParameters().get( 0 ); ParameterDialogModel parameterSecond = controller.getDialogResult().getAnalysisParameters().get( 1 ); assertEquals( parameterFirst.getValue(), dsExpectedValue ); assertEquals( parameterSecond.getValue(), dspExpectedValueDSP ); assertEquals( controller.getDialogResult().getParameters(), "DataSource=\"DS &quot;Test's&quot; & <Fun>\";DynamicSchemaProcessor=\"DSP's & &quot;Other&quot; <stuff>\"" ); }