Package com.google.appengine.datanucleus.test.jdo

Examples of com.google.appengine.datanucleus.test.jdo.KitchenSink


  public void testSimpleDelete() {
    Key key = ds.put(KitchenSink.newKitchenSinkEntity(null));

    String keyStr = KeyFactory.keyToString(key);
    KitchenSink ks;
    beginTxn();
    ks = em.find(KitchenSink.class, keyStr);
    assertNotNull(ks);
    em.remove(ks);
    commitTxn();
View Full Code Here


  public void testSimpleDeleteWithNamedKey() {
    Key key = ds.put(KitchenSink.newKitchenSinkEntity("named key", null));
    assertEquals("named key", key.getName());
    String keyStr = KeyFactory.keyToString(key);
    KitchenSink ks;
    beginTxn();
    ks = em.find(KitchenSink.class, keyStr);
    assertNotNull(ks);
    em.remove(ks);
    commitTxn();
View Full Code Here

  }

  public void testDeletePersistentNew() {
    int count = countForClass(KitchenSink.class);
    beginTxn();
    KitchenSink ks = KitchenSink.newKitchenSink();
    em.persist(ks);
    em.remove(ks);
    commitTxn();
    assertEquals(count, countForClass(KitchenSink.class));
  }
View Full Code Here

  }

  public void testDeletePersistentNew_NoTxn() {
    int count = countForClass(KitchenSink.class);
    switchDatasource(EntityManagerFactoryName.nontransactional_ds_non_transactional_ops_not_allowed);
    KitchenSink ks = KitchenSink.newKitchenSink();
    em.persist(ks);
    em.remove(ks);
    assertEquals(count, countForClass(KitchenSink.class));
    em.close();
  }
View Full Code Here

  public void testSimpleDelete() {
    Key key = ds.put(KitchenSink.newKitchenSinkEntity(null));

    String keyStr = KeyFactory.keyToString(key);
    beginTxn();
    KitchenSink ks = pm.getObjectById(KitchenSink.class, keyStr);
    assertNotNull(ks);
    pm.deletePersistent(ks);
    commitTxn();
    beginTxn();
    try {
View Full Code Here

  public void testSimpleDelete_NamedKey() {
    Key key = ds.put(KitchenSink.newKitchenSinkEntity("named key", null));

    String keyStr = KeyFactory.keyToString(key);
    beginTxn();
    KitchenSink ks = pm.getObjectById(KitchenSink.class, keyStr);
    assertNotNull(ks);
    assertEquals("named key", KeyFactory.stringToKey(ks.key).getName());
    pm.deletePersistent(ks);
    commitTxn();
    beginTxn();
View Full Code Here

    commitTxn();
  }

  public void testDeletePersistentNew() {
    beginTxn();
    KitchenSink ks = KitchenSink.newKitchenSink();
    pm.makePersistent(ks);
    String keyStr = ks.key;
    pm.deletePersistent(ks);
    commitTxn();
    beginTxn();
View Full Code Here

    }
  }

  public void testDeletePersistentNew_NoTxn() {
    switchDatasource(PersistenceManagerFactoryName.nontransactional);
    KitchenSink ks = KitchenSink.newKitchenSink();
    pm.makePersistent(ks);
    String keyStr = ks.key;
    pm.deletePersistent(ks);
    pm.close();
    pm = pmf.getPersistenceManager();
View Full Code Here

    Key key = ds.put(KitchenSink.newKitchenSinkEntity(null));
    commitTxn();
    beginTxn();

    String keyStr = KeyFactory.keyToString(key);
    KitchenSink ks = pm.detachCopy(pm.getObjectById(KitchenSink.class, keyStr));
    assertNotNull(ks);
    assertEquals(keyStr, ks.key);
    assertEquals(KitchenSink.newKitchenSink(ks.key), ks);
  }
View Full Code Here

  public void testKitchenSinkInsert() throws EntityNotFoundException {
    Map<String, String> props = new HashMap<String, String>();
    props.put("datanucleus.appengine.BigDecimalsEncoding", "String");
    switchDatasource(PersistenceManagerFactoryName.originalStorageVersion, props);
    KitchenSink ks = KitchenSink.newKitchenSink();
    assertNull(ks.key);
    makePersistentInTxn(ks, TXN_START_END);
    assertNotNull(ks.key);

    Entity entity = ds.get(KeyFactory.stringToKey(ks.key));
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jdo.KitchenSink

Copyright © 2018 www.massapicom. 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.