1 package org.apache.ojb.broker; 2 3 import org.apache.ojb.junit.PBTestCase; 4 12 public class AutoIncrementWithRelatedObjectTest extends PBTestCase 13 { 14 public static void main(String [] args) 15 { 16 String [] arr = {AutoIncrementWithRelatedObjectTest.class.getName()}; 17 junit.textui.TestRunner.main(arr); 18 } 19 20 25 public void testCreateWithoutRelatedObject() 26 { 27 Table_1Object table1Ojb = new Table_1Object(); 28 broker.beginTransaction(); 29 broker.store(table1Ojb); 30 broker.commitTransaction(); 31 } 32 33 36 public void testCreateWithRelatedObject() 37 { 38 Table_1Object table1Obj = new Table_1Object(); 39 Table_2Object table2Obj = new Table_2Object(); 40 table1Obj.setTable2Object(table2Obj); 41 broker.beginTransaction(); 42 broker.store(table2Obj); 43 broker.store(table1Obj); 44 broker.commitTransaction(); 45 } 46 47 public AutoIncrementWithRelatedObjectTest(String name) 48 { 49 super(name); 50 } 51 } 52 | Popular Tags |