1 package org.objectweb.speedo.runtime.unilog; 2 3 4 import java.util.Iterator ; 5 6 import javax.jdo.Extent; 7 import javax.jdo.PersistenceManager; 8 9 import org.objectweb.speedo.SpeedoTestHelper; 10 import org.objectweb.speedo.pobjects.unilog.Checkpoint; 11 import org.objectweb.speedo.pobjects.unilog.Personne; 12 import org.objectweb.speedo.pobjects.unilog.Team; 13 import org.objectweb.speedo.pobjects.unilog.Vehicle; 14 import org.objectweb.util.monolog.api.BasicLevel; 15 16 20 public class ModelTest extends SpeedoTestHelper { 21 22 public ModelTest(String s) { 23 super(s); 24 } 25 26 protected String getLoggerName() { 27 return LOG_NAME + ".rt.tutorial.ModelTest"; 28 } 29 30 public void testModel() { 31 logger.log(BasicLevel.DEBUG, "***************testModel*****************"); 32 33 PersistenceManager pm = pmf.getPersistenceManager(); 34 pm.getObjectIdClass(Personne.class); 36 pm.getObjectIdClass(Team.class); 37 pm.getObjectIdClass(Vehicle.class); 38 pm.getObjectIdClass(Checkpoint.class); 39 40 Extent extent = pm.getExtent(Team.class, false); 41 Iterator it = extent.iterator(); 42 while(it.hasNext()) { 43 Object a = it.next(); 44 System.out.print(a.toString()); 45 } 46 extent.closeAll(); 47 pm.close(); 48 } 49 } 50 | Popular Tags |