Search in sources :

Example 6 with FieldException

use of org.z3950.zing.cql.cql2pgjson.FieldException in project raml-module-builder by folio-org.

the class CQLWrapperTest method allRecords.

@Test
public void allRecords() throws FieldException {
    CQLWrapper wrapper = new CQLWrapper().setField(new CQL2PgJSON("field")).setQuery("cql.allRecords=1");
    assertThat(wrapper.toString(), is(" WHERE true"));
}
Also used : CQL2PgJSON(org.z3950.zing.cql.cql2pgjson.CQL2PgJSON) CQLWrapper(org.folio.rest.persist.cql.CQLWrapper) Test(org.junit.Test)

Example 7 with FieldException

use of org.z3950.zing.cql.cql2pgjson.FieldException in project raml-module-builder by folio-org.

the class CQLWrapperTest method wrap.

@Test
public void wrap() throws FieldException {
    CQLWrapper wrapper = new CQLWrapper().setField(new CQL2PgJSON("field")).setQuery("cql.allRecords=1");
    wrapper.addWrapper(wrapper);
    wrapper.addWrapper(wrapper, "or");
    assertThat(wrapper.toString(), is(" WHERE true and true or true"));
}
Also used : CQL2PgJSON(org.z3950.zing.cql.cql2pgjson.CQL2PgJSON) CQLWrapper(org.folio.rest.persist.cql.CQLWrapper) Test(org.junit.Test)

Example 8 with FieldException

use of org.z3950.zing.cql.cql2pgjson.FieldException in project raml-module-builder by folio-org.

the class CQLWrapperTest method invalidCQL.

@Test(expected = IllegalStateException.class)
public void invalidCQL() throws FieldException {
    CQLWrapper wrapper = new CQLWrapper().setField(new CQL2PgJSON("field")).setQuery("or name=miller");
    wrapper.toString();
}
Also used : CQL2PgJSON(org.z3950.zing.cql.cql2pgjson.CQL2PgJSON) CQLWrapper(org.folio.rest.persist.cql.CQLWrapper) Test(org.junit.Test)

Aggregations

CQLWrapper (org.folio.rest.persist.cql.CQLWrapper)8 CQL2PgJSON (org.z3950.zing.cql.cql2pgjson.CQL2PgJSON)7 Test (org.junit.Test)6 FieldException (org.z3950.zing.cql.cql2pgjson.FieldException)2 Async (io.vertx.ext.unit.Async)1 IOException (java.io.IOException)1 List (java.util.List)1 Location (org.folio.rest.jaxrs.model.Location)1 Locations (org.folio.rest.jaxrs.model.Locations)1 SimplePojo (org.folio.rest.persist.helpers.SimplePojo)1