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 ModifyInheritedTagIgnoreAttributeTests.java
Date Sat, 20 Aug 2005 15:19:54 GMT
tomdz       2005/08/20 08:19:54

  Modified:    src/xdoclet/test/xdoclet/modules/ojb/tests Tag:
                        OJB_1_0_RELEASE
                        ModifyInheritedTagIgnoreAttributeTests.java
  Log:
  Added testcase for OJB-53
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.4.2.3   +54 -1     db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/ModifyInheritedTagIgnoreAttributeTests.java
  
  Index: ModifyInheritedTagIgnoreAttributeTests.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/ModifyInheritedTagIgnoreAttributeTests.java,v
  retrieving revision 1.4.2.2
  retrieving revision 1.4.2.3
  diff -u -r1.4.2.2 -r1.4.2.3
  --- ModifyInheritedTagIgnoreAttributeTests.java	1 Mar 2005 21:54:07 -0000	1.4.2.2
  +++ ModifyInheritedTagIgnoreAttributeTests.java	20 Aug 2005 15:19:54 -0000	1.4.2.3
  @@ -18,7 +18,7 @@
   /**
    * Tests for the ojb.modify-inherited tag with the ignore attribute.
    *
  - * @author <a href="mailto:tomdz@users.sourceforge.net">Thomas Dudziak (tomdz@users.sourceforge.net)</a>
  + * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
    */
   public class ModifyInheritedTagIgnoreAttributeTests extends OjbTestBase
   {
  @@ -628,4 +628,57 @@
               "</database>",
               runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest"));
       }
  +
  +    // Test for OJB-53
  +    public void testIgnore10()
  +    {
  +        addClass(
  +            "test.A",
  +            "package test;\n"+
  +            "/** @ojb.class */\n" +
  +            "public class A {\n"+
  +            "  /** @ojb.field primarykey=\"true\" */\n"+
  +            "  private int id;\n"+
  +            "  /** @ojb.field */\n"+
  +            "  private int bid;\n"+
  +            "  /** @ojb.reference foreignkey=\"bid\" */\n"+
  +            "  private B b;\n"+
  +            "}");
  +        addClass(
  +            "test.B",
  +            "package test;\n"+
  +            "/** @ojb.class */\n"+
  +            "public class B {\n"+
  +            "  /** @ojb.field primarykey=\"true\" */\n"+
  +            "  private int id;\n"+
  +            "  /** @ojb.collection element-class-ref=\"test.A\"\n"+
  +            "    *                 foreignkey=\"bid\"\n"+
  +            "    */\n"+
  +            "  private java.util.List as;\n"+
  +            "}");
  +        addClass(
  +            "test.C",
  +            "package test;\n"+
  +            "/** @ojb.class\n" +
  +            "  * @ojb.modify-inherited name=\"bid\"\n"+
  +            "  *                       ignore=\"true\"\n"+
  +            "  * @ojb.modify-inherited name=\"b\"\n"+
  +            "  *                       ignore=\"true\"\n"+
  +            "  */\n"+
  +            "public class C extends A {}\n");
  +        addClass(
  +            "test.D",
  +            "package test;\n"+
  +            "/** @ojb.class\n" +
  +            "  * @ojb.modify-inherited name=\"as\"\n"+
  +            "  *                       ignore=\"true\"\n"+
  +            "  */\n"+
  +            "public class D extends B {}\n");
  +
  +        // This is supposed to fail because the as collection in B may contain a C instance,
  +        // but they cannot be correctly handled by OJB because the field establishing the
  +        // collection (bid in A) is no longer mapped in C
  +        assertNull(runOjbXDoclet(OJB_DEST_FILE));
  +        assertNull(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