mchades commented on code in PR #7215:
URL: https://github.com/apache/gravitino/pull/7215#discussion_r2113624924
##########
catalogs/catalog-hadoop/src/test/java/org/apache/gravitino/catalog/hadoop/integration/test/HadoopCatalogIT.java:
##########
@@ -151,6 +154,16 @@ private void dropSchema() {
Assertions.assertFalse(catalog.asSchemas().schemaExists(schemaName));
}
+ protected void uploadFileIntoFileset(String filesetName, String subPath,
String content) {
Review Comment:
you can make the method signature as
```java
private String getFileInfos(NameIdentifier filesetIdent, String subPath,
String locationName)
```
The return value is the response body string
##########
catalogs/catalog-hadoop/src/test/java/org/apache/gravitino/catalog/hadoop/integration/test/HadoopCatalogIT.java:
##########
@@ -151,6 +154,16 @@ private void dropSchema() {
Assertions.assertFalse(catalog.asSchemas().schemaExists(schemaName));
}
+ protected void uploadFileIntoFileset(String filesetName, String subPath,
String content) {
+ String targetUrl = String.format("/fileset/%s/%s/%s/%s", catalogName,
schemaName, filesetName, subPath);
+ HTTPClient client = HTTPClient.builder(Collections.emptyMap())
Review Comment:
You can change it to a protected member variable `HTTPClient httpClient` of
this class, then initialize it in the `setup` method, and close it in the
`stop` method.
initialize:
```java
httpClient =
HTTPClient.builder(Collections.emptyMap())
.uri(serverUri)
.build();
```
##########
catalogs/catalog-hadoop/src/test/java/org/apache/gravitino/catalog/hadoop/integration/test/HadoopCatalogIT.java:
##########
@@ -656,6 +669,50 @@ public void testListFilesets() throws IOException {
Assertions.assertEquals(fileset2.name(), nameIdentifiers1[1].name());
}
+ @Test
+ public void testListFilesetFiles() throws IOException {
+ // clear schema
+ dropSchema();
+ createSchema();
+
+ String filesetName = "test_list_fileset_files";
+ String storageLocation = storageLocation(filesetName);
+ createFileset(filesetName, "comment", MANAGED, storageLocation,
ImmutableMap.of("k1", "v1"));
+ assertFilesetExists(filesetName);
+
+ String fileName = "test1.txt";
Review Comment:
after creating the fileset, you can use `fileSystem` to prepare some files
or directories for following tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]