Esempio n. 1
0
 public void testDescendantDescendantNotNull() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(new STRUH1());
   q.descend("h2").descend("h3").constrain(null).not();
   st.expect(q, new Object[] {r[4], r[5]});
 }
Esempio n. 2
0
 public void testDescendOne() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(STVectorEU.class);
   q.descend("col").constrain(new Integer(17));
   st.expect(q, new Object[] {r[0]});
 }
Esempio n. 3
0
 public void testNotEquals() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(r[0]);
   q.descend("i_int").constrain(new Integer(0)).not();
   st.expect(q, new Object[] {r[1], r[2], r[3]});
 }
Esempio n. 4
0
 public void testGreater() {
   Query q = st.query();
   q.constrain(new STInteger(9));
   q.descend("i_int").constraints().greater();
   Object[] r = store();
   st.expect(q, new Object[] {r[2], r[3]});
 }
Esempio n. 5
0
 public void testStrNull() {
   Query q = st.query();
   q.constrain(new STRUH1());
   q.descend("foo1").constrain(null);
   Object[] r = store();
   st.expect(q, new Object[] {r[0], r[2], r[3], r[4], r[5]});
 }
Esempio n. 6
0
 public void testNotContains() {
   Query q = st.query();
   q.constrain(new STInteger(0));
   q.descend("i_int").constrain(new Integer(0)).contains().not();
   Object[] r = store();
   st.expect(q, new Object[] {r[1], r[2]});
 }
Esempio n. 7
0
 public void testDescendantDescendantStringPath() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(new STRUH1());
   q.descend("h2").descend("h3").descend("foo3").constrain("str3");
   st.expect(q, new Object[] {r[4], r[5]});
 }
Esempio n. 8
0
 // FIXME: the SodaQueryComparator changes seem to have broken this
 public void _testMemberClassConstraint() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(STIdentityEvaluation.class);
   q.descend("helper").constrain(HelperDerivate.class);
   st.expect(q, new Object[] {r[4]});
 }
Esempio n. 9
0
 public void testNotLike() {
   Query q = st.query();
   q.constrain(new STInteger(1));
   q.descend("i_int").constraints().like().not();
   Object[] r = store();
   st.expect(q, new Object[] {r[0], r[2], r[3]});
 }
Esempio n. 10
0
 public void testDescendOne() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(STArrIntegerON.class);
   q.descend("intArr").constrain(new Integer(17));
   st.expect(q, new Object[] {r[3], r[4]});
 }
 public void testDescendOne() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(STOwnCollectionW.class);
   q.descend("col").constrain(new Integer(17));
   st.expect(q, new Object[] {r[3], r[4]});
 }
Esempio n. 12
0
 public void testDescendToObject() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(new STHashtableT());
   q.descend("col").descend("foo1").constrain("bar");
   st.expect(q, new Object[] {r[5], r[6]});
 }
Esempio n. 13
0
 public void testEqualsNull() {
   Query q = st.query();
   q.constrain(new STOrU(1000, null));
   q.descend("orInt").constraints().or(q.descend("orString").constrain(null));
   Object[] r = store();
   st.expect(q, new Object[] {r[1], r[2], r[4]});
 }
Esempio n. 14
0
 public void testDescendNotSmaller() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(STArrIntegerON.class);
   Query qElements = q.descend("intArr");
   qElements.constrain(new Integer(3)).smaller();
   st.expect(q, new Object[] {r[2], r[3]});
 }
Esempio n. 15
0
 public void testDefaultContainsOne() {
   Query q = st.query();
   Object[] r = store();
   int[][][] content = new int[1][1][1];
   content[0][0][0] = 17;
   q.constrain(new STArrIntegerON(content));
   st.expect(q, new Object[] {r[3], r[4]});
 }
Esempio n. 16
0
 public void testNotGreaterGreater() {
   Query q = st.query();
   q.constrain(new STOrU());
   Query sub = q.descend("orInt");
   (sub.constrain(new Integer(30000)).greater().or(sub.constrain(new Integer(5)).greater())).not();
   Object[] r = store();
   st.expect(q, new Object[] {r[0], r[1]});
 }
