diff --git a/tds/src/integrationTests/java/thredds/server/radar/TestRadarServer.java b/tds/src/integrationTests/java/thredds/server/radar/TestRadarServer.java index 1440f453b9..8200585835 100644 --- a/tds/src/integrationTests/java/thredds/server/radar/TestRadarServer.java +++ b/tds/src/integrationTests/java/thredds/server/radar/TestRadarServer.java @@ -31,7 +31,15 @@ public static java.util.Collection getTestParameters() { // {"/radar/radarCollections.xml"}, {"/radarServer/nexrad/level2/IDD/dataset.xml"}, {"/radarServer/nexrad/level2/IDD/stations.xml"}, {"/radarServer/nexrad/level2/IDD?stn=KDGX&time_start=2014-06-05T12:47:17&time_end=2014-06-05T16:07:17"}, - {"/radarServer/nexrad/level3/IDD/stations.xml"}, {"/radarServer/terminal/level3/IDD/stations.xml"},}); + {"/radarServer/nexrad/level3/IDD/stations.xml"}, {"/radarServer/terminal/level3/IDD/stations.xml"}, + + + // s3 tests + {"/radarServer/s3/nexrad/level2/IDD/dataset.xml"}, {"/radarServer/s3/nexrad/level2/IDD/stations.xml"}, + {"/radarServer/s3/nexrad/level2/IDD?stn=KDGX&time_start=2014-06-05T12:47:17&time_end=2014-06-05T16:07:17"}, + {"/radarServer/s3/nexrad/level3/IDD/stations.xml"}, + + }); } private static final String expectedContentType = "application/xml"; diff --git a/tds/src/integrationTests/java/thredds/server/radar/TestRadarServerQuery.java b/tds/src/integrationTests/java/thredds/server/radar/TestRadarServerQuery.java index a3fb8bd386..cf44184113 100644 --- a/tds/src/integrationTests/java/thredds/server/radar/TestRadarServerQuery.java +++ b/tds/src/integrationTests/java/thredds/server/radar/TestRadarServerQuery.java @@ -10,62 +10,77 @@ import org.jdom2.xpath.XPathFactory; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; import thredds.test.util.TestOnLocalServer; import thredds.util.xml.XmlUtil; import ucar.unidata.util.test.category.NeedsCdmUnitTest; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.List; import static com.google.common.truth.Truth.assertThat; @Category(NeedsCdmUnitTest.class) +@RunWith(Parameterized.class) public class TestRadarServerQuery { private static final Namespace NS = Namespace.getNamespace("ns", "http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0"); - private static final String L2_URL = "/radarServer/nexrad/level2/IDD"; - private static final String L3_URL = "/radarServer/nexrad/level3/IDD"; + + private final String l2Url; + private final String l3Url; + + @Parameterized.Parameters(name = "{0}") + public static List getTestParameters() { + return Arrays.asList("", "s3/"); + } + + public TestRadarServerQuery(String datasetPathPrefix) { + l2Url = "/radarServer/" + datasetPathPrefix + "nexrad/level2/IDD"; + l3Url = "/radarServer/" + datasetPathPrefix + "nexrad/level3/IDD"; + } @Test public void shouldReturnAllDatasetsForStation() throws IOException, JDOMException { - String endpoint = L2_URL + "?stn=KDGX&temporal=all"; + String endpoint = l2Url + "?stn=KDGX&temporal=all"; verifyNumberOfDatasets(endpoint, 3); } @Test public void shouldReturnZeroDatasetsForNonOverlappingTimeRange() throws IOException, JDOMException { - String endpoint = L2_URL + "?stn=KDGX&time_start=2000-01-01T12:00:00&time_end=2001-01-01T12:00:00"; + String endpoint = l2Url + "?stn=KDGX&time_start=2000-01-01T12:00:00&time_end=2001-01-01T12:00:00"; verifyNumberOfDatasets(endpoint, 0); } @Test public void shouldReturnOneDatasetForOverlappingTimeRange() throws IOException, JDOMException { - String endpoint = L2_URL + "?stn=KDGX&time_start=2014-06-02T23:52:00&time_end=2014-06-02T23:53:00"; + String endpoint = l2Url + "?stn=KDGX&time_start=2014-06-02T23:52:00&time_end=2014-06-02T23:53:00"; verifyNumberOfDatasets(endpoint, 1); } @Test public void shouldReturnOneDatasetForOverlappingTimeDuration() throws IOException, JDOMException { - String endpoint = L2_URL + "?stn=KDGX&time_start=2014-06-02T23:52:00&time_duration=PT1M"; + String endpoint = l2Url + "?stn=KDGX&time_start=2014-06-02T23:52:00&time_duration=PT1M"; verifyNumberOfDatasets(endpoint, 1); } @Test public void shouldReturnOneDatasetForTime() throws IOException, JDOMException { - String endpoint = L2_URL + "?stn=KDGX&time=2014-06-02T23:52:00"; + String endpoint = l2Url + "?stn=KDGX&time=2014-06-02T23:52:00"; verifyNumberOfDatasets(endpoint, 1); } @Test public void shouldReturnZeroDatasetsForNonExistentStation() throws IOException, JDOMException { - String endpoint = L2_URL + "?stn=ABCD&temporal=all"; + String endpoint = l2Url + "?stn=ABCD&temporal=all"; verifyNumberOfDatasets(endpoint, 0); } @Test public void shouldReturnErrorForNonOverlappingBox() throws IOException, JDOMException { - String endpoint = L2_URL + "?north=10&south=0&west=-100&east=-80&temporal=all"; + String endpoint = l2Url + "?north=10&south=0&west=-100&east=-80&temporal=all"; byte[] result = TestOnLocalServer.getContent(TestOnLocalServer.withHttpPath(endpoint), HttpServletResponse.SC_OK, "text/plain;charset=iso-8859-1"); assertThat(new String(result, StandardCharsets.UTF_8)).isEqualTo("No stations found for specified coordinates."); @@ -73,25 +88,25 @@ public void shouldReturnErrorForNonOverlappingBox() throws IOException, JDOMExce @Test public void shouldReturnAllDatasetsForOverlappingBox() throws IOException, JDOMException { - String endpoint = L2_URL + "?north=50&south=30&west=-100&east=-80&temporal=all"; + String endpoint = l2Url + "?north=50&south=30&west=-100&east=-80&temporal=all"; verifyNumberOfDatasets(endpoint, 3); } @Test public void shouldReturnAllDatasetsForLonLat() throws IOException, JDOMException { - String endpoint = L2_URL + "?latitude=30&longitude=-90&temporal=all"; + String endpoint = l2Url + "?latitude=30&longitude=-90&temporal=all"; verifyNumberOfDatasets(endpoint, 3); } @Test public void shouldReturnAllLevel3Datasets() throws IOException, JDOMException { - String endpoint = L3_URL + "?temporal=all&var=N0R&stn=UDX"; + String endpoint = l3Url + "?temporal=all&var=N0R&stn=UDX"; verifyNumberOfDatasets(endpoint, 329); } @Test public void shouldReturnErrorWithoutVar() throws IOException, JDOMException { - String endpoint = L3_URL + "?temporal=all&stn=UDX"; + String endpoint = l3Url + "?temporal=all&stn=UDX"; byte[] result = TestOnLocalServer.getContent(TestOnLocalServer.withHttpPath(endpoint), HttpServletResponse.SC_OK, "text/plain;charset=iso-8859-1"); assertThat(new String(result, StandardCharsets.UTF_8)).isEqualTo("One or more variables required."); diff --git a/tds/src/test/content/thredds/radar/radarCollections.xml b/tds/src/test/content/thredds/radar/radarCollections.xml index e0e14e35f0..eece1ab041 100644 --- a/tds/src/test/content/thredds/radar/radarCollections.xml +++ b/tds/src/test/content/thredds/radar/radarCollections.xml @@ -47,6 +47,46 @@ + + + + Radial + NEXRAD2 + radarServer + NEXRAD Level II Radar WSR-88D for Case Study CCS039. + + 1998-06-29T18:00:00 + 1998-06-29T23:00:00 + + + + + + + + + nexrad/level2/CCS039 + + + 37.0 + 9.0 + degrees_north + + + -100.0 + 16.0 + degrees_east + + + 0.0 + 21.0 + km + + + + + @@ -169,6 +209,129 @@ + + + + Radial + NIDS + radarServer + + The NIDS data feed provides roughly 20 radar products sent every 5-10 minutes from 154 sites over NOAAPORT broadcast. These "derived" products include base reflectivity and velocity, composite reflectivity, precipitation estimates, echo tops and VAD winds + + + + + DOC/NOAA/NWS + + + + + 20.0 + 40.0 + degrees_north + + + -135.0 + 70.0 + degrees_east + + + 0.0 + 0.0 + km + + + + present + 14 days + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +