use of org.opendatakit.briefcase.model.ExportFailedEvent in project briefcase by opendatakit.
the class FormsTableUnitTest method appends_to_a_forms_status_history_when_export_events_are_sent.
@Test
@Ignore
public void appends_to_a_forms_status_history_when_export_events_are_sent() {
FormStatus theForm = buildFormStatus(1);
ExportForms forms = new ExportForms(Collections.singletonList(theForm), ExportConfiguration.empty(), new HashMap<>(), new HashMap<>(), new HashMap<>());
TestFormsTableViewModel viewModel = new TestFormsTableViewModel(forms);
new FormsTable(forms, new TestFormsTableView(viewModel), viewModel);
// TODO Event publishing happens asynchronously. We have to work this test a little more to stop ignoring it
EventBus.publish(new ExportProgressEvent("some progress", (BriefcaseFormDefinition) theForm.getFormDefinition()));
EventBus.publish(new ExportFailedEvent((BriefcaseFormDefinition) theForm.getFormDefinition()));
EventBus.publish(new ExportSucceededEvent((BriefcaseFormDefinition) theForm.getFormDefinition()));
EventBus.publish(new ExportSucceededWithErrorsEvent((BriefcaseFormDefinition) theForm.getFormDefinition()));
assertThat(theForm.getStatusHistory(), Matchers.containsString("some progress"));
assertThat(theForm.getStatusHistory(), Matchers.containsString("Failed."));
assertThat(theForm.getStatusHistory(), Matchers.containsString("Succeeded."));
assertThat(theForm.getStatusHistory(), Matchers.containsString("Succeeded, but with errors."));
}
Aggregations