Package com.google.code.gaeom.test

Source Code of com.google.code.gaeom.test.TestTextEncoder$Foo

package com.google.code.gaeom.test;

import static org.junit.Assert.assertTrue;

import org.apache.commons.lang.RandomStringUtils;
import org.junit.Test;

import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Key;
import com.google.code.gaeom.ObjectStore;
import com.google.code.gaeom.annotation.Text;

public class TestTextEncoder extends AbstractLocalTest
{
  public static class Foo
  {
    @Text
    String longString;
  }

  @Test
  public void testTextAnnotation() throws Exception
  {
    Foo f = new Foo();
    f.longString = RandomStringUtils.randomAlphanumeric(800);

    Key key = ObjectStore.Singleton.get().beginSession().store(f).now();

    Entity e = DatastoreServiceFactory.getDatastoreService().get(key);
    assertTrue(e.getProperty("longString") instanceof com.google.appengine.api.datastore.Text);
  }
}
TOP

Related Classes of com.google.code.gaeom.test.TestTextEncoder$Foo

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.