Package org.jitterbit.integration.data.validation

Examples of org.jitterbit.integration.data.validation.ValidationResult


        public boolean equals(Object obj) {
            if (obj == this) {
                return true;
            }
            if (obj instanceof ValidationResult) {
                ValidationResult that = (ValidationResult) obj;
                return Sets.newHashSet(allMessages()).equals(Sets.newHashSet(that.allMessages()));
            }
            return false;
        }
View Full Code Here


        }
        return null;
    }

    private String getIconToolTip() {
        ValidationResult v = getOperation().getCurrentValidationResult();
        if (v.status() == ValidationStatus.VALID) {
            return "This " + EntityType.Operation.toString() + " is valid.";
        } else {
            StringBuilder s = new StringBuilder("<html>");
            s.append("<b>Validation Problems:</b><br>");
            HtmlListGenerator list = HtmlListGenerator.unordered();
            for (ValidationMessage m : v.allMessages()) {
                list.newItem().escapeAndAdd(m.message());
            }
            return s.append(list.toHtml()).append("</html>").toString();
        }
    }
View Full Code Here

* @since 4.0.0
*/
public final class LocationValidationTestUtils {

    public static void ensureOneFatalMessage(ValidationMessageCollectorImpl collector, ValidationIssue expected) {
        ValidationResult result = collector.result();
        assertSame(ValidationStatus.INVALID, result.status());
        ValidationMessage[] messages = result.allMessages();
        assertEquals(1, messages.length);
        ValidationMessage message = messages[0];
        assertTrue(StringUtils.isNotEmpty(message.message()));
        assertEquals(expected.getMessage(), message.message());
    }
View Full Code Here

        }

        private void populateList(EntityCollectionValidationResult result) {
            DefaultListModel model = new DefaultListModel();
            for (IntegrationEntity entity : result.getValidatedEntities()) {
                ValidationResult state = result.getValidationResult(entity);
                if (state.status() != ValidationStatus.VALID) {
                    IntegrationEntityListDecorator entityItem = new IntegrationEntityListDecorator(entity);
                    entityItem.setIndicateValidationStatus(true);
                    model.addElement(entityItem);
                    for (ValidationMessage msg : state.allMessages()) {
                        model.addElement(new ProblemItem(msg));
                    }
                }
            }
            problemList.setModel(model);
View Full Code Here

        DefaultListModel model = new DefaultListModel();
        if (isValid(result)) {
            model.addElement(ListItem.fromString(Strings.get("Validation.ListDisplayer.Valid")));
        } else {
            for (IntegrationEntity entity : result.getValidatedEntities()) {
                ValidationResult r = result.getValidationResult(entity);
                if (!r.isEmpty()) {
                    model.addElement(entity);
                    for (ValidationMessage msg : r.allMessages()) {
                        model.addElement(ListItem.fromMessage(msg));
                    }
                }
            }
            model.addElement(ListItem.empty());
View Full Code Here

    }

    private void addEntityNode(EntityCollectionValidationResult result,
                               IntegrationEntity entity,
                               DefaultKongaTreeNode parent) {
        ValidationResult r = result.getValidationResult(entity);
        if (!r.isEmpty()) {
            EntityNodeObject o = new EntityNodeObject(entity, r.status());
            DefaultKongaTreeNode node = new DefaultKongaTreeNode(parent, o, true);
            for (ValidationMessage msg : r.allMessages()) {
                addValidationMessage(msg, node);
            }
        }
    }
View Full Code Here

     * @return a <code>ValidationResult</code> describing the result of the validation. This method
     *         never returns <code>null</code>.
     */
    public final ValidationResult validate(ValidationContext context) {
        ValidationMessageCollectorImpl collector = new ValidationMessageCollectorImpl(context);
        ValidationResult result;
        synchronized (getDataLock()) {
            collector.collect(this);
            result = collector.result();
            currentValidationResult = result;
        }
View Full Code Here

                Alert.error("The Schedule is invalid.", "Invalid Schedule");
            }
        }

        private boolean isValid() {
            ValidationResult result = schedule.validate(new ValidationContext() {

                @Override
                public IntegrationEntityLookup getDataStore() {
                    return null;
                }

                @Override
                public ProjectDependencies getDependencies() {
                    return null;
                }
            });
            return !result.isFatal();
        }
View Full Code Here

        }
    }

    @Override
    public ValidationResult getValidationState(IntegrationEntity entity) {
        ValidationResult r;
        synchronized (lock) {
            r = results.get(entity);
        }
        if (r == null) {
            r = ValidationResult.VALID; // TODO: Use Unknown here
View Full Code Here

            return validated;
        }

        private void validateEntity(IntegrationEntity entity) {
            if (!validated.containsKey(entity)) {
                ValidationResult result = validateSingleItem(entity);
                validated.put(entity, result);
            }
        }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.data.validation.ValidationResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.