Created
April 21, 2011 15:19
-
-
Save pomu0325/934753 to your computer and use it in GitHub Desktop.
NullPointerException at org.slim3.datastore.ModelQuery.asQueryResultList(ModelQuery.java:295)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pomu0325.model; | |
import static org.hamcrest.CoreMatchers.is; | |
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 { | |
@Test | |
public void test() throws Exception { | |
Person pomu0325 = new Person(); | |
pomu0325.getSkill().add("Java"); | |
pomu0325.getSkill().add("Scala"); | |
Datastore.put(pomu0325); | |
PersonMeta meta = PersonMeta.get(); | |
S3QueryResultList<Person> result1 | |
= Datastore.query(meta).filter(meta.skill.in("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(ModelQuery.java:295) | |
S3QueryResultList<Person> result2 | |
= Datastore.query(meta).filter(meta.skill.in("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