Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo n.º 11
0
 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }
Ejemplo n.º 28
0
 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]});
 }
Ejemplo 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]});
 }
Ejemplo 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]});
 }