Skip to content

Commit

Permalink
add test non-composite
Browse files Browse the repository at this point in the history
Signed-off-by: qGYdXbY2 <[email protected]>
  • Loading branch information
qGYdXbY2 committed Apr 30, 2024
1 parent 98d6e72 commit 3d605b9
Showing 1 changed file with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class JobApiExportVersionIT extends JobApiIT {
protected static String scope = "export";
protected static String testVersionedSpaceId1 = "version-space-1";
protected static String testVersionedSpaceId1Ext = testVersionedSpaceId1 + "-ext";
protected static String testVersionedSpaceId2 = "version-space-2";
private static int versionsToKeep = 29;

private static void addSomeData(String spaceId, String filename) throws Exception
Expand Down Expand Up @@ -80,18 +81,25 @@ public static void init() throws Exception {

deleteFeature(getScopedSpaceId(testVersionedSpaceId1Ext,scope), "id003"); // feature in base got deleted in delta

createSpaceWithCustomStorage(getScopedSpaceId(testVersionedSpaceId2, scope), "psql", null, versionsToKeep);
addSomeData( getScopedSpaceId(testVersionedSpaceId2,scope), deltaDataFile);

deleteAllJobsOnSpace(getScopedSpaceId(testVersionedSpaceId1, scope));
deleteAllJobsOnSpace(getScopedSpaceId(testVersionedSpaceId1Ext, scope));

deleteAllJobsOnSpace(getScopedSpaceId(testVersionedSpaceId2, scope));
}

@AfterClass
public static void clean(){

deleteAllJobsOnSpace(getScopedSpaceId(testVersionedSpaceId1, scope));
deleteAllJobsOnSpace(getScopedSpaceId(testVersionedSpaceId1Ext, scope));
deleteAllJobsOnSpace(getScopedSpaceId(testVersionedSpaceId2, scope));

removeSpace(getScopedSpaceId(testVersionedSpaceId1, scope));
removeSpace(getScopedSpaceId(testVersionedSpaceId1Ext, scope));
removeSpace(getScopedSpaceId(testVersionedSpaceId2, scope));
}

@Test
Expand Down Expand Up @@ -227,6 +235,31 @@ public void compositeL1Export_VersionRange_tileid_partitionedJsonWkb() throws Ex

}

@Test
public void export_VersionRange_tileid_partitionedJsonWkb() throws Exception {
/* non composite */ /* check semantic for next_version with range ? */
int targetLevel = 12;
int maxTilesPerFile= 300;

Export.ExportTarget exportTarget = new Export.ExportTarget()
.withType(Export.ExportTarget.Type.VML)
.withTargetId(testVersionedSpaceId2+":dummy");

/** Create job */
Export job = buildVMTestJob(testExportJobId, null, exportTarget, Job.CSVFormat.PARTITIONED_JSON_WKB, targetLevel, maxTilesPerFile)
.withPartitionKey("tileid");

/*set explict as targetVersion - filters are only mapped by data-hub-dp to legacy jobconfig*/
job.setTargetVersion("9..13"); // from,to
/* */

List<URL> urls = performExport(job, getScopedSpaceId(testVersionedSpaceId2, scope), finalized, failed, Export.CompositeMode.CHANGES );

List<String> mustContain = Arrays.asList("23600776,","jumpPoint delta","122001322020");

downloadAndCheck(urls, 378, 1, mustContain);
}


@Test
public void compositeL1Export_Changes_id_partitionedJsonWkb() throws Exception {
Expand Down Expand Up @@ -270,6 +303,29 @@ public void compositeL1Export_VersionRange_id_partitionedJsonWkb() throws Except
downloadAndCheck(urls, 375, 1, mustContain);
}

@Test
public void export_VersionRange_id_partitionedJsonWkb() throws Exception {
/* non composite */ /* check semantic for next_version with range ? */
Export.ExportTarget exportTarget = new Export.ExportTarget()
.withType(Export.ExportTarget.Type.VML)
.withTargetId(testVersionedSpaceId2+":dummy");

/** Create job */
Export job = buildTestJob(testExportJobId, null, exportTarget, Job.CSVFormat.PARTITIONED_JSON_WKB)
.withPartitionKey("id");
job.addParam("skipTrigger", true);

/*set explict as targetVersion - filters are only mapped by data-hub-dp to legacy jobconfig*/
job.setTargetVersion("9..13"); // from,to
/* */

List<URL> urls = performExport(job, getScopedSpaceId(testVersionedSpaceId2, scope), finalized, failed, Export.CompositeMode.CHANGES );

List<String> mustContain = Arrays.asList("id007,","jumpPoint delta","122001322020");

downloadAndCheck(urls, 375, 1, mustContain);
}

@Test
public void compositeL1Export_Changes_partitionkey_partitionedJsonWkb() throws Exception {

Expand Down

0 comments on commit 3d605b9

Please sign in to comment.