Package org.objectweb.speedo.runtime.relations.mn

Source Code of org.objectweb.speedo.runtime.relations.mn.TestMNRemove

/**
* Copyright (C) 2001-2004 France Telecom R&D
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
package org.objectweb.speedo.runtime.relations.mn;

import org.objectweb.speedo.SpeedoTestHelper;
import org.objectweb.speedo.pobjects.relations.mn.Qsdfgh;
import org.objectweb.speedo.pobjects.relations.mn.p1.Azerty;

import javax.jdo.PersistenceManager;
import javax.jdo.Extent;
import java.util.Iterator;

/**
*
* @author S.Chassande-Barrioz
*/
public class TestMNRemove extends SpeedoTestHelper {

  public TestMNRemove(String s) {
    super(s);
  }

  protected String getLoggerName() {
    return LOG_NAME + "rt.relations.mn";
  }

  public void testA() {
    PersistenceManager pm = pmf.getPersistenceManager();
    pm.currentTransaction().begin();
    Extent ex = pm.getExtent(Azerty.class, false);
    Iterator it = ex.iterator();
    while(it.hasNext()) {     
      pm.deletePersistent(it.next());     
    }
    ex = pm.getExtent(Qsdfgh.class, false);
    it = ex.iterator();
    while(it.hasNext()) {
     
      pm.deletePersistent(it.next());
     
    }
    pm.currentTransaction().commit();
    pm.close();
  }
}
TOP

Related Classes of org.objectweb.speedo.runtime.relations.mn.TestMNRemove

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.