cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1178845 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java
Date Tue, 04 Oct 2011 16:01:09 GMT
Author: dkazimirchyk
Date: Tue Oct  4 16:01:08 2011
New Revision: 1178845

URL: http://svn.apache.org/viewvc?rev=1178845&view=rev
Log:
CAY-1622 Generated classes shouldn't produce serialVersionUID compiler warning

unit test

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java?rev=1178845&r1=1178844&r2=1178845&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/ObjEntityTest.java
Tue Oct  4 16:01:08 2011
@@ -460,4 +460,66 @@ public class ObjEntityTest extends Serve
 
         assertFalse(translated.match(new Artist()));
     }
+    
+    public void testSerialVersionUID() throws Exception {
+        ObjEntity entity1 = new ObjEntity("entity");
+        entity1.setClassName("EntityClass");
+        
+        entity1.addAttribute(new TestAttribute("attr1"));
+        entity1.addAttribute(new TestAttribute("attr2"));
+        entity1.addAttribute(new TestAttribute("attr3"));
+        
+        entity1.addRelationship(new TestRelationship("rel1"));
+        entity1.addRelationship(new TestRelationship("rel2"));
+        entity1.addRelationship(new TestRelationship("rel3"));
+        
+        ObjEntity entity2 = new ObjEntity("entity");
+        entity2.setClassName("EntityClass");
+        
+        entity2.addAttribute(new TestAttribute("attr3"));
+        entity2.addAttribute(new TestAttribute("attr1"));
+        entity2.addAttribute(new TestAttribute("attr2"));
+        
+        entity2.addRelationship(new TestRelationship("rel1"));
+        entity2.addRelationship(new TestRelationship("rel3"));
+        entity2.addRelationship(new TestRelationship("rel2"));
+        
+        ObjEntity entity3 = new ObjEntity("entity");
+        entity3.setClassName("EntityClass");
+        
+        entity3.addAttribute(new TestAttribute("attr4"));
+        entity3.addAttribute(new TestAttribute("attr5"));
+        entity3.addAttribute(new TestAttribute("attr6"));
+        
+        entity3.addRelationship(new TestRelationship("rel4"));
+        entity3.addRelationship(new TestRelationship("rel5"));
+        entity3.addRelationship(new TestRelationship("rel6"));
+        
+        assertEquals(entity1.getSerialVersionUID(), entity2.getSerialVersionUID());
+        assertTrue(entity1.getSerialVersionUID() != entity3.getSerialVersionUID());
+    }
+    
+    class TestRelationship extends ObjRelationship {
+        
+        public TestRelationship(String name) {
+            super(name);
+        }
+        
+        @Override
+        public String getCollectionType() {
+            return "SomeCollectionType";
+        }
+    }
+    
+    class TestAttribute extends ObjAttribute {
+        
+        public TestAttribute(String name) {
+            super(name);
+        }
+        
+        @Override
+        public String getType() {
+            return "SomeType";
+        }
+    }
 }



Mime
View raw message