db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject cvs commit: db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests FieldTagAutoincrementAttributeTests.java
Date Thu, 13 May 2004 19:55:10 GMT
tomdz       2004/05/13 12:55:10

  Modified:    src/xdoclet/test/xdoclet/modules/ojb/tests
                        FieldTagAutoincrementAttributeTests.java
  Log:
  Added testcases to ensure that a present access attribute is overwritten when using autoincrement='database'
  
  Revision  Changes    Path
  1.5       +85 -0     db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/FieldTagAutoincrementAttributeTests.java
  
  Index: FieldTagAutoincrementAttributeTests.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/FieldTagAutoincrementAttributeTests.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FieldTagAutoincrementAttributeTests.java	5 Apr 2004 12:16:16 -0000	1.4
  +++ FieldTagAutoincrementAttributeTests.java	13 May 2004 19:55:10 -0000	1.5
  @@ -239,4 +239,89 @@
               "</database>",
               runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest"));
       }
  +
  +    // Test: autoincrement attribute with 'database' value together with access attribute
  +    public void testAutoincrement7()
  +    {
  +        addClass(
  +            "test.A",
  +            "package test;\n"+
  +            "/** @ojb.class */\n"+
  +            "public class A {\n"+
  +            "  /** @ojb.field autoincrement=\"database\"\n"+
  +            "    *            access=\"readonly\"\n"+
  +            "    */\n"+
  +            "  private int attr;\n"+
  +            "}\n");
  +
  +        assertEqualsOjbDescriptorFile(
  +            "<class-descriptor\n"+
  +            "    class=\"test.A\"\n"+
  +            "    table=\"A\"\n"+
  +            ">\n"+
  +            "    <field-descriptor\n"+
  +            "        name=\"attr\"\n"+
  +            "        column=\"attr\"\n"+
  +            "        jdbc-type=\"INTEGER\"\n"+
  +            "        autoincrement=\"true\"\n"+
  +            "        access=\"readonly\"\n"+
  +            "    >\n"+
  +            "    </field-descriptor>\n"+
  +            "</class-descriptor>",
  +            runOjbXDoclet(OJB_DEST_FILE));
  +        assertEqualsTorqueSchemaFile(
  +            "<database name=\"ojbtest\">\n"+
  +            "    <table name=\"A\">\n"+
  +            "        <column name=\"attr\"\n"+
  +            "                javaName=\"attr\"\n"+
  +            "                type=\"INTEGER\"\n"+
  +            "                autoIncrement=\"true\"\n"+
  +            "        />\n"+
  +            "    </table>\n"+
  +            "</database>",
  +            runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest"));
  +    }
  +
  +    // Test: autoincrement attribute with 'database' value together with different access
attribute
  +    public void testAutoincrement8()
  +    {
  +        addClass(
  +            "test.A",
  +            "package test;\n"+
  +            "/** @ojb.class */\n"+
  +            "public class A {\n"+
  +            "  /** @ojb.field autoincrement=\"database\"\n"+
  +            "    *            access=\"readwrite\"\n"+
  +            "    */\n"+
  +            "  private int attr;\n"+
  +            "}\n");
  +
  +        assertEqualsOjbDescriptorFile(
  +            "<class-descriptor\n"+
  +            "    class=\"test.A\"\n"+
  +            "    table=\"A\"\n"+
  +            ">\n"+
  +            "    <field-descriptor\n"+
  +            "        name=\"attr\"\n"+
  +            "        column=\"attr\"\n"+
  +            "        jdbc-type=\"INTEGER\"\n"+
  +            "        autoincrement=\"true\"\n"+
  +            "        access=\"readonly\"\n"+
  +            "    >\n"+
  +            "    </field-descriptor>\n"+
  +            "</class-descriptor>",
  +            runOjbXDoclet(OJB_DEST_FILE));
  +        assertEqualsTorqueSchemaFile(
  +            "<database name=\"ojbtest\">\n"+
  +            "    <table name=\"A\">\n"+
  +            "        <column name=\"attr\"\n"+
  +            "                javaName=\"attr\"\n"+
  +            "                type=\"INTEGER\"\n"+
  +            "                autoIncrement=\"true\"\n"+
  +            "        />\n"+
  +            "    </table>\n"+
  +            "</database>",
  +            runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest"));
  +    }
   }
  +
  
  
  

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


Mime
View raw message