1 package xdoclet.modules.ojb.tests; 2 3 17 18 23 public class ClassTagAcceptLocksAttributeTests extends OjbTestBase 24 { 25 public ClassTagAcceptLocksAttributeTests(String name) 26 { 27 super(name); 28 } 29 30 public void testAcceptLocks1() 32 { 33 addClass( 34 "test.A", 35 "package test;\n"+ 36 "/** @ojb.class accept-locks=\"\" */\n"+ 37 "public class A {}\n"); 38 39 assertNull(runOjbXDoclet(OJB_DEST_FILE)); 40 assertNull(runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest")); 41 } 42 43 public void testAcceptLocks2() 45 { 46 addClass( 47 "test.A", 48 "package test;\n"+ 49 "/** @ojb.class accept-locks=\"yes\" */\n"+ 50 "public class A {}\n"); 51 52 assertNull(runOjbXDoclet(OJB_DEST_FILE)); 53 assertNull(runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest")); 54 } 55 56 public void testAcceptLocks3() 58 { 59 addClass( 60 "test.A", 61 "package test;\n"+ 62 "/** @ojb.class accept-locks=\"true\" */\n"+ 63 "public class A {}\n"); 64 65 assertEqualsOjbDescriptorFile( 66 "<class-descriptor\n"+ 67 " class=\"test.A\"\n"+ 68 " table=\"A\"\n"+ 69 " accept-locks=\"true\"\n"+ 70 ">\n"+ 71 "</class-descriptor>", 72 runOjbXDoclet(OJB_DEST_FILE)); 73 assertEqualsTorqueSchemaFile( 74 "<database name=\"ojbtest\">\n"+ 75 " <table name=\"A\">\n"+ 76 " </table>\n"+ 77 "</database>", 78 runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest")); 79 } 80 81 public void testAcceptLocks4() 83 { 84 addClass( 85 "test.A", 86 "package test;\n"+ 87 "/** @ojb.class accept-locks=\"false\" */\n"+ 88 "public class A {}\n"); 89 90 assertEqualsOjbDescriptorFile( 91 "<class-descriptor\n"+ 92 " class=\"test.A\"\n"+ 93 " table=\"A\"\n"+ 94 " accept-locks=\"false\"\n"+ 95 ">\n"+ 96 "</class-descriptor>", 97 runOjbXDoclet(OJB_DEST_FILE)); 98 assertEqualsTorqueSchemaFile( 99 "<database name=\"ojbtest\">\n"+ 100 " <table name=\"A\">\n"+ 101 " </table>\n"+ 102 "</database>", 103 runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest")); 104 } 105 106 } 107 | Popular Tags |