use of com.yahoo.elide.async.models.TableExport in project elide by yahoo.
the class JsonAPITableExportOperationTest method testProcessQueryWithRelationship.
@Test
public void testProcessQueryWithRelationship() {
TableExport queryObj = new TableExport();
String query = "/group?fields[group]=products";
String id = "edc4a871-dff2-4194-804e-d80075cf827d";
queryObj.setId(id);
queryObj.setQuery(query);
queryObj.setQueryType(QueryType.JSONAPI_V1_0);
queryObj.setResultType(ResultType.CSV);
JSONAPITableExportOperation jsonAPIOperation = new JSONAPITableExportOperation(new JSONExportFormatter(elide), asyncExecutorService, queryObj, requestScope, engine);
TableExportResult queryResultObj = (TableExportResult) jsonAPIOperation.call();
assertEquals(200, queryResultObj.getHttpStatus());
assertEquals("Export is not supported for Query that requires traversing Relationships.", queryResultObj.getMessage());
assertNull(queryResultObj.getRecordCount());
assertNull(queryResultObj.getUrl());
}
use of com.yahoo.elide.async.models.TableExport in project elide by yahoo.
the class JsonAPITableExportOperationTest method testProcessBadQuery.
@Test
public void testProcessBadQuery() throws IOException {
dataPrep();
TableExport queryObj = new TableExport();
String query = "tableExport/^IllegalCharacter^";
String id = "edc4a871-dff2-4054-804e-d80075cf827d";
queryObj.setId(id);
queryObj.setQuery(query);
queryObj.setQueryType(QueryType.JSONAPI_V1_0);
queryObj.setResultType(ResultType.CSV);
JSONAPITableExportOperation jsonAPIOperation = new JSONAPITableExportOperation(new JSONExportFormatter(elide), asyncExecutorService, queryObj, requestScope, engine);
TableExportResult queryResultObj = (TableExportResult) jsonAPIOperation.call();
assertEquals(200, queryResultObj.getHttpStatus());
assertEquals("Illegal character in path at index 12: tableExport/^IllegalCharacter^", queryResultObj.getMessage());
}
use of com.yahoo.elide.async.models.TableExport in project elide by yahoo.
the class FileResultStorageEngineTest method storeResultsFile.
private void storeResultsFile(String path, String queryId, Observable<String> storable) {
FileResultStorageEngine engine = new FileResultStorageEngine(path, false);
TableExport query = new TableExport();
query.setId(queryId);
engine.storeResults(query, storable);
}
use of com.yahoo.elide.async.models.TableExport in project elide by yahoo.
the class RedisResultStorageEngineTest method storeResults.
private void storeResults(String queryId, Observable<String> storable) {
TableExport query = new TableExport();
query.setId(queryId);
engine.storeResults(query, storable);
}
use of com.yahoo.elide.async.models.TableExport in project elide by yahoo.
the class CSVExportFormatterTest method testNullProjectionHeader.
@Test
public void testNullProjectionHeader() {
CSVExportFormatter formatter = new CSVExportFormatter(elide, false);
TableExport queryObj = new TableExport();
// Prepare EntityProjection
EntityProjection projection = null;
String output = formatter.preFormat(projection, queryObj);
assertNull(output);
}
Aggregations