db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpoes...@apache.org
Subject cvs commit: db-torque/src/generator/src/test/org/apache/torque/engine/database/model ColumnTest.java domaintest-schema.xml DomainTest.java
Date Tue, 18 Nov 2003 17:59:59 GMT
mpoeschl    2003/11/18 09:59:59

  Modified:    src/generator/src/test/org/apache/torque/engine/database/model
                        domaintest-schema.xml DomainTest.java
  Added:       src/generator/src/test/org/apache/torque/engine/database/model
                        ColumnTest.java
  Log:
  more unit tests
  
  Revision  Changes    Path
  1.3       +7 -0      db-torque/src/generator/src/test/org/apache/torque/engine/database/model/domaintest-schema.xml
  
  Index: domaintest-schema.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/test/org/apache/torque/engine/database/model/domaintest-schema.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- domaintest-schema.xml	31 Oct 2003 20:48:42 -0000	1.2
  +++ domaintest-schema.xml	18 Nov 2003 17:59:59 -0000	1.3
  @@ -9,4 +9,11 @@
       <column name="name" size="40" />
       <column name="price" domain="amount" />
     </table>
  +  
  +  <table name="article">
  +    <column name="article_id" required="true" primaryKey="true" type="INTEGER" />
  +    <column name="name" size="40" />
  +    <column name="price" domain="amount" size="12" default="1000" />
  +  </table>
  +  
   </database>
  
  
  
  1.4       +16 -1     db-torque/src/generator/src/test/org/apache/torque/engine/database/model/DomainTest.java
  
  Index: DomainTest.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/test/org/apache/torque/engine/database/model/DomainTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DomainTest.java	16 Nov 2003 20:16:55 -0000	1.3
  +++ DomainTest.java	18 Nov 2003 17:59:59 -0000	1.4
  @@ -119,4 +119,19 @@
           assertEquals("(10,2)", price.printSize());
       }
       
  +    /**
  +     * test if the tables get the package name from the properties file
  +     */
  +    public void testExtendedDomainColumn() throws Exception
  +    {
  +        Table table = db.getTable("article");
  +        Column price = table.getColumn("price");
  +        assertEquals("NUMERIC", price.getTorqueType());
  +        assertEquals("NUMERIC", price.getType());
  +        assertEquals("12", price.getSize());
  +        assertEquals("2", price.getScale());
  +        assertEquals("1000", price.getDefaultValue());
  +        assertEquals("(12,2)", price.printSize());
  +    }
  +    
   }
  
  
  
  1.1                  db-torque/src/generator/src/test/org/apache/torque/engine/database/model/ColumnTest.java
  
  Index: ColumnTest.java
  ===================================================================
  package org.apache.torque.engine.database.model;
  
  import junit.framework.TestCase;
  
  /**
   * @author martin
   */
  public class ColumnTest extends TestCase {
  
      public void testRequiresTransactionInPostgres() {
          Column col = new Column();
          col.setType("VARBINARY");
          assertTrue(col.requiresTransactionInPostgres());
          col = new Column();
          col.setType("INTEGER");
          assertFalse(col.requiresTransactionInPostgres());
          col = new Column();
          col.setType("BLOB");
          assertTrue(col.requiresTransactionInPostgres());
      }
  
  }
  
  
  

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


Mime
View raw message