Examples of PM


Examples of org.apache.ws.jaxme.PM

    if (c == null) {
      throw new PMException("No persistency class configured for " +
                             pElementInterface.getName());
    }
    try {
      PM pm = (PM) c.newInstance();
      pm.init(manager);
      return pm;
    } catch (Exception e) {
      e.printStackTrace(System.err);
      throw new PMException("Could not instantiate persistence manager class " +
                             c.getName(), e);
View Full Code Here

Examples of org.apache.ws.jaxme.PM

    Class c = manager.getPmClass();
    if (c == null) {
      throw new PMException("No persistency class configured for " + pQName);
    }
    try {
      PM pm = (PM) c.newInstance();
      pm.init(manager);
      return pm;
    } catch (Exception e) {
      throw new PMException("Could not instantiate persistence manager class " +
                             c.getName(), e);
    }
View Full Code Here

Examples of org.apache.ws.jaxme.PM

  public void testCreateFactory() throws Exception {
    getFactory();
  }

  public void testCreateManager() throws Exception {
    PM pm = getPM();
    assertTrue(pm instanceof SessionTypePM);
    SessionTypePM sessionTypePM = (SessionTypePM) pm;
    Connection conn = sessionTypePM.getConnection();
    assertNotNull(conn);
    assertTrue(conn.getAutoCommit());
View Full Code Here

Examples of org.apache.ws.jaxme.PM

    assertNotNull(conn);
    assertTrue(conn.getAutoCommit());
  }

  public void testClear() throws Exception {
    PM pm = getPM();
    for (Iterator iter = pm.select(null);  iter.hasNext()) {
      pm.delete((Session) iter.next());
    }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PM

      pm.delete((Session) iter.next());
    }
  }

  public void testCreate() throws Exception {
    PM pm = getPM();
    getSession(pm);
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PM

    PM pm = getPM();
    getSession(pm);
  }

  public void testInsert() throws Exception {
    PM pm = getPM();
    Session session = getSession(pm);
    session.setID(1);
    pm.insert(session);
    session = getSession(pm);
    session.setID(2);
    session.setIpAddress("192.168.5.127");
    pm.insert(session);
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PM

    session.setIpAddress("192.168.5.127");
    pm.insert(session);
  }

  public void testSelectAll() throws Exception {
    PM pm = getPM();
    Iterator iter = pm.select("1=1 ORDER BY ID");
    assertTrue(iter.hasNext());
    Session session = (Session) iter.next();
    assertEquals(1, session.getID());
    assertTrue(iter.hasNext());
    session = (Session) iter.next();
View Full Code Here

Examples of org.apache.ws.jaxme.PM

    assertEquals(2, session.getID());
    assertTrue(!iter.hasNext());
  }

  public void testSelect() throws Exception {
    PM pm = getPM();
    Iterator iter = pm.select("IPADDRESS='192.168.5.127'");
    assertTrue(iter.hasNext());
    Session session = (Session) iter.next();
    assertEquals("192.168.5.127", session.getIpAddress());
    assertEquals(2, session.getID());
    assertTrue(!iter.hasNext());
    assertTrue(!pm.select("IPADDRESS='192.168.5.128'").hasNext());
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PM

    assertTrue(!iter.hasNext());
    assertTrue(!pm.select("IPADDRESS='192.168.5.128'").hasNext());
  }

  public void testUpdate() throws Exception {
    PM pm = getPM();
    Iterator iter = pm.select("IPADDRESS='192.168.5.127'");
    Session session = (Session) iter.next();
    session.setIpAddress("192.168.5.128");
    pm.update(session);

    assertTrue(!pm.select("IPADDRESS='192.168.5.127'").hasNext());
    iter = pm.select("IPADDRESS='192.168.5.128'");
    assertTrue(iter.hasNext());
    session = (Session) iter.next();
    assertEquals("192.168.5.128", session.getIpAddress());
    assertEquals(2, session.getID());
    assertTrue(!iter.hasNext());

    iter = pm.select("IPADDRESS='192.168.5.128'");
    session = (Session) iter.next();
    session.setIpAddress("192.168.5.127");
    pm.update(session);

    testSelect();
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PM

    testSelect();
  }

  public void testDelete() throws Exception {
    testClear();
    PM pm = getPM();
    assertTrue(!pm.select(null).hasNext());
  }
View Full Code Here
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.