You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2003/07/11 09:43:54 UTC

cvs commit: db-ojb/src/test/org/apache/ojb/broker NestedFieldsTest.java

arminw      2003/07/11 00:43:54

  Modified:    src/test/org/apache/ojb repository_junit.xml
               src/test/org/apache/ojb/broker NestedFieldsTest.java
  Log:
  rename field/method names
  
  Revision  Changes    Path
  1.80      +2 -2      db-ojb/src/test/org/apache/ojb/repository_junit.xml
  
  Index: repository_junit.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository_junit.xml,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- repository_junit.xml	8 Jul 2003 00:34:54 -0000	1.79
  +++ repository_junit.xml	11 Jul 2003 07:43:53 -0000	1.80
  @@ -4406,13 +4406,13 @@
           />
   
           <field-descriptor
  -            name="detail::detail::realDetailName"
  +            name="nestedDetail::nestedDetailDetail::realDetailName"
               column="NESTED_VALUE"
               jdbc-type="VARCHAR"
           />
   
           <field-descriptor
  -            name="detail::detail::realDetailDescription"
  +            name="nestedDetail::nestedDetailDetail::realDetailDescription"
               column="NESTED_DESCRIPTION"
               jdbc-type="VARCHAR"
           />
  
  
  
  1.3       +28 -28    db-ojb/src/test/org/apache/ojb/broker/NestedFieldsTest.java
  
  Index: NestedFieldsTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/NestedFieldsTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NestedFieldsTest.java	8 Jul 2003 00:34:54 -0000	1.2
  +++ NestedFieldsTest.java	11 Jul 2003 07:43:53 -0000	1.3
  @@ -60,29 +60,29 @@
           broker.store(nested);
           broker.commitTransaction();
   
  -        assertNotNull(nested.getDetail());
  -        assertNotNull(nested.getDetail().getDetail());
  -        assertNotNull(nested.getDetail().getDetail().getRealDetailName());
  -        dd = nested.getDetail().getDetail();
  +        assertNotNull(nested.getNestedDetail());
  +        assertNotNull(nested.getNestedDetail().getNestedDetailDetail());
  +        assertNotNull(nested.getNestedDetail().getNestedDetailDetail().getRealDetailName());
  +        dd = nested.getNestedDetail().getNestedDetailDetail();
           assertEquals(ddName, dd.getRealDetailName());
           assertEquals(ddDescription, dd.getRealDetailDescription());
   
           // retrieve copy of nested object
           NestedMain nestedCopy = (NestedMain) broker.getObjectByIdentity(oid);
  -        assertNotNull(nestedCopy.getDetail());
  -        assertNotNull(nestedCopy.getDetail().getDetail());
  -        assertNotNull(nestedCopy.getDetail().getDetail().getRealDetailName());
  -        dd = nested.getDetail().getDetail();
  +        assertNotNull(nestedCopy.getNestedDetail());
  +        assertNotNull(nestedCopy.getNestedDetail().getNestedDetailDetail());
  +        assertNotNull(nestedCopy.getNestedDetail().getNestedDetailDetail().getRealDetailName());
  +        dd = nested.getNestedDetail().getNestedDetailDetail();
           assertEquals(ddName, dd.getRealDetailName());
           assertEquals(ddDescription, dd.getRealDetailDescription());
   
           // clear cache and retrieve copy of nested object
           broker.clearCache();
           nestedCopy = (NestedMain) broker.getObjectByIdentity(oid);
  -        assertNotNull(nestedCopy.getDetail());
  -        assertNotNull(nestedCopy.getDetail().getDetail());
  -        assertNotNull(nestedCopy.getDetail().getDetail().getRealDetailName());
  -        dd = nested.getDetail().getDetail();
  +        assertNotNull(nestedCopy.getNestedDetail());
  +        assertNotNull(nestedCopy.getNestedDetail().getNestedDetailDetail());
  +        assertNotNull(nestedCopy.getNestedDetail().getNestedDetailDetail().getRealDetailName());
  +        dd = nested.getNestedDetail().getNestedDetailDetail();
           assertEquals(ddName, dd.getRealDetailName());
           assertEquals(ddDescription, dd.getRealDetailDescription());
       }
  @@ -110,7 +110,7 @@
           till now we do the same as in the test above
           now change nested field and store
           */
  -        nested.getDetail().getDetail().setRealDetailName("update_name_"+timestamp);
  +        nested.getNestedDetail().getNestedDetailDetail().setRealDetailName("update_name_"+timestamp);
           broker.beginTransaction();
           broker.store(nested);
           broker.commitTransaction();
  @@ -118,7 +118,7 @@
           // clear cache and retrieve copy of nested object
           broker.clearCache();
           nested = (NestedMain) broker.getObjectByIdentity(oid);
  -        assertEquals("update_name_"+timestamp, nested.getDetail().getDetail().getRealDetailName());
  +        assertEquals("update_name_"+timestamp, nested.getNestedDetail().getNestedDetailDetail().getRealDetailName());
       }
   
       public void testDeleteNestedField()
  @@ -158,7 +158,7 @@
       {
           private Long objId;
           private String name;
  -        private NestedDetail detail;
  +        private NestedDetail nestedDetail;
   
           public NestedMain()
           {
  @@ -167,7 +167,7 @@
           public NestedMain(String name, NestedDetail detail)
           {
               this.name = name;
  -            this.detail = detail;
  +            this.nestedDetail = detail;
           }
   
           public Long getObjId()
  @@ -190,14 +190,14 @@
               this.name = name;
           }
   
  -        public NestedDetail getDetail()
  +        public NestedDetail getNestedDetail()
           {
  -            return detail;
  +            return nestedDetail;
           }
   
  -        public void setDetail(NestedDetail detail)
  +        public void setNestedDetail(NestedDetail nestedDetail)
           {
  -            this.detail = detail;
  +            this.nestedDetail = nestedDetail;
           }
   
           public String toString()
  @@ -205,14 +205,14 @@
               ToStringBuilder buf = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
               buf.append("objId", objId).
                       append("name", name).
  -                    append("detail", detail);
  +                    append("detail", nestedDetail);
               return buf.toString();
           }
       }
   
       public static class NestedDetail
       {
  -        private NestedDetailDetail detail;
  +        private NestedDetailDetail nestedDetailDetail;
   
           public NestedDetail()
           {
  @@ -220,23 +220,23 @@
   
           public NestedDetail(NestedDetailDetail detail)
           {
  -            this.detail = detail;
  +            this.nestedDetailDetail = detail;
           }
   
  -        public NestedDetailDetail getDetail()
  +        public NestedDetailDetail getNestedDetailDetail()
           {
  -            return detail;
  +            return nestedDetailDetail;
           }
   
  -        public void setDetail(NestedDetailDetail detail)
  +        public void setNestedDetailDetail(NestedDetailDetail nestedDetailDetail)
           {
  -            this.detail = detail;
  +            this.nestedDetailDetail = nestedDetailDetail;
           }
   
           public String toString()
           {
               ToStringBuilder buf = new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE);
  -            buf.append("detail", detail);
  +            buf.append("detail", nestedDetailDetail);
               return buf.toString();
           }
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org