Package org.jpox

Examples of org.jpox.OMFContext


    /**
     * Test of the valid locations for a specified package.
     */
    public void testLocationsForPackage()
    {
        JDOMetaDataManager mgr = new JDOMetaDataManager(new OMFContext(new PersistenceConfiguration(){}));

        // Try typical JDO package name
        String packageName = "org.jpox.samples";
        List locations = mgr.getValidMetaDataLocationsForPackage("jdo", null, packageName);
        assertTrue("Locations returned from MetaData Manager was null!", locations != null);
View Full Code Here


    /**
     * Test of the valid locations for a specified class.
     */
    public void testLocationsForClass()
    {
        JDOMetaDataManager mgr = new JDOMetaDataManager(new OMFContext(new PersistenceConfiguration(){}));

        // Try typical JDO class name
        String className = "org.jpox.samples.store.Product";
        List locations = mgr.getValidMetaDataLocationsForClass("jdo", null, className);
        assertTrue("Locations returned from MetaData Manager was null!", locations != null);
View Full Code Here

{


    public void testParseMetaDataURLnullURL()
    {
        MetaDataParser parser = new MetaDataParser(new JDOMetaDataManager(new OMFContext(new PersistenceConfiguration(){})),true);
        try
        {
            parser.parseMetaDataURL(null, "jdo");
            fail("expected JPOXException");
        }
View Full Code Here

        }
    }

    public void testParseMetaDataURLnullhandler()
    {
        MetaDataParser parser = new MetaDataParser(new JDOMetaDataManager(new OMFContext(new PersistenceConfiguration(){})),true);
        try
        {
            parser.parseMetaDataURL(getClass().getResource("/org/jpox/metadata/xml/package2.jdo"), null);
            fail("expected JPOXException");
        }
View Full Code Here

public class PersistenceFileMetaDataHandlerTest extends TestCase
{
    public void testParseDefaultNamespace()
    {
        MetaDataParser parser = new MetaDataParser(new JDOMetaDataManager(new OMFContext(new PersistenceConfiguration(){})),true);
        MetaData md = parser.parseMetaDataURL(getClass().getResource("/org/jpox/metadata/xml/persistence1.xml"), "persistence");
        assertNotNull(md);
    }
View Full Code Here

        assertNotNull(md);
    }

    public void testParseNamespace()
    {
        MetaDataParser parser = new MetaDataParser(new JDOMetaDataManager(new OMFContext(new PersistenceConfiguration(){})),true);
        MetaData md = parser.parseMetaDataURL(getClass().getResource("/org/jpox/metadata/xml/persistence2.xml"), "persistence");
        assertNotNull(md);
    }
View Full Code Here

public class JDOMetaDataHandlerTest extends TestCase
{
    public void testParseDefaultNamespace()
    {
        MetaDataParser parser = new MetaDataParser(new JDOMetaDataManager(new OMFContext(new PersistenceConfiguration(){})),true);
        MetaData md = parser.parseMetaDataURL(getClass().getResource("/org/jpox/metadata/xml/package1.jdo"), "jdo");
        assertNotNull(md);
    }
View Full Code Here

        assertNotNull(md);
    }

    public void testParseNamespace()
    {
        MetaDataParser parser = new MetaDataParser(new JDOMetaDataManager(new OMFContext(new PersistenceConfiguration(){})),true);
        MetaData md = parser.parseMetaDataURL(getClass().getResource("/org/jpox/metadata/xml/package2.jdo"), "jdo");
        assertNotNull(md);
    }
View Full Code Here

     * Test the lookup of adapter from the product name.
     * @throws SQLException
     */
    public void testDatabaseProductNames() throws SQLException
    {
        OMFContext ctxt = new OMFContext(new PersistenceConfiguration(){});
        PluginManager pluginMgr = ctxt.getPluginManager();
        ClassLoaderResolver clr = ctxt.getClassLoaderResolver(null);

        RDBMSAdapterFactory factory = RDBMSAdapterFactory.getInstance();

        assertEquals("org.jpox.store.rdbms.adapter.DerbyAdapter", factory.getAdapterClass(pluginMgr, null, "Apache Derby", clr).getName());
        assertEquals("org.jpox.store.rdbms.adapter.DerbyAdapter", factory.getAdapterClass(pluginMgr, null, "Derby", clr).getName());
View Full Code Here

     * @throws SQLException Thrown when an error occurs applying the constraints
     */
    protected void prepareStatementForExecution(PreparedStatement ps)
    throws SQLException
    {
        OMFContext omfCtx = om.getOMFContext();
        MappedStoreManager storeMgr = (MappedStoreManager)omfCtx.getStoreManager();
        PersistenceConfiguration conf = omfCtx.getPersistenceConfiguration();

        // Apply any user-specified timeout
        int timeout = conf.getIntProperty("org.jpox.query.timeout");
        Object timeoutExt = query.getExtension("org.jpox.query.timeout");
        if (timeoutExt != null)
View Full Code Here

TOP

Related Classes of org.jpox.OMFContext

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.