Package org.apache.cayenne.jpa

Examples of org.apache.cayenne.jpa.MockPersistenceUnitInfo


public class EntityMapDefaultsProcessor1Test extends TestCase {

    public void testVersion() {

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

        // apply defaults
        new EntityMapDefaultsProcessor().applyDefaults(context);
View Full Code Here


    }

    public void testStaticFields() throws Exception {

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

        // apply defaults
        new EntityMapDefaultsProcessor().applyDefaults(context);
View Full Code Here

        assertSame(dbr1, dbr2.getReverseRelationship());
    }

    private DataMap load(Class<?>... classes) {
        EntityMapLoaderContext context = new EntityMapLoaderContext(
                new MockPersistenceUnitInfo());
        EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);

        for (Class<?> c : classes) {
            loader.loadClassMapping(c);
        }
View Full Code Here

public class DataMapConverterTest extends TestCase {

    public void testDefaultEntityListeners() {
        EntityMapLoaderContext context = new EntityMapLoaderContext(
                new MockPersistenceUnitInfo());
        JpaEntityMap jpaMap = context.getEntityMap();

        JpaPersistenceUnitMetadata metadata = new JpaPersistenceUnitMetadata();
        jpaMap.setPersistenceUnitMetadata(metadata);
View Full Code Here

        assertEquals(0, cl1.getCallbackMap().getPostPersist().getCallbackMethods().size());
    }

    public void testEntityCallbackMethods() {
        EntityMapLoaderContext context = new EntityMapLoaderContext(
                new MockPersistenceUnitInfo());
        JpaEntityMap jpaMap = context.getEntityMap();

        JpaTable table = new JpaTable();
        table.setName("ET1");
       
View Full Code Here

                .size());
    }

    public void testEntityListeners() {
        EntityMapLoaderContext context = new EntityMapLoaderContext(
                new MockPersistenceUnitInfo());
        JpaEntityMap jpaMap = context.getEntityMap();

        JpaTable table = new JpaTable();
        table.setName("ET1");
       
View Full Code Here

        assertEquals(0, cl1.getCallbackMap().getPostPersist().getCallbackMethods().size());
    }

    public void testDataMapDefaults() {
        EntityMapLoaderContext context = new EntityMapLoaderContext(
                new MockPersistenceUnitInfo());
        JpaEntityMap jpaMap = context.getEntityMap();
        jpaMap.setPackageName("p1");
        jpaMap.setSchema("s1");

        // TODO: unsupported by DataMap
View Full Code Here

        assertEquals("s1", cayenneMap.getDefaultSchema());
    }

    public void testLoadClassMapping() throws Exception {
        EntityMapLoaderContext context = new EntityMapLoaderContext(
                new MockPersistenceUnitInfo());
        EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);

        loader.loadClassMapping(MockCayenneEntity1.class);
        loader.loadClassMapping(MockCayenneEntity2.class);
        loader.loadClassMapping(MockCayenneTargetEntity1.class);
View Full Code Here

        new DataMapMappingAssertion().testDataMap(dataMap);
    }

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

        loader.loadClassMapping(MockTypesEntity.class);

        // apply defaults before conversion
View Full Code Here

        assertEquals(Types.BINARY, byteArrayColumn.getType());
    }

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

        loader.loadClassMapping(MockIdColumnEntity.class);

        // apply defaults before conversion
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.