01: package org.objectweb.speedo.runtime.unilog;
02:
03: import java.util.Iterator;
04:
05: import javax.jdo.Extent;
06: import javax.jdo.PersistenceManager;
07:
08: import org.objectweb.speedo.SpeedoTestHelper;
09: import org.objectweb.speedo.pobjects.unilog.Checkpoint;
10: import org.objectweb.speedo.pobjects.unilog.Personne;
11: import org.objectweb.speedo.pobjects.unilog.Team;
12: import org.objectweb.speedo.pobjects.unilog.Vehicle;
13: import org.objectweb.util.monolog.api.BasicLevel;
14:
15: /**
16: *
17: * @author Y.Bersihand
18: */
19: public class ModelTest extends SpeedoTestHelper {
20:
21: public ModelTest(String s) {
22: super (s);
23: }
24:
25: protected String getLoggerName() {
26: return LOG_NAME + ".rt.tutorial.ModelTest";
27: }
28:
29: public void testModel() {
30: logger.log(BasicLevel.DEBUG,
31: "***************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 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: }
|