cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r449505 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src: main/java/org/apache/cayenne/access/DataContext.java test/java/org/apache/cayenne/access/DataContextSerializationTst.java
Date Sun, 24 Sep 2006 22:04:37 GMT
Author: aadamchik
Date: Sun Sep 24 15:04:36 2006
New Revision: 449505

URL: http://svn.apache.org/viewvc?view=rev&rev=449505
Log:
CAY-652 - patching trunk

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataContext.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSerializationTst.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataContext.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataContext.java?view=diff&rev=449505&r1=449504&r2=449505
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataContext.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataContext.java
Sun Sep 24 15:04:36 2006
@@ -394,6 +394,11 @@
         }
     }
 
+    public DataChannel getChannel() {
+        awakeFromDeserialization();
+        return super.getChannel();
+    }
+    
     /**
      * Returns a DataDomain used by this DataContext. DataDomain is looked up in the
      * DataChannel hierarchy. If a channel is not a DataDomain or a DataContext, null is

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSerializationTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSerializationTst.java?view=diff&rev=449505&r1=449504&r2=449505
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSerializationTst.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSerializationTst.java
Sun Sep 24 15:04:36 2006
@@ -32,6 +32,10 @@
  */
 public class DataContextSerializationTst extends CayenneTestCase {
 
+    protected void setUp() throws Exception {
+        fixSharedConfiguration();
+    }
+
     protected void fixSharedConfiguration() {
         // for context to deserialize properly,
         // Configuration singleton must have the right default domain
@@ -45,7 +49,6 @@
     }
 
     public void testSerializeResolver() throws Exception {
-        fixSharedConfiguration();
 
         DataContext context = createDataContextWithSharedCache();
 
@@ -56,8 +59,18 @@
         assertSame(context.getEntityResolver(), deserializedContext.getEntityResolver());
     }
 
+    public void testSerializeChannel() throws Exception {
+
+        DataContext context = createDataContextWithSharedCache();
+
+        DataContext deserializedContext = (DataContext) Util
+                .cloneViaSerialization(context);
+
+        assertNotNull(deserializedContext.getChannel());
+        assertSame(context.getChannel(), deserializedContext.getChannel());
+    }
+
     public void testSerializeWithSharedCache() throws Exception {
-        fixSharedConfiguration();
 
         DataContext context = createDataContextWithSharedCache();
 
@@ -80,7 +93,6 @@
     }
 
     public void testSerializeWithLocalCache() throws Exception {
-        fixSharedConfiguration();
 
         DataContext context = createDataContextWithLocalCache();
 
@@ -105,7 +117,6 @@
     }
 
     public void testSerializeNew() throws Exception {
-        fixSharedConfiguration();
 
         DataContext context = createDataContextWithSharedCache();
 
@@ -132,7 +143,6 @@
     }
 
     public void testSerializeCommitted() throws Exception {
-        fixSharedConfiguration();
 
         DataContext context = createDataContextWithSharedCache();
 
@@ -168,7 +178,6 @@
     }
 
     public void testSerializeModified() throws Exception {
-        fixSharedConfiguration();
 
         DataContext context = createDataContextWithSharedCache();
 



Mime
View raw message