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 FieldTagSimpleTests.java
Date Sun, 30 May 2004 11:56:46 GMT
tomdz       2004/05/30 04:56:46

  Modified:    src/xdoclet/test/xdoclet/modules/ojb/tests
                        FieldTagSimpleTests.java
  Log:
  Added tests to manifest two related bugs in XDoclet (it won't process final/transient fields)
  
  Revision  Changes    Path
  1.6       +56 -0     db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/FieldTagSimpleTests.java
  
  Index: FieldTagSimpleTests.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/FieldTagSimpleTests.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FieldTagSimpleTests.java	5 Apr 2004 12:16:16 -0000	1.5
  +++ FieldTagSimpleTests.java	30 May 2004 11:56:46 -0000	1.6
  @@ -1090,4 +1090,60 @@
               "</database>",
               runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest"));
       }
  +
  +    // Basic test: final field with type Integer
  +    public void testFinalField()
  +    {
  +        addClass(
  +            "test.A",
  +            "package test;\n"+
  +            "/** @ojb.class */\n"+
  +            "public class A {\n"+
  +            "/** @ojb.field */\n"+
  +            "  private final Integer attr;\n"+
  +            "}\n");
  +
  +        // This is a known XDoclet bug: it won't read the final field
  +        assertEqualsOjbDescriptorFile(
  +            "<class-descriptor\n"+
  +            "    class=\"test.A\"\n"+
  +            "    table=\"A\"\n"+
  +            ">\n"+
  +            "</class-descriptor>",
  +            runOjbXDoclet(OJB_DEST_FILE));
  +        assertEqualsTorqueSchemaFile(
  +            "<database name=\"ojbtest\">\n"+
  +            "    <table name=\"A\">\n"+
  +            "    </table>\n"+
  +            "</database>",
  +            runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest"));
  +    }
  +
  +    // Basic test: transient field with type Integer
  +    public void testTransientField()
  +    {
  +        addClass(
  +            "test.A",
  +            "package test;\n"+
  +            "/** @ojb.class */\n"+
  +            "public class A {\n"+
  +            "/** @ojb.field */\n"+
  +            "  private transient Integer attr;\n"+
  +            "}\n");
  +
  +        // This is a known XDoclet bug: it won't read the transient field
  +        assertEqualsOjbDescriptorFile(
  +            "<class-descriptor\n"+
  +            "    class=\"test.A\"\n"+
  +            "    table=\"A\"\n"+
  +            ">\n"+
  +            "</class-descriptor>",
  +            runOjbXDoclet(OJB_DEST_FILE));
  +        assertEqualsTorqueSchemaFile(
  +            "<database name=\"ojbtest\">\n"+
  +            "    <table name=\"A\">\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