Examples of BasicObjectInfo


Examples of org.fcrepo.client.utility.validate.types.BasicObjectInfo

            // This falls into the case of object==null.
        }

        if (object == null) {
            ValidationResult result =
                    new ValidationResult(new BasicObjectInfo(pid));
            result.addNote(ValidationResultNotation.objectNotFound(pid));
            return result;
        } else {
            return validate(object);
        }
View Full Code Here

Examples of org.fcrepo.client.utility.validate.types.BasicObjectInfo

    @Override
    public ObjectInfo getValidationObject(String pid)
            throws ObjectSourceException {
        List<RelationshipInfo> relations = getRelationships(pid);
        Set<DatastreamInfo> dsDefs = getDatastreams(pid);
        return new BasicObjectInfo(pid, relations, dsDefs);
    }
View Full Code Here

Examples of org.fcrepo.client.utility.validate.types.BasicObjectInfo

    @Test
    public void gettingFromPidThrowsException() {
        objectSource.throwObjectSourceExceptionOnPid(SAMPLE_PID);

        ValidationResult expected =
                expectedResult(new BasicObjectInfo(SAMPLE_PID),
                               ValidationResultNotation
                                       .objectNotFound(SAMPLE_PID));

        ValidationResult actual = validator.validate(SAMPLE_PID);
        assertEquals("result", expected, actual);
View Full Code Here

Examples of org.fcrepo.client.utility.validate.types.BasicObjectInfo

    }

    @Test
    public void pidReturnsNullObject() {
        ValidationResult expected =
                expectedResult(new BasicObjectInfo(SAMPLE_PID),
                               ValidationResultNotation
                                       .objectNotFound(SAMPLE_PID));

        ValidationResult actual = validator.validate(SAMPLE_PID);
        assertEquals("result", expected, actual);
View Full Code Here

Examples of org.fcrepo.client.utility.validate.types.BasicObjectInfo

        validateObject(OBJECT_SIMPLE_SAMPLE);
    }

    @Test
    public void noContentModel() {
        BasicObjectInfo object =
                basicObject("noContentModel", NO_RELATIONS, NO_DATASTREAMS);
        validateObject(object, ValidationResultNotation.noContentModel());
    }
View Full Code Here

Examples of org.fcrepo.client.utility.validate.types.BasicObjectInfo

        validateObject(object, ValidationResultNotation.noContentModel());
    }

    @Test
    public void contentModelUriIsNotPid() {
        BasicObjectInfo object =
                basicObject("unknownContentModel",
                            unknownContentModelRelation(),
                            NO_DATASTREAMS);
        validateObject(object, ValidationResultNotation
                .unrecognizedContentModelUri(NON_PID_URI));
View Full Code Here

Examples of org.fcrepo.client.utility.validate.types.BasicObjectInfo

    public void noDsToMatchTypeModel() {
        TypeModel typeNoForms = new TypeModel(new HashSet<Form>(), "dsNoForms");
        TestContentModelInfo model =
                contentModel("oneTypeContentModel",
                             new DsTypeModel[] {typeNoForms});
        BasicObjectInfo object =
                basicObject("objectNoDsForModel",
                            contentModelRelations(model),
                            NO_DATASTREAMS);

        addSeedsToObjectSource(model, object);
View Full Code Here

Examples of org.fcrepo.client.utility.validate.types.BasicObjectInfo

        DatastreamInfo dsMime = new DatastreamInfo("mime only", "mime", null);
        DatastreamInfo dsFormat =
                new DatastreamInfo("format_uri only", null, "format_uri");
        DatastreamInfo dsBoth =
                new DatastreamInfo("both", "both_mime", "both_format_uri");
        BasicObjectInfo matcher =
                basicObject("severalDatastreamAllMatch",
                            contentModelRelations(model),
                            datastreams(dsNeither, dsMime, dsFormat, dsBoth));

        addSeedsToObjectSource(model, matcher);
View Full Code Here

Examples of org.fcrepo.client.utility.validate.types.BasicObjectInfo

        // This model has one type, with neither mime nor format URI specified.
        TypeModel typeNeither = typeModel("neither", new TestForm(null, null));
        TestContentModelInfo model =
                contentModel("model", typeModels(typeNeither));

        BasicObjectInfo neither =
                basicObject("neitherMatchesNeither",
                            contentModelRelations(model),
                            datastreams(new DatastreamInfo("neither",
                                                           null,
                                                           null)));

        BasicObjectInfo mime =
                basicObject("anyMimeMatchesNeither",
                            contentModelRelations(model),
                            datastreams(new DatastreamInfo("neither",
                                                           "wrongMime",
                                                           null)));

        BasicObjectInfo formatUri =
                basicObject("anyFormatMatchesNeither",
                            contentModelRelations(model),
                            datastreams(new DatastreamInfo("neither",
                                                           null,
                                                           "wrongFormat")));
View Full Code Here

Examples of org.fcrepo.client.utility.validate.types.BasicObjectInfo

        // This model has one type, with mime specified but not format uri.
        TypeModel typeMime = typeModel("mime", new TestForm(null, "mimeType"));
        TestContentModelInfo model =
                contentModel("model", typeModels(typeMime));

        BasicObjectInfo neither =
                basicObject("neitherFailsOnMime",
                            contentModelRelations(model),
                            datastreams(new DatastreamInfo("mime", null, null)));

        BasicObjectInfo mime =
                basicObject("mimeMatch",
                            contentModelRelations(model),
                            datastreams(new DatastreamInfo("mime",
                                                           "mimeType",
                                                           null)));

        BasicObjectInfo wrongMime =
                basicObject("mimeMisMatch",
                            contentModelRelations(model),
                            datastreams(new DatastreamInfo("mime",
                                                           "wrongMime",
                                                           null)));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.