Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
NullPointerException at org.slim3.datastore.ModelQuery.asQueryResultList(
package pomu0325.model;
import static;
import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.slim3.datastore.Datastore;
import org.slim3.datastore.S3QueryResultList;
import org.slim3.tester.AppEngineTestCase;
import pomu0325.meta.PersonMeta;
public class PersonTest extends AppEngineTestCase {
public void test() throws Exception {
Person pomu0325 = new Person();
PersonMeta meta = PersonMeta.get();
S3QueryResultList<Person> result1
= Datastore.query(meta).filter("Java")).asQueryResultList();
assertThat(result1.size(), is(1));
// NullPointerException is thrown at asQueryResultList() when using InCriterion with 2 or more values...
// at org.slim3.datastore.ModelQuery.asQueryResultList(
S3QueryResultList<Person> result2
= Datastore.query(meta).filter("Java", "Scala")).asQueryResultList();
assertThat(result2.size(), is(1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.