Package org.jpox

Examples of org.jpox.PersistenceConfiguration


    /**
     * 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

     */
    protected AbstractStoreManager(String key, ClassLoaderResolver clr, OMFContext omfContext)
    {
        this.storeManagerKey = key;
        this.omfContext = omfContext;
        PersistenceConfiguration conf = omfContext.getPersistenceConfiguration();
        this.readOnlyDatastore = conf.getBooleanProperty("org.jpox.readOnlyDatastore");
        this.readOnlyDatastoreAction = conf.getStringProperty("org.jpox.readOnlyDatastoreAction");
        this.fixedDatastore = conf.getBooleanProperty("org.jpox.fixedDatastore");
        this.autoStartMechanism = conf.getStringProperty("org.jpox.autoStartMechanism");

        // Register this StoreManager with the OMFContext
        omfContext.setStoreManager(this);

        this.poidManager = new PoidManager();
View Full Code Here

     * @param ctxt OMF Context that this metadata manager operates in
     */
    public MetaDataManager(OMFContext ctxt)
    {
        this.omfContext = ctxt;
        PersistenceConfiguration conf = omfContext.getPersistenceConfiguration();
        JDOImplHelper.getInstance().removeRegisterClassListener(new MetaDataRegisterClassListener());
        this.setValidate(conf.getBooleanProperty("org.jpox.metadata.validate"));

        if (JavaUtils.isJRE1_5OrAbove())
        {
            try
            {
                ClassLoaderResolver clr = ctxt.getClassLoaderResolver(null);
                Class annotationReaderClass = clr.classForName(conf.getStringProperty("org.jpox.metadata.annotationManager"));

                Class[] ctrArgs = new Class[] {MetaDataManager.class};
                Object[] ctrParams = new Object[] {this};
                Constructor ctor = annotationReaderClass.getConstructor(ctrArgs);
                annotationManager = (AnnotationManager)ctor.newInstance(ctrParams);
View Full Code Here

TOP

Related Classes of org.jpox.PersistenceConfiguration

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.