Package org.apache.cayenne.configuration.server

Examples of org.apache.cayenne.configuration.server.ServerRuntime


                binder.bind(ResourceLocator.class).toInstance(
                        new FilesystemResourceLocator(projectFile));
            }
        };

        ServerRuntime runtime = new ServerRuntime(
                projectFileLocation,
                dataPortModule);
        DataDomain domain;

        ClassLoader threadContextClassLoader = Thread
                .currentThread()
                .getContextClassLoader();
        try {
            // need to set context class loader so that cayenne can find jdbc driver and
            // PasswordEncoder
            // TODO: andrus 04/11/2010 is this still relevant in 3.1?
            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());

            domain = runtime.getDataDomain();
        }
        catch (Exception ex) {
            throw new BuildException("Error loading Cayenne configuration from "
                    + projectFile, ex);
        }
View Full Code Here


                binder.bind(ResourceLocator.class).toInstance(
                        new FilesystemResourceLocator(projectFile));
            }
        };

        ServerRuntime runtime = new ServerRuntime(
                projectFileLocation,
                dataPortModule);
        DataDomain domain;

        ClassLoader threadContextClassLoader = Thread
                .currentThread()
                .getContextClassLoader();
        try {
            // need to set context class loader so that cayenne can find jdbc driver and
            // PasswordEncoder
            // TODO: andrus 04/11/2010 is this still relevant in 3.1?
            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());

            domain = runtime.getDataDomain();
        }
        catch (Exception ex) {
            throw new BuildException("Error loading Cayenne configuration from "
                    + projectFile, ex);
        }
View Full Code Here

    private TableHelper e1Helper;
    private TableHelper e2Helper;

    @Override
    protected void setUp() throws Exception {
        runtime = new ServerRuntime("cayenne-lifecycle.xml");
        dbHelper = new DBHelper(runtime.getDataSource("lifecycle-db"));
        e1Helper = new TableHelper(dbHelper, "E1", "ID");
        e2Helper = new TableHelper(dbHelper, "E2", "ID");
    }
View Full Code Here

    private ServerRuntime runtime;

    @Override
    protected void setUp() throws Exception {
        runtime = new ServerRuntime("cayenne-lifecycle.xml");
    }
View Full Code Here

    @Inject
    protected Provider<ServerRuntime> runtimeProvider;

    public void testServerSetup_TearDown_Runtime() throws Exception {

        ServerRuntime local = this.runtime;
        assertNotNull(local);
        assertSame(local, runtimeProvider.get());

        tearDown();
View Full Code Here

        if (configurationLocation == null) {
            throw new NullPointerException("Null 'configurationLocation', "
                    + "annotate your test case with @UseServerRuntime");
        }

        return new ServerRuntime(configurationLocation, new ServerExtraModule());
    }
View Full Code Here

    public void testSetup_TearDown_Runtime() throws Exception {

        assertNotNull(properties);
        assertEquals(ServerCase.TESTMAP_PROJECT, properties.getConfigurationLocation());

        ServerRuntime local = this.runtime;
        assertNotNull(local);
        assertSame(local, runtimeProvider.get());

        tearDown();
View Full Code Here

    private ServerRuntime runtime;

    @Override
    protected void setUp() throws Exception {

        runtime = new ServerRuntime("cayenne-lifecycle.xml");

        // a filter is required to invalidate root objects after commit
        ObjectIdRelationshipFilter filter = new ObjectIdRelationshipFilter();
        runtime.getDataDomain().addFilter(filter);
        runtime.getDataDomain().getEntityResolver().getCallbackRegistry().addListener(
View Full Code Here

    private TableHelper auditableChild3;
    private TableHelper auditableChildUuid;

    @Override
    protected void setUp() throws Exception {
        runtime = new ServerRuntime("cayenne-lifecycle.xml");

        DBHelper dbHelper = new DBHelper(runtime.getDataSource(null));

        auditable1 = new TableHelper(dbHelper, "AUDITABLE1").setColumns(
                "ID",
View Full Code Here

        resolver = mock(EntityResolver.class);
       
        ObjEntity objectEntity = new ObjEntity("CayenneDataObject");
        when(resolver.lookupObjEntity(any(Object.class))).thenReturn(objectEntity);

        runtime = new ServerRuntime("cayenne-lifecycle.xml");
        // a filter is required to invalidate root objects after commit
        ObjectIdRelationshipFilter filter = new ObjectIdRelationshipFilter();
        runtime.getDataDomain().addFilter(filter);
        runtime.getDataDomain().getEntityResolver().getCallbackRegistry().addListener(filter);
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.configuration.server.ServerRuntime

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.