Changeset 25 for trunk/fmgVen/test/com/fmguler/ven
- Timestamp:
- Oct 3, 2010, 10:02:59 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/fmgVen/test/com/fmguler/ven/sample/Sample.java
r24 r25 21 21 import com.fmguler.ven.sample.domain.SomeDomainObject; 22 22 import java.sql.SQLException; 23 import java.util.Date; 24 import java.util.List; 23 25 import java.util.Locale; 24 26 import javax.sql.DataSource; … … 38 40 public static void main(String[] args) { 39 41 buildDatabase(); 40 test 1();42 testGet(); 41 43 //rollbackDatabase(); 42 44 } 43 45 44 public static void test1() { 46 /** 47 * Test save an object 48 */ 49 public static void testSave() { 50 Ven ven = getVen(); 51 52 //insert 53 SomeDomainObject obj = new SomeDomainObject(); 54 obj.setName("name"); 55 obj.setDescription("desc"); 56 obj.setDate(new Date()); 57 ven.save(obj); 58 System.out.println(obj); 59 60 //update 61 obj.setName("name update"); 62 ven.save(obj); 63 System.out.println(obj); 64 } 65 66 /** 67 * Test delete an object 68 */ 69 public static void testDelete() { 70 Ven ven = getVen(); 71 ven.delete(1, SomeDomainObject.class); 72 } 73 74 /** 75 * Test get an object by primary key 76 */ 77 public static void testGet() { 45 78 Ven ven = getVen(); 46 79 SomeDomainObject obj = (SomeDomainObject)ven.get(1, SomeDomainObject.class); 47 80 System.out.println(obj); 81 } 82 83 /** 84 * Test list the collection of objects 85 */ 86 public static void testList() { 87 Ven ven = getVen(); 88 List objList = ven.list(SomeDomainObject.class); 89 System.out.println(objList); 90 } 91 92 /** 93 * Test list the collection of objects by some criteria 94 */ 95 public static void testListByCriteria() { 96 Ven ven = getVen(); 97 List objList = ven.list(SomeDomainObject.class/*, criteria */); 98 System.out.println(objList); 48 99 } 49 100
Note: See TracChangeset
for help on using the changeset viewer.