Package com.googlecode.objectify.persister.test

Examples of com.googlecode.objectify.persister.test.Product


  }

  @Test
  public void testDelete() {

    Product expected = create("code1", "aaa");

    persiter.put(expected);

    persiter.delete(expected);
View Full Code Here


  }

  @Test
  public void testFind() {

    Product expected = create("code1", "aaa");

    persiter.put(expected);

    Product result = persiter.find(Product.class, expected.getCode());

    assertEqualsProduct(expected, result);

  }
View Full Code Here

  }

  @Test
  public void testGet() {

    Product expected = create("code1", "aaa");

    persiter.put(expected);

    Product result = persiter.get(Product.class, expected.getCode());

    assertEqualsProduct(expected, result);

  }
View Full Code Here

  }

  @Test
  public void testPutT() {

    Product expected = create("code1", "aaa");

    persiter.put(expected);

  }
View Full Code Here

  }

  @Test
  public void testQueryList() {

    Product product1 = create("code1", "aaa");
    Product product2 = create("code2", "bbb");
    Product product3 = create("code3", "ccc");

    persiter.put(product1, product2, product3);

    Query<Product> query = persiter.query(Product.class);
View Full Code Here

  }

  @Test
  public void testQuerySingle() {

    Product product1 = create("code1", "aaa");
    Product product2 = create("code2", "bbb");
    Product product3 = create("code3", "ccc");

    persiter.put(product1, product2, product3);

    Query<Product> query = persiter.query(Product.class);

    Product actual = query.filter("name", product2.getName()).get();

    assertEqualsProduct(product2, actual);

  }
View Full Code Here

  }

  @Test
  public void testRefresh() {

    Product expected = create("code1", "aaa");

    persiter.put(expected);

    Product result = create("code1", "");

    persiter.refresh(result);

    assertEqualsProduct(expected, result);
View Full Code Here

  @Test
  public void testForDatastore_NameNull() {

    String name = null;

    Product value = new Product();
    value.setCode(name);

    Object result = null;

    try {
      result = converter.forDatastore(value, saveContext);
View Full Code Here

  @Test
  public void testForDatastore_NameNotNull() {

    String name = "test";

    Product value = new Product();
    value.setCode(name);

    Object result = converter.forDatastore(value, saveContext);

    assertNotNull(result);
    assertTrue(result instanceof Key);
View Full Code Here

    String name = "test";

    String kind = factory.getMetadata(Product.class).getKind();
    Key value = KeyFactory.createKey(kind, name);
    Product pojo = new Product();

    Object result = converter.forPojo(value, Product.class, loadContext, pojo);

    assertNotNull(result);
    assertTrue(result instanceof Product);
View Full Code Here

TOP

Related Classes of com.googlecode.objectify.persister.test.Product

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.