Examples of fromProperties()


Examples of org.apache.openjpa.conf.OpenJPAConfiguration.fromProperties()

        OpenJPAConfiguration config = new OpenJPAConfigurationImpl();
        // track the messages
        BufferedLogFactory log = new BufferedLogFactory();
        config.setLogFactory(log);

        config.fromProperties(props);

        // make sure we got a warning that contains the string with the
        // bad property name and a hint for the valid property name.
        log.assertLogMessage("*\"openjpa.MaxxFetchDepth\"*");
        log.assertLogMessage("*\"openjpa.MaxFetchDepth\"*");
 
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration.fromProperties()

        // now make sure we do *not* try to validate sub-configurations (such
        // as openjpa.jdbc.Foo).
        props.clear();
        props.setProperty("openjpa.jdbc.Foo", "XXX");
        props.setProperty("oponjpa", "XXX");
        config.fromProperties(props);
        log.assertNoLogMessage("*\"openjpa.jdbc.Foo\"*");
        log.assertNoLogMessage("*\"oponjpa\"*");
    }

    /**
 
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration.fromProperties()

        map.put("javax.persistence.query.timeout", new Integer(1500));

        // use new conf so no unexpected restrictions on type of connection
        // factory
        OpenJPAConfiguration conf = new OpenJPAConfigurationImpl(true, false);
        conf.fromProperties(map);
        assertEquals(cfactory, conf.getConnectionFactory());
        assertEquals(cfactory2, conf.getConnectionFactory2());
        assertEquals(false, conf.getOptimistic());
        assertEquals(503, conf.getLockTimeout());
        assertEquals(1500, conf.getQueryTimeout());
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration.fromProperties()

        assertEquals(false, conf.getOptimistic());
        assertEquals(503, conf.getLockTimeout());
        assertEquals(1500, conf.getQueryTimeout());

        OpenJPAConfiguration conf2 = new OpenJPAConfigurationImpl(true, false);
        conf2.fromProperties(map);
        assertEquals(conf, conf2);

        Map p = conf.toProperties(false);
        assertTrue(!p.containsKey("openjpa.ConnectionFactory"));
        assertTrue(!p.containsKey("openjpa.ConnectionFactory2"));
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration.fromProperties()

        map.put("javax.persistence.query.timeout", new Integer(1500));

        // use new conf so no unexpected restrictions on type of connection
        // factory
        OpenJPAConfiguration conf = new OpenJPAConfigurationImpl(true, false);
        conf.fromProperties(map);
        assertEquals(cfactory, conf.getConnectionFactory());
        assertEquals(cfactory2, conf.getConnectionFactory2());
        assertEquals(false, conf.getOptimistic());
        assertEquals(false, conf.getPostLoadOnMerge());
        assertEquals(503, conf.getLockTimeout());
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration.fromProperties()

        assertEquals(false, conf.getPostLoadOnMerge());
        assertEquals(503, conf.getLockTimeout());
        assertEquals(1500, conf.getQueryTimeout());

        OpenJPAConfiguration conf2 = new OpenJPAConfigurationImpl(true, false);
        conf2.fromProperties(map);
        assertEquals(conf, conf2);

        Map p = conf.toProperties(false);
        assertTrue(!p.containsKey("openjpa.ConnectionFactory"));
        assertTrue(!p.containsKey("openjpa.ConnectionFactory2"));
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration.fromProperties()

        assertEquals("503", p.get("openjpa.LockTimeout"));
        assertEquals(p, conf2.toProperties(false));

        map.put("openjpa.LockTimeout", new Integer(504));
        OpenJPAConfiguration conf3 = new OpenJPAConfigurationImpl(true, false);
        conf3.fromProperties(map);
        assertNotEquals(conf, conf3);
    }

    public void testClassAliases()
        throws Exception {
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration.fromProperties()

        OpenJPAConfiguration config = new OpenJPAConfigurationImpl();
        // track the messages
        BufferedLogFactory log = new BufferedLogFactory();
        config.setLogFactory(log);

        config.fromProperties(props);

        // make sure we got a warning that contains the string with the
        // bad property name and a hint for the valid property name.
        log.assertLogMessage("*\"openjpa.MaxxFetchDepth\"*");
        log.assertLogMessage("*\"openjpa.MaxFetchDepth\"*");
 
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration.fromProperties()

        // now make sure we do *not* try to validate sub-configurations (such
        // as openjpa.jdbc.Foo).
        props.clear();
        props.setProperty("openjpa.jdbc.Foo", "XXX");
        props.setProperty("oponjpa", "XXX");
        config.fromProperties(props);
        log.assertNoLogMessage("*\"openjpa.jdbc.Foo\"*");
        log.assertNoLogMessage("*\"oponjpa\"*");
    }

    /**
 
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfigurationImpl.fromProperties()

    private void enhance() throws Exception {
        Properties props = getProperties(new String[]{
            "openjpa.DetachState", "DetachedStateField=true",
        });
        OpenJPAConfiguration conf = new OpenJPAConfigurationImpl(true, false);
        conf.fromProperties(props);

        Options opts = new Options();
        opts.put("jdo", "true");
        PCEnhancer.run(conf, new String[]{
            "org.apache.openjpa.persistence.kernel.noenhance.DetachSMPC" }, opts);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.