Skip to content

Commit

Permalink
Replace remotetest server constant with TestOnLocalServer constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Tara Drwenski committed Apr 5, 2024
1 parent 014b1af commit 092c18e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 29 deletions.
15 changes: 0 additions & 15 deletions tds-test-utils/src/main/java/thredds/test/util/TdsTestDir.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,11 @@ public abstract class TdsUnitTestCommon {
static final Set<NetcdfDataset.Enhance> ENHANCEMENT = EnumSet.of(NetcdfDataset.Enhance.CoordSystems);

protected static String threddsroot = null;
protected static String threddsServer = null;

static {
// Compute the root path
threddsroot = locateThreddsRoot();
assert threddsroot != null : "Cannot locate /thredds parent dir";
threddsServer = TdsTestDir.remoteTestServer;
if (DEBUG)
System.err.println("TdsUnitTestCommon: threddsServer=" + threddsServer);
}

//////////////////////////////////////////////////
Expand Down
19 changes: 9 additions & 10 deletions tds/src/integrationTests/java/ucar/nc2/dt/fmrc/TestUgridFmrc.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import thredds.test.util.TdsTestDir;
import thredds.test.util.TestOnLocalServer;
import ucar.ma2.Array;
import ucar.ma2.DataType;
import ucar.ma2.InvalidRangeException;
Expand Down Expand Up @@ -49,8 +49,8 @@ public static void openIndividualFiles() {
@Test
@Category(NeedsCdmUnitTest.class)
public void test2DFmrc() throws IOException, InvalidRangeException {
final String urlPath2d = "/thredds/cdmremote/testUsfWsfUgridFmrc/USF_WSF_nc_fmrc.ncd";
final String tdsLocation = "cdmremote:http://" + TdsTestDir.remoteTestServer + urlPath2d;
final String urlPath2d = "cdmremote/testUsfWsfUgridFmrc/USF_WSF_nc_fmrc.ncd";
final String tdsLocation = "cdmremote:http://" + TestOnLocalServer.server + urlPath2d;
String testVariableName = "salinity";
String singleRuntimeSection = ":,2,10:10000:100";
try (NetcdfFile fmrc2d = NetcdfDatasets.openFile(tdsLocation, null)) {
Expand Down Expand Up @@ -80,8 +80,8 @@ public void test2DFmrc() throws IOException, InvalidRangeException {
@Category(NeedsCdmUnitTest.class)
public void testCFOFmrc() throws IOException, InvalidRangeException {
// 8 hour offset into a collection of runs that output hourly
final String urlPathCfo = "/thredds/cdmremote/testUsfWsfUgridFmrc/offset/USF_WSF_nc_Offset_8.0hr";
final String tdsLocation = "cdmremote:http://" + TdsTestDir.remoteTestServer + urlPathCfo;
final String urlPathCfo = "cdmremote/testUsfWsfUgridFmrc/offset/USF_WSF_nc_Offset_8.0hr";
final String tdsLocation = "cdmremote:http://" + TestOnLocalServer.server + urlPathCfo;
String testVariableName = "salinity";
String singleSpatialSection = "2,10:10000:100";
// index 8 => forecast hour 8 since index 0 is forecast hour 0
Expand Down Expand Up @@ -113,9 +113,8 @@ public void testCFOFmrc() throws IOException, InvalidRangeException {
@Category(NeedsCdmUnitTest.class)
public void testCFTFmrc() throws IOException, InvalidRangeException {
// 8 hour offset into a collection of runs that output hourly
final String urlPathCft =
"/thredds/cdmremote/testUsfWsfUgridFmrc/forecast/USF_WSF_nc_ConstantForecast_2019-01-28T03:00:00Z";
final String tdsLocation = "cdmremote:http://" + TdsTestDir.remoteTestServer + urlPathCft;
final String urlPathCft = "cdmremote/testUsfWsfUgridFmrc/forecast/USF_WSF_nc_ConstantForecast_2019-01-28T03:00:00Z";
final String tdsLocation = "cdmremote:http://" + TestOnLocalServer.server + urlPathCft;
String testVariableName = "salinity";
String singleSpatialSection = "2,10:10000:100";
// Forecast time 2019-01-28T03:00:00Z should be the 4th time index into the second granule of the collection
Expand All @@ -141,8 +140,8 @@ public void testCFTFmrc() throws IOException, InvalidRangeException {
@Category(NeedsCdmUnitTest.class)
public void testFMRFmrc() throws IOException, InvalidRangeException {
// the 2019-01-28T00:00:00Z Forecast Model Run should be the same as the second granule that makes up collection.
final String urlPathCft = "/thredds/cdmremote/testUsfWsfUgridFmrc/runs/USF_WSF_nc_RUN_2019-01-28T00:00:00Z";
final String tdsLocation = "cdmremote:http://" + TdsTestDir.remoteTestServer + urlPathCft;
final String urlPathCft = "cdmremote/testUsfWsfUgridFmrc/runs/USF_WSF_nc_RUN_2019-01-28T00:00:00Z";
final String tdsLocation = "cdmremote:http://" + TestOnLocalServer.server + urlPathCft;
String testVariableName = "salinity";
String testSection = ":,2,10:10000:100";
try (NetcdfFile fmrcCfo = NetcdfDatasets.openFile(tdsLocation, null)) {
Expand Down

0 comments on commit 092c18e

Please sign in to comment.