Package com.google.appengine.datanucleus.test.jpa

Examples of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA


    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strLinkedHashSet")).size());
  }

  public void testUpdateTreeSet_Add() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    TreeSet<String> set = Utils.newTreeSet("a", "b");
    pojo.setStrTreeSet(set);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    pojo.getStrTreeSet().add("zoom");
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strTreeSet")).size());
  }
View Full Code Here


    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strTreeSet")).size());
  }

  public void testUpdateTreeSet_Reset() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    TreeSet<String> set = Utils.newTreeSet("a", "b");
    pojo.setStrTreeSet(set);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    set = Utils.newTreeSet("a", "b", "zoom");
    pojo.setStrTreeSet(set);
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strTreeSet")).size());
  }
View Full Code Here

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strTreeSet")).size());
  }

  public void testUpdateSortedSet_Add() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    SortedSet<String> set = Utils.newTreeSet("a", "b");
    pojo.setStrSortedSet(set);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    pojo.getStrSortedSet().add("zoom");
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strSortedSet")).size());
  }
View Full Code Here

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strSortedSet")).size());
  }

  public void testUpdateSortedSet_Reset() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    SortedSet<String> set = Utils.newTreeSet("a", "b");
    pojo.setStrSortedSet(set);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    set = Utils.newTreeSet("a", "b", "zoom");
    pojo.setStrSortedSet(set);
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strSortedSet")).size());
  }
View Full Code Here

    assertEquals("22333", bookCheck.getProperty("isbn"));
    assertEquals("not yam", bookCheck.getProperty("title"));
  }

  public void testUpdateList_Add() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    List<String> list = Utils.newArrayList("a", "b");
    pojo.setStrList(list);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    pojo.getStrList().add("zoom");
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strList")).size());
  }
View Full Code Here

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strList")).size());
  }

  public void testUpdateList_Reset() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    List<String> list = Utils.newArrayList("a", "b");
    pojo.setStrList(list);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    list = Utils.newArrayList("a", "b", "zoom");
    pojo.setStrList(list);
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strList")).size());
  }
View Full Code Here

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strList")).size());
  }

  public void testUpdateCollection_Add() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    List<Integer> list = Utils.newArrayList(2, 3);
    pojo.setIntColl(list);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    pojo.getIntColl().add(4);
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("intColl")).size());
  }
View Full Code Here

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("intColl")).size());
  }

  public void testUpdateCollection_Reset() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    List<Integer> list = Utils.newArrayList(2, 3);
    pojo.setIntColl(list);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    list = Utils.newArrayList(2, 3, 4);
    pojo.setIntColl(list);
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("intColl")).size());
  }
View Full Code Here

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("intColl")).size());
  }

  public void testUpdateArrayList_Add() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    ArrayList<String> list = Utils.newArrayList("a", "b");
    pojo.setStrArrayList(list);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    pojo.getStrArrayList().add("zoom");
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strArrayList")).size());
  }
View Full Code Here

    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strArrayList")).size());
  }

  public void testUpdateArrayList_Reset() throws EntityNotFoundException {
    HasMultiValuePropsJPA pojo = new HasMultiValuePropsJPA();
    ArrayList<String> list = Utils.newArrayList("a", "b");
    pojo.setStrArrayList(list);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    pojo = em.find(HasMultiValuePropsJPA.class, pojo.getId());
    list = Utils.newArrayList("a", "b", "zoom");
    pojo.setStrArrayList(list);
    commitTxn();
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    assertEquals(3, ((List<?>)e.getProperty("strArrayList")).size());
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jpa.HasMultiValuePropsJPA

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.