tomdz 2005/08/20 08:20:40
Modified: src/xdoclet/test/xdoclet/modules/ojb/tests
ModifyInheritedTagIgnoreAttributeTests.java
Log:
Added testcase for OJB-53
Revision Changes Path
1.7 +53 -0
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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ModifyInheritedTagIgnoreAttributeTests.java 22 Mar 2005 21:30:39
-0000 1.6
+++ ModifyInheritedTagIgnoreAttributeTests.java 20 Aug 2005 15:20:40
-0000 1.7
@@ -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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]