Esempio n. 17
0
 public void testGreaterEquals() {
   Query q = st.query();
   q.constrain(new STOrU());
   Query sub = q.descend("orInt");
   sub.constrain(new Integer(1000)).greater().or(sub.constrain(new Integer(0)));
   Object[] r = store();
   st.expect(q, new Object[] {r[0], r[3], r[4]});
 }
Esempio n. 18
0
 public void testDescendSmaller() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(STHashtableT.class);
   Query qElements = q.descend("col");
   qElements.constrain(new Integer(3)).smaller();
   st.expect(q, new Object[] {r[2], r[3]});
 }
Esempio n. 19
0
 public void testTwoLevelOr() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(new STRUH1("str1"));
   q.descend("foo1")
       .constraints()
       .or(q.descend("h2").descend("h3").descend("foo3").constrain("str3"));
   st.expect(q, new Object[] {r[1], r[4], r[5]});
 }
Esempio n. 20
0
 public void testDescendTwo() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(STHashtableT.class);
   Query qElements = q.descend("col");
   qElements.constrain(new Integer(17));
   qElements.constrain(new Integer(25));
   st.expect(q, new Object[] {r[4]});
 }
Esempio n. 21
0
 public void testAndOrAnd() {
   Query q = st.query();
   q.constrain(new STOrU(0, null));
   (q.descend("orInt").constrain(new Integer(5)).and(q.descend("orString").constrain(null)))
       .or(
           q.descend("orInt")
               .constrain(new Integer(1000))
               .and(q.descend("orString").constrain("joho")));
   Object[] r = store();
   st.expect(q, new Object[] {r[1], r[2]});
 }
Esempio n. 22
0
 public void testNotOrOrAnd() {
   Query q = st.query();
   q.constrain(new STOrU(0, null));
   (q.descend("orInt")
           .constrain(new Integer(Integer.MAX_VALUE - 1))
           .or(q.descend("orString").constrain("joho")))
       .or(q.descend("orInt").constrain(new Integer(5)).and(q.descend("orString").constrain(null)))
       .not();
   Object[] r = store();
   st.expect(q, new Object[] {r[0], r[3]});
 }
Esempio n. 23
0
 public void testNotIdentity() {
   Query q = st.query();
   q.constrain(new STInteger(1));
   ObjectSet set = q.execute();
   STInteger identityConstraint = (STInteger) set.next();
   identityConstraint.i_int = 9080;
   q = st.query();
   q.constrain(identityConstraint).identity().not();
   identityConstraint.i_int = 1;
   Object[] r = store();
   st.expect(q, new Object[] {r[0], r[2], r[3]});
 }
Esempio n. 24
0
 public void test() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(new Helper("aaa"));
   ObjectSet os = q.execute();
   Helper helperA = (Helper) os.next();
   q = st.query();
   q.constrain(STIdentityEvaluation.class);
   q.descend("helper").constrain(helperA).identity();
   q.constrain(new IncludeAllEvaluation());
   st.expect(q, new Object[] {r[1], r[2], r[3]});
 }
Esempio n. 25
0
 public void testDefaultContainsTwo() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(new STHashtableT(new Object[] {new Integer(17), new Integer(25)}));
   st.expect(q, new Object[] {r[4]});
 }
Esempio n. 26
0
 public void testDefaultContainsString() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(new STHashtableT(new Object[] {"foo"}));
   st.expect(q, new Object[] {r[5]});
 }
Esempio n. 27
0
 public void testDefaultContainsObject() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(new STHashtableT(new Object[] {new STElement("bar", null)}));
   st.expect(q, new Object[] {r[5], r[6]});
 }
 public void testDefaultContainsInteger() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(new STOwnCollectionW(new Object[] {new Integer(17)}));
   st.expect(q, new Object[] {r[3], r[4]});
 }
Esempio n. 29
0
 public void testDescendantValue() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(r[3]);
   st.expect(q, new Object[] {r[3], r[5]});
 }
Esempio n. 30
0
 public void testDescendantDescendantValue() {
   Query q = st.query();
   Object[] r = store();
   q.constrain(new STRUH1(new STRUH2(new STRUH3("str3"))));
   st.expect(q, new Object[] {r[4], r[5]});
 }