Exclude some tests with HerdDBDictionary

This commit is contained in:
Enrico Olivelli 2021-04-17 12:30:07 +02:00
parent d1b9072c03
commit 7d291f8a6f
13 changed files with 67 additions and 2 deletions

View File

@ -30,12 +30,22 @@ import javax.persistence.Query;
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
import org.apache.openjpa.jdbc.sql.DerbyDictionary;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.kernel.QueryLanguages;
import org.apache.openjpa.lib.jdbc.DelegatingConnection;
import org.apache.openjpa.persistence.detachment.model.NoDetachedStateEntityFieldAccess;
import org.apache.openjpa.persistence.detachment.model.NoDetachedStateEntityPropertyAccess;
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
import static org.junit.Assume.assumeFalse;
public class TestUnwrap extends SingleEMFTestCase {
@Override
protected void setUp(Object... props) {
assumeFalse(this.getDBDictionary() instanceof HerdDBDictionary);
}
/**
* Tests a query can be unwrapped as an instance of a series of class or
* interface.

View File

@ -20,9 +20,14 @@ package org.apache.openjpa.persistence.annotations;
import javax.persistence.Query;
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
import org.apache.openjpa.jdbc.sql.DBDictionary;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.persistence.OpenJPAEntityManager;
import org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.Generator;
import static org.junit.Assume.assumeFalse;
/**
* Test for generators
*
@ -40,6 +45,9 @@ public class TestGenerators extends AnnotationTestCase
public void setUp()
throws Exception {
deleteAll(Generator.class);
JDBCConfiguration conf = (JDBCConfiguration) getEmf().getConfiguration();
DBDictionary dict = conf.getDBDictionaryInstance();
assumeFalse(dict instanceof HerdDBDictionary);
}
public void testGet() {

View File

@ -20,10 +20,17 @@ package org.apache.openjpa.persistence.annotations;
import java.util.Collection;
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
import org.apache.openjpa.jdbc.sql.DBDictionary;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.jdbc.sql.OracleDictionary;
import org.apache.openjpa.jdbc.sql.PostgresDictionary;
import org.apache.openjpa.persistence.OpenJPAEntityManager;
import org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.AnnoTest1;
import org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.AnnoTest2;
import static org.junit.Assume.assumeFalse;
/**
* Test for 1-m
@ -41,6 +48,9 @@ public class TestOneToMany extends AnnotationTestCase
public void setUp() {
deleteAll(AnnoTest1.class);
deleteAll(AnnoTest2.class);
JDBCConfiguration conf = (JDBCConfiguration) getEmf().getConfiguration();
DBDictionary dict = conf.getDBDictionaryInstance();
assumeFalse(dict instanceof HerdDBDictionary);
}
public void testOneToMany() {

View File

@ -23,12 +23,15 @@ import javax.persistence.EntityManagerFactory;
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
import org.apache.openjpa.jdbc.sql.DBDictionary;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.jdbc.sql.OracleDictionary;
import org.apache.openjpa.jdbc.sql.PostgresDictionary;
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
import org.apache.openjpa.persistence.test.AbstractPersistenceTestCase;
import org.apache.openjpa.util.ExceptionInfo;
import static org.junit.Assume.assumeFalse;
//This test was created for OPENJPA-1550. In this issue the user was
//not able to get the 'failed object' (the object causing the failure) when
//batch limit was -1 or a value greater than 1. Also, they found that the
@ -63,6 +66,7 @@ public class TestBatchLimitException extends AbstractPersistenceTestCase {
DBDictionary dict = conf.getDBDictionaryInstance();
isOracle = dict instanceof OracleDictionary;
isPostgres = dict instanceof PostgresDictionary;
assumeFalse(dict instanceof HerdDBDictionary);
return emf;
}

View File

@ -22,11 +22,14 @@ import java.util.List;
import javax.persistence.EntityManager;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.persistence.OpenJPAEntityManager;
import org.apache.openjpa.persistence.OpenJPAPersistence;
import org.apache.openjpa.persistence.simple.AllFieldTypes;
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
import static org.junit.Assume.assumeFalse;
public class TestBulkJPQLAndDataCache
extends SingleEMFTestCase {
@ -34,6 +37,7 @@ public class TestBulkJPQLAndDataCache
@Override
public void setUp() throws Exception {
assumeFalse(this.getDBDictionary() instanceof HerdDBDictionary);
setUp("openjpa.DataCache", "true",
"openjpa.QueryCache", "true",
"openjpa.RemoteCommitProvider", "sjvm",

View File

@ -25,10 +25,13 @@ import javax.persistence.RollbackException;
import org.apache.openjpa.jdbc.meta.ClassMapping;
import org.apache.openjpa.jdbc.meta.FieldMapping;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.persistence.JPAFacadeHelper;
import org.apache.openjpa.persistence.OpenJPAEntityManager;
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
import static org.junit.Assume.assumeFalse;
public class TestBulkUpdatesAndVersionColumn
extends SingleEMFTestCase {
@ -37,7 +40,7 @@ public class TestBulkUpdatesAndVersionColumn
setUp("openjpa.DataCache", "true",
"openjpa.RemoteCommitProvider", "sjvm",
OptimisticLockInstance.class, CLEAR_TABLES);
assumeFalse(this.getDBDictionary() instanceof HerdDBDictionary);
OpenJPAEntityManager em = emf.createEntityManager();
em.getTransaction().begin();
OptimisticLockInstance pc = new OptimisticLockInstance("foo");

View File

@ -21,10 +21,13 @@ package org.apache.openjpa.persistence.datacache;
import javax.persistence.Cache;
import javax.persistence.EntityManager;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
import static org.junit.Assume.assumeFalse;
public class TestBulkUpdatesDataCacheEviction extends SingleEMFTestCase {
Object[] props = new Object[] { CLEAR_TABLES, CachedEntityStatistics.class, "openjpa.DataCache", "true" };
Object[] noEvictProps = new Object[] { CLEAR_TABLES, CachedEntityStatistics.class
@ -33,6 +36,7 @@ public class TestBulkUpdatesDataCacheEviction extends SingleEMFTestCase {
@Override
public void setUp() throws Exception {
super.setUp(props);
assumeFalse(this.getDBDictionary() instanceof HerdDBDictionary);
}
/**

View File

@ -19,17 +19,21 @@
package org.apache.openjpa.persistence.detachment;
import org.apache.openjpa.enhance.PersistenceCapable;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
import org.apache.openjpa.persistence.detachment.model.NoDetachedStateEntityFieldAccess;
import org.apache.openjpa.persistence.detachment.model.NoDetachedStateEntityPropertyAccess;
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
import static org.junit.Assume.assumeFalse;
public class TestDetachNoStateField extends SingleEMFTestCase {
@Override
protected void setUp(Object... props) {
super.setUp(DROP_TABLES, "openjpa.DetachState", "loaded(DetachedStateField=false)",
NoDetachedStateEntityPropertyAccess.class, NoDetachedStateEntityFieldAccess.class);
assumeFalse(this.getDBDictionary() instanceof HerdDBDictionary);
loadDB();
}

View File

@ -24,13 +24,17 @@ import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.Query;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.persistence.simple.EntityWithTimestampPK;
import org.apache.openjpa.persistence.test.SQLListenerTestCase;
import static org.junit.Assume.assumeFalse;
public class TestTimestampPKDeletion extends SQLListenerTestCase {
@Override
public void setUp() {
assumeFalse(this.getDBDictionary() instanceof HerdDBDictionary);
setUp(EntityWithTimestampPK.class);
}

View File

@ -31,12 +31,15 @@ import org.apache.openjpa.jdbc.meta.strats.ClobValueHandler;
import org.apache.openjpa.jdbc.meta.strats.MaxEmbeddedClobFieldStrategy;
import org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy;
import org.apache.openjpa.jdbc.sql.DBDictionary;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.meta.ClassMetaData;
import org.apache.openjpa.meta.FieldMetaData;
import org.apache.openjpa.persistence.JPAFacadeHelper;
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
import static org.junit.Assume.assumeFalse;
/**
* Test for embedded
*
@ -58,6 +61,7 @@ public class TestEJBEmbedded extends SingleEMFTestCase {
setUp(EmbedOwner.class, EmbedValue.class, CLEAR_TABLES
// ,"openjpa.Log","SQL=trace"
);
assumeFalse(this.getDBDictionary() instanceof HerdDBDictionary);
}
public void testEmbedded() {

View File

@ -22,9 +22,12 @@ import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
import org.apache.openjpa.jdbc.meta.ClassMapping;
import org.apache.openjpa.jdbc.meta.strats.FullClassStrategy;
import org.apache.openjpa.jdbc.meta.strats.NoneDiscriminatorStrategy;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.persistence.OpenJPAEntityManager;
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
import static org.junit.Assume.assumeFalse;
/**
* <p>Test that InheritanceType.TABLE_PER_CLASS JPA mapping is translated
* correctly. See the <code>kodo.jdbc.meta.tableperclass</code> test package
@ -39,6 +42,7 @@ public class TestTablePerClassInheritance
public void setUp() {
setUp(TablePerClass1.class, TablePerClass2.class, EmbedOwner.class,
EmbedValue.class, CLEAR_TABLES);
assumeFalse(this.getDBDictionary() instanceof HerdDBDictionary);
}
public void testMapping() {

View File

@ -20,6 +20,7 @@ package org.apache.openjpa.persistence.jdbc.schema;
import static org.apache.openjpa.jdbc.identifier.DBIdentifier.newTable;
import static org.apache.openjpa.jdbc.identifier.QualifiedDBIdentifier.getPath;
import static org.junit.Assume.assumeFalse;
import java.io.File;
import java.sql.SQLException;
@ -31,6 +32,7 @@ import org.apache.openjpa.jdbc.meta.MappingTool;
import org.apache.openjpa.jdbc.schema.SchemaGroup;
import org.apache.openjpa.jdbc.schema.SchemaTool;
import org.apache.openjpa.jdbc.sql.DBDictionary;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.jdbc.sql.PostgresDictionary;
import org.apache.openjpa.jdbc.sql.SQLServerDictionary;
import org.apache.openjpa.persistence.OpenJPAEntityManager;
@ -75,7 +77,6 @@ public class TestSchemaGenerationProperties extends BaseJDBCTest {
@Override
public void setUp() throws Exception {
super.setUp();
OpenJPAEntityManagerFactory pmf = getEmf(new HashMap());
pmf.createEntityManager();
JDBCConfiguration conf = (JDBCConfiguration) ((OpenJPAEntityManagerFactorySPI) pmf).getConfiguration();

View File

@ -22,10 +22,14 @@ import javax.persistence.EntityManager;
import org.apache.openjpa.jdbc.meta.FieldMapping;
import org.apache.openjpa.jdbc.schema.ForeignKey;
import org.apache.openjpa.jdbc.sql.HerdDBDictionary;
import org.apache.openjpa.meta.ClassMetaData;
import org.apache.openjpa.meta.MetaDataRepository;
import org.apache.openjpa.persistence.test.CombinatorialPersistenceTestCase;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
/**
* Tests for SQL statement ordering capabilities of different update strategies
* for a Parent-Child model against different physical database constraints.
@ -103,6 +107,7 @@ public class TestParentChild extends CombinatorialPersistenceTestCase {
@Override
public void setUp() {
assumeFalse(this.getDBDictionary() instanceof HerdDBDictionary);
// The options can also be added in setup() as well but then
// coutTestCase() will only record test methods and not multiply them
// with number of configuration combinations the same tests will run.