congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DatastoreQueryOptionsTest
Code IndexAdd Tabnine to your IDE (free)

How to use
DatastoreQueryOptionsTest
in
io.yawp.repository.query

Best Java code snippets using io.yawp.repository.query.DatastoreQueryOptionsTest (Showing top 6 results out of 315)

origin: feroult/yawp

@Test
public void testQueryOptions() {
  String q = "{where: ['longValue', '=', 1, 'intValue', '=', 3, 'doubleValue', '=', 4.3], order: [{p:'stringValue', d:'desc'}], sort: [{p:'longValue', d:'desc'}], limit: 2}";
  QueryOptions options = QueryOptions.parse(q);
  JoinedCondition conditions = assertJoinedCondition(options.getCondition(), LogicalOperator.AND, 3);
  assertSimpleCondition(conditions.getConditions()[0], "longValue", WhereOperator.EQUAL, 1l);
  assertSimpleCondition(conditions.getConditions()[1], "intValue", WhereOperator.EQUAL, 3l);
  assertSimpleCondition(conditions.getConditions()[2], "doubleValue", WhereOperator.EQUAL, 4.3);
  List<QueryOrder> order = options.getPreOrders();
  assertEquals(1, order.size());
  assertOrderEquals("stringValue", "desc", order.get(0));
  List<QueryOrder> sort = options.getPostOrders();
  assertEquals(1, sort.size());
  assertOrderEquals("longValue", "desc", sort.get(0));
  assertEquals(new Integer(2), options.getLimit());
}
origin: feroult/yawp

@Test
public void testWhereJoinedConditionsWithPrecedence() {
  String q = "{where: {op: 'and', c: [{p: 'longValue', op: '=', v: 1}, {op: 'or', c: [{p: 'intValue', op: '=', v: 3}, {p: 'doubleValue', op: '=', v: 4.3}]}]}}";
  QueryOptions options = QueryOptions.parse(q);
  JoinedCondition condition1 = assertJoinedCondition(options.getCondition(), LogicalOperator.AND, 2);
  assertSimpleCondition(condition1.getConditions()[0], "longValue", WhereOperator.EQUAL, 1l);
  JoinedCondition condition2 = assertJoinedCondition(condition1.getConditions()[1], LogicalOperator.OR, 2);
  assertSimpleCondition(condition2.getConditions()[0], "intValue", WhereOperator.EQUAL, 3l);
  assertSimpleCondition(condition2.getConditions()[1], "doubleValue", WhereOperator.EQUAL, 4.3);
}
origin: feroult/yawp

@Test
public void testWhereWithIn() {
  String q = "{ where: [ 'id', 'in', ['1', '3', '5'] ] }";
  QueryOptions options = QueryOptions.parse(q);
  assertSimpleCondition(options.getCondition(), "id", WhereOperator.IN, Arrays.asList("1", "3", "5"));
}
origin: feroult/yawp

@Test
public void testWhereJoinedConditions() {
  String q = "{where: {op: 'and', c: [{p: 'longValue', op: '=', v: 1}, {p: 'intValue', op: '=', v: 3}]}}";
  QueryOptions options = QueryOptions.parse(q);
  JoinedCondition condition = assertJoinedCondition(options.getCondition(), LogicalOperator.AND, 2);
  assertSimpleCondition(condition.getConditions()[0], "longValue", WhereOperator.EQUAL, 1l);
  assertSimpleCondition(condition.getConditions()[1], "intValue", WhereOperator.EQUAL, 3l);
}
origin: feroult/yawp

@Test
public void testWhereSimpleCondition() {
  String q = "{where: {p: 'longValue', op: '=', v: 1}}";
  QueryOptions options = QueryOptions.parse(q);
  assertSimpleCondition(options.getCondition(), "longValue", WhereOperator.EQUAL, 1l);
}
origin: feroult/yawp

@Test
public void testBooleanCodition() {
  String q = "{where: {p: 'booleanValue', op: '=', v: true}}";
  QueryOptions options = QueryOptions.parse(q);
  assertSimpleCondition(options.getCondition(), "booleanValue", WhereOperator.EQUAL, true);
}
io.yawp.repository.queryDatastoreQueryOptionsTest

Most used methods

  • assertJoinedCondition
  • assertOrderEquals
  • assertSimpleCondition

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now