Skip to content

Commit

Permalink
Add test for opening an ncml file with xml extension and change expec…
Browse files Browse the repository at this point in the history
…ted behavior for file with other extension
  • Loading branch information
Tara Drwenski committed Dec 29, 2023
1 parent 3cf8964 commit 4e7044c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tds/src/integrationTests/java/thredds/tds/TestS3Ncml.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,23 @@ public void shouldOpenNcmlOnS3() {
}

@Test
public void shouldOpenNcmlWithOtherExtensionOnS3() {
final String endpoint = TestOnLocalServer.withHttpPath(S3_NCML_PATH + "testStandaloneNcml.otherExt.ascii?time");
public void shouldOpenNcmlWithXmlExtensionOnS3() {
final String endpoint = TestOnLocalServer.withHttpPath(S3_NCML_PATH + "testStandalone.xml.ascii?time");
final byte[] content = TestOnLocalServer.getContent(endpoint, HttpServletResponse.SC_OK);
final String stringContent = new String(content, StandardCharsets.UTF_8);

assertThat(stringContent).contains("time[2]");
assertThat(stringContent).contains("6, 18");
}

@Test
public void shouldOpenNcmlWithOtherExtensionOnS3() {
// Can't currently open an S3 NcML file with an extension other than xml or ncml.
// Peaking inside the file to check if it's ncml is too slow
final String endpoint = TestOnLocalServer.withHttpPath(S3_NCML_PATH + "testStandaloneNcml.otherExt.ascii?time");
TestOnLocalServer.getContent(endpoint, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}

@Test
public void shouldOpenAggregationWithRelativePathsOnS3() {
final String endpoint = TestOnLocalServer.withHttpPath(S3_NCML_PATH + "nc/namExtract/test_agg.ncml.ascii?time");
Expand Down

0 comments on commit 4e7044c

Please sign in to comment.