org.eclipse.core.databinding.observable.value.WritableValue Java Examples
The following examples show how to use
org.eclipse.core.databinding.observable.value.WritableValue.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SmartImportBdmPage.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override public Control createControl(Composite parent, IWizardContainer wizardContainer, DataBindingContext ctx) { resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent); Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(GridLayoutFactory.fillDefaults().create()); composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); super.createControl(composite, wizardContainer, ctx); Composite importComposite = createImportComposite(composite); filePathObservable.addValueChangeListener(e -> parseInput()); ctx.bindValue(WidgetProperties.visible().observe(importComposite), new ComputedValue<Boolean>() { @Override protected Boolean calculate() { return filePathObservable.getValue() != null; } }); ctx.bindValue(new WritableValue(), importBdmModelObservable, // Purpose: disable on finish button when input isn't correct UpdateStrategyFactory.neverUpdateValueStrategy().create(), UpdateStrategyFactory.updateValueStrategy() .withValidator(new SmartImportBdmModelValidator()) .create()); return composite; }
Example #2
Source File: AvailableDataValidatorTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Test public void testValidate_OK() throws Exception { final WritableValue selectedDataObservable = new WritableValue(); final BusinessObjectData businessObjectData = aBusinessData().withClassname("org.test.Employee").build(); selectedDataObservable.setValue(businessObjectData); final List<Data> availableBusinessData = new ArrayList<>(); availableBusinessData.add(ProcessFactory.eINSTANCE.createData()); final BusinessObjectModelRepositoryStore businessObjectStore = mock(BusinessObjectModelRepositoryStore.class); when(businessObjectStore.getBusinessObjectByQualifiedName(businessObjectData.getClassName())) .thenReturn(Optional.of(new BusinessObject())); assertThat( new AvailableDataValidator(availableBusinessData, selectedDataObservable, new ArrayList<Document>(), businessObjectStore) .validate().isOK()).isTrue(); }
Example #3
Source File: EmptySelectionMultivalidatorTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Test public void shouldReturnOkWhenElementIsMandatoryAndChecked() { final IObservableSet checkedElements = new WritableSet(); final FieldToContractInputMapping rootMapping1 = new RelationFieldToContractInputMapping(Mockito.mock(RelationField.class)); final SimpleField simpleField1 = new SimpleField(); simpleField1.setNullable(false); final SimpleField simpleField2 = new SimpleField(); simpleField2.setNullable(true); final SimpleFieldToContractInputMapping childMapping1 = new SimpleFieldToContractInputMapping(simpleField1); childMapping1.setGenerated(true); final SimpleFieldToContractInputMapping childMapping2 = new SimpleFieldToContractInputMapping(simpleField2); rootMapping1.addChild(childMapping1); rootMapping1.addChild(childMapping2); final FieldToContractInputMapping rootMapping2 = new RelationFieldToContractInputMapping(Mockito.mock(RelationField.class)); checkedElements.add(rootMapping1); checkedElements.add(rootMapping2); checkedElements.add(childMapping2); checkedElements.add(childMapping1); final WritableValue selectedDataObservable = new WritableValue(); final BusinessObjectData businessObjectData = aBusinessData().withClassname("org.test.Employee").build(); selectedDataObservable.setValue(businessObjectData); final EmptySelectionMultivalidator multiValidator = new EmptySelectionMultivalidator(selectedDataObservable, checkedElements, Lists.newArrayList(rootMapping1, rootMapping2), aPool().build(),new WritableValue<GenerationOptions.EditMode>(EditMode.CREATE, EditMode.class)); assertThat(multiValidator.validate().isOK()).isTrue(); }
Example #4
Source File: SelectDataWizardPageTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Test public void shouldStatusBeOk_whenDocumentType_isSetToNone() { final List<Data> availableBusinessData = new ArrayList<Data>(); final List<Document> availableDocuments = new ArrayList<Document>(); final Contract contract = aContract().build(); final BusinessObjectData bd = aBusinessData().build(); availableBusinessData.add(bd); final Document document = ProcessFactory.eINSTANCE.createDocument(); availableDocuments.add(document); final WritableValue selectedDataObservable = new WritableValue(); selectedDataObservable.setValue(document); final SelectDataWizardPage page = new SelectDataWizardPage(contract, availableBusinessData, availableDocuments, selectedDataObservable, selectedDataObservable, new GenerationOptions(), store); page.setBusinessDataTypeSelected(false); assertThat(page.createDefaultValueAlreadyDefinedValidator().validate(document)).isEqualTo(Status.OK_STATUS); }
Example #5
Source File: CodingComposite.java From elexis-3-core with Eclipse Public License 1.0 | 6 votes |
private void initDataBinding(){ transientCodingValue = new WritableValue(); DataBindingContext bindingContext = new DataBindingContext(); IObservableValue targetObservable = SWTObservables.observeText(codeTxt, SWT.Modify); IObservableValue modelObservable = PojoObservables.observeDetailValue(transientCodingValue, "code", TransientCoding.class); bindingContext.bindValue(targetObservable, modelObservable); targetObservable = SWTObservables.observeText(displayTxt, SWT.Modify); modelObservable = PojoObservables.observeDetailValue(transientCodingValue, "display", TransientCoding.class); bindingContext.bindValue(targetObservable, modelObservable); setCoding(null); }
Example #6
Source File: SelectDataWizardPageTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Test public void shouldNotStatusBeOk_whenDocumentType_isSetToExternal() { final List<Data> availableBusinessData = new ArrayList<Data>(); final List<Document> availableDocuments = new ArrayList<Document>(); final Contract contract = aContract().build(); final Pool pool = aPool().build(); pool.setContract(contract); final BusinessObjectData bd = aBusinessData().build(); availableBusinessData.add(bd); final Document document = ProcessFactory.eINSTANCE.createDocument(); document.setDocumentType(DocumentType.EXTERNAL); availableDocuments.add(document); final WritableValue selectedDataObservable = new WritableValue(); selectedDataObservable.setValue(document); final SelectDataWizardPage page = new SelectDataWizardPage(contract, availableBusinessData, availableDocuments, selectedDataObservable, selectedDataObservable, new GenerationOptions(), store); page.setBusinessDataTypeSelected(false); assertThat(page.createDefaultValueAlreadyDefinedValidator().validate(document)).isNotEqualTo(Status.OK_STATUS); }
Example #7
Source File: SelectDataWizardPageTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Test public void should_select_first_businessVariable_whenSelecting_businessDataType() { final List<Data> availableBusinessData = new ArrayList<Data>(); final List<Document> availableDocuments = new ArrayList<Document>(); final Contract contract = aContract().build(); final BusinessObjectData bd = aBusinessData().build(); availableBusinessData.add(bd); final Document document = ProcessFactory.eINSTANCE.createDocument(); availableDocuments.add(document); final WritableValue selectedDataObservable = new WritableValue(); selectedDataObservable.setValue(document); final SelectDataWizardPage page = new SelectDataWizardPage(contract, availableBusinessData, availableDocuments, selectedDataObservable, selectedDataObservable, new GenerationOptions(), store); page.setBusinessDataTypeSelected(false); final SelectionAdapter bvSelectionAdapter = page.createBusinessVariableSelectionAdapter(); bvSelectionAdapter.widgetSelected(mock(SelectionEvent.class)); assertThat(page.isBusinessDataTypeSelected()).isTrue(); assertThat(selectedDataObservable.getValue()).isEqualTo(bd); }
Example #8
Source File: ContractConstraintsTableViewerTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { parent = realm.createComposite(); FileActionDialog.setDisablePopup(true); viewer = new ContractConstraintsTableViewer(parent, new FormToolkit(parent.getDisplay())); final ContractConstraintController inputController = new ContractConstraintController(new WritableValue(aContract() .build(), Contract.class)); viewer.initialize(inputController, messageManager, new EMFDataBindingContext()); final Contract contract = ProcessFactory.eINSTANCE.createContract(); final ContractInput input = ProcessFactory.eINSTANCE.createContractInput(); input.setName("name"); input.setType(ContractInputType.TEXT); contract.getInputs().add(input); constraint = ProcessFactory.eINSTANCE.createContractConstraint(); constraint.setName("c1"); constraint2 = ProcessFactory.eINSTANCE.createContractConstraint(); constraint2.setName("c2"); contract.getConstraints().add(constraint); contract.getConstraints().add(constraint2); viewer.setInput(EMFObservables.observeList(Realm.getDefault(), contract, ProcessPackage.Literals.CONTRACT__CONSTRAINTS)); }
Example #9
Source File: SelectDataWizardPageTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Test public void should_isPageComplete_ReturnTrue_when_available_documents_is_not_empty_selection_not_empty() { final List<Data> availableBusinessData = new ArrayList<Data>(); final List<Document> availableDocuments = new ArrayList<Document>(); final Contract contract = aContract().build(); final BusinessObjectData bd = aBusinessData().build(); availableBusinessData.add(bd); final Document document = ProcessFactory.eINSTANCE.createDocument(); availableDocuments.add(document); final WritableValue selectedDataObservable = new WritableValue(); selectedDataObservable.setValue(document); final SelectDataWizardPage page = new SelectDataWizardPage(contract, availableBusinessData, availableDocuments, selectedDataObservable, selectedDataObservable, new GenerationOptions(), store); page.setBusinessDataTypeSelected(false); assertThat(page.isPageComplete()).isTrue(); }
Example #10
Source File: ApplicationTokenUnicityValidatorTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Test public void sould_take_into_account_working_copy() throws Exception { final RepositoryAccessor repositoryAccessor = initRepositoryAccessor(); ApplicationNodeContainer workingCopy = new ApplicationNodeContainer(); workingCopy.addApplication(ApplicationNodeBuilder.newApplication("workingcpy_token1", "name1", "1.0").create()); workingCopy.addApplication(ApplicationNodeBuilder.newApplication("workingcpy_token2", "name2", "1.0").create()); workingCopy.addApplication(ApplicationNodeBuilder.newApplication("token1", "name3", "1.0").create()); workingCopy.addApplication(ApplicationNodeBuilder.newApplication("duplicatedToken", "name4", "1.0").create()); workingCopy.addApplication(ApplicationNodeBuilder.newApplication("duplicatedToken", "name5", "1.0").create()); ApplicationTokenUnicityValidator validator = new ApplicationTokenUnicityValidator(repositoryAccessor, workingCopy, "filename.xml", new WritableValue<>("workingcpy_token2", String.class)); assertThat(validator.validate("token1")).isNotOK(); assertThat(validator.validate("workingcpy_token1")).isNotOK(); assertThat(validator.validate("workingcpy_TOKEN1")).isNotOK(); assertThat(validator.validate("workingcpy_token2")).isOK(); validator = new ApplicationTokenUnicityValidator(repositoryAccessor, workingCopy, "myApp.xml"); assertThat(validator.validate("token2")).isOK(); validator = new ApplicationTokenUnicityValidator(repositoryAccessor, workingCopy, "myApp.xml", new WritableValue<>("duplicatedToken", String.class)); assertThat(validator.validate("duplicatedToken")).isNotOK(); }
Example #11
Source File: GeneratedScriptPreviewPage.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @param pageName */ public GeneratedScriptPreviewPage(final WritableValue rootNameObservable, final WritableList fieldToContactInputMappingsObservable, final WritableValue selectedDataObservable, final RepositoryAccessor repositoryAccessor, final FieldToContractInputMappingOperationBuilder operationBuilder, final FieldToContractInputMappingExpressionBuilder expressionBuilder, final GroovySourceViewerFactory sourceViewerFactory) { super(GeneratedScriptPreviewPage.class.getName()); setTitle(Messages.generatedScriptPreviewTitle); this.rootNameObservable = rootNameObservable; fieldToContractInputMappingsObservable = fieldToContactInputMappingsObservable; this.selectedDataObservable = selectedDataObservable; this.operationBuilder = operationBuilder; this.expressionBuilder = expressionBuilder; this.repositoryAccessor = repositoryAccessor; this.sourceViewerFactory = sourceViewerFactory; generatedExpression = ExpressionFactory.eINSTANCE.createExpression(); }
Example #12
Source File: AvailableDataValidatorTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Test public void testValidate_KO_forNoBusinessDataSelected() throws Exception { final WritableValue selectedDataObservable = new WritableValue(); final BusinessObjectData businessObjectData = aBusinessData().withClassname("org.test.Employee").build(); selectedDataObservable.setValue(businessObjectData); final List<Data> availableBusinessData = new ArrayList<>(); availableBusinessData.add(ProcessFactory.eINSTANCE.createData()); final BusinessObjectModelRepositoryStore<BusinessObjectModelFileStore> businessObjectStore = mock( BusinessObjectModelRepositoryStore.class); when(businessObjectStore.getBusinessObjectByQualifiedName(businessObjectData.getClassName())) .thenReturn(Optional.empty()); assertThat( new AvailableDataValidator(availableBusinessData, selectedDataObservable, new ArrayList<Document>(), businessObjectStore) .validate().isOK()).isFalse(); }
Example #13
Source File: OperationViewer.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
public OperationViewer(final Composite parent, final TabbedPropertySheetWidgetFactory widgetFactory, final EditingDomain editingDomain, final ViewerFilter actionExpressionFilter, final ViewerFilter storageExpressionFilter, final boolean isPageFlowContext) { super(parent, SWT.NONE); this.isPageFlowContext = isPageFlowContext; this.editingDomain = editingDomain; this.widgetFactory = widgetFactory; if (widgetFactory != null) { widgetFactory.adapt(this); } this.actionExpressionFilter = actionExpressionFilter; this.storageExpressionFilter = storageExpressionFilter; setLayout(GridLayoutFactory.fillDefaults().numColumns(4).margins(0, 0).create()); operationObervable = new WritableValue(Realm.getDefault()); eObjectObervable = new WritableValue(Realm.getDefault()); doCreateControls(); }
Example #14
Source File: CreateContractInputFromBusinessObjectWizardPage.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
protected CreateContractInputFromBusinessObjectWizardPage(ContractContainer contractContainer, GenerationOptions generationOptions, WritableValue<BusinessObjectData> selectedDataObservable, FieldToContractInputMappingFactory fieldToContractInputMappingFactory, WritableList<FieldToContractInputMapping> fieldToContractInputMappingsObservable, BusinessObjectModelRepositoryStore<BusinessObjectModelFileStore> businessObjectStore) { super(CreateContractInputFromBusinessObjectWizardPage.class.getName()); setDescription(Messages.selectFieldToGenerateDescription); this.selectedDataObservable = selectedDataObservable; this.fieldToContractInputMappingFactory = fieldToContractInputMappingFactory; this.contractContainer = contractContainer; this.contract = contractContainer.getContract(); this.generationOptions = generationOptions; this.businessObjectStore = businessObjectStore; this.fieldToContractInputMappingsObservable = fieldToContractInputMappingsObservable; mappings = new ArrayList<>(); }
Example #15
Source File: SelectDataWizardPageTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Test public void should_rename_inputName_when_entering_a_text() { final List<Data> availableBusinessData = new ArrayList<Data>(); final List<Document> availableDocuments = new ArrayList<Document>(); final Contract contract = aContract().build(); final BusinessObjectData bd = aBusinessData().withName("myData").build(); availableBusinessData.add(bd); final WritableValue selectedDataObservable = new WritableValue(); selectedDataObservable.setValue(bd); final WritableValue rootNameObservable = new WritableValue(); final SelectDataWizardPage page = new SelectDataWizardPage(contract, availableBusinessData, availableDocuments, selectedDataObservable, rootNameObservable, new GenerationOptions(), store); page.setWizard(wizardWithContainer()); page.createControl(realmWithDisplay.createComposite()); final Text text = widgetFinder.<Text> withLabel(realmWithDisplay.getShell(), org.bonitasoft.studio.contract.i18n.Messages.rootContractInputName); text.setText("myDataInput"); text.notifyListeners(SWT.Modify, new Event()); assertThat(rootNameObservable.getValue()).isEqualTo("myDataInput"); }
Example #16
Source File: SelectDataWizardPage.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
public SelectDataWizardPage(final Contract contract, final List<Data> availableBusinessData, final List<Document> availableDocuments, final WritableValue<Object> selectedDataObservable, final WritableValue<String> rootNameObservable, GenerationOptions generateOptions, final BusinessObjectModelRepositoryStore<BusinessObjectModelFileStore> businessObjectStore) { super(SelectDataWizardPage.class.getName()); setTitle(Messages.SelectBusinessDataWizardPageTitle); setDescription(Messages.selectBusinessDataWizardPageDescription); this.availableBusinessData = availableBusinessData; this.availableDocuments = availableDocuments; this.selectedDataObservable = selectedDataObservable; this.businessObjectStore = businessObjectStore; this.rootNameObservable = rootNameObservable; this.generateOptions = generateOptions; this.contract = contract; }
Example #17
Source File: ContractPropertySectionTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_bindGenerateButtonEnablement_convert_return_boolean_value_to_false_when_pool_contains_no_data() { final Pool pool = aPool().havingContract(aContract()).havingData(aData().build()).build(); section.init(new WritableValue(pool.getContract(), Contract.class)); doReturn(new StructuredSelection(pool)).when(poolSelectionProvider).getSelection(); final Button button = new Button(parent, SWT.PUSH); section.bindGenerateButtonEnablement(button); assertThat(button.isEnabled()).isFalse(); }
Example #18
Source File: ContractPropertySectionTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_bindRemoveButtonEnablement_convert_boolean_value() throws Exception { section.init(new WritableValue(aContract().build(), Contract.class)); final Button removeButton = new Button(parent, SWT.PUSH); final TableViewer inputsTableViewer = new TableViewer(parent); inputsTableViewer.setLabelProvider(new LabelProvider()); inputsTableViewer.setContentProvider(ArrayContentProvider.getInstance()); inputsTableViewer.setInput(Arrays.asList("item")); section.bindRemoveButtonEnablement(removeButton, inputsTableViewer); assertThat(removeButton.isEnabled()).isFalse(); assertThat(inputsTableViewer.getSelection().isEmpty()).isTrue(); inputsTableViewer.setSelection(new StructuredSelection("item")); assertThat(removeButton.isEnabled()).isTrue(); assertThat(inputsTableViewer.getSelection().isEmpty()).isFalse(); }
Example #19
Source File: ProcessElementNameContributionTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_validationStatusProvider_fail_name_with_reservedKeywords() throws Exception { final WritableValue targetValue = new WritableValue(); final WritableValue modelValue = new WritableValue(); dbc.bindValue(targetValue, modelValue); final MultiValidator validationStatusProvider = nameGridPropertySectionContribution.nameValidationStatusProvider(targetValue); dbc.addValidationStatusProvider(validationStatusProvider); targetValue.setValue("content"); assertThat(((IStatus) validationStatusProvider.getValidationStatus().getValue()).isOK()).isFalse(); assertThat(modelValue.getValue()).isEqualTo(targetValue.getValue()).isEqualTo("content"); }
Example #20
Source File: ProcessElementNameContributionTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_validationStatusProvider_fail_name_with_special_chars() throws Exception { final WritableValue targetValue = new WritableValue(); final WritableValue modelValue = new WritableValue(); dbc.bindValue(targetValue, modelValue); final MultiValidator validationStatusProvider = nameGridPropertySectionContribution.nameValidationStatusProvider(targetValue); dbc.addValidationStatusProvider(validationStatusProvider); targetValue.setValue("a #invalid name"); assertThat(((IStatus) validationStatusProvider.getValidationStatus().getValue()).isOK()).isFalse(); assertThat(modelValue.getValue()).isEqualTo(targetValue.getValue()).isEqualTo("a #invalid name"); }
Example #21
Source File: ProcessElementNameContributionTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_validationStatusProvider_accept_valid_name() throws Exception { final WritableValue targetValue = new WritableValue(); final WritableValue modelValue = new WritableValue(); dbc.bindValue(targetValue, modelValue); final MultiValidator validationStatusProvider = nameGridPropertySectionContribution.nameValidationStatusProvider(targetValue); dbc.addValidationStatusProvider(validationStatusProvider); targetValue.setValue("a valid name"); assertThat(((IStatus) validationStatusProvider.getValidationStatus().getValue()).isOK()).isTrue(); assertThat(modelValue.getValue()).isEqualTo(targetValue.getValue()).isEqualTo("a valid name"); }
Example #22
Source File: AvailableDataValidatorTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void testValidate_KO_forEmptyBusinessData() throws Exception { final WritableValue selectedDataObservable = new WritableValue(); final List<Data> availableBusinessData = new ArrayList<>(); assertThat( new AvailableDataValidator(availableBusinessData, selectedDataObservable, new ArrayList<Document>(), mock(BusinessObjectModelRepositoryStore.class)).validate() .isOK()).isFalse(); }
Example #23
Source File: EmptySelectionMultivalidatorTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void shouldReturnErrorWhenNoElementsAreChecked() { final IObservableSet checkedElements = new WritableSet(); final WritableValue selectedDataObservable = new WritableValue(); final BusinessObjectData businessObjectData = aBusinessData().withClassname("org.test.Employee").build(); selectedDataObservable.setValue(businessObjectData); final EmptySelectionMultivalidator multiValidator = new EmptySelectionMultivalidator(selectedDataObservable, checkedElements, new ArrayList<FieldToContractInputMapping>(), aPool().build(), new WritableValue<GenerationOptions.EditMode>(EditMode.CREATE, EditMode.class)); assertThat(multiValidator.validate().isOK()).isFalse(); }
Example #24
Source File: MoveConnectorWizardPage.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public MoveConnectorWizardPage(final AbstractProcess sourceProcess, final WritableValue targetLocationObservable, final WritableValue connectorEventObservable) { super(MoveConnectorWizardPage.class.getName(), Messages.switchContainerConnectorTitle, Pics.getWizban()); setDescription(Messages.switchContainerConnectorMessage); this.sourceProcess = sourceProcess; this.targetLocationObservable = targetLocationObservable; this.connectorEventObservable = connectorEventObservable; originalLocation = (ConnectableElement) targetLocationObservable.getValue(); adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); }
Example #25
Source File: MoveConnectorWizardPageTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_return_an_error_status_if_target_location_is_not_a_connectable_element() throws Exception { final Pool pool = aPool().build(); final Task task = aTask().build(); final MoveConnectorWizardPage wizardPage = new MoveConnectorWizardPage(pool, new WritableValue(task, Connector.class), new WritableValue( ConnectorEvent.ON_ENTER.name(), String.class)); final MultiValidator validator = wizardPage.selectionValidator(); StatusAssert.assertThat(validator.validate(aLane().build())).isNotOK(); }
Example #26
Source File: MoveConnectorWizardPageTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_return_an_error_status_if_no_target_location_is_selected_tasks() throws Exception { final Pool pool = aPool().build(); final Task task = aTask().build(); final MoveConnectorWizardPage wizardPage = new MoveConnectorWizardPage(pool, new WritableValue(task, Connector.class), new WritableValue( ConnectorEvent.ON_ENTER.name(), String.class)); final MultiValidator validator = wizardPage.selectionValidator(); StatusAssert.assertThat(validator.validate(null)).isNotOK(); }
Example #27
Source File: MoveConnectorWizardPageTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_return_a_warning_status_if_moving_a_connector_from_a_tasks() throws Exception { final Pool pool = aPool().build(); final Task task = aTask().build(); final MoveConnectorWizardPage wizardPage = new MoveConnectorWizardPage(pool, new WritableValue(task, Connector.class), new WritableValue( ConnectorEvent.ON_ENTER.name(), String.class)); final MultiValidator validator = wizardPage.selectionValidator(); StatusAssert.assertThat(validator.validate(pool)).hasSeverity(IStatus.WARNING); }
Example #28
Source File: MoveConnectorWizardPageTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_return_a_valid_status_if_moving_a_process_connector() throws Exception { final Pool pool = aPool().build(); final Task task = aTask().build(); final MoveConnectorWizardPage wizardPage = new MoveConnectorWizardPage(pool, new WritableValue(pool, Connector.class), new WritableValue( ConnectorEvent.ON_ENTER.name(), String.class)); final MultiValidator validator = wizardPage.selectionValidator(); StatusAssert.assertThat(validator.validate(task)).isOK(); }
Example #29
Source File: MoveConnectorWizardPageTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_return_a_valid_status_if_not_moving_a_task_connector() throws Exception { final Pool pool = aPool().build(); final Task task = aTask().build(); final MoveConnectorWizardPage wizardPage = new MoveConnectorWizardPage(pool, new WritableValue(task, Connector.class), new WritableValue(ConnectorEvent.ON_ENTER.name(), String.class)); final MultiValidator validator = wizardPage.selectionValidator(); StatusAssert.assertThat(validator.validate(task)).isOK(); }
Example #30
Source File: AvailableDataValidator.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public AvailableDataValidator(final List<Data> availableBusinessData, final WritableValue<Object> selectedDataObservable, final List<Document> availableDocuments, final BusinessObjectModelRepositoryStore<BusinessObjectModelFileStore> businessObjectStore) { this.availableBusinessData = availableBusinessData; this.selectedDataObservable = selectedDataObservable; this.businessObjectStore = businessObjectStore; this.availableDocuments = availableDocuments; }