use of org.opendatakit.briefcase.export.ExportConfiguration in project briefcase by opendatakit.
the class ExportPanelUnitTest method saves_to_user_preferences_changes_on_a_custom_configuration.
@Test
public void saves_to_user_preferences_changes_on_a_custom_configuration() throws IOException {
BriefcasePreferences exportPreferences = new BriefcasePreferences(InMemoryPreferences.empty());
BriefcasePreferences appPreferences = new BriefcasePreferences(InMemoryPreferences.empty());
List<FormStatus> formsList = FormStatusBuilder.buildFormStatusList(10);
initialDefaultConf = ExportConfiguration.empty();
ExportForms forms = load(initialDefaultConf, formsList, exportPreferences, appPreferences);
ConfigurationPanel confPanel = ConfigurationPanel.defaultPanel(initialDefaultConf, true, true);
ExportPanelForm exportPanelForm = ExportPanelForm.from(forms, confPanel);
new ExportPanel(new TerminationFuture(), forms, exportPanelForm, exportPreferences, Runnable::run, new NoOpAnalytics());
FormStatus form = formsList.get(0);
String formId = form.getFormDefinition().getFormId();
ExportConfiguration conf = ExportConfiguration.empty();
conf.setExportDir(Paths.get(Files.createTempDirectory("briefcase_test").toUri()));
assertThat(ExportConfiguration.load(exportPreferences, buildCustomConfPrefix(formId)).getExportDir(), isEmpty());
forms.putConfiguration(form, conf);
exportPanelForm.getFormsTable().getViewModel().triggerChange();
assertThat(ExportConfiguration.load(exportPreferences, buildCustomConfPrefix(formId)).getExportDir(), isPresent());
}
use of org.opendatakit.briefcase.export.ExportConfiguration in project briefcase by opendatakit.
the class ConfigurationPanelTest method default_panel_wires_UI_fields_to_the_model.
@Test
public void default_panel_wires_UI_fields_to_the_model() {
component = ConfigurationPanelPageObject.setUpDefaultPanel(robot(), ExportConfiguration.empty(), true, true);
component.show();
component.setSomePemFile();
component.setSomeExportDir();
component.setSomeStartDate();
component.setSomeEndDate();
component.setPullBefore(true);
ExportConfiguration conf = component.getConfiguration();
assertThat(conf.getExportDir(), isPresent());
assertThat(conf.getPemFile(), isPresent());
assertThat(conf.getStartDate(), isPresent());
assertThat(conf.getEndDate(), isPresent());
assertThat(conf.getPullBefore(), isPresent());
}
Aggregations