use of com.cloudant.client.api.query.JsonIndex in project java-cloudant by cloudant.
the class IndexTests method testNotNullIndexNamesAndFields.
@Test
public void testNotNullIndexNamesAndFields() {
List<JsonIndex> indices = db.listIndexes().jsonIndexes();
assertNotNull(indices);
assert (indices.size() > 0);
for (JsonIndex i : indices) {
assertNotNull(i.getName());
assertNotNull(i.getFields());
List<JsonIndex.Field> flds = i.getFields();
assertTrue(flds.size() > 0, "The fields should not be empty");
for (JsonIndex.Field field : flds) {
assertNotNull(field.getName(), "The field name should not be null");
assertNotNull(field.getOrder(), "The sort order should not be null");
}
}
}
use of com.cloudant.client.api.query.JsonIndex in project java-cloudant by cloudant.
the class IndexListTests method listComplexJsonIndex.
@Test
public void listComplexJsonIndex() throws Exception {
enqueueList(JSON_COMPLEX);
List<JsonIndex> indexes = db.listIndexes().jsonIndexes();
assertEquals(1, indexes.size(), "There should be 1 JSON index");
JsonIndex complex = indexes.get(0);
assertComplexJson(complex);
}
use of com.cloudant.client.api.query.JsonIndex in project java-cloudant by cloudant.
the class IndexListTests method listSimpleJsonIndex.
@Test
public void listSimpleJsonIndex() throws Exception {
enqueueList(JSON_SIMPLE);
List<JsonIndex> indexes = db.listIndexes().jsonIndexes();
assertEquals(1, indexes.size(), "There should be 1 JSON index");
JsonIndex simple = indexes.get(0);
assertSimpleJson(simple);
}
use of com.cloudant.client.api.query.JsonIndex in project java-cloudant by cloudant.
the class IndexListTests method listMultipleJsonIndexes.
@Test
public void listMultipleJsonIndexes() throws Exception {
enqueueList(JSON_SIMPLE, JSON_COMPLEX);
List<JsonIndex> indexes = db.listIndexes().jsonIndexes();
assertEquals(2, indexes.size(), "There should be 2 JSON indexes");
JsonIndex simple = indexes.get(0);
assertSimpleJson(simple);
JsonIndex complex = indexes.get(1);
assertComplexJson(complex);
}
Aggregations