KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > speedo > runtime > unilog > ModelTest


1 package org.objectweb.speedo.runtime.unilog;
2
3
4 import java.util.Iterator JavaDoc;
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 /**
17  *
18  * @author Y.Bersihand
19  */

20 public class ModelTest extends SpeedoTestHelper {
21
22     public ModelTest(String JavaDoc s) {
23         super(s);
24     }
25
26     protected String JavaDoc 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         //store the graph defined above in the datastore
35
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 JavaDoc it = extent.iterator();
42         while(it.hasNext()) {
43             Object JavaDoc a = it.next();
44             System.out.print(a.toString());
45         }
46         extent.closeAll();
47         pm.close();
48     }
49 }
50
Popular Tags