@Test public void testFailedCreation() { when(formEditorService.createForm(any(), anyString(), any())).thenThrow(new IllegalStateException("Something wrong happened")); handler.create(pkg, NEW_FORM_NAME, newResourcePresenter); verify(translationService).getTranslation(FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse); verify(busyIndicatorView).showBusyIndicator(anyString()); verify(errorCallback).error(any(), any()); }
@Override public void create(final org.guvnor.common.services.project.model.Package pkg, final String baseFileName, final NewResourcePresenter presenter) { busyIndicatorView.showBusyIndicator(translationService.getTranslation(FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse)); modelerService.call(getSuccessCallback(presenter), getErrorCallback()).createForm(pkg.getPackageMainResourcesPath(), buildFileName(baseFileName, resourceType), formModelsPresenter.getFormModel()); }
NewFormDefinitionlHandler extends DefaultNewResourceHandler { @Override public void create(final org.guvnor.common.services.project.model.Package pkg, final String baseFileName, final NewResourcePresenter presenter) { busyIndicatorView.showBusyIndicator(translationService.getTranslation(FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse)); modelerService.call(getSuccessCallback(presenter), getErrorCallback()).createForm(pkg.getPackageMainResourcesPath(), buildFileName(baseFileName, resourceType), formModelsPresenter.getFormModel()); } }
NewFormDefinitionlHandler extends DefaultNewResourceHandler { @Override public void create(final org.guvnor.common.services.project.model.Package pkg, final String baseFileName, final NewResourcePresenter presenter) { busyIndicatorView.showBusyIndicator(translationService.getTranslation(FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse)); modelerService.call(getSuccessCallback(presenter), getErrorCallback()).createForm(pkg.getPackageMainResourcesPath(), buildFileName(baseFileName, resourceType), formModelsPresenter.getFormModel()); } @Inject  NewFormDefinitionlHandler(final Caller<FormEditorService> modelerService,
                                     final FormDefinitionResourceType resourceType,
                                     final TranslationService translationService,
                                     final FormModelsPresenter formModelsPresenter,
                                     final WorkspaceProjectContext context,
                                     final Caller<KieModuleService> moduleService,
                                     final Caller<ValidationService> validationService,
                                     final PlaceManager placeManager,
                                     final Event<NotificationEvent> notificationEvent,
                                     final Event<NewResourceSuccessEvent> newResourceSuccessEvent,
                                     final BusyIndicatorView busyIndicatorView); }
NewFormDefinitionlHandler extends DefaultNewResourceHandler { @Override public void create(final org.guvnor.common.services.project.model.Package pkg, final String baseFileName, final NewResourcePresenter presenter) { busyIndicatorView.showBusyIndicator(translationService.getTranslation(FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse)); modelerService.call(getSuccessCallback(presenter), getErrorCallback()).createForm(pkg.getPackageMainResourcesPath(), buildFileName(baseFileName, resourceType), formModelsPresenter.getFormModel()); } @Inject  NewFormDefinitionlHandler(final Caller<FormEditorService> modelerService,
                                     final FormDefinitionResourceType resourceType,
                                     final TranslationService translationService,
                                     final FormModelsPresenter formModelsPresenter,
                                     final WorkspaceProjectContext context,
                                     final Caller<KieModuleService> moduleService,
                                     final Caller<ValidationService> validationService,
                                     final PlaceManager placeManager,
                                     final Event<NotificationEvent> notificationEvent,
                                     final Event<NewResourceSuccessEvent> newResourceSuccessEvent,
                                     final BusyIndicatorView busyIndicatorView); @Override String getDescription(); @Override IsWidget getIcon(); @Override ResourceTypeDefinition getResourceType(); @Override List<Pair<String, ? extends IsWidget>> getExtensions(); @Override void validate(String baseFileName,
                         ValidatorWithReasonCallback callback); @Override void create(final org.guvnor.common.services.project.model.Package pkg,
                       final String baseFileName,
                       final NewResourcePresenter presenter); @Override List<Profile> getProfiles(); }
NewFormDefinitionlHandler extends DefaultNewResourceHandler { @Override public void create(final org.guvnor.common.services.project.model.Package pkg, final String baseFileName, final NewResourcePresenter presenter) { busyIndicatorView.showBusyIndicator(translationService.getTranslation(FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse)); modelerService.call(getSuccessCallback(presenter), getErrorCallback()).createForm(pkg.getPackageMainResourcesPath(), buildFileName(baseFileName, resourceType), formModelsPresenter.getFormModel()); } @Inject  NewFormDefinitionlHandler(final Caller<FormEditorService> modelerService,
                                     final FormDefinitionResourceType resourceType,
                                     final TranslationService translationService,
                                     final FormModelsPresenter formModelsPresenter,
                                     final WorkspaceProjectContext context,
                                     final Caller<KieModuleService> moduleService,
                                     final Caller<ValidationService> validationService,
                                     final PlaceManager placeManager,
                                     final Event<NotificationEvent> notificationEvent,
                                     final Event<NewResourceSuccessEvent> newResourceSuccessEvent,
                                     final BusyIndicatorView busyIndicatorView); @Override String getDescription(); @Override IsWidget getIcon(); @Override ResourceTypeDefinition getResourceType(); @Override List<Pair<String, ? extends IsWidget>> getExtensions(); @Override void validate(String baseFileName,
                         ValidatorWithReasonCallback callback); @Override void create(final org.guvnor.common.services.project.model.Package pkg,
                       final String baseFileName,
                       final NewResourcePresenter presenter); @Override List<Profile> getProfiles();  }