01: /**
02: * Copyright (C) 2001-2004 France Telecom R&D
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package org.objectweb.speedo.runtime.relations.mn;
18:
19: import org.objectweb.speedo.SpeedoTestHelper;
20: import org.objectweb.speedo.pobjects.relations.mn.Qsdfgh;
21: import org.objectweb.speedo.pobjects.relations.mn.p1.Azerty;
22:
23: import javax.jdo.PersistenceManager;
24: import javax.jdo.Extent;
25: import java.util.Iterator;
26:
27: /**
28: *
29: * @author S.Chassande-Barrioz
30: */
31: public class TestMNRemove extends SpeedoTestHelper {
32:
33: public TestMNRemove(String s) {
34: super (s);
35: }
36:
37: protected String getLoggerName() {
38: return LOG_NAME + "rt.relations.mn";
39: }
40:
41: public void testA() {
42: PersistenceManager pm = pmf.getPersistenceManager();
43: pm.currentTransaction().begin();
44: Extent ex = pm.getExtent(Azerty.class, false);
45: Iterator it = ex.iterator();
46: while (it.hasNext()) {
47: pm.deletePersistent(it.next());
48: }
49: ex = pm.getExtent(Qsdfgh.class, false);
50: it = ex.iterator();
51: while (it.hasNext()) {
52:
53: pm.deletePersistent(it.next());
54:
55: }
56: pm.currentTransaction().commit();
57: pm.close();
58: }
59: }
|