Make some part of the test database dependent because it verifies hardcoded Derby URL

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@739148 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2009-01-30 02:41:14 +00:00
parent d00a4e6eb9
commit e47d83b051
1 changed files with 5 additions and 2 deletions
openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/lib/conf

View File

@ -26,10 +26,12 @@ import javax.persistence.Persistence;
import org.apache.openjpa.conf.OpenJPAConfiguration;
import org.apache.openjpa.enhance.TestEnhancementWithMultiplePUs;
import org.apache.openjpa.jdbc.schema.DataSourceFactory;
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
import org.apache.openjpa.persistence.OpenJPAPersistence;
import org.apache.openjpa.persistence.common.utils.AbstractTestCase;
import org.apache.openjpa.persistence.test.AllowFailure;
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
import junit.framework.TestCase;
@ -45,7 +47,7 @@ import junit.framework.TestCase;
* @author Pinaki Poddar
*
*/
public class TestEquivalentConfiguration extends TestCase {
public class TestEquivalentConfiguration extends SingleEMFTestCase {
private EntityManagerFactory emf;
private Properties _system;
@ -82,7 +84,6 @@ public class TestEquivalentConfiguration extends TestCase {
*/
@Override
public void setUp() throws Exception {
super.setUp();
_system = backup();
clear(_system);
}
@ -328,6 +329,8 @@ public class TestEquivalentConfiguration extends TestCase {
}
void verifyDatabaseConnection() {
String driver = OpenJPAPersistence.cast(emf).getConfiguration().getConnectionDriverName();
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.flush();