cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r423749 [4/4] - in /incubator/cayenne/main/trunk/cayenne/cayenne-java/src: cayenne/java/org/apache/cayenne/ cayenne/java/org/apache/cayenne/access/ cayenne/java/org/apache/cayenne/access/event/ cayenne/java/org/apache/cayenne/access/jdbc/ c...
Date Thu, 20 Jul 2006 04:04:10 GMT
Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/OptimisticLockingTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/OptimisticLockingTst.java?rev=423749&r1=423748&r2=423749&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/OptimisticLockingTst.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/OptimisticLockingTst.java
Wed Jul 19 21:04:04 2006
@@ -33,6 +33,7 @@
  * @author Andrei Adamchik
  */
 public class OptimisticLockingTst extends LockingTestCase {
+
     protected DataContext context;
 
     protected void setUp() throws Exception {
@@ -72,7 +73,8 @@
         context.commitChanges();
     }
 
-    public void testSuccessSimpleLockingOnDeleteFollowedByForgetSnapshot() throws Exception
{
+    public void testSuccessSimpleLockingOnDeleteFollowedByForgetSnapshot()
+            throws Exception {
         createTestData("testSimpleLocking");
 
         List allObjects = context.performQuery(new SelectQuery(SimpleLockingTest.class));
@@ -106,7 +108,8 @@
         context.commitChanges();
     }
 
-    public void testSuccessSimpleLockingOnDeletePrecededByForgetSnapshot() throws Exception
{
+    public void testSuccessSimpleLockingOnDeletePrecededByForgetSnapshot()
+            throws Exception {
         createTestData("testSimpleLocking");
 
         List allObjects = context.performQuery(new SelectQuery(SimpleLockingTest.class));
@@ -135,9 +138,9 @@
         object.setDescription("second update");
         context.commitChanges();
 
-        // change row underneath, delete and save...  optimistic lock failure expected
+        // change row underneath, delete and save... optimistic lock failure expected
         createTestData("SimpleLockUpdate");
-        
+
         context.deleteObject(object);
 
         try {
@@ -202,7 +205,8 @@
         context.commitChanges();
     }
 
-    public void testSuccessSimpleLockingOnUpdateFollowedByForgetSnapshot() throws Exception
{
+    public void testSuccessSimpleLockingOnUpdateFollowedByForgetSnapshot()
+            throws Exception {
         createTestData("testSimpleLocking");
 
         List allObjects = context.performQuery(new SelectQuery(SimpleLockingTest.class));
@@ -220,7 +224,8 @@
         context.commitChanges();
     }
 
-    public void testSuccessSimpleLockingOnUpdatePrecededByForgetSnapshot() throws Exception
{
+    public void testSuccessSimpleLockingOnUpdatePrecededByForgetSnapshot()
+            throws Exception {
         createTestData("testSimpleLocking");
 
         List allObjects = context.performQuery(new SelectQuery(SimpleLockingTest.class));
@@ -250,7 +255,8 @@
         object.setDescription("first update");
         context.commitChanges();
 
-        // change row underneath, change description and save...  optimistic lock failure
expected
+        // change row underneath, change description and save... optimistic lock failure
+        // expected
         createTestData("SimpleLockUpdate");
         object.setDescription("second update");
 
@@ -271,11 +277,12 @@
 
         SimpleLockingTest object = (SimpleLockingTest) allObjects.get(0);
 
-        // change description and save... no optimistic lock failure expected... 
+        // change description and save... no optimistic lock failure expected...
         object.setDescription("first update");
         context.commitChanges();
 
-        // change row underneath, change description and save...  optimistic lock failure
expected
+        // change row underneath, change description and save... optimistic lock failure
+        // expected
         createTestData("SimpleLockUpdate");
         object.setDescription("second update");
 
@@ -300,13 +307,14 @@
         SimpleLockingTest object2 = (SimpleLockingTest) allObjects.get(1);
         SimpleLockingTest object3 = (SimpleLockingTest) allObjects.get(2);
 
-        // change description and save... no optimistic lock failure expected... 
+        // change description and save... no optimistic lock failure expected...
         object1.setDescription("first update for object1");
         object2.setDescription("first update for object2");
         object3.setName("object3 - new name");
         context.commitChanges();
 
-        // TODO: it would be nice to pick inside DataContext to see that 3 batches where
generated...
+        // TODO: it would be nice to pick inside DataContext to see that 3 batches where
+        // generated...
         // this requires refactoring of ContextCommit.
     }
 
@@ -323,13 +331,13 @@
         context.commitChanges();
 
         // change relationship and save... no optimistic lock failure expected
-        SimpleLockingTest object1 =
-            (SimpleLockingTest) context.createAndRegisterNewObject(
-                SimpleLockingTest.class);
+        SimpleLockingTest object1 = (SimpleLockingTest) context
+                .createAndRegisterNewObject(SimpleLockingTest.class);
         object.setToSimpleLockingTest(object1);
         context.commitChanges();
 
-        // change row underneath, change description and save...  optimistic lock failure
expected
+        // change row underneath, change description and save... optimistic lock failure
+        // expected
         createTestData("RelLockUpdate");
         object.setName("third update");
 
@@ -351,7 +359,8 @@
         SimpleLockingTest object = (SimpleLockingTest) allObjects.get(0);
         object.setDescription("first update");
 
-        // change row underneath, change description and save...  optimistic lock failure
expected
+        // change row underneath, change description and save... optimistic lock failure
+        // expected
         createTestData("SimpleLockUpdate");
 
         try {
@@ -359,7 +368,7 @@
             fail("Optimistic lock failure expected.");
         }
         catch (OptimisticLockException ex) {
-            Map freshFailedRow = ex.getFreshSnapshot(context);
+            Map freshFailedRow = ex.getFreshSnapshot(context.getParentDataDomain());
             assertNotNull(freshFailedRow);
             assertEquals("LockTest1Updated", freshFailedRow.get("NAME"));
         }
@@ -375,7 +384,8 @@
 
         object.setDescription("first update");
 
-        // delete row underneath, change description and save...  optimistic lock failure
expected
+        // delete row underneath, change description and save... optimistic lock failure
+        // expected
         createTestData("SimpleLockDelete");
 
         try {
@@ -383,7 +393,7 @@
             fail("Optimistic lock failure expected.");
         }
         catch (OptimisticLockException ex) {
-            Map freshFailedRow = ex.getFreshSnapshot(context);
+            Map freshFailedRow = ex.getFreshSnapshot(context.getParentDataDomain());
             assertNull(freshFailedRow);
         }
     }

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/UnitTestDomain.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/UnitTestDomain.java?rev=423749&r1=423748&r2=423749&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/UnitTestDomain.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/UnitTestDomain.java
Wed Jul 19 21:04:04 2006
@@ -67,17 +67,6 @@
         super.performQueries(queries, callback);
     }
 
-    /**
-     * @deprecated since 1.2, as the super method is also deprecated.
-     */
-    public void performQueries(
-            Collection queries,
-            OperationObserver callback,
-            Transaction transaction) {
-        checkQueryAllowed();
-        super.performQueries(queries, callback, transaction);
-    }
-
     public void checkQueryAllowed() throws AssertionFailedError {
         Assert.assertFalse("Query is unexpected.", blockingQueries);
 

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/trans/SelectTranslatorTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/trans/SelectTranslatorTst.java?rev=423749&r1=423748&r2=423749&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/trans/SelectTranslatorTst.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/access/trans/SelectTranslatorTst.java
Wed Jul 19 21:04:04 2006
@@ -564,12 +564,12 @@
     }
 
     SelectTranslator makeTranslator(Query q) throws Exception {
-        // TODO: this API is deprecated, need to refactor test cases...
-        SelectTranslator transl = (SelectTranslator) getNode()
-                .getAdapter()
-                .getQueryTranslator(q);
-        transl.setEntityResolver(getNode().getEntityResolver());
-        return transl;
+
+        SelectTranslator translator = new SelectTranslator();
+        translator.setQuery(q);
+        translator.setAdapter(getNode().getAdapter());
+        translator.setEntityResolver(getNode().getEntityResolver());
+        return translator;
     }
 
     /**

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/dba/JdbcAdapterTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/dba/JdbcAdapterTst.java?rev=423749&r1=423748&r2=423749&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/dba/JdbcAdapterTst.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/dba/JdbcAdapterTst.java
Wed Jul 19 21:04:04 2006
@@ -21,28 +21,18 @@
 
 import java.sql.Types;
 
-import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DerivedDbEntity;
 import org.apache.cayenne.unit.CayenneTestCase;
 
 public class JdbcAdapterTst extends CayenneTestCase {
+
     protected JdbcAdapter adapter;
 
     protected void setUp() throws java.lang.Exception {
         adapter = new JdbcAdapter();
     }
 
-    /**
-     * @deprecated Since 1.2 "createDataNode" is deprecated.
-     */
-    public void testCreateDataNode() throws Exception {
-        DataNode node = adapter.createDataNode("1234");
-        assertNotNull(node);
-        assertEquals("1234", node.getName());
-        assertSame(adapter, node.getAdapter());
-    }
-
     public void testExternalTypesForJdbcType() throws Exception {
         // check a few types
         checkType(Types.BLOB);
@@ -55,7 +45,7 @@
         DbEntity e = getDbEntity("ARTIST_ASSETS");
         assertNotNull(e);
         assertTrue(e instanceof DerivedDbEntity);
-        
+
         // an attempt to create a derived table must generate an exception
         try {
             adapter.createTable(e);

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/dba/MockDbAdapter.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/dba/MockDbAdapter.java?rev=423749&r1=423748&r2=423749&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/dba/MockDbAdapter.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/dba/MockDbAdapter.java
Wed Jul 19 21:04:04 2006
@@ -52,13 +52,6 @@
         return null;
     }
 
-    /**
-     * @deprecated Since 1.2
-     */
-    public DataNode createDataNode(String name) {
-        return null;
-    }
-
     public QueryTranslator getQueryTranslator(Query query) throws Exception {
         return null;
     }

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/event/EventBridgeTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/event/EventBridgeTst.java?rev=423749&r1=423748&r2=423749&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/event/EventBridgeTst.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/event/EventBridgeTst.java
Wed Jul 19 21:04:04 2006
@@ -31,18 +31,6 @@
  */
 public class EventBridgeTst extends TestCase {
 
-    /**
-     * @deprecated since 1.2
-     */
-    public void testConstructorOld() throws Exception {
-        EventSubject local = EventSubject.getSubject(EventBridgeTst.class, "testInstall");
-        String external = "externalSubject";
-        TestBridge bridge = new TestBridge(local, external);
-
-        assertEquals(local, bridge.getLocalSubject());
-        assertEquals(external, bridge.getExternalSubject());
-    }
-
     public void testConstructor() throws Exception {
         EventSubject local = EventSubject.getSubject(EventBridgeTst.class, "testInstall");
         String external = "externalSubject";
@@ -91,7 +79,9 @@
 
     public void testSendExternalEvent() throws Exception {
 
-        final EventSubject local = EventSubject.getSubject(EventBridgeTst.class, "testInstall");
+        final EventSubject local = EventSubject.getSubject(
+                EventBridgeTst.class,
+                "testInstall");
         String external = "externalSubject";
         final TestBridge bridge = new TestBridge(local, external);
 
@@ -121,8 +111,7 @@
         };
 
         helper.assertWithTimeout(5000);
-        
-        
+
         final SnapshotEvent eventWithSubject = new SnapshotEvent(
                 this,
                 this,

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/event/JGroupsBridgeFactoryTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/event/JGroupsBridgeFactoryTst.java?rev=423749&r1=423748&r2=423749&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/event/JGroupsBridgeFactoryTst.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/event/JGroupsBridgeFactoryTst.java
Wed Jul 19 21:04:04 2006
@@ -29,20 +29,6 @@
  */
 public class JGroupsBridgeFactoryTst extends TestCase {
 
-    /**
-     * @deprecated since 1.2
-     */
-    public void testCreateEventBridgeOld() throws Exception {
-        EventSubject subject = new EventSubject("test");
-        EventBridge bridge = new JavaGroupsBridgeFactory().createEventBridge(
-                subject,
-                Collections.EMPTY_MAP);
-
-        assertNotNull(bridge);
-        assertTrue(bridge instanceof JavaGroupsBridge);
-        assertSame(subject, bridge.getLocalSubject());
-    }
-
     public void testCreateEventBridge() throws Exception {
         Collection subjects = Collections.singleton(new EventSubject("test"));
         EventBridge bridge = new JavaGroupsBridgeFactory().createEventBridge(

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/query/MockQuery.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/query/MockQuery.java?rev=423749&r1=423748&r2=423749&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/query/MockQuery.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/apache/cayenne/query/MockQuery.java
Wed Jul 19 21:04:04 2006
@@ -24,9 +24,7 @@
 public class MockQuery implements Query {
 
     protected String name;
-    protected Object root;
     protected boolean selecting;
-
     protected boolean routeCalled;
 
     public MockQuery(boolean selecting) {
@@ -58,21 +56,6 @@
 
     public void setName(String name) {
         this.name = name;
-    }
-
-    public Object getRoot(EntityResolver resolver) {
-        return root;
-    }
-
-    /**
-     * @deprecated since 1.2
-     */
-    public Object getRoot() {
-        return root;
-    }
-
-    public void setRoot(Object value) {
-        this.root = value;
     }
 
     public SQLAction createSQLAction(SQLActionVisitor visitor) {



Mime
View raw message