You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by mi...@apache.org on 2009/05/21 16:39:43 UTC
svn commit: r777135 [9/10] - in /openjpa/trunk:
openjpa-kernel/src/test/java/org/apache/openjpa/meta/
openjpa-lib/src/test/java/org/apache/openjpa/lib/conf/
openjpa-lib/src/test/java/org/apache/openjpa/lib/graph/
openjpa-lib/src/test/java/org/apache/op...
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryResults.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryResults.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryResults.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryResults.java Thu May 21 14:39:31 2009
@@ -175,8 +175,8 @@
em = (OpenJPAEntityManager) currentEntityManager();
startTx(em);
- String query =
- "SELECT r FROM RuntimeTest2 r WHERE r.stringField = \'TestQueryResults1\'";
+ String query = "SELECT r FROM RuntimeTest2 r WHERE r.stringField = "
+ + "\'TestQueryResults1\'";
List c = em.createQuery(query).getResultList();
assertEquals(1, c.size());
@@ -249,18 +249,19 @@
(OpenJPAEntityManager) currentEntityManager();
startTx(em);
- String query =
- "SELECT DISTINCT r FROM RuntimeTest1 r WHERE r.stringField = \'TestQueryResults1\'";
+ String query = "SELECT DISTINCT r FROM RuntimeTest1 r WHERE "
+ + "r.stringField = \'TestQueryResults1\'";
Object obj = em.createQuery(query).getSingleResult();
assertTrue(obj instanceof RuntimeTest1);
- query =
- "SELECT DISTINCT r FROM RuntimeTest1 r WHERE r.stringField = \'xxxx\'";
+ query = "SELECT DISTINCT r FROM RuntimeTest1 r WHERE r.stringField = "
+ + "\'xxxx\'";
OpenJPAQuery q = em.createQuery(query);
try {
Object l = q.getSingleResult();
- fail("Expected NoResultException since there is no RuntimeTest1 instance with stringfield=xxxx");
+ fail("Expected NoResultException since there is no RuntimeTest1 "
+ + "instance with stringfield=xxxx");
} catch (NoResultException e) {
// good
}
@@ -311,8 +312,8 @@
(OpenJPAEntityManager) currentEntityManager();
startTx(em);
- OpenJPAQuery q = em.createQuery(
- "SELECT DISTINCT r FROM RuntimeTest1 r WHERE r.stringField = \'TestQueryResults1\'");
+ OpenJPAQuery q = em.createQuery("SELECT DISTINCT r FROM RuntimeTest1 r "
+ + "WHERE r.stringField = \'TestQueryResults1\'");
q.setFirstResult(2);
q.setMaxResults(0);
assertTrue(
@@ -328,8 +329,8 @@
(OpenJPAEntityManager) currentEntityManager();
startTx(em);
- OpenJPAQuery q = em.createQuery(
- "SELECT DISTINCT r FROM RuntimeTest1 r WHERE r.stringField = \'TestQueryResults1\'");
+ OpenJPAQuery q = em.createQuery("SELECT DISTINCT r FROM RuntimeTest1 r "
+ + "WHERE r.stringField = \'TestQueryResults1\'");
q.setFirstResult(1);
q.setMaxResults(1000000);
@@ -356,15 +357,18 @@
endEm(em);
}
- /* This test is being commented because it was supposed to be a converted test complementing the original JDO test
- * which uses the setUnique() method available in JDO Query. OpenJPAQuery does not have such a method and hence this test
- * does not make sense.
+ /* This test is being commented because it was supposed to be a converted
+ * test complementing the original JDO test which uses the setUnique()
+ * method available in JDO Query. OpenJPAQuery does not have such a method
+ * and hence this test does not make sense.
public void testUniqueThrowsExceptionIfNonUniqueRange()
{
- OpenJPAEntityManager em = (OpenJPAEntityManager) currentEntityManager();
+ OpenJPAEntityManager em =
+ (OpenJPAEntityManager) currentEntityManager();
startTx(em);
- OpenJPAQuery q = em.createQuery("SELECT DISTINCT r FROM RuntimeTest1 r ORDER BY r.stringField ASC");
+ OpenJPAQuery q = em.createQuery(
+ "SELECT DISTINCT r FROM RuntimeTest1 r ORDER BY r.stringField ASC");
q.setFirstResult(1);
q.setMaxResults(3);
@@ -404,7 +408,8 @@
endEm(em);
}
catch (Exception uoe) {
- //FIXME:AFAM -- Figure out JPA Equivalence of createExtent(class, false) ie how to restrict the query result to the base entity and
+ //FIXME:AFAM -- Figure out JPA Equivalence of createExtent(class,
+ //false) ie how to restrict the query result to the base entity and
//not the subclasses
}
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryTimeout.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryTimeout.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryTimeout.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryTimeout.java Thu May 21 14:39:31 2009
@@ -213,7 +213,7 @@
em.getTransaction().commit();
long endTime = System.currentTimeMillis();
long runTime = endTime - startTime;
- getLog().trace("testQueryTimeout1c() - executeUpdate runTime " +
+ getLog().trace("testQueryTimeout1c() - executeUpdate runTime " +
"msecs=" + runTime);
assertTrue("Verify we received one result.", (count == 1));
// Hack - Windows sometimes returns 1999 instead of 2000+
@@ -275,7 +275,7 @@
Object result = q.getSingleResult();
long endTime = System.currentTimeMillis();
long runTime = endTime - startTime;
- getLog().trace("testQueryTimeout21b() - NoHintSingle runTime " +
+ getLog().trace("testQueryTimeout21b() - NoHintSingle runTime " +
"msecs=" + runTime);
// Hack - Windows sometimes returns 1999 instead of 2000+
assertTrue("Should have taken 2+ secs, but was msecs=" +
@@ -381,7 +381,7 @@
Object result = q.getSingleResult();
long endTime = System.currentTimeMillis();
long runTime = endTime - startTime;
- getLog().trace("testQueryTimeout23b() - NoHintSingle runTime " +
+ getLog().trace("testQueryTimeout23b() - NoHintSingle runTime " +
"msecs=" + runTime);
// Hack - Windows sometimes returns 1999 instead of 2000+
assertTrue("Should have taken 2+ secs, but was msecs=" +
@@ -657,7 +657,7 @@
q.setParameter(1, new String("updated"));
// verify no default javax.persistence.query.timeout is supplied
Map<String, Object> hints = q.getHints();
- assertFalse(hints.containsKey("javax.persistence.query.timeout"));
+ assertFalse(hints.containsKey("javax.persistence.query.timeout"));
// update the query timeout value and verify it was set
setTime = 1000;
getLog().trace("testQueryTimeout33c() - Setting hint " +
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestSubquery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestSubquery.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestSubquery.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestSubquery.java Thu May 21 14:39:31 2009
@@ -59,7 +59,8 @@
"select c.name from Customer c where exists" +
" (select o from c.orders o where o.oid = 1) or exists" +
" (select o from c.orders o where o.oid = 2)",
- "select c.name from Customer c, in(c.orders) o where o.amount between" +
+ "select c.name from Customer c, in(c.orders) o where o.amount " +
+ "between" +
" (select max(o.amount) from Order o) and" +
" (select avg(o.amount) from Order o) ",
"select o.oid from Order o where o.amount >" +
@@ -82,8 +83,9 @@
"FROM Magazine m3 "+
"WHERE m3.idPublisher.id = p.id)) ",
// outstanding problem subqueries:
- //"select o from Order o where o.amount > (select count(o) from Order o)",
- //"select o from Order o where o.amount > (select count(o2) from Order o2)",
+ // "select o from Order o where o.amount > (select count(o) from Order o)",
+ // "select o from Order o where o.amount > (select count(o2) from
+ // Order o2)",
// "select c from Customer c left join c.orders p where not exists"
// + " (select o2 from c.orders o2 where o2 = o",
};
@@ -119,24 +121,28 @@
"select c from Customer c where c.creditRating =" +
" (select " +
" CASE WHEN o2.amount > 10 THEN " +
- "org.apache.openjpa.persistence.query.Customer$CreditRating.POOR" +
+ "org.apache.openjpa.persistence.query.Customer$CreditRating.POOR" +
" WHEN o2.amount = 10 THEN " +
- "org.apache.openjpa.persistence.query.Customer$CreditRating.GOOD " +
+ "org.apache.openjpa.persistence.query.Customer$CreditRating." +
+ "GOOD " +
" ELSE " +
- "org.apache.openjpa.persistence.query.Customer$CreditRating.EXCELLENT " +
+ "org.apache.openjpa.persistence.query." +
+ "Customer$CreditRating.EXCELLENT " +
" END " +
" from Order o2" +
" where c.cid.id = o2.customer.cid.id)",
"select c from Customer c " +
"where c.creditRating = (select COALESCE (c1.creditRating, " +
- "org.apache.openjpa.persistence.query.Customer$CreditRating.POOR) " +
+ "org.apache.openjpa.persistence.query." +
+ "Customer$CreditRating.POOR) " +
"from Customer c1 where c1.name = 'Famzy') order by c.name DESC",
"select c from Customer c " +
"where c.creditRating = (select NULLIF (c1.creditRating, " +
- "org.apache.openjpa.persistence.query.Customer$CreditRating.POOR) " +
- "from Customer c1 where c1.name = 'Famzy') order by c.name DESC",
+ "org.apache.openjpa.persistence.query." +
+ "Customer$CreditRating.POOR) " +
+ "from Customer c1 where c1.name = 'Famzy') order by c.name DESC",
};
static String[] updates = new String[] {
@@ -174,7 +180,8 @@
/**
* Verify a sub query can contain MAX and additional date comparisons
* without losing the correct alias information. This sort of query
- * originally caused problems for DBDictionaries which used DATABASE syntax.
+ * originally caused problems for DBDictionaries which used DATABASE
+ * syntax.
*/
public void testSubSelectMaxDateRange() {
String query =
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/C.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/C.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/C.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/C.java Thu May 21 14:39:31 2009
@@ -99,16 +99,16 @@
CId id = (CId) obj;
- return (this.getCId() == id.getCId() || (this.getCId() != null &&
+ return (this.getCId() == id.getCId() || (this.getCId() != null &&
this.getCId().equals(id.getCId())))
- && (this.getCm() == id.getCm() || (this.getCm() != null &&
+ && (this.getCm() == id.getCm() || (this.getCm() != null &&
this.getCm().equals(id.getCm())));
}
@Override
public int hashCode() {
- return ((this.getCId() != null) ? this.getCId().hashCode():0)
- ^ ((this.getCm() != null)? this.getCm().hashCode():0);
+ return ((this.getCId() != null) ? this.getCId().hashCode():0)
+ ^ ((this.getCm() != null)? this.getCm().hashCode():0);
}
}
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CM.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CM.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CM.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CM.java Thu May 21 14:39:31 2009
@@ -106,14 +106,14 @@
CMId id = (CMId) obj;
return ( this.getCmId() == id.getCmId() ||
(this.getCmId() != null && this.getCmId().equals(id.getCmId())))
- && ( this.getE() == id.getE() || (this.getE() != null &&
+ && ( this.getE() == id.getE() || (this.getE() != null &&
this.getE().equals(id.getE())));
}
@Override
public int hashCode() {
- return (this.getCmId() != null? this.getCmId().hashCode():0)
- ^ (this.getE()!= null ? this.getE().hashCode():0);
+ return (this.getCmId() != null? this.getCmId().hashCode():0)
+ ^ (this.getE()!= null ? this.getE().hashCode():0);
}
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java Thu May 21 14:39:31 2009
@@ -41,7 +41,8 @@
private Integer optLock;
//cascade = CascadeType.ALL,
- @OneToMany(cascade=CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "chainEntityB")
+ @OneToMany(cascade=CascadeType.ALL, fetch = FetchType.EAGER,
+ mappedBy = "chainEntityB")
protected Set<ChainEntityC> chainEntityCSet = null;
public void addChainEntityC (ChainEntityC bean) {
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/D.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/D.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/D.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/D.java Thu May 21 14:39:31 2009
@@ -107,16 +107,16 @@
if (obj == null || ! (obj instanceof CId))
return false;
CId id = (CId) obj;
- return (this.getId() == id.getId() || (this.getId() != null &&
+ return (this.getId() == id.getId() || (this.getId() != null &&
this.getId().equals(id.getId())))
- && (this.getVc() == id.getVc() || (this.getVc() != null &&
+ && (this.getVc() == id.getVc() || (this.getVc() != null &&
this.getVc().equals(id.getVc())));
}
@Override
public int hashCode() {
- return (this.getId() != null ? this.getId().hashCode():0)
- ^ (this.getVc() != null ? this.getVc().hashCode():0);
+ return (this.getId() != null ? this.getId().hashCode():0)
+ ^ (this.getVc() != null ? this.getVc().hashCode():0);
}
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityA1InverseEager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityA1InverseEager.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityA1InverseEager.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityA1InverseEager.java Thu May 21 14:39:31 2009
@@ -31,7 +31,8 @@
private String name1;
@OneToMany(fetch=FetchType.EAGER, mappedBy="entityA")
- private List<EntityBInverseEager> listB = new ArrayList<EntityBInverseEager>();
+ private List<EntityBInverseEager> listB =
+ new ArrayList<EntityBInverseEager>();
public EntityA1InverseEager() {}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityA2InverseEager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityA2InverseEager.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityA2InverseEager.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityA2InverseEager.java Thu May 21 14:39:31 2009
@@ -31,7 +31,8 @@
private String name2;
@OneToMany(fetch=FetchType.EAGER, mappedBy="entityA")
- private List<EntityBInverseEager> listB = new ArrayList<EntityBInverseEager>();
+ private List<EntityBInverseEager> listB =
+ new ArrayList<EntityBInverseEager>();
public EntityA2InverseEager() {}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityAInverseEager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityAInverseEager.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityAInverseEager.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EntityAInverseEager.java Thu May 21 14:39:31 2009
@@ -40,7 +40,8 @@
private String name;
@OneToMany(fetch=FetchType.EAGER, mappedBy="entityA")
- private List<EntityBInverseEager> listB = new ArrayList<EntityBInverseEager>();
+ private List<EntityBInverseEager> listB =
+ new ArrayList<EntityBInverseEager>();
public EntityAInverseEager() {}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneCompoundIdOwnerId.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneCompoundIdOwnerId.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneCompoundIdOwnerId.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneCompoundIdOwnerId.java Thu May 21 14:39:31 2009
@@ -21,7 +21,8 @@
import java.io.*;
/**
- * Application identity class for: org.apache.openjpa.persistence.relations.ManyOneCompoundIdOwner
+ * Application identity class for:
+ * org.apache.openjpa.persistence.relations.ManyOneCompoundIdOwner
*
* Auto-generated by:
* org.apache.openjpa.enhance.ApplicationIdTool
@@ -29,8 +30,10 @@
public class ManyOneCompoundIdOwnerId implements Serializable {
static {
// register persistent class in JVM
- try { Class.forName("org.apache.openjpa.persistence.relations.ManyOneCompoundIdOwner"); }
- catch (Exception e) {}
+ try {
+ Class.forName(
+ "org.apache.openjpa.persistence.relations.ManyOneCompoundIdOwner");
+ } catch (Exception e) {}
}
public long entityId;
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/Order.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/Order.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/Order.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/Order.java Thu May 21 14:39:31 2009
@@ -81,7 +81,7 @@
}
public String toString(){
- return "Order:"+oid+" amount:"+amount+" delivered:"+delivered+" customer:"+
- ( customer!=null ? customer.getCid() : -1 );
+ return "Order:" + oid + " amount:" + amount + " delivered:" + delivered
+ + " customer:" + ( customer != null ? customer.getCid() : -1 );
}
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java Thu May 21 14:39:31 2009
@@ -58,7 +58,7 @@
b.setName ("Test_B_");
ChainEntityC c;
/*
- * Create and add C to B. Increasing the number of iterations (number of
+ * Create and add C to B. Increasing the number of iterations (number of
* ChainEntityC) increases the probability to get the unique key
* constraint violation error.
*/
@@ -74,8 +74,8 @@
em.getTransaction ().begin ();
a = em.merge (a);
/*
- * workaround: Uncommenting following line is a workaround. If we
- * retrive Ids of ChainEntityC objects after merge but before commit we
+ * workaround: Uncommenting following line is a workaround. If we
+ * retrive Ids of ChainEntityC objects after merge but before commit we
* don't get the error.
*/
//dump (a);
@@ -103,14 +103,14 @@
*/
protected void dump (ChainEntityA testA) {
System.out.println ("-------");
- System.out.println (testA.getName () + "[" + testA.getId () + "]");
- for (ChainEntityB testB : testA.getChildren ()) {
- System.out.println (testB.getName () + "[" + testB.getId () + "]");
- for (ChainEntityC testC : testB.getChainEntityCSet ()) {
- System.out.println (testC.getName () + "[" + testC.getId ()
- + "]");
- }
- }
+ System.out.println (testA.getName () + "[" + testA.getId () + "]");
+ for (ChainEntityB testB : testA.getChildren ()) {
+ System.out.println (testB.getName () + "[" + testB.getId () + "]");
+ for (ChainEntityC testC : testB.getChainEntityCSet ()) {
+ System.out.println (testC.getName () + "[" + testC.getId ()
+ + "]");
+ }
+ }
System.out.println ("-------");
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestInverseEagerSQL.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestInverseEagerSQL.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestInverseEagerSQL.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestInverseEagerSQL.java Thu May 21 14:39:31 2009
@@ -42,8 +42,9 @@
public void setUp() {
setUp(Customer.class, Customer.CustomerKey.class, Order.class,
- EntityAInverseEager.class, EntityA1InverseEager.class, EntityA2InverseEager.class,
- EntityBInverseEager.class, EntityCInverseEager.class, EntityDInverseEager.class,
+ EntityAInverseEager.class, EntityA1InverseEager.class,
+ EntityA2InverseEager.class, EntityBInverseEager.class,
+ EntityCInverseEager.class, EntityDInverseEager.class,
Publisher.class, Magazine.class, DROP_TABLES);
EntityManager em = emf.createEntityManager();
@@ -95,7 +96,8 @@
EntityCInverseEager c1 = new EntityCInverseEager("c"+i, i, i);
em.persist(c1);
- EntityDInverseEager d1 = new EntityDInverseEager("d"+i, "d"+i, i, i);
+ EntityDInverseEager d1 = new EntityDInverseEager("d" + i, "d" + i,
+ i, i);
em.persist(d1);
c1.setD(d1);
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestManyEagerSQL.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestManyEagerSQL.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestManyEagerSQL.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestManyEagerSQL.java Thu May 21 14:39:31 2009
@@ -195,7 +195,7 @@
assertEquals(id, p.getLazyChildren().get(0).getParent().getId());
assertEquals(id, p.getLazyChildren().get(1).getParent().getId());
assertEquals("lazychild0", p.getLazyChildren().get(0).getName());
- assertEquals("lazychild1", p.getLazyChildren().get(1).getName());
+ assertEquals("lazychild1", p.getLazyChildren().get(1).getName());
}
assertEquals(0, sql.size());
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestRelationFieldAsPrimaryKeyAndForeignKey.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestRelationFieldAsPrimaryKeyAndForeignKey.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestRelationFieldAsPrimaryKeyAndForeignKey.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestRelationFieldAsPrimaryKeyAndForeignKey.java Thu May 21 14:39:31 2009
@@ -161,7 +161,7 @@
Assert.assertEquals(1, e.getCms().size());
Assert.assertEquals(1, e.getVcss().size());
- // Get virtual container set and check that it has a reference to the
+ // Get virtual container set and check that it has a reference to the
// ensemble
List<VCS> vcss = (List<VCS>) em.createQuery(
"Select vcset from VCS vcset where vcset.vcsId='VCS1'")
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestRelationToRelationMaps.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestRelationToRelationMaps.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestRelationToRelationMaps.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestRelationToRelationMaps.java Thu May 21 14:39:31 2009
@@ -19,7 +19,8 @@
package org.apache.openjpa.persistence.relations;
import org.apache.openjpa.jdbc.meta.ClassMapping;
-import org.apache.openjpa.jdbc.meta.strats.RelationRelationMapTableFieldStrategy;
+import org.apache.openjpa.jdbc.meta.strats.
+ RelationRelationMapTableFieldStrategy;
import org.apache.openjpa.persistence.JPAFacadeHelper;
import org.apache.openjpa.persistence.simple.AllFieldTypes;
import org.apache.openjpa.persistence.test.SingleEMTestCase;
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/VC.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/VC.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/VC.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/VC.java Thu May 21 14:39:31 2009
@@ -52,7 +52,8 @@
@Id
private VCS vcs;
- @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "vc")
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY,
+ mappedBy = "vc")
private Set<D> ds = new HashSet<D>();
public VC() {
@@ -120,8 +121,8 @@
@Override
public int hashCode() {
- return (this.getVcId() != null ? this.getVcId().hashCode() : 0)
- ^ (this.getVcs() != null ? this.getVcs().hashCode() : 0);
+ return (this.getVcId() != null ? this.getVcId().hashCode() : 0)
+ ^ (this.getVcs() != null ? this.getVcs().hashCode() : 0);
}
}
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/VCS.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/VCS.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/VCS.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/VCS.java Thu May 21 14:39:31 2009
@@ -49,7 +49,7 @@
@Basic
private String name;
- @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy = "vcs")
+ @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy = "vcs")
private Set<VC> vcs = new HashSet<VC>();
public VCS() {
@@ -129,14 +129,14 @@
return (this.getVcsId() == id.getVcsId() ||
(this.getVcsId() != null &&
this.getVcsId().equals(id.getVcsId())))
- && (this.getE() == id.getE() || (this.getE() != null
+ && (this.getE() == id.getE() || (this.getE() != null
&& this.getE().equals(id.getE())));
}
@Override
public int hashCode() {
- return (this.getVcsId() != null ?this.getVcsId().hashCode():0)
- ^ (this.getE() != null ? this.getE().hashCode():0);
+ return (this.getVcsId() != null ?this.getVcsId().hashCode():0)
+ ^ (this.getE() != null ? this.getE().hashCode():0);
}
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerClear.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerClear.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerClear.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerClear.java Thu May 21 14:39:31 2009
@@ -159,9 +159,9 @@
}
/**
- * Test modify entity then clear context which cause unflushed modified entity detached.
- * Do more modification on detached entity, merge back and commit.
- * Expect both changes before clear and after clear are persisted.
+ * Test modify entity then clear context which cause unflushed modified
+ * entity detached. Do more modification on detached entity, merge back and
+ * commit. Expect both changes before clear and after clear are persisted.
*
*/
public void testUpdateClearUpdateMerge() {
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerMerge.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerMerge.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerMerge.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerMerge.java Thu May 21 14:39:31 2009
@@ -73,7 +73,7 @@
}
/**
- * This test verifies that persisting a new entity which matches an existing
+ * This test verifies that persisting a new entity which matches an existing
* row in the database succeeds.
*/
public void testMergeExistingEntity() {
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/LibService.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/LibService.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/LibService.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/LibService.java Thu May 21 14:39:31 2009
@@ -52,21 +52,23 @@
*
* <pre>
* <bean id="emf"
- * class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
- * <property name="persistenceUnitName" value="" />
+ * class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"
+ * >
+ * <property name="persistenceUnitName" value="" />
* </bean>
*
* <!-- enable Spring's support for JPA injection -->
- * <bean class=
- * "org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
+ * <bean class="
+ *org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
+ *"/>
*
* <bean id="transactionalService"
* class="sample.jpa.service.LibServiceImpl" >
* </bean>
*
* <bean id="transactionManager"
- * class="org.springframework.orm.jpa.JpaTransactionManager" >
- * <property name="entityManagerFactory" ref="emf" />
+ * class="org.springframework.orm.jpa.JpaTransactionManager" >
+ * <property name="entityManagerFactory" ref="emf" />
* </bean>
*
* <tx:annotation-driven/>
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/LibServiceImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/LibServiceImpl.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/LibServiceImpl.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/LibServiceImpl.java Thu May 21 14:39:31 2009
@@ -73,8 +73,8 @@
"the title cannot be null or empty");
// set up the query
- Query query = em
- .createQuery("select b from Book b join fetch b.subjects where b.title = :x");
+ Query query = em.createQuery(
+ "select b from Book b join fetch b.subjects where b.title = :x");
query.setParameter("x", title);
// execute the query and return the books
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/ClassSelector.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/ClassSelector.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/ClassSelector.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/ClassSelector.java Thu May 21 14:39:31 2009
@@ -29,10 +29,10 @@
import serp.bytecode.Project;
/**
- * List class names that match specific selection criteria based on inheritance,
+ * List class names that match specific selection criteria based on inheritance,
* implemented interface or annotations. The classes are scanned starting from
- * a root directory or a single file. Uses serp bytecode library for reading the
- * bytecode. The classes are not loaded in Java Virtual Machine and hence
+ * a root directory or a single file. Uses serp bytecode library for reading the
+ * bytecode. The classes are not loaded in Java Virtual Machine and hence
* dependent classes need not be in the classpath.
*
* @author Pinaki Poddar
@@ -49,21 +49,22 @@
* junit.framework.TestCase
* and annotated with org.apache.openjpa.persistence.test.AllowFailure
*
- * @param args the root directory of the class files to be scanned. If no
+ * @param args the root directory of the class files to be scanned. If no
* argument is given then assumes the current directory.
*
*/
public static void main(String[] args) throws Exception {
String dir = (args.length == 0) ? System.getProperty("user.dir")
: args[0];
- ClassSelector reader = new ClassSelector()
- .addSuper("org.apache.openjpa.persistence.test.SingleEMTestCase")
- .addSuper("org.apache.openjpa.persistence.test.SingleEMFTestCase")
- .addSuper("org.apache.openjpa.persistence.kernel.BaseKernelTest")
- .addSuper("org.apache.openjpa.persistence.query.BaseQueryTest")
- .addSuper("org.apache.openjpa.persistence.jdbc.kernel.BaseJDBCTest")
- .addSuper("org.apache.openjpa.persistence.common.utils.AbstractTestCase")
- .addAnnotation("org.apache.openjpa.persistence.test.AllowFailure");
+ ClassSelector reader = new ClassSelector()
+ .addSuper("org.apache.openjpa.persistence.test.SingleEMTestCase")
+ .addSuper("org.apache.openjpa.persistence.test.SingleEMFTestCase")
+ .addSuper("org.apache.openjpa.persistence.kernel.BaseKernelTest")
+ .addSuper("org.apache.openjpa.persistence.query.BaseQueryTest")
+ .addSuper("org.apache.openjpa.persistence.jdbc.kernel.BaseJDBCTest")
+ .addSuper(
+ "org.apache.openjpa.persistence.common.utils.AbstractTestCase")
+ .addAnnotation("org.apache.openjpa.persistence.test.AllowFailure");
List<String> names = reader.list(new File(dir), true);
String spec = reader.getSpecification();
System.err.println("Found " + names.size() + " classes under "
@@ -89,20 +90,20 @@
private void list(File file, boolean recursive, List<String> names) {
if (file.isDirectory()) {
if (recursive) {
- String[] children = file.list(new FilenameFilter() {
- public boolean accept(File dir, String name) {
+ String[] children = file.list(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
return name.endsWith(".class");
}
});
for (String name : children)
- list(new File(file, name), recursive, names);
+ list(new File(file, name), recursive, names);
String[] dirs = file.list(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return new File(dir, name).isDirectory();
+ public boolean accept(File dir, String name) {
+ return new File(dir, name).isDirectory();
}
});
for (String name : dirs)
- list(new File(file, name), recursive, names);
+ list(new File(file, name), recursive, names);
}
} else if (file.getName().endsWith(".class")) {
String cls = select(file);
@@ -143,7 +144,7 @@
&& applyAnnotationFilter(bcls))
return bcls.getName();
} catch (Exception e) {
- System.err.println("Error reading " + file.getAbsolutePath()
+ System.err.println("Error reading " + file.getAbsolutePath()
+ " : " + e);
}
return null;
@@ -183,7 +184,7 @@
}
/**
- * Affirms if annotations of the given class or its methods match any of the
+ * Affirms if annotations of the given class or its methods match any of the
* selection filter names. If no annotation name has been set for
* selection then return true.
*
@@ -223,21 +224,21 @@
tmp.append("\textends ");
and = "and ";
for (int i=0; i<_supers.size(); i++)
- tmp.append(_supers.get(i))
- .append((i != _supers.size()-1 ? "\r\n\t or " : "\r\n"));
+ tmp.append(_supers.get(i)).append(
+ (i != _supers.size()-1 ? "\r\n\t or " : "\r\n"));
}
if (!_interfaces.isEmpty()) {
tmp.append("\t" + and + "implements ");
and = "and ";
for (int i=0; i<_interfaces.size(); i++)
- tmp.append(_interfaces.get(i))
- .append((i != _interfaces.size()-1 ? "\r\n\t or " : "\r\n"));
+ tmp.append(_interfaces.get(i)).append(
+ (i != _interfaces.size()-1 ? "\r\n\t or " : "\r\n"));
}
if (!_annotations.isEmpty()) {
tmp.append("\t" + and + "annotatated with ");
for (int i=0; i<_annotations.size(); i++)
tmp.append(_annotations.get(i))
- .append((i != _annotations.size()-1 ? " or " : "\r\n"));
+ .append((i != _annotations.size()-1 ? " or " : "\r\n"));
}
return tmp.toString();
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinationGenerator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinationGenerator.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinationGenerator.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinationGenerator.java Thu May 21 14:39:31 2009
@@ -87,7 +87,7 @@
List dimValueList = dimensions.get(dimIndex);
int valuListSize = dimValueList.size();
for (int j = 0; j < comboSize; j++) {
- result[j].set(dimIndex, dimValueList.get((j / dimRepeatingStep)
+ result[j].set(dimIndex, dimValueList.get((j / dimRepeatingStep)
% valuListSize));
}
dimRepeatingStep *= valuListSize;
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinatorialPersistenceTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinatorialPersistenceTestCase.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinatorialPersistenceTestCase.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinatorialPersistenceTestCase.java Thu May 21 14:39:31 2009
@@ -42,20 +42,22 @@
@Override
public int countTestCases() {
- return super.countTestCases() * getHelper().getCombinationSize();
+ return super.countTestCases() * getHelper().getCombinationSize();
}
@Override
public void runBare() throws Throwable {
Map<String, Throwable> errors = new HashMap<String, Throwable>();
- Map<String, AssertionFailedError> failures = new HashMap<String, AssertionFailedError>();
+ Map<String, AssertionFailedError> failures =
+ new HashMap<String, AssertionFailedError>();
do {
try {
super.runBare();
} catch (Throwable t) {
if (t instanceof AssertionFailedError) {
- failures.put(getHelper().getOptionsAsString(), (AssertionFailedError)t);
- testResult.addFailure(this, (AssertionFailedError)t);
+ failures.put(getHelper().getOptionsAsString(),
+ (AssertionFailedError)t);
+ testResult.addFailure(this, (AssertionFailedError)t);
} else {
errors.put(getHelper().getOptionsAsString(), t);
testResult.addError(this, t);
@@ -65,7 +67,7 @@
if (testResult.errorCount() + testResult.failureCount() > 0) {
if (!failures.isEmpty())
- System.err.println(failures.size() + " assertion failures");
+ System.err.println(failures.size() + " assertion failures");
for (String o : failures.keySet()) {
System.err.println("Combination:\r\n" + o);
failures.get(o).printStackTrace();
@@ -76,10 +78,11 @@
System.err.println("Combination:\r\n" + o);
errors.get(o).printStackTrace();
}
- throw new Throwable(getName() + ": "
- + getHelper().getCombinationSize() + " combinations, "
- + errors.size() + " errors, " + failures.size() + " failures\r\n"
- + "Stack trace for each error/failure is printed on console");
+ throw new Throwable(getName() + ": "
+ + getHelper().getCombinationSize() + " combinations, "
+ + errors.size() + " errors, " + failures.size()
+ + " failures\r\n"
+ + "Stack trace for each error/failure is printed on console");
}
}
@@ -95,8 +98,9 @@
try {
super.assertSQL(sqlExp);
} catch (AssertionFailedError e) {
- String newMessage = "Combination\r\n" + getHelper().getOptionsAsString()
- + " failed \r\n " + e.getMessage();
+ String newMessage = "Combination\r\n"
+ + getHelper().getOptionsAsString()
+ + " failed \r\n " + e.getMessage();
fail(newMessage);
}
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinatorialTestHelper.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinatorialTestHelper.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinatorialTestHelper.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/CombinatorialTestHelper.java Thu May 21 14:39:31 2009
@@ -67,7 +67,7 @@
* The important side effect of this method is to set the current
* configuration options.
*
- * If no property is configured for combinatorial generation then returns
+ * If no property is configured for combinatorial generation then returns
* the given list as it is.
*
*/
@@ -96,7 +96,7 @@
Object[] newProps = new Object[props.length + options.length];
System.arraycopy(props, 0, newProps, 0, props.length);
- System.arraycopy(options, 0, newProps, props.length, options.length);
+ System.arraycopy(options, 0, newProps, props.length, options.length);
return newProps;
}
@@ -118,7 +118,7 @@
* Adds options for the given property.
* If runtime is true then this property is not added to configuration.
*/
- public void addOption(String property, Object[] options, boolean runtime) {
+ public void addOption(String property, Object[] options, boolean runtime) {
addOption(property, Arrays.asList(options), runtime);
}
@@ -147,7 +147,7 @@
public Object getOption(String key) {
int index = propertyKeys.indexOf(key);
if (index == -1)
- throw new IllegalArgumentException("Unknown option " + key);
+ throw new IllegalArgumentException("Unknown option " + key);
return currentOption.get(index);
}
@@ -174,12 +174,12 @@
for (int i = 0; i <propertyKeys.size(); i++) {
String key = propertyKeys.get(i);
if (!runtimeKeys.get(i))
- buf.append(key + " : " + getOption(key)).append("\r\n");
+ buf.append(key + " : " + getOption(key)).append("\r\n");
}
for (int i = 0; i <propertyKeys.size(); i++) {
String key = propertyKeys.get(i);
if (runtimeKeys.get(i))
- buf.append("* " + key + " : " + getOption(key)).append("\r\n");
+ buf.append("* " + key + " : " + getOption(key)).append("\r\n");
}
return buf.toString();
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java Thu May 21 14:39:31 2009
@@ -252,8 +252,8 @@
if (emf == null)
return;
clear(emf, true, ((OpenJPAEntityManagerFactorySPI) emf)
- .getConfiguration()
- .getMetaDataRepositoryInstance().getMetaDatas());
+ .getConfiguration()
+ .getMetaDataRepositoryInstance().getMetaDatas());
}
/**
@@ -261,7 +261,7 @@
* @param closeEMs TODO
*/
private void clear(EntityManagerFactory emf, boolean closeEMs,
- ClassMetaData... types) {
+ ClassMetaData... types) {
if (emf == null || types.length == 0)
return;
@@ -365,53 +365,54 @@
// Utility methods for exception handling
// ================================================
/**
- * Asserts that the given targetType is assignable from given actual
- * Throwable.
- */
+ * Asserts that the given targetType is assignable from given actual
+ * Throwable.
+ */
protected void assertException(final Throwable actual, Class targetType) {
- assertException(actual, targetType, null);
- }
-
- /**
- * Asserts that the given targetType is assignable from given actual
- * Throwable. Asserts that the nestedType is nested (possibly recursively)
- * within the given actual Throwable.
- *
- * @param actual is the actual throwable to be tested
- * @param targetType is expected type or super type of actual. If null, then
- * the check is omitted.
- * @param nestedTargetType is expected type of exception nested within
- * actual. If null this search is omitted.
- *
- */
+ assertException(actual, targetType, null);
+ }
+
+ /**
+ * Asserts that the given targetType is assignable from given actual
+ * Throwable. Asserts that the nestedType is nested (possibly recursively)
+ * within the given actual Throwable.
+ *
+ * @param actual is the actual throwable to be tested
+ * @param targetType is expected type or super type of actual. If null, then
+ * the check is omitted.
+ * @param nestedTargetType is expected type of exception nested within
+ * actual. If null this search is omitted.
+ *
+ */
protected void assertException(final Throwable actual, Class targetType,
- Class nestedTargetType) {
- assertNotNull(actual);
- Class actualType = actual.getClass();
- if (targetType != null && !targetType.isAssignableFrom(actualType)) {
- actual.printStackTrace();
- fail(targetType.getName() + " is not assignable from "
- + actualType.getName());
- }
+ Class nestedTargetType) {
+ assertNotNull(actual);
+ Class actualType = actual.getClass();
+ if (targetType != null && !targetType.isAssignableFrom(actualType)) {
+ actual.printStackTrace();
+ fail(targetType.getName() + " is not assignable from "
+ + actualType.getName());
+ }
- if (nestedTargetType != null) {
- Throwable nested = actual.getCause();
- Class nestedActualType = (nested == null) ? null : nested.getClass();
- while (nestedActualType != null) {
- if (nestedTargetType.isAssignableFrom(nestedActualType)) {
- return;
- } else {
- Throwable next = nested.getCause();
- if (next == null || next == nested)
- break;
- nestedActualType = next.getClass();
- nested = next;
- }
- }
- actual.printStackTrace();
- fail("No nested type " + nestedTargetType + " in " + actual);
- }
- }
+ if (nestedTargetType != null) {
+ Throwable nested = actual.getCause();
+ Class nestedActualType =
+ (nested == null) ? null : nested.getClass();
+ while (nestedActualType != null) {
+ if (nestedTargetType.isAssignableFrom(nestedActualType)) {
+ return;
+ } else {
+ Throwable next = nested.getCause();
+ if (next == null || next == nested)
+ break;
+ nestedActualType = next.getClass();
+ nested = next;
+ }
+ }
+ actual.printStackTrace();
+ fail("No nested type " + nestedTargetType + " in " + actual);
+ }
+ }
/**
* Asserts that the given targetType is assignable from given actual
@@ -424,34 +425,34 @@
assertMessage(actual, messages);
}
- /**
- * Assert that each of given keys are present in the message of the given
- * Throwable.
- */
+ /**
+ * Assert that each of given keys are present in the message of the given
+ * Throwable.
+ */
protected void assertMessage(Throwable actual, String... keys) {
- if (actual == null || keys == null)
- return;
- String message = actual.getMessage();
- for (String key : keys) {
- assertTrue(key + " is not in " + message, message.contains(key));
- }
- }
+ if (actual == null || keys == null)
+ return;
+ String message = actual.getMessage();
+ for (String key : keys) {
+ assertTrue(key + " is not in " + message, message.contains(key));
+ }
+ }
public void printException(Throwable t) {
- printException(t, 2);
+ printException(t, 2);
}
public void printException(Throwable t, int tab) {
- if (t == null) return;
- for (int i=0; i<tab*4;i++) System.out.print(" ");
- String sqlState = (t instanceof SQLException) ?
- "(SQLState=" + ((SQLException)t).getSQLState() + ":"
- + t.getMessage() + ")" : "";
- System.out.println(t.getClass().getName() + sqlState);
- if (t.getCause() == t)
- return;
- printException(t.getCause(), tab+2);
- }
+ if (t == null) return;
+ for (int i=0; i<tab*4;i++) System.out.print(" ");
+ String sqlState = (t instanceof SQLException) ?
+ "(SQLState=" + ((SQLException)t).getSQLState() + ":"
+ + t.getMessage() + ")" : "";
+ System.out.println(t.getClass().getName() + sqlState);
+ if (t.getCause() == t)
+ return;
+ printException(t.getCause(), tab+2);
+ }
/**
* Overrides to allow tests annotated with @AllowFailure to fail.
@@ -483,27 +484,28 @@
* level annotation.
*/
protected AllowFailure getAllowFailure() {
- try {
+ try {
Method runMethod = getClass().getMethod(getName(), (Class[])null);
AllowFailure anno = runMethod.getAnnotation(AllowFailure.class);
- if (anno != null)
- return anno;
- } catch (SecurityException e) {
- //ignore
- } catch (NoSuchMethodException e) {
- //ignore
- }
- return getClass().getAnnotation(AllowFailure.class);
+ if (anno != null)
+ return anno;
+ } catch (SecurityException e) {
+ //ignore
+ } catch (NoSuchMethodException e) {
+ //ignore
+ }
+ return getClass().getAnnotation(AllowFailure.class);
}
/**
- * Affirms if either this test has been annotated with @DatabasePlatform and
+ * Affirms if either this test has been annotated with @DatabasePlatform and
* at least one of the specified driver is available in the classpath,
* or no such annotation is used.
*
*/
protected boolean isRunsOnCurrentPlatform() {
- DatabasePlatform anno = getClass().getAnnotation(DatabasePlatform.class);
+ DatabasePlatform anno =
+ getClass().getAnnotation(DatabasePlatform.class);
if (anno == null)
return true;
if (anno != null) {
@@ -524,8 +526,10 @@
return false;
}
- private static class FixedMap extends LinkedHashMap<EMFKey, OpenJPAEntityManagerFactorySPI> {
- public boolean removeEldestEntry(Map.Entry<EMFKey, OpenJPAEntityManagerFactorySPI> entry) {
+ private static class FixedMap extends LinkedHashMap<EMFKey,
+ OpenJPAEntityManagerFactorySPI> {
+ public boolean removeEldestEntry(Map.Entry<EMFKey,
+ OpenJPAEntityManagerFactorySPI> entry) {
return this.size() > 2;
}
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java Thu May 21 14:39:31 2009
@@ -115,9 +115,9 @@
* Get number of instances by an aggregate query with the given alias.
*/
public int count(String alias) {
- return ((Number)emf.createEntityManager()
- .createQuery("SELECT COUNT(p) FROM " + alias + " p")
- .getSingleResult()).intValue();
+ return ((Number)emf.createEntityManager().createQuery(
+ "SELECT COUNT(p) FROM " + alias + " p")
+ .getSingleResult()).intValue();
}
/**
@@ -134,14 +134,13 @@
*/
@SuppressWarnings("unchecked")
public <T> List<T> getAll(Class<T> t) {
- return (List<T>)emf.createEntityManager()
- .createQuery("SELECT p FROM " + getAlias(t) + " p")
- .getResultList();
+ return (List<T>)emf.createEntityManager().createQuery(
+ "SELECT p FROM " + getAlias(t) + " p").getResultList();
}
/**
* Get all the instances of given type.
- * The returned instances are obtained within the given persistence context.
+ * The returned instances are obtained within the given persistence context.
*/
@SuppressWarnings("unchecked")
public <T> List<T> getAll(EntityManager em, Class<T> t) {
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestPersistenceUnitWithoutXSD.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestPersistenceUnitWithoutXSD.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestPersistenceUnitWithoutXSD.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestPersistenceUnitWithoutXSD.java Thu May 21 14:39:31 2009
@@ -29,7 +29,7 @@
public void testPersistenceUnitWithoutXSD() {
EntityManagerFactory emf = OpenJPAPersistence
.createEntityManagerFactory("incorrect-ordering-and-no-xsd",
- "org/apache/openjpa/persistence/xml/persistence-without-xsd.xml");
+ "org/apache/openjpa/persistence/xml/persistence-without-xsd.xml");
emf.createEntityManager().close();
emf.close();
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java Thu May 21 14:39:31 2009
@@ -37,9 +37,12 @@
import org.apache.openjpa.persistence.xmlmapping.entities.Order;
import org.apache.openjpa.persistence.xmlmapping.entities.Customer.CreditRating;
import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.Address;
-import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.CANAddress;
-import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.ObjectFactory;
-import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.USAAddress;
+import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.
+ CANAddress;
+import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.
+ ObjectFactory;
+import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.
+ USAAddress;
/**
* Test query with predicates on persistent field mapped to XML column.
@@ -345,15 +348,17 @@
c1.setCid( new Customer.CustomerKey("USA", 1) );
c1.setName("Harry's Auto");
c1.setRating( CreditRating.GOOD );
- c1.setAddress( new EAddress("12500 Monterey", "San Jose", "CA"
- , "95141"));
+ c1.setAddress( new EAddress("12500 Monterey", "San Jose", "CA",
+ "95141"));
em.persist(c1);
- Order o1 = new Order(ORDER_1_OID, ORDER_1_AMOUNT, ORDER_1_DELIVERED, c1);
+ Order o1 = new Order(ORDER_1_OID, ORDER_1_AMOUNT, ORDER_1_DELIVERED,
+ c1);
o1.setShipAddress(createUSAAddress(c1.getName()));
em.persist(o1);
- Order o2 = new Order(ORDER_2_OID, ORDER_2_AMOUNT, ORDER_2_DELIVERED, c1);
+ Order o2 = new Order(ORDER_2_OID, ORDER_2_AMOUNT, ORDER_2_DELIVERED,
+ c1);
o2.setShipAddress(createCANAddress(c2.getName()));
em.persist(o2);
}
@@ -362,7 +367,8 @@
* Check whether DBDictionary supports XML column.
* This is done by forcing the execution of
* {@link DBDictionary#connectedConfiguration(Connection)}.
- * This is where some dictionaries actually determine whether XML column is supported.
+ * This is where some dictionaries actually determine whether XML column is
+ * supported.
* @return true if {@link DBDictionary} supports XML column
*/
private boolean dictionarySupportsXMLColumn() {
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/Address.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/Address.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/Address.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/Address.java Thu May 21 14:39:31 2009
@@ -1,8 +1,10 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.2-b01-fcs
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2006.10.04 at 03:08:16 PM PDT
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB)
+// Reference Implementation, v2.0.2-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the
+// source schema.
+// Generated on: 2006.10.04 at 03:08:16 PM PDT
//
@@ -19,16 +21,20 @@
/**
* <p>Java class for Address complex type.
*
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>The following schema fragment specifies the expected content contained
+ * within this class.
*
* <pre>
* <complexType name="Address">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
- * <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * <element name="Street" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="3"/>
- * <element name="City" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Name" type=
+ * "{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Street" type=
+ * "{http://www.w3.org/2001/XMLSchema}string" maxOccurs="3"/>
+ * <element name="City" type=
+ * "{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/CANAddress.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/CANAddress.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/CANAddress.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/CANAddress.java Thu May 21 14:39:31 2009
@@ -1,8 +1,10 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.2-b01-fcs
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2006.10.04 at 03:08:16 PM PDT
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB)
+// Reference Implementation, v2.0.2-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the
+// source schema.
+// Generated on: 2006.10.04 at 03:08:16 PM PDT
//
@@ -19,15 +21,18 @@
/**
* <p>Java class for CAN_Address complex type.
*
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>The following schema fragment specifies the expected content contained
+ * within this class.
*
* <pre>
* <complexType name="CAN_Address">
* <complexContent>
* <extension base="{}Address">
* <sequence>
- * <element name="Province" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * <element name="PostalCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Province" type=
+ * "{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="PostalCode" type=
+ * "{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </extension>
* </complexContent>
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/GBRAddress.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/GBRAddress.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/GBRAddress.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/GBRAddress.java Thu May 21 14:39:31 2009
@@ -1,8 +1,10 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.2-b01-fcs
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2006.10.04 at 03:08:16 PM PDT
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB)
+// Reference Implementation, v2.0.2-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the
+// source schema.
+// Generated on: 2006.10.04 at 03:08:16 PM PDT
//
@@ -19,15 +21,18 @@
/**
* <p>Java class for GBR_Address complex type.
*
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>The following schema fragment specifies the expected content contained
+ * within this class.
*
* <pre>
* <complexType name="GBR_Address">
* <complexContent>
* <extension base="{}Address">
* <sequence>
- * <element name="County" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * <element name="Postcode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="County" type=
+ * "{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Postcode" type=
+ * "{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </extension>
* </complexContent>
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/ObjectFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/ObjectFactory.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/ObjectFactory.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/ObjectFactory.java Thu May 21 14:39:31 2009
@@ -1,8 +1,10 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.2-b01-fcs
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2006.10.04 at 03:08:16 PM PDT
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB)
+// Reference Implementation, v2.0.2-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the
+// source schema.
+// Generated on: 2006.10.04 at 03:08:16 PM PDT
//
@@ -33,12 +35,13 @@
private final static QName _AddrUSA_QNAME = new QName("", "AddrUSA");
private final static QName _AddrCAN_QNAME = new QName("", "AddrCAN");
- private final static QName _MailAddress_QNAME = new QName("", "MailAddress");
+ private final static QName _MailAddress_QNAME =
+ new QName("", "MailAddress");
private final static QName _AddrGBR_QNAME = new QName("", "AddrGBR");
/**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: myaddress
- *
+ * Create a new ObjectFactory that can be used to create new instances of
+ * schema derived classes for package: myaddress
*/
public ObjectFactory() {
}
@@ -84,39 +87,50 @@
}
/**
- * Create an instance of {@link JAXBElement }{@code <}{@link USAAddress }{@code >}}
- *
+ * Create an instance of
+ * {@link JAXBElement }{@code <}{@link USAAddress }{@code >}}
*/
- @XmlElementDecl(namespace = "", name = "AddrUSA", substitutionHeadNamespace = "", substitutionHeadName = "MailAddress")
+ @XmlElementDecl(namespace = "", name = "AddrUSA",
+ substitutionHeadNamespace = "",
+ substitutionHeadName = "MailAddress")
public JAXBElement<USAAddress> createAddrUSA(USAAddress value) {
- return new JAXBElement<USAAddress>(_AddrUSA_QNAME, USAAddress.class, null, value);
+ return new JAXBElement<USAAddress>(_AddrUSA_QNAME, USAAddress.class,
+ null, value);
}
/**
- * Create an instance of {@link JAXBElement }{@code <}{@link CANAddress }{@code >}}
+ * Create an instance of
+ * {@link JAXBElement }{@code <}{@link CANAddress }{@code >}}
*
*/
- @XmlElementDecl(namespace = "", name = "AddrCAN", substitutionHeadNamespace = "", substitutionHeadName = "MailAddress")
+ @XmlElementDecl(namespace = "", name = "AddrCAN",
+ substitutionHeadNamespace = "",
+ substitutionHeadName = "MailAddress")
public JAXBElement<CANAddress> createAddrCAN(CANAddress value) {
- return new JAXBElement<CANAddress>(_AddrCAN_QNAME, CANAddress.class, null, value);
+ return new JAXBElement<CANAddress>(_AddrCAN_QNAME, CANAddress.class,
+ null, value);
}
/**
- * Create an instance of {@link JAXBElement }{@code <}{@link Address }{@code >}}
- *
+ * Create an instance of
+ * {@link JAXBElement }{@code <}{@link Address }{@code >}}
*/
@XmlElementDecl(namespace = "", name = "MailAddress")
public JAXBElement<Address> createMailAddress(Address value) {
- return new JAXBElement<Address>(_MailAddress_QNAME, Address.class, null, value);
+ return new JAXBElement<Address>(_MailAddress_QNAME, Address.class, null,
+ value);
}
/**
- * Create an instance of {@link JAXBElement }{@code <}{@link GBRAddress }{@code >}}
- *
+ * Create an instance of
+ * {@link JAXBElement }{@code <}{@link GBRAddress }{@code >}}
*/
- @XmlElementDecl(namespace = "", name = "AddrGBR", substitutionHeadNamespace = "", substitutionHeadName = "MailAddress")
+ @XmlElementDecl(namespace = "", name = "AddrGBR",
+ substitutionHeadNamespace = "",
+ substitutionHeadName = "MailAddress")
public JAXBElement<GBRAddress> createAddrGBR(GBRAddress value) {
- return new JAXBElement<GBRAddress>(_AddrGBR_QNAME, GBRAddress.class, null, value);
+ return new JAXBElement<GBRAddress>(_AddrGBR_QNAME, GBRAddress.class,
+ null, value);
}
}
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/ShortAddress.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/ShortAddress.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/ShortAddress.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/ShortAddress.java Thu May 21 14:39:31 2009
@@ -1,8 +1,10 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.2-b01-fcs
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2006.10.04 at 03:08:16 PM PDT
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB)
+// Reference Implementation, v2.0.2-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the
+// source schema.
+// Generated on: 2006.10.04 at 03:08:16 PM PDT
//
@@ -17,16 +19,20 @@
/**
* <p>Java class for ShortAddress complex type.
*
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>The following schema fragment specifies the expected content contained
+ * within this class.
*
* <pre>
* <complexType name="ShortAddress">
* <complexContent>
* <restriction base="{}Address">
* <sequence>
- * <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * <element name="Street" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * <element name="City" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Name" type=
+ * "{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Street" type=
+ * "{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="City" type=
+ * "{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/USAAddress.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/USAAddress.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/USAAddress.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/USAAddress.java Thu May 21 14:39:31 2009
@@ -1,8 +1,10 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.2-b01-fcs
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2006.10.04 at 03:08:16 PM PDT
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB)
+// Reference Implementation, v2.0.2-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the
+// source schema.
+// Generated on: 2006.10.04 at 03:08:16 PM PDT
//
@@ -19,14 +21,16 @@
/**
* <p>Java class for USA_Address complex type.
*
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>The following schema fragment specifies the expected content contained
+ * within this class.
*
* <pre>
* <complexType name="USA_Address">
* <complexContent>
* <extension base="{}Address">
* <sequence>
- * <element name="State" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="State" type=
+ * "{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="ZIP" type="{}USPS_ZIP"/>
* </sequence>
* </extension>
Modified: openjpa/trunk/openjpa-persistence/src/test/java/org/apache/openjpa/persistence/TestPersistenceProductDerivation.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/test/java/org/apache/openjpa/persistence/TestPersistenceProductDerivation.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/test/java/org/apache/openjpa/persistence/TestPersistenceProductDerivation.java (original)
+++ openjpa/trunk/openjpa-persistence/src/test/java/org/apache/openjpa/persistence/TestPersistenceProductDerivation.java Thu May 21 14:39:31 2009
@@ -45,10 +45,10 @@
// openjpa-persistence/src/test/resources/second-persistence/
// META-INF/persistence.xml
- sourceFile = new File(currentDir + File.separator + "src"+File.separator
- + "test" + File.separator + "resources" + File.separator
- + "second-persistence" + File.separator + "META-INF"
- + File.separator + "persistence.xml");
+ sourceFile = new File(currentDir + File.separator + "src"
+ + File.separator + "test" + File.separator + "resources"
+ + File.separator + "second-persistence" + File.separator
+ + "META-INF" + File.separator + "persistence.xml");
// openjpa-persistence/target/test-classes/
// TestPersistenceProductDerivation_generated_(time_stamp).jar
Modified: openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/PersistenceTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/PersistenceTestCase.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/PersistenceTestCase.java (original)
+++ openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/PersistenceTestCase.java Thu May 21 14:39:31 2009
@@ -147,7 +147,8 @@
}
/**
- * Closes all open entity managers after first rolling back any open transactions
+ * Closes all open entity managers after first rolling back any open
+ * transactions.
*/
protected void closeAllOpenEMs(EntityManagerFactory emf) {
if (emf == null || !emf.isOpen())
@@ -191,15 +192,16 @@
protected void clear(EntityManagerFactory emf) {
if (emf == null)
return;
- clear(emf, true, ((OpenJPAEntityManagerFactorySPI) emf).getConfiguration().
- getMetaDataRepositoryInstance().getMetaDatas());
+ clear(emf, true, ((OpenJPAEntityManagerFactorySPI) emf).
+ getConfiguration().getMetaDataRepositoryInstance().getMetaDatas());
}
/**
* Delete all instances of the given types using bulk delete queries.
* @param closeEMs TODO
*/
- private void clear(EntityManagerFactory emf, boolean closeEMs, ClassMetaData... types) {
+ private void clear(EntityManagerFactory emf, boolean closeEMs,
+ ClassMetaData... types) {
if (emf == null || types.length == 0)
return;
Modified: openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestBasic.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestBasic.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestBasic.java (original)
+++ openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestBasic.java Thu May 21 14:39:31 2009
@@ -317,16 +317,21 @@
}
public void testDynamicSlice() {
- DistributedConfiguration conf = (DistributedConfiguration)emf.getConfiguration();
+ DistributedConfiguration conf =
+ (DistributedConfiguration)emf.getConfiguration();
conf.setDistributionPolicyInstance(new DistributionPolicy() {
- public String distribute(Object pc, List<String> slices, Object context) {
+ public String distribute(Object pc, List<String> slices,
+ Object context) {
if (PObject.class.isInstance(pc)) {
PObject o = (PObject)pc;
if (o.getValue() > 50) {
DistributedBroker broker = (DistributedBroker)context;
Map newProps = new HashMap();
- newProps.put("openjpa.slice.newslice.ConnectionURL", "jdbc:derby:target/database/newslice;create=true");
- newProps.put("openjpa.slice.newslice.ConnectionDriverName", "org.apache.derby.jdbc.EmbeddedDriver");
+ newProps.put("openjpa.slice.newslice.ConnectionURL",
+ "jdbc:derby:target/database/newslice;create=true");
+ newProps.put(
+ "openjpa.slice.newslice.ConnectionDriverName",
+ "org.apache.derby.jdbc.EmbeddedDriver");
broker.addSlice("newslice", newProps);
return "newslice";
} else {
Modified: openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestConfiguration.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestConfiguration.java?rev=777135&r1=777134&r2=777135&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestConfiguration.java (original)
+++ openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestConfiguration.java Thu May 21 14:39:31 2009
@@ -73,8 +73,10 @@
BrokerFactory bf = ((EntityManagerFactoryImpl) emf).getBrokerFactory();
DistributedBroker broker = (DistributedBroker)bf.newBroker();
Map newProps = new HashMap();
- newProps.put("openjpa.slice.newslice.ConnectionURL", "jdbc:derby:target/database/newslice;create=true");
- newProps.put("openjpa.slice.newslice.ConnectionDriverName", "org.apache.derby.jdbc.EmbeddedDriver");
+ newProps.put("openjpa.slice.newslice.ConnectionURL",
+ "jdbc:derby:target/database/newslice;create=true");
+ newProps.put("openjpa.slice.newslice.ConnectionDriverName",
+ "org.apache.derby.jdbc.EmbeddedDriver");
broker.addSlice("newslice", newProps);
assertTrue(conf.getActiveSliceNames().contains("newslice"));