Author: arminw
Date: Wed Oct  4 03:10:19 2006
New Revision: 452820

URL: http://svn.apache.org/viewvc?view=rev&rev=452820
Log:
use IdentityFactory

Modified:
    db/ojb/trunk/src/test/org/apache/ojb/broker/ReferenceTest.java

Modified: db/ojb/trunk/src/test/org/apache/ojb/broker/ReferenceTest.java
URL: 
http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/broker/ReferenceTest.java?view=diff&rev=452820&r1=452819&r2=452820
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/broker/ReferenceTest.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/broker/ReferenceTest.java Wed Oct  4 
03:10:19 2006
@@ -521,7 +521,7 @@
         broker.store(region);
         broker.commitTransaction();
 
-        Identity oid = new Identity(region, broker);
+        Identity oid = broker.serviceIdentity().buildIdentity(region);
         broker.clearCache();
         Region loadedRegion = (Region) broker.getObjectByIdentity(oid);
 
@@ -575,7 +575,7 @@
         broker.store(wine);
         broker.commitTransaction();
 
-        Identity oid = new Identity(wine, broker);
+        Identity oid = broker.serviceIdentity().buildIdentity(wine);
         broker.clearCache();
         Wine loadedWine = (Wine) broker.getObjectByIdentity(oid);
         assertNotNull(loadedWine);
@@ -606,7 +606,7 @@
         broker.store(wine);
         broker.commitTransaction();
 
-        Identity oid = new Identity(wine, broker);
+        Identity oid = broker.serviceIdentity().buildIdentity(wine);
         broker.clearCache();
         Wine loadedWine = (Wine) broker.getObjectByIdentity(oid);
         assertNotNull(loadedWine);
@@ -638,8 +638,8 @@
         broker.store(wine);
         broker.commitTransaction();
 
-        Identity oid = new Identity(wine, broker);
-        Identity oidRegion = new Identity(region, broker);
+        Identity oid = broker.serviceIdentity().buildIdentity(wine);
+        Identity oidRegion = broker.serviceIdentity().buildIdentity(region);
         broker.clearCache();
         Wine loadedWine = (Wine) broker.getObjectByIdentity(oid);
         assertNotNull(loadedWine);
@@ -685,7 +685,7 @@
         broker.store(wine);
         broker.commitTransaction();
 
-        Identity oid = new Identity(wine, broker);
+        Identity oid = broker.serviceIdentity().buildIdentity(wine);
         broker.clearCache();
         Wine loadedWine = (Wine) broker.getObjectByIdentity(oid);
         assertNotNull(loadedWine);
@@ -741,7 +741,7 @@
         broker.commitTransaction();
 
         broker.clearCache();
-        Identity oid = new Identity(repository[0], broker);
+        Identity oid = broker.serviceIdentity().buildIdentity(repository[0]);
 
         Repository rep = (Repository) broker.getObjectByIdentity(oid);
         assertNotNull(rep.getRef());
@@ -766,9 +766,9 @@
         assertNotNull(repository[0].getRefA());
         assertNotNull(repository[0].getRefB());
 
-        Identity oid_ref = new Identity(repository[0].getRef(), broker);
-        Identity oid_refA = new Identity(repository[0].getRefA(), broker);
-        Identity oid_refB = new Identity(repository[0].getRefB(), broker);
+        Identity oid_ref = 
broker.serviceIdentity().buildIdentity(repository[0].getRef());
+        Identity oid_refA = 
broker.serviceIdentity().buildIdentity(repository[0].getRefA());
+        Identity oid_refB = 
broker.serviceIdentity().buildIdentity(repository[0].getRefB());
 
         broker.clearCache();
         Object result;
@@ -780,7 +780,7 @@
         assertTrue(result instanceof ReferenceB);
 
         broker.clearCache();
-        Identity repOID = new Identity(repository[0], broker);
+        Identity repOID = 
broker.serviceIdentity().buildIdentity(repository[0]);
         Repository repositoryObj = (Repository) 
broker.getObjectByIdentity(repOID);
         assertNotNull(repositoryObj);
         ReferenceBIF refB = repositoryObj.getRefB();
@@ -1004,7 +1004,7 @@
         broker.store(repository[2]);
         broker.commitTransaction();
 
-        Identity oid = new Identity(repository[0], broker);
+        Identity oid = broker.serviceIdentity().buildIdentity(repository[0]);
         RepositoryFK repFK = (RepositoryFK) broker.getObjectByIdentity(oid);
 
         assertNotNull("We should found a RepositoryFK object, but doesn't.", 
repFK);
@@ -1065,12 +1065,12 @@
         broker.store(rep_3);
         broker.commitTransaction();
 
-        Identity oid_mammal = new Identity(mammal_1, broker);
-        Identity oid_bird = new Identity(bird_1, broker);
-        Identity oid_fish = new Identity(fish_1, broker);
-        Identity oid_rep_1 = new Identity(rep_1, broker);
-        Identity oid_rep_2 = new Identity(rep_2, broker);
-        Identity oid_rep_3 = new Identity(rep_3, broker);
+        Identity oid_mammal = broker.serviceIdentity().buildIdentity(mammal_1);
+        Identity oid_bird = broker.serviceIdentity().buildIdentity(bird_1);
+        Identity oid_fish = broker.serviceIdentity().buildIdentity(fish_1);
+        Identity oid_rep_1 = broker.serviceIdentity().buildIdentity(rep_1);
+        Identity oid_rep_2 = broker.serviceIdentity().buildIdentity(rep_2);
+        Identity oid_rep_3 = broker.serviceIdentity().buildIdentity(rep_3);
 
         broker.clearCache();
         // check the references
@@ -1151,9 +1151,9 @@
         broker.store(rep_3);
         broker.commitTransaction();
 
-        Identity oid_rep_1 = new Identity(rep_1, broker);
-        Identity oid_rep_2 = new Identity(rep_2, broker);
-        Identity oid_rep_3 = new Identity(rep_3, broker);
+        Identity oid_rep_1 = broker.serviceIdentity().buildIdentity(rep_1);
+        Identity oid_rep_2 = broker.serviceIdentity().buildIdentity(rep_2);
+        Identity oid_rep_3 = broker.serviceIdentity().buildIdentity(rep_3);
 
         broker.clearCache();
         // check the main objects
@@ -1248,9 +1248,9 @@
         broker.store(rep_3);
         broker.commitTransaction();
 
-        Identity oid_rep_1 = new Identity(rep_1, broker);
-        Identity oid_rep_2 = new Identity(rep_2, broker);
-        Identity oid_rep_3 = new Identity(rep_3, broker);
+        Identity oid_rep_1 = broker.serviceIdentity().buildIdentity(rep_1);
+        Identity oid_rep_2 = broker.serviceIdentity().buildIdentity(rep_2);
+        Identity oid_rep_3 = broker.serviceIdentity().buildIdentity(rep_3);
 
         broker.clearCache();
         // check the main objects



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to