Package org.apache.cayenne.jpa

Examples of org.apache.cayenne.jpa.MockPersistenceUnitInfo


        assertTrue(pk.isPrimaryKey());
    }

    public void testBasicOptionality() {
        EntityMapLoaderContext context = new EntityMapLoaderContext(
                new MockPersistenceUnitInfo());
        EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);

        loader.loadClassMapping(MockBasicEntity.class);

        // apply defaults before conversion
View Full Code Here


public class EntityMapAnnotationLoaderTest extends TestCase {

    public void testSortAnnotations1() throws Exception {

        EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(
                new EntityMapLoaderContext(new MockPersistenceUnitInfo()));

        Annotation[] a1 = new Annotation[3];
        a1[0] = MockAnnotatedBean1.class.getAnnotation(NamedQuery.class);
        a1[1] = MockAnnotatedBean1.class.getAnnotation(IdClass.class);
        a1[2] = MockAnnotatedBean1.class.getAnnotation(Entity.class);
View Full Code Here

        assertEquals(IdClass.class, a1[2].annotationType());
    }

    public void testSortAnnotations2() throws Exception {
        EntityMapLoaderContext context = new EntityMapLoaderContext(
                new MockPersistenceUnitInfo());
        EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);
        loader.loadClassMapping(MockAnnotatedBeanOrdering.class);

        JpaEntityMap map = context.getEntityMap();
        JpaEntity entity = map.getEntities().iterator().next();
View Full Code Here

     * are both processed correctly.
     */
    public void testAttributeOverride() {

        EntityMapLoaderContext context = new EntityMapLoaderContext(
                new MockPersistenceUnitInfo());
        EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);
        loader.loadClassMapping(MockAnnotatedBean2.class);

        JpaEntityMap map = context.getEntityMap();
        assertEquals(1, map.getEntities().size());
View Full Code Here

     * {@link EntityMapXMLLoaderTest#testDetails()}.
     */
    public void testLoadClassMapping() throws Exception {

        EntityMapLoaderContext context = new EntityMapLoaderContext(
                new MockPersistenceUnitInfo());
        EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);

        loader.loadClassMapping(MockEntity1.class);
        loader.loadClassMapping(MockEntity2.class);
        loader.loadClassMapping(MockEntity3.class);
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        // sanity check - test object must not be serializable to be rejected...
        assertFalse(Serializable.class.isAssignableFrom(MockAnnotatedBean3.class));

        context = new EntityMapLoaderContext(new MockPersistenceUnitInfo());
        EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);
        loader.loadClassMapping(MockAnnotatedBean1.class);
        loader.loadClassMapping(MockAnnotatedBean3.class);
        loader.loadClassMapping(MockAnnotatedBean5.class);
View Full Code Here

TOP

Related Classes of org.apache.cayenne.jpa.MockPersistenceUnitInfo

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.