Package org.apache.cayenne.access

Examples of org.apache.cayenne.access.UnitTestDomain


    @Inject
    protected DbAdapter adapter;

    @Override
    protected DataDomain createDataDomain(String name) {
        return new UnitTestDomain(name);
    }
View Full Code Here


    @Inject
    private UnitDbAdapter unitDbAdapter;

    @Override
    protected DataDomain createDataDomain(String name) {
        return new UnitTestDomain(name);
    }
View Full Code Here

    public SimpleAccessStack(CayenneResources resources, DataSetFactory dataSetFactory,
            DataMap[] maps) throws Exception {

        this.dataSetFactory = dataSetFactory;
        this.resources = resources;
        this.domain = new UnitTestDomain("domain");
        domain.setEventManager(new DefaultEventManager(2));
        domain.setEntitySorter(new AshwoodEntitySorter());
       
        for (DataMap map : maps) {
            initNode(map);
View Full Code Here

    public SimpleAccessStack(CayenneResources resources, DataSetFactory dataSetFactory,
            DataMap[] maps) throws Exception {

        this.dataSetFactory = dataSetFactory;
        this.resources = resources;
        this.domain = new UnitTestDomain("domain");
        domain.setEventManager(new EventManager(2));
        for (DataMap map : maps) {
            initNode(map);
        }
    }
View Full Code Here

    @Inject
    private JdbcEventLogger jdbcEventLogger;

    @Override
    protected DataDomain createDataDomain(String name) {
        return new UnitTestDomain(name);
    }
View Full Code Here

    // injecting provider to make this provider independent from scoping of ServerRuntime
    protected Provider<ServerRuntime> serverRuntimeProvider;

    public void runWithQueriesBlocked(UnitTestClosure closure) {

        UnitTestDomain channel = (UnitTestDomain) serverRuntimeProvider
                .get()
                .getChannel();

        channel.setBlockingQueries(true);
        try {
            closure.execute();
        }
        finally {
            channel.setBlockingQueries(false);
        }
    }
View Full Code Here

        }
    }

    public int runWithQueryCounter(UnitTestClosure closure) {

        UnitTestDomain channel = (UnitTestDomain) serverRuntimeProvider
                .get()
                .getChannel();

        int start = channel.getQueryCount();
        int end;
        try {
            closure.execute();
        }
        finally {
            end = channel.getQueryCount();
        }

        return end - start;
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.access.UnitTestDomain

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.