mirror of https://github.com/apache/openjpa.git
OPENJPA-854 remove hard coded trace levels from testcases
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@733054 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0a20368e58
commit
f491d6e361
|
@ -20,8 +20,6 @@
|
|||
package org.apache.openjpa.persistence.criteria;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.persistence.DomainObject;
|
||||
import javax.persistence.EntityManager;
|
||||
|
@ -81,8 +79,7 @@ public class TestCriteria extends SingleEMFTestCase {
|
|||
Photo.class,
|
||||
Student.class,
|
||||
Transaction.class,
|
||||
VideoStore.class,
|
||||
"openjpa.Log","SQL=TRACE, Query=TRACE");
|
||||
VideoStore.class);
|
||||
emf = super.emf;
|
||||
}
|
||||
qb = (QueryBuilderImpl)emf.getQueryBuilder();
|
||||
|
@ -544,8 +541,8 @@ public class TestCriteria extends SingleEMFTestCase {
|
|||
*/
|
||||
private void executeActually(String jpql, QueryDefinition q, Object...p) {
|
||||
EntityManager em = emf.createEntityManager();
|
||||
List criteriaResult = null;
|
||||
List jpqlResult = null;
|
||||
List<?> criteriaResult = null;
|
||||
List<?> jpqlResult = null;
|
||||
Throwable criteriaError = null;
|
||||
Throwable jpqlError = null;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class TestStatistics extends SingleEMFTestCase {
|
|||
public void setUp() {
|
||||
super.setUp(CLEAR_TABLES, Customer.class, Order.class,
|
||||
"openjpa.DataCache", "true", "openjpa.RemoteCommitProvider",
|
||||
"sjvm", "openjpa.Log", "DefaultLevel=WARN");
|
||||
"sjvm");
|
||||
startCaching(Customer.class);
|
||||
startCaching(Order.class);
|
||||
assertTrue(((EntityManagerImpl) emf.createEntityManager()).getBroker()
|
||||
|
@ -46,7 +46,7 @@ public class TestStatistics extends SingleEMFTestCase {
|
|||
assertNotNull(stats);
|
||||
}
|
||||
|
||||
void startCaching(Class cls) {
|
||||
void startCaching(Class<?> cls) {
|
||||
ClassMetaData meta = emf.getConfiguration()
|
||||
.getMetaDataRepositoryInstance().getMetaData(cls, null, true);
|
||||
meta.setDataCacheName(DataCache.NAME_DEFAULT);
|
||||
|
@ -56,7 +56,8 @@ public class TestStatistics extends SingleEMFTestCase {
|
|||
* Tests that statistics captures correct data under perfect caching
|
||||
* condition.
|
||||
*/
|
||||
public void testPerfectCache() {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testPerfectCache() {
|
||||
print(stats);
|
||||
// populate a bunch of customer and order
|
||||
int nCustomer = 20;
|
||||
|
|
|
@ -48,20 +48,20 @@ import org.apache.openjpa.persistence.test.SingleEMFTestCase;
|
|||
*/
|
||||
public class TestTablePerClassInheritanceWithAbstractRoot extends
|
||||
SingleEMFTestCase {
|
||||
Class[] UNJOINED_SUBCLASSES = {
|
||||
Class<?>[] UNJOINED_SUBCLASSES = {
|
||||
EnglishParagraph.class,
|
||||
FrenchParagraph.class,
|
||||
GermanParagraph.class};
|
||||
|
||||
public void setUp() {
|
||||
setUp(CLEAR_TABLES,
|
||||
"openjpa.Log", "SQL=TRACE",
|
||||
Translation.class, BaseEntity.class,
|
||||
EnglishParagraph.class, FrenchParagraph.class,
|
||||
GermanParagraph.class, Translatable.class);
|
||||
}
|
||||
|
||||
public void testConsistency() {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testConsistency() {
|
||||
OpenJPAEntityManager em = emf.createEntityManager();
|
||||
em.getTransaction().begin();
|
||||
/**
|
||||
|
@ -144,9 +144,9 @@ public class TestTablePerClassInheritanceWithAbstractRoot extends
|
|||
* Count total number of instances of all the given classes by separate JPQL
|
||||
* aggregate query. Useful when a base class has unjoined subclasses.
|
||||
*/
|
||||
public int count(Class... classes) {
|
||||
public int count(Class<?>... classes) {
|
||||
int total = 0;
|
||||
for (Class c:classes) {
|
||||
for (Class<?> c:classes) {
|
||||
total += count(c);
|
||||
}
|
||||
return total;
|
||||
|
|
|
@ -49,8 +49,8 @@ public class TestAutoIncrement extends SingleEMFTestCase {
|
|||
if ("testAutoIncrementIdentityWithNamedSequence".equals(getName())) {
|
||||
super.setUp(CLEAR_TABLES, PObject.class,
|
||||
"openjpa.jdbc.DBDictionary",
|
||||
"oracle(UseTriggersForAutoAssign=true,autoAssignSequenceName=autoIncrementSequence)",
|
||||
"openjpa.Log", "SQL=TRACE");
|
||||
"oracle(UseTriggersForAutoAssign=true," +
|
||||
"autoAssignSequenceName=autoIncrementSequence)");
|
||||
} else {
|
||||
super.setUp(CLEAR_TABLES, PObjectNative.class,
|
||||
"openjpa.jdbc.DBDictionary",
|
||||
|
|
|
@ -47,8 +47,7 @@ public class TestNewEntityAsQueryParameter extends SingleEMFTestCase {
|
|||
public static final int MEMBER_COUNT_TOTAL = 8;
|
||||
|
||||
public void setUp() throws Exception {
|
||||
super.setUp(CLEAR_TABLES, Osoba.class, Projekt.class,
|
||||
"openjpa.Log", "SQL=TRACE");
|
||||
super.setUp(CLEAR_TABLES, Osoba.class, Projekt.class);
|
||||
createData();
|
||||
}
|
||||
|
||||
|
@ -110,7 +109,8 @@ public class TestNewEntityAsQueryParameter extends SingleEMFTestCase {
|
|||
queryWithParameter(em, projekt1, projekt2);
|
||||
}
|
||||
|
||||
void queryWithParameter(EntityManager em, Projekt projekt1, Projekt projekt2) {
|
||||
@SuppressWarnings("unchecked")
|
||||
void queryWithParameter(EntityManager em, Projekt projekt1, Projekt projekt2) {
|
||||
String jpql = "SELECT DISTINCT o FROM Osoba o WHERE :projekt MEMBER OF o.projekty";
|
||||
em.getTransaction().begin();
|
||||
Query query = em.createQuery(jpql);
|
||||
|
|
Loading…
Reference in New Issue