Changeset 29 for trunk/fmgVen/test/com


Ignore:
Timestamp:
Feb 10, 2011, 10:06:10 PM (14 years ago)
Author:
fmguler
Message:

Refs #3 - Ven.list() is converted to the new format. Almost the same as Ven.get(). Added javadoc to Ven public methods. Added listing test, and made the sample domain object toString methods more readable.

Now, adding the criteria parameter to the operations is to be done.

Location:
trunk/fmgVen/test/com/fmguler/ven/sample
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/fmgVen/test/com/fmguler/ven/sample/Sample.java

    r28 r29  
    2424import java.util.Date; 
    2525import java.util.HashSet; 
     26import java.util.Iterator; 
    2627import java.util.List; 
    2728import java.util.Set; 
     
    4041        //get an object 
    4142        testGet(); 
     43        //list the objects 
     44        testList(); 
    4245        //delete an object 
    4346        testDelete(); 
     
    5154     */ 
    5255    public static void testSave() { 
     56        System.out.println("******SAVE******"); 
    5357        Ven ven = getVen(); 
    5458 
     
    7175     */ 
    7276    public static void testDelete() { 
     77        System.out.println("******DELETE******"); 
    7378        Ven ven = getVen(); 
    7479        ven.delete(2, SomeDomainObject.class); 
     
    7984     */ 
    8085    public static void testGet() { 
     86        System.out.println("******GET******"); 
    8187        Ven ven = getVen(); 
    8288 
     
    98104     */ 
    99105    public static void testList() { 
     106        System.out.println("******LIST******"); 
    100107        Ven ven = getVen(); 
    101         List objList = ven.list(SomeDomainObject.class); 
    102         System.out.println(objList); 
     108 
     109        //list with includes 
     110        Set joins = new HashSet(); 
     111        joins.add("SomeDomainObject.anotherDomainObjects"); 
     112        joins.add("SomeDomainObject.anotherDomainObject"); 
     113        List objList = ven.list(SomeDomainObject.class, joins); 
     114         
     115        Iterator it = objList.iterator(); 
     116        while (it.hasNext()) { 
     117            SomeDomainObject someDomainObject = (SomeDomainObject)it.next(); 
     118            System.out.println(someDomainObject); 
     119        } 
    103120    } 
    104121 
     
    108125    public static void testListByCriteria() { 
    109126        Ven ven = getVen(); 
    110         List objList = ven.list(SomeDomainObject.class/*, criteria */); 
    111         System.out.println(objList); 
     127        //List objList = ven.list(SomeDomainObject.class/*, criteria */); 
     128        //System.out.println(objList); 
    112129    } 
    113130 
  • trunk/fmgVen/test/com/fmguler/ven/sample/domain/AnotherDomainObject.java

    r28 r29  
    102102 
    103103    public String toString() { 
    104         return id + " " + name + " " + description + " some domain object: {" + someDomainObject + "}"; 
     104        return "{" + id + ", " + name + ", " + description + ", some domain object: " + someDomainObject + "}"; 
    105105    } 
    106106} 
  • trunk/fmgVen/test/com/fmguler/ven/sample/domain/SomeDomainObject.java

    r28 r29  
    112112 
    113113    public String toString() { 
    114         return id + " " + name + " " + description + " another domain object: {" + anotherDomainObject + "} another domain objects:\n" + anotherDomainObjects; 
     114        return "{" + id + ", " + name + ", " + description + ", another domain object: " + anotherDomainObject + ", another domain objects: " + anotherDomainObjects + "} "; 
    115115    } 
    116116} 
Note: See TracChangeset for help on using the changeset viewer.