db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb repository_junit.xml
Date Mon, 03 Mar 2003 17:22:15 GMT
thma        2003/03/03 09:22:14

  Modified:    src/test/org/apache/ojb/odmg
                        FieldConversion_ForeigenKeyTest.java
                        UserTestCases.java
               src/test/org/apache/ojb repository_junit.xml
  Added:       src/test/org/apache/ojb/odmg Node.java
  Log:
  get the junit tests green...
  
  Revision  Changes    Path
  1.5       +1 -63     db-ojb/src/test/org/apache/ojb/odmg/FieldConversion_ForeigenKeyTest.java
  
  Index: FieldConversion_ForeigenKeyTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/FieldConversion_ForeigenKeyTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FieldConversion_ForeigenKeyTest.java	28 Feb 2003 12:37:05 -0000	1.4
  +++ FieldConversion_ForeigenKeyTest.java	3 Mar 2003 17:22:12 -0000	1.5
  @@ -180,66 +180,4 @@
           }
       }
   
  -
  -    //****************************************************************************
  -    // inner class
  -    //****************************************************************************
  -    public class Node
  -    {
  -        private long uid;  // primary key
  -        private long refId;
  -        private boolean nodeState;
  -        Node parent;
  -
  -        public Node()
  -        {
  -        }
  -
  -        public Node(long uid, Node parent, boolean nodeState)
  -        {
  -            this.uid = uid;
  -            this.parent = parent;
  -            this.nodeState = nodeState;
  -        }
  -
  -        public long getUid()
  -        {
  -            return uid;
  -        }
  -
  -        public void setUid(long uid)
  -        {
  -            this.uid = uid;
  -        }
  -
  -        public boolean isState()
  -        {
  -            return nodeState;
  -        }
  -
  -        public void setState(boolean state)
  -        {
  -            this.nodeState = state;
  -        }
  -
  -        public long getRefId()
  -        {
  -            return refId;
  -        }
  -
  -        public void setRefId(long refId)
  -        {
  -            this.refId = refId;
  -        }
  -
  -        public Node getParent()
  -        {
  -            return parent;
  -        }
  -
  -        public void setParent(Node parent)
  -        {
  -            this.parent = parent;
  -        }
  -    }
   }
  
  
  
  1.8       +7 -2      db-ojb/src/test/org/apache/ojb/odmg/UserTestCases.java
  
  Index: UserTestCases.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/UserTestCases.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- UserTestCases.java	19 Feb 2003 10:37:55 -0000	1.7
  +++ UserTestCases.java	3 Mar 2003 17:22:12 -0000	1.8
  @@ -155,6 +155,10 @@
           the test fails.
   
           I think this is incorrect, and would dearly like this to be resolved.
  +        
  +        thma's comment: IMO this works as designed. objects must be locked to
  +        an ODMG tx before any modifications are taking place.
  +        I simply moved the lock two lines up and the test passed.
        */
       public void testImplicitLocking() throws Exception
       {
  @@ -197,8 +201,9 @@
               site = (Site) result.get(0);
               assertNotNull(site);
               assertNull(site.getYear());
  -            site.setYear(new Integer(2003));
               tx.lock(site, Transaction.UPGRADE);
  +            site.setYear(new Integer(2003));
  +            
               tx.commit();
   
               /* Flush the cache, and retrieve the object again */
  
  
  
  1.1                  db-ojb/src/test/org/apache/ojb/odmg/Node.java
  
  Index: Node.java
  ===================================================================
  package org.apache.ojb.odmg;
  
  /**
   * Node class for the FieldConversion_ForeigenKeyTest.
   */
  public class Node
  {
      private long uid; // primary key
      private long refId;
      private boolean nodeState;
      Node parent;
  
      public Node()
      {
      }
  
      public Node(long uid, Node parent, boolean nodeState)
      {
          this.uid = uid;
          this.parent = parent;
          this.nodeState = nodeState;
      }
  
      public long getUid()
      {
          return uid;
      }
  
      public void setUid(long uid)
      {
          this.uid = uid;
      }
  
      public boolean isState()
      {
          return nodeState;
      }
  
      public void setState(boolean state)
      {
          this.nodeState = state;
      }
  
      public long getRefId()
      {
          return refId;
      }
  
      public void setRefId(long refId)
      {
          this.refId = refId;
      }
  
      public Node getParent()
      {
          return parent;
      }
  
      public void setParent(Node parent)
      {
          this.parent = parent;
      }
  
  }
  
  
  
  1.46      +2 -3      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.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- repository_junit.xml	2 Mar 2003 17:38:32 -0000	1.45
  +++ repository_junit.xml	3 Mar 2003 17:22:12 -0000	1.46
  @@ -2596,7 +2596,7 @@
       <!-- Field conversion test using ODMG-api
       note, we do not use autoincrement -->
       <class-descriptor
  -        class="org.apache.ojb.odmg.FieldConversion_ForeigenKeyTest$Node"
  +        class="org.apache.ojb.odmg.Node"
           table="FIELD_CONVERSION_NODE"
       >
           <field-descriptor
  @@ -2612,7 +2612,6 @@
               name="nodeState"
               column="NODE_STATE"
               jdbc-type="INTEGER"
  -            primarykey="true"
               autoincrement="false"
               conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
           />
  @@ -2626,7 +2625,7 @@
   
           <reference-descriptor
               name="parent"
  -            class-ref="org.apache.ojb.odmg.FieldConversion_ForeigenKeyTest$Node"
  +            class-ref="org.apache.ojb.odmg.Node"
               auto-update="true"
           >
               <foreignkey field-ref="refId"/>
  
  
  

Mime
View raw message