map.put("openjpa.LockTimeout", new Integer(503));
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());
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"));
assertEquals("false", p.get("openjpa.Optimistic"));
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);
}