Examples of validateForSave()


Examples of org.apache.art.Artist.validateForSave()

    public void testValidateForSaveMandatoryAttributeMissing() throws Exception {
        DataContext context = createDataContext();
        Artist artist = (Artist) context.newObject("Artist");

        ValidationResult result = new ValidationResult();
        artist.validateForSave(result);

        assertTrue("Validation of 'artistName' should've failed.", result.hasFailures());
        assertTrue(result.hasFailures(artist));

        List failures = result.getFailures();
View Full Code Here

Examples of org.apache.art.Artist.validateForSave()

        assertEquals(Artist.ARTIST_NAME_PROPERTY, failure.getProperty());

        // fix the problem and see if it goes away
        artist.setArtistName("aa");
        result = new ValidationResult();
        artist.validateForSave(result);
        assertFalse(result.hasFailures());
    }

    public void testValidateForSaveAttributeTooLong() throws Exception {
        DataContext context = createDataContext();
View Full Code Here

Examples of org.apache.art.Artist.validateForSave()

            buf.append("c");
        }
        artist.setArtistName(buf.toString());

        ValidationResult result = new ValidationResult();
        artist.validateForSave(result);

        assertTrue(result.hasFailures());
        assertTrue(result.hasFailures(artist));

        List failures = result.getFailures();
View Full Code Here

Examples of org.apache.art.Artist.validateForSave()

        assertEquals(Artist.ARTIST_NAME_PROPERTY, failure.getProperty());

        // fix the problem and see if it goes away
        artist.setArtistName("aa");
        result = new ValidationResult();
        artist.validateForSave(result);
        assertFalse(result.hasFailures());
    }
}
View Full Code Here

Examples of org.apache.art.Exhibit.validateForSave()

        Exhibit exhibit = context.newObject(Exhibit.class);
        exhibit.setOpeningDate(new Date());
        exhibit.setClosingDate(new Date());

        ValidationResult result = new ValidationResult();
        exhibit.validateForSave(result);

        assertTrue("Validation of 'toGallery' should've failed.", result.hasFailures());
        assertTrue(result.hasFailures(exhibit));

        List failures = result.getFailures();
View Full Code Here

Examples of org.apache.art.Exhibit.validateForSave()

        // fix the problem and see if it goes away
        Gallery gallery = context.newObject(Gallery.class);
        exhibit.setToGallery(gallery);
        result = new ValidationResult();
        exhibit.validateForSave(result);
        assertFalse("No failures expected: " + result, result.hasFailures());
    }

    public void testValidateForSaveMandatoryAttributeMissing() throws Exception {
        DataContext context = createDataContext();
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.MeaningfulFK.validateForSave()

    public void testValidateForSave1() throws Exception {
        MeaningfulFK testObject = createDataContext().newObject(
                MeaningfulFK.class);

        ValidationResult validation = new ValidationResult();
        testObject.validateForSave(validation);
        assertTrue(
                "Must fail validation due to missing required relationship",
                validation.hasFailures());
        assertEquals(
                "Must fail validation due to missing required relationship",
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.MeaningfulFK.validateForSave()

                .getObjectContext()
                .newObject(RelationshipHelper.class);
        testObject.setToRelationshipHelper(related);

        ValidationResult validation = new ValidationResult();
        testObject.validateForSave(validation);
        assertFalse(validation.hasFailures());
    }
}
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.MeaningfulFK.validateForSave()

    public void testValidateForSave1() throws Exception {
        MeaningfulFK testObject = context.newObject(MeaningfulFK.class);

        ValidationResult validation = new ValidationResult();
        testObject.validateForSave(validation);
        assertTrue(
                "Must fail validation due to missing required relationship",
                validation.hasFailures());
        assertEquals(
                "Must fail validation due to missing required relationship",
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.MeaningfulFK.validateForSave()

        RelationshipHelper related = testObject.getObjectContext().newObject(
                RelationshipHelper.class);
        testObject.setToRelationshipHelper(related);

        ValidationResult validation = new ValidationResult();
        testObject.validateForSave(validation);
        assertFalse(validation.hasFailures());
    }
}
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.