|
@@ -2810,51 +2810,53 @@ class MilvusServiceClientTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// @Test
|
|
|
-// void testGetBulkloadStateWrapper() {
|
|
|
-// long count = 1000;
|
|
|
-// ImportState state = ImportState.ImportStarted;
|
|
|
-// String reason = "unexpected error";
|
|
|
-// String files = "1.json";
|
|
|
-// String collection = "c1";
|
|
|
-// String partition = "p1";
|
|
|
-// GetImportStateResponse reso = GetImportStateResponse.newBuilder()
|
|
|
-// .setState(state)
|
|
|
-// .setRowCount(count)
|
|
|
-// .addIdList(0)
|
|
|
-// .addIdList(99)
|
|
|
-// .addInfos(KeyValuePair.newBuilder()
|
|
|
-// .setKey(Constant.FAILED_REASON)
|
|
|
-// .setValue(reason)
|
|
|
-// .build())
|
|
|
-// .addInfos(KeyValuePair.newBuilder()
|
|
|
-// .setKey(Constant.IMPORT_FILES)
|
|
|
-// .setValue(files)
|
|
|
-// .build())
|
|
|
-// .addInfos(KeyValuePair.newBuilder()
|
|
|
-// .setKey(Constant.IMPORT_COLLECTION)
|
|
|
-// .setValue(collection)
|
|
|
-// .build())
|
|
|
-// .addInfos(KeyValuePair.newBuilder()
|
|
|
-// .setKey(Constant.IMPORT_PARTITION)
|
|
|
-// .setValue(partition)
|
|
|
-// .build())
|
|
|
-// .setDataQueryable(false)
|
|
|
-// .setDataIndexed(false)
|
|
|
-// .build();
|
|
|
-//
|
|
|
-// GetBulkloadStateWrapper wrapper = new GetBulkloadStateWrapper(reso);
|
|
|
-// assertEquals(count, wrapper.getImportedCount());
|
|
|
-// assertEquals(100, wrapper.getAutoGeneratedIDs().size());
|
|
|
-// assertEquals(0, wrapper.getAutoGeneratedIDs().get(0));
|
|
|
-// assertEquals(99, wrapper.getAutoGeneratedIDs().get(99));
|
|
|
-// assertEquals(reason, wrapper.getFailedReason());
|
|
|
-// assertEquals(files, wrapper.getFiles());
|
|
|
-// assertEquals(collection, wrapper.getCollectionName());
|
|
|
-// assertEquals(partition, wrapper.getPartitionName());
|
|
|
-// assertEquals(false, wrapper.queryable());
|
|
|
-// assertEquals(false, wrapper.indexed());
|
|
|
-//
|
|
|
-// assertFalse(wrapper.toString().isEmpty());
|
|
|
-// }
|
|
|
+ @Test
|
|
|
+ void testGetBulkInsertStateWrapper() {
|
|
|
+ long count = 1000;
|
|
|
+ ImportState state = ImportState.ImportStarted;
|
|
|
+ String reason = "unexpected error";
|
|
|
+ String files = "1.json";
|
|
|
+ String collection = "c1";
|
|
|
+ String partition = "p1";
|
|
|
+ String progress = "50";
|
|
|
+ GetImportStateResponse resp = GetImportStateResponse.newBuilder()
|
|
|
+ .setState(state)
|
|
|
+ .setRowCount(count)
|
|
|
+ .addIdList(0)
|
|
|
+ .addIdList(99)
|
|
|
+ .addInfos(KeyValuePair.newBuilder()
|
|
|
+ .setKey(Constant.FAILED_REASON)
|
|
|
+ .setValue(reason)
|
|
|
+ .build())
|
|
|
+ .addInfos(KeyValuePair.newBuilder()
|
|
|
+ .setKey(Constant.IMPORT_FILES)
|
|
|
+ .setValue(files)
|
|
|
+ .build())
|
|
|
+ .addInfos(KeyValuePair.newBuilder()
|
|
|
+ .setKey(Constant.IMPORT_COLLECTION)
|
|
|
+ .setValue(collection)
|
|
|
+ .build())
|
|
|
+ .addInfos(KeyValuePair.newBuilder()
|
|
|
+ .setKey(Constant.IMPORT_PARTITION)
|
|
|
+ .setValue(partition)
|
|
|
+ .build())
|
|
|
+ .addInfos(KeyValuePair.newBuilder()
|
|
|
+ .setKey(Constant.IMPORT_PROGRESS)
|
|
|
+ .setValue(progress)
|
|
|
+ .build())
|
|
|
+ .build();
|
|
|
+
|
|
|
+ GetBulkInsertStateWrapper wrapper = new GetBulkInsertStateWrapper(resp);
|
|
|
+ assertEquals(count, wrapper.getImportedCount());
|
|
|
+ assertEquals(100, wrapper.getAutoGeneratedIDs().size());
|
|
|
+ assertEquals(0, wrapper.getAutoGeneratedIDs().get(0));
|
|
|
+ assertEquals(99, wrapper.getAutoGeneratedIDs().get(99));
|
|
|
+ assertEquals(reason, wrapper.getFailedReason());
|
|
|
+ assertEquals(files, wrapper.getFiles());
|
|
|
+ assertEquals(collection, wrapper.getCollectionName());
|
|
|
+ assertEquals(partition, wrapper.getPartitionName());
|
|
|
+ assertEquals(progress, String.valueOf(wrapper.getProgress()));
|
|
|
+
|
|
|
+ assertFalse(wrapper.toString().isEmpty());
|
|
|
+ }
|
|
|
}
|