Permalink
Browse files

Added test for IN operator and GAE using references

  • Loading branch information...
1 parent 360d90d commit 90db9c173136a749bb18ad63b1f9ba6562950c35 @ZiglioNZ committed Mar 31, 2012
@@ -50,6 +50,7 @@
import siena.base.test.model.MultipleKeys;
import siena.base.test.model.PersonLongAutoID;
import siena.base.test.model.PersonLongManualID;
+import siena.base.test.model.PersonRef;
import siena.base.test.model.PersonStringAutoIncID;
import siena.base.test.model.PersonStringID;
import siena.base.test.model.PersonUUID;
@@ -560,6 +561,23 @@ public void testFilterOperatorInForStringID() {
assertEquals(StringID_CURIE, people.get(0));
assertEquals(StringID_TESLA, people.get(1));
}
+
+ public void testFilterOperatorInForUUIDReference() {
+ List<PersonUUID> l = getOrderedPersonUUIDs();
+
+ PersonRef personref = new PersonRef();
+ personref.personUUID = l.get(0);
+ pm.insert(personref);
+
+ PersonRef personref2 = pm.createQuery(PersonRef.class)
+// .filter("personUUID IN", l )
+ .filter("personUUID IN", Arrays.asList( l.get(0).id, l.get(1).id))
+ .get();
+
+ assertNotNull(personref2);
+
+ assertEquals(personref, personref2);
+ }
public void testFilterOperatorLessThan() {
List<PersonUUID> people = pm.createQuery(PersonUUID.class).filter("n<", 3).order("n").fetch();
@@ -919,6 +919,12 @@ public void testFilterOperatorInForStringID() {
}
@Override
+ public void testFilterOperatorInForUUIDReference() {
+ // TODO Auto-generated method stub
+ super.testFilterOperatorInForUUIDReference();
+ }
+
+ @Override
public void testFilterOperatorLessThan() {
// TODO Auto-generated method stub
super.testFilterOperatorLessThan();
@@ -0,0 +1,19 @@
+package siena.base.test.model;
+
+import siena.Id;
+import siena.Model;
+
+public class PersonRef extends Model{
+
+ @Id
+ public long id;
+
+ public PersonUUID personUUID;
+
+ public PersonRef(){
+ super();
+ }
+
+}
+
+

0 comments on commit 90db9c1

Please sign in to comment.