Package com.google.devrel.training.conference.form

Examples of com.google.devrel.training.conference.form.ConferenceQueryForm$Filter


    List<Filter> keyFilters = new ArrayList<Filter>();
    if (query.hasFilter()) {
      keyFilters.add(query.getFilter());
    }
    if (lastKey != null) {
      Filter lowerBound = DatastoreHelper.makeFilter(DatastoreHelper.KEY_PROPERTY_NAME,
          PropertyFilter.Operator.GREATER_THAN_OR_EQUAL,
          DatastoreHelper.makeValue(lastKey)).build();
      keyFilters.add(lowerBound);
    }
    if (nextKey != null) {
      Filter upperBound = DatastoreHelper.makeFilter(DatastoreHelper.KEY_PROPERTY_NAME,
          PropertyFilter.Operator.LESS_THAN,
          DatastoreHelper.makeValue(nextKey)).build();
      keyFilters.add(upperBound);
    }
    return Query.newBuilder(query).setFilter(makeFilter(keyFilters)).build();
View Full Code Here


    }

    @Test
    public void testEmptyQuery() throws Exception {
        // Empty query.
        ConferenceQueryForm conferenceQueryForm = new ConferenceQueryForm();
        List<Conference> conferences = conferenceApi.queryConferences(conferenceQueryForm);
        assertEquals(3, conferences.size());
        assertTrue("The result should contain conference1.", conferences.contains(conference1));
        assertTrue("The result should contain conference2.", conferences.contains(conference2));
        assertTrue("The result should contain conference3.", conferences.contains(conference3));
View Full Code Here

    }

    @Test
    public void testCityQuery() throws Exception {
        // A query only specifies the city.
        ConferenceQueryForm conferenceQueryForm = new ConferenceQueryForm()
                .filter(new ConferenceQueryForm.Filter(
                        ConferenceQueryForm.Field.CITY,
                        ConferenceQueryForm.Operator.EQ,
                        "Tokyo"
                ));
View Full Code Here

    }

    @Test
    public void testTopicsQuery() throws Exception {
        // A query only specifies the topics.
        ConferenceQueryForm conferenceQueryForm = new ConferenceQueryForm()
                .filter(new ConferenceQueryForm.Filter(
                        ConferenceQueryForm.Field.TOPIC,
                        ConferenceQueryForm.Operator.EQ,
                        "Japan"
                ));
View Full Code Here

    }

    @Test
    public void testComplexQuery() throws Exception {
        // A query specifies the city and topics and month.
        ConferenceQueryForm conferenceQueryForm = new ConferenceQueryForm()
                .filter(new ConferenceQueryForm.Filter(
                        ConferenceQueryForm.Field.TOPIC,
                        ConferenceQueryForm.Operator.EQ,
                        "Platform"
                ))
View Full Code Here

    }

    @Test
    public void testMaxAttendeesGT() throws Exception {
        // A query specifies the maxAttendees > 999.
        ConferenceQueryForm conferenceQueryForm = new ConferenceQueryForm()
                .filter(new ConferenceQueryForm.Filter(
                        ConferenceQueryForm.Field.MAX_ATTENDEES,
                        ConferenceQueryForm.Operator.GT,
                        "999"
                ));
View Full Code Here

    }

    @Test
    public void testMaxAttendeesLT() throws Exception {
        // A query specifies the maxAttendees > 1001.
        ConferenceQueryForm conferenceQueryForm = new ConferenceQueryForm()
                .filter(new ConferenceQueryForm.Filter(
                        ConferenceQueryForm.Field.MAX_ATTENDEES,
                        ConferenceQueryForm.Operator.LT,
                        "1001"
                ));
View Full Code Here

    }

    @Test
    public void testMaxAttendeesGTEQ() throws Exception {
        // A query specifies the maxAttendees >= 1000.
        ConferenceQueryForm conferenceQueryForm = new ConferenceQueryForm()
                .filter(new ConferenceQueryForm.Filter(
                        ConferenceQueryForm.Field.MAX_ATTENDEES,
                        ConferenceQueryForm.Operator.GTEQ,
                        "1000"
                ));
View Full Code Here

    }

    @Test
    public void testMaxAttendeesLTEQ() throws Exception {
        // A query specifies the maxAttendees <= 1000.
        ConferenceQueryForm conferenceQueryForm = new ConferenceQueryForm()
                .filter(new ConferenceQueryForm.Filter(
                        ConferenceQueryForm.Field.MAX_ATTENDEES,
                        ConferenceQueryForm.Operator.LTEQ,
                        "1000"
                ));
View Full Code Here

    }

    @Test
    public void testMaxAttendeesNE() throws Exception {
        // A query specifies the maxAttendees != 1000.
        ConferenceQueryForm conferenceQueryForm = new ConferenceQueryForm()
                .filter(new ConferenceQueryForm.Filter(
                        ConferenceQueryForm.Field.MAX_ATTENDEES,
                        ConferenceQueryForm.Operator.NE,
                        "1000"
                ));
View Full Code Here

TOP

Related Classes of com.google.devrel.training.conference.form.ConferenceQueryForm$Filter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.