Skip to content

Commit 93e9951

Browse files
committed
Do not request DAP4 checksums by default
* Both TDS and Hyrax do not return checksums by default, so change DAP4 * checksum default from True to False. Upgrade Hyrax server test to request/not request/not specify checksum responses
1 parent d6dd515 commit 93e9951

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

dap4/src/main/java/dap4/core/util/ChecksumMode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright 2012, UCAR/Unidata.
3-
* See the LICENSE file for more information.
2+
* Copyright (c) 2012-2026 University Corporation for Atmospheric Research/Unidata
3+
* See LICENSE for license information.
44
*/
55

66
package dap4.core.util;
@@ -14,7 +14,7 @@ public enum ChecksumMode {
1414
FALSE, // => dap4.checksum=false
1515
TRUE; // => dap4.checksum=true
1616

17-
public static final ChecksumMode dfalt = TRUE; // Must be TRUE|FALSE
17+
public static final ChecksumMode dfalt = FALSE; // Must be TRUE|FALSE
1818

1919
static final String[] trues = new String[] {"true", "on", "yes", "1"};
2020
static final String[] falses = new String[] {"false", "off", "no", "0"};

dap4/src/test/java/dap4/test/TestHyrax.java

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright 2012, UCAR/Unidata.
3-
* See the LICENSE file for more information.
2+
* Copyright (c) 2012-2026 University Corporation for Atmospheric Research/Unidata
3+
* See LICENSE for license information.
44
*/
55

66
package dap4.test;
@@ -22,12 +22,6 @@
2222
import java.util.List;
2323
import ucar.unidata.util.test.category.NeedsExternalResource;
2424

25-
/**
26-
* This Test uses the JUNIT Version 4 parameterized test mechanism.
27-
* The set of arguments for each test is encapsulated in a class
28-
* called TestCase. This allows for code re-use and for extending
29-
* tests by adding fields to the TestCase object.
30-
*/
3125

3226
/**
3327
* This test set reads DAP4 datasets (both constrained and not)
@@ -48,7 +42,8 @@ public class TestHyrax extends DapTestCommon implements Dap4ManifestIF {
4842

4943
// Define the input set location(s)
5044
protected static final String INPUTEXT = "";
51-
protected static final String INPUTQUERY = "?dap4.checksum=true";
45+
// request checksums true, false, and default
46+
protected static final String[] INPUTQUERY = new String[] {"?dap4.checksum=true", "?dap4.checksum=false", ""};
5247
protected static final String INPUTFRAG = "#dap4&hyrax";
5348

5449
protected static final String BASELINEDIR = "/baselinehyrax";
@@ -112,14 +107,24 @@ public static List<TestCaseCommon> defineTestCases() {
112107
String file = tuple[0];
113108
String prefix = tuple[1];
114109
String query = tuple[2]; // excluding leading '?'
115-
// Unfortunately, The OPeNDAP test server does not appear to support https:
116-
String url = server.getURL("http:") + "/" + prefix + "/" + file + INPUTEXT + INPUTQUERY;
117-
if (query != null)
118-
url += ("&" + DapConstants.CONSTRAINTTAG + "=" + query);
119-
url += INPUTFRAG;
120-
String baseline = resourceroot + BASELINEDIR + "/" + file + BASELINEEXT;
121-
TestCase tc = new TestCase(file, url, baseline, query);
122-
testcases.add(tc);
110+
for (String IQ : INPUTQUERY) {
111+
// Unfortunately, The OPeNDAP test server does not appear to support https:
112+
String url = server.getURL("http:") + "/" + prefix + "/" + file + INPUTEXT + IQ;
113+
System.out.println(url);
114+
if (query != null) {
115+
if (IQ.isEmpty()) {
116+
url += ("?");
117+
} else {
118+
url += ("&");
119+
}
120+
url += (DapConstants.CONSTRAINTTAG + "=" + query);
121+
}
122+
123+
url += INPUTFRAG;
124+
String baseline = resourceroot + BASELINEDIR + "/" + file + BASELINEEXT;
125+
TestCase tc = new TestCase(file, url, baseline, query);
126+
testcases.add(tc);
127+
}
123128
}
124129
return testcases;
125130
}

0 commit comments

Comments
 (0)