use of org.apache.atlas.model.impexp.AtlasExportRequest in project incubator-atlas by apache.
the class ExportServiceTest method getRequestForDept.
private AtlasExportRequest getRequestForDept(boolean addFetchType, String fetchTypeValue, boolean addMatchType, String matchTypeValue) {
AtlasExportRequest request = new AtlasExportRequest();
List<AtlasObjectId> itemsToExport = new ArrayList<>();
itemsToExport.add(new AtlasObjectId("Department", "name", "hr"));
request.setItemsToExport(itemsToExport);
setOptionsMap(request, addFetchType, fetchTypeValue, addMatchType, matchTypeValue);
return request;
}
use of org.apache.atlas.model.impexp.AtlasExportRequest in project incubator-atlas by apache.
the class ExportServiceTest method exportType_Succeeds.
@Test
public void exportType_Succeeds() throws AtlasBaseException, FileNotFoundException {
String requestingIP = "1.0.0.0";
String hostName = "root";
AtlasExportRequest request = getRequestForFullFetch();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipSink zipSink = new ZipSink(baos);
AtlasExportResult result = exportService.run(zipSink, request, "admin", hostName, requestingIP);
assertNotNull(exportService);
assertEquals(result.getHostName(), hostName);
assertEquals(result.getClientIpAddress(), requestingIP);
assertEquals(request, result.getRequest());
}
use of org.apache.atlas.model.impexp.AtlasExportRequest in project incubator-atlas by apache.
the class ExportServiceTest method getRequestForFullFetch.
private AtlasExportRequest getRequestForFullFetch() {
AtlasExportRequest request = new AtlasExportRequest();
List<AtlasObjectId> itemsToExport = new ArrayList<>();
itemsToExport.add(new AtlasObjectId("hive_db", "qualifiedName", "default@cl1"));
request.setItemsToExport(itemsToExport);
return request;
}
use of org.apache.atlas.model.impexp.AtlasExportRequest in project incubator-atlas by apache.
the class ExportServiceTest method requestingExportOfNonExistentEntity_ReturnsFailure.
@Test
public void requestingExportOfNonExistentEntity_ReturnsFailure() throws Exception {
AtlasExportRequest request = getRequestForEmployee();
tamperEmployeeRequest(request);
ZipSource zipSource = runExportWithParameters(request);
assertNotNull(zipSource.getCreationOrder());
assertEquals(zipSource.getCreationOrder().size(), 0);
assertEquals(AtlasExportResult.OperationStatus.FAIL, zipSource.getExportResult().getOperationStatus());
}
use of org.apache.atlas.model.impexp.AtlasExportRequest in project incubator-atlas by apache.
the class ExportServiceTest method getRequestForEmployee.
private AtlasExportRequest getRequestForEmployee() {
AtlasExportRequest request = new AtlasExportRequest();
List<AtlasObjectId> itemsToExport = new ArrayList<>();
itemsToExport.add(new AtlasObjectId("Employee", "name", "Max"));
request.setItemsToExport(itemsToExport);
setOptionsMap(request, true, "CONNECTED", false, "");
return request;
}
Aggregations