com.googlecode.objectify.test.CachingTests Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of objectify Show documentation
Show all versions of objectify Show documentation
*** THIS VERSION UPLOADED FOR USE WITH CEDAR-COMMON, TO AVOID DEPENDENCIES ON GOOGLE CODE-BASED MAVEN REPOSITORIES. *** The simplest convenient interface to the Google App Engine datastore
The newest version!
/*
* $Id: BeanMixin.java 1075 2009-05-07 06:41:19Z lhoriman $
* $URL: https://subetha.googlecode.com/svn/branches/resin/rtest/src/org/subethamail/rtest/util/BeanMixin.java $
*/
package com.googlecode.objectify.test;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import javax.persistence.Id;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.test.entity.Trivial;
/**
* Normally we run all tests with caching enabled. This lets us mix cached
* and uncached in batches to see what happens.
*
* @author Jeff Schnitzer
*/
public class CachingTests extends TestBase
{
/** */
@SuppressWarnings("unused")
private static Logger log = Logger.getLogger(CachingTests.class.getName());
/** */
static class Uncached
{
@Id Long id;
String stuff;
}
/**
*/
@BeforeMethod
public void setUp()
{
super.setUp();
this.fact.register(Uncached.class);
}
/** */
@Test
public void testHeterogeneousBatch() throws Exception
{
Uncached un1 = new Uncached();
un1.stuff = "un1 stuff";
Uncached un2 = new Uncached();
un2.stuff = "un2 stuff";
Trivial triv1 = new Trivial("foo1", 5);
Trivial triv2 = new Trivial("foo2", 6);
List