diff --git a/dap4/build.gradle b/dap4/build.gradle index fd4e9da1d7..18834c9aed 100644 --- a/dap4/build.gradle +++ b/dap4/build.gradle @@ -2,20 +2,6 @@ ext.title = 'Data Access Protocol (DAP) version 4.0' // Will be inherited by su // dap4 has no source code nor any artifacts to publish -// NON-TRANSITIVE Dependency graph: -// module depends on -// ---------------------------------------- -// common: -// d4core nothing -// d4lib d4core httpservices -// d4cdm d4lib cdm -// server: -// d4servletshared d4cdmshared netcdf4 -// d4ts d4servletshared -// d4tswar d4ts -// tests: -// d4tests d4servletshared d4ts - subprojects { // TODO: Give the subprojects real titles. ext.title = "DAP4: $name" diff --git a/dap4/d4servlet/build.gradle b/dap4/d4servlet/build.gradle index 406ccf6de3..e5c57fec19 100644 --- a/dap4/d4servlet/build.gradle +++ b/dap4/d4servlet/build.gradle @@ -4,9 +4,10 @@ apply from: "$rootDir/gradle/any/java-published.gradle" dependencies { implementation enforcedPlatform(project(':tds-platform')) - compile 'edu.ucar:dap4' - compile 'edu.ucar:httpservices' + implementation 'edu.ucar:dap4' + implementation 'edu.ucar:httpservices' + implementation 'edu.ucar:cdm-core' compileOnly 'jakarta.servlet:jakarta.servlet-api' - compile 'org.slf4j:slf4j-api' + compileOnly 'org.slf4j:slf4j-api' } diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/CDMDMR.java b/dap4/d4servlet/src/main/java/dap4/servlet/CDMDMR.java new file mode 100644 index 0000000000..78c179516f --- /dev/null +++ b/dap4/d4servlet/src/main/java/dap4/servlet/CDMDMR.java @@ -0,0 +1,84 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.servlet; + +import dap4.core.dmr.*; + +public class CDMDMR { + ////////////////////////////////////////////////// + + public static class CDMAttribute extends DapAttribute { + public CDMAttribute(String name, DapType basetype) { + super(name, basetype); + } + } + + public static class CDMAttributeSet extends DapAttributeSet { + public CDMAttributeSet(String name) { + super(name); + } + } + + public static class CDMDimension extends DapDimension { + public CDMDimension(String name, long size) { + super(name, size); + } + } + + public static class CDMMap extends DapMap { + public CDMMap(String target) { + super(target); + } + } + + public abstract static class CDMVariable extends DapVariable { + public CDMVariable(String name, DapType t) { + super(name, t); + } + } + + public static class CDMGroup extends DapGroup { + public CDMGroup(String name) { + super(name); + } + } + + public static class CDMDataset extends DapDataset { + public CDMDataset(String name) { + super(name); + } + } + + public static class CDMEnumeration extends DapEnumeration { + public CDMEnumeration(String name, DapType basetype) { + super(name, basetype); + } + } + + public static class CDMEnumConst extends DapEnumConst { + public CDMEnumConst(String name, long value) { + super(name, value); + } + } + + public static class CDMStructure extends DapStructure { + public CDMStructure(String name) { + super(name); + } + } + + public static class CDMSequence extends DapSequence { + public CDMSequence(String name) { + super(name); + } + } + + public static class CDMOtherXML extends DapOtherXML { + public CDMOtherXML(String name) { + super(name); + } + } +} diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/CDMData.java b/dap4/d4servlet/src/main/java/dap4/servlet/CDMData.java new file mode 100644 index 0000000000..7a3c5a40b8 --- /dev/null +++ b/dap4/d4servlet/src/main/java/dap4/servlet/CDMData.java @@ -0,0 +1,375 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.servlet; + +import dap4.core.dmr.*; +import dap4.core.interfaces.ArrayScheme; +import dap4.core.util.*; +import dap4.dap4lib.D4Index; +import dap4.dap4lib.cdm.CDMTypeFcns; +import dap4.dap4lib.cdm.CDMUtil; +import ucar.ma2.*; + +import java.util.List; + +/** + * Wrap a CDM Array and metadata to provide a DAP4 read API + */ + +public class CDMData { + + ////////////////////////////////////////////////// + // Instance variables + protected ArrayScheme scheme; + protected CDMWrap cdmwrap; + protected DapNode template; + protected CDMData container; + + protected ucar.ma2.Array array = null; + protected ucar.ma2.StructureData structdata = null; // scheme == STRUCTURE + ucar.ma2.StructureMembers.Member member = null; // for field cursors + + protected long recordindex = -1; + protected long recordcount = -1; + protected Index index = null; + + ////////////////////////////////////////////////// + // Constructor(s) + + public CDMData(ArrayScheme scheme, CDMWrap c4, DapNode template, CDMData container) throws DapException { + this.scheme = scheme; + this.cdmwrap = c4; + this.template = template; + this.container = container; + } + + public CDMData(CDMData c) { + assert false; + this.array = c.array; + this.structdata = c.structdata; + this.member = c.member; + + } + + ////////////////////////////////////////////////// + // Get/Set + + public ArrayScheme getScheme() { + return this.scheme; + } + + public CDMWrap getCDMWrap() { + return this.cdmwrap; + } + + public DapNode getTemplate() { + return this.template; + } + + public CDMData getContainer() { + return this.container; + } + + public long getRecordIndex() { + return this.recordindex; + } + + public long getRecordCount() { + return this.recordcount; + } + + public Index getIndex() { + return this.index; + } + + public CDMData setRecordIndex(long index) { + this.recordindex = index; + return this; + } + + public CDMData setRecordCount(long count) { + this.recordcount = count; + return this; + } + + public CDMData setIndex(Index count) { + this.index = count; + return this; + } + + ////////////////////////////////////////////////// + + public Object read(List slices) throws DapException { + switch (this.scheme) { + case ATOMIC: + return readAtomic(slices); + case STRUCTURE: + if (((DapVariable) this.getTemplate()).getRank() > 0 || DapUtil.isScalarSlices(slices)) + throw new DapException("Cannot slice a scalar variable"); + CDMData[] instances = new CDMData[1]; + instances[0] = this; + return instances; + case SEQUENCE: + if (((DapVariable) this.getTemplate()).getRank() > 0 || DapUtil.isScalarSlices(slices)) + throw new DapException("Cannot slice a scalar variable"); + instances = new CDMData[1]; + instances[0] = this; + return instances; + case STRUCTARRAY: + Odometer odom = OdometerFactory.factory(slices, ((DapVariable) this.getTemplate()).getDimensions()); + instances = new CDMData[(int) odom.totalSize()]; + for (int i = 0; odom.hasNext(); i++) { + instances[i] = readStructure(odom.next()); + } + return instances; + case SEQARRAY: + instances = readSequence(slices); + return instances; + default: + throw new DapException("Attempt to slice a scalar object"); + } + } + + public Object read(Index index) throws DapException { + return read(D4Index.indexToSlices(index)); + } + + public CDMData readField(int findex) throws DapException { + if (this.scheme != scheme.RECORD && this.scheme != scheme.STRUCTURE) + throw new DapException("Illegal cursor scheme for readfield()"); + DapVariable var = (DapVariable) getTemplate(); + DapStructure basetype = (DapStructure) var.getBaseType(); + if (findex < 0 || findex >= basetype.getFields().size()) + throw new DapException("Field index out of range: " + findex); + CDMData fieldcursor = null; + if (this.scheme == ArrayScheme.RECORD) { + DapSequence seq = (DapSequence) basetype; + DapVariable field = seq.getField(0); + DapType fieldtype = field.getBaseType(); + switch (fieldtype.getTypeSort()) { + default: // atomic + DataType cdmfieldtype = CDMTypeFcns.daptype2cdmtype(fieldtype); + if (cdmfieldtype == null) + throw new dap4.core.util.DapException("Unknown field type: " + fieldtype); + int ri = (int) this.recordindex; + Object o = array.getObject(ri); + Array fielddata = CDMTypeFcns.arrayify(cdmfieldtype, o); // not very efficient; should do conversion + fieldcursor = new CDMData(ArrayScheme.ATOMIC, getCDMWrap(), field, this); + fieldcursor.setArray(fielddata); + break; + case Sequence: + case Structure: + break; + } + } else { // scheme == STRUCTURE + assert this.structdata != null; + fieldcursor = getFieldCursor(this, findex); + } + return fieldcursor; + } + + protected CDMData getFieldCursor(CDMData container, int findex) throws DapException { + // Now, create a cursors for a field f this instance + DapVariable var = (DapVariable) getTemplate(); + DapStructure type = (DapStructure) var.getBaseType(); + DapVariable field = (DapVariable) type.getFields().get(findex); + DapType ftype = field.getBaseType(); + ArrayScheme scheme = schemeFor(field); + CDMData fc = new CDMData(scheme, (CDMWrap) getCDMWrap(), field, this); + StructureMembers.Member member = this.structdata.getStructureMembers().getMember(findex); + fc.setMember(member); + fc.setArray(this.structdata.getArray(fc.member)); + return fc; + } + + public boolean isScalar() { + if (getTemplate().getSort().isVar()) { + return ((DapVariable) getTemplate()).getRank() == 0; + } else + return false; + } + + + public boolean isField() { + return getTemplate().getContainer() != null; + } + + public boolean isAtomic() { + boolean is = this.scheme == ArrayScheme.ATOMIC; + assert !is || getTemplate().getSort() == DapSort.ATOMICTYPE || (getTemplate().getSort() == DapSort.VARIABLE + && ((DapVariable) getTemplate()).getBaseType().getTypeSort().isAtomic()); + return is; + } + + public boolean isCompound() { + boolean is = (this.scheme == ArrayScheme.SEQUENCE || this.scheme == ArrayScheme.STRUCTURE); + assert !is || getTemplate().getSort() == DapSort.SEQUENCE || getTemplate().getSort() == DapSort.STRUCTURE + || (getTemplate().getSort() == DapSort.VARIABLE + && ((DapVariable) getTemplate()).getBaseType().getTypeSort().isCompoundType()); + return is; + } + + public boolean isCompoundArray() { + boolean is = (this.scheme == ArrayScheme.SEQARRAY || this.scheme == ArrayScheme.STRUCTARRAY); + assert !is || getTemplate().getSort() == DapSort.SEQUENCE || getTemplate().getSort() == DapSort.STRUCTURE + || (getTemplate().getSort() == DapSort.VARIABLE + && ((DapVariable) getTemplate()).getBaseType().getTypeSort().isCompoundType()); + return is; + } + + protected static ArrayScheme schemeFor(DapVariable field) { + DapType ftype = field.getBaseType(); + ArrayScheme scheme = null; + boolean isscalar = field.getRank() == 0; + if (ftype.getTypeSort().isAtomic()) + scheme = ArrayScheme.ATOMIC; + else { + if (ftype.getTypeSort().isStructType()) + scheme = ArrayScheme.STRUCTARRAY; + else if (ftype.getTypeSort().isSeqType()) + scheme = ArrayScheme.SEQARRAY; + } + return scheme; + } + + public CDMData readRecord(long i) throws DapException { + if (this.scheme != scheme.SEQUENCE) + throw new DapException("Attempt to read record from non-sequence cursor"); + if (i < 0 || i >= this.recordcount) + throw new DapException("Record index out of bounds"); + DapVariable var = (DapVariable) getTemplate(); + CDMData c = new CDMData(ArrayScheme.RECORD, getCDMWrap(), var, this); + c.setArray(this.array); + c.setRecordIndex(i); + return c; + } + + public int fieldIndex(String name) throws DapException { + DapStructure ds; + if (getTemplate().getSort().isCompound()) + ds = (DapStructure) getTemplate(); + else if (getTemplate().getSort().isVar() && (((DapVariable) getTemplate()).getBaseType().getSort().isCompound())) + ds = (DapStructure) ((DapVariable) getTemplate()).getBaseType(); + else + throw new DapException("Attempt to get field name on non-compound object"); + int i = ds.indexByName(name); + if (i < 0) + throw new DapException("Unknown field name: " + name); + return i; + } + + + ////////////////////////////////////////////////// + // Support Methods + + protected Object readAtomic(List slices) throws DapException { + if (slices == null) + throw new DapException("CDMCursor.read: null set of slices"); + assert (this.scheme == scheme.ATOMIC); + DapVariable atomvar = (DapVariable) getTemplate(); + assert slices != null && ((atomvar.getRank() == 0 && slices.size() == 1) || (slices.size() == atomvar.getRank())); + return sliceAtomic(slices, this.array, atomvar); + } + + protected Object sliceAtomic(List slices, Array array, DapVariable var) throws DapException { + List dimset = var.getDimensions(); + DapType basetype = var.getBaseType(); + // If content.getDataType returns object, then we + // really do not know its true datatype. So, as a rule, + // we will rely on this.basetype. + DataType datatype = CDMTypeFcns.daptype2cdmtype(basetype); + if (datatype == null) + throw new dap4.core.util.DapException("Unknown basetype: " + basetype); + Object content = array.get1DJavaArray(datatype); // not very efficient; should do conversion + Odometer odom = OdometerFactory.factory(slices, dimset); + Object data = CDMTypeFcns.createVector(datatype, odom.totalSize()); + for (int dstoffset = 0; odom.hasNext(); dstoffset++) { + D4Index index = odom.next(); + long srcoffset = index.index(); + CDMTypeFcns.vectorcopy(basetype, content, data, srcoffset, dstoffset); + } + return data; + } + + + protected CDMData readStructure(Index index) throws DapException { + assert (index != null); + DapVariable var = (DapVariable) getTemplate(); + DapStructure type = (DapStructure) var.getBaseType(); + int pos = index.currentElement(); + if (pos < 0 || pos > var.getCount()) + throw new IndexOutOfBoundsException("read: " + index); + ArrayStructure sarray = (ArrayStructure) this.array; + CDMData instance; + assert (this.scheme == scheme.STRUCTARRAY); + ucar.ma2.StructureData sd = sarray.getStructureData((int) pos); + assert sd != null; + instance = new CDMData(ArrayScheme.STRUCTURE, getCDMWrap(), var, null).setStructureData(sd); + instance.setIndex(index); + return instance; + } + + protected CDMData[] readSequence(List slices) throws DapException { + assert (this.scheme == scheme.SEQARRAY); + DapVariable var = (DapVariable) getTemplate(); + DapSequence type = (DapSequence) var.getBaseType(); + // new CDMCursor(Scheme.SEQUENCE, (CDMDSP) this.dsp, var, this); + CDMData[] instances = new CDMData[(int) DapUtil.sliceProduct(slices)]; + Array seqarray = this.array; + if (var.getRank() == 0) {// scalar + if (!DapUtil.isScalarSlices(slices)) + throw new DapException("Non-scalar slice set applied to scalar variable"); + instances[0] = new CDMData(ArrayScheme.SEQUENCE, getCDMWrap(), var, this); + instances[0].setArray(seqarray); + instances[0].setRecordCount(seqarray.getSize()); + } else { + List rlist = CDMUtil.createCDMRanges(slices); + Array instancearray; + try { + instancearray = seqarray.section(rlist); + } catch (InvalidRangeException e) { + throw new DapException("Illegal slice set", e); + } + // extracted via List. IN theory, this should be an array of arrays, + // but if the sequence field basetype is atomic, thenit is an array + // of atomic values. + int slicecount = (int) DapUtil.sliceProduct(slices); + for (int i = 0; i < slicecount; i++) { + Array ao = (Array) instancearray.getObject(i); + CDMData c = new CDMData(ArrayScheme.SEQUENCE, getCDMWrap(), var, this); + c.setArray(ao); + long rcount = ao.getSize(); + c.setRecordCount(rcount); + instances[i] = c; + } + } + return instances; + } + + ////////////////////////////////////////////////// + // CDMCursor Extensions + + public CDMData setArray(ucar.ma2.Array a) { + this.array = a; + return this; + } + + public ucar.ma2.Array getArray() { + return this.array; + } + + public CDMData setStructureData(ucar.ma2.StructureData sd) { + this.structdata = sd; + return this; + } + + public CDMData setMember(ucar.ma2.StructureMembers.Member m) { + this.member = m; + return this; + } + + +} diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/CDMWrap.java b/dap4/d4servlet/src/main/java/dap4/servlet/CDMWrap.java new file mode 100644 index 0000000000..fe0dcea1ab --- /dev/null +++ b/dap4/d4servlet/src/main/java/dap4/servlet/CDMWrap.java @@ -0,0 +1,1065 @@ +/* + * Copyright (c) 2012-2018 University Corporation for Atmospheric Research/Unidata + * See LICENSE for license information. + */ + +package dap4.servlet; + +import dap4.core.interfaces.ArrayScheme; +import dap4.dap4lib.cdm.CDMTypeFcns; +import dap4.dap4lib.cdm.CDMUtil; +import dap4.dap4lib.cdm.NodeMap; +import dap4.core.dmr.*; +import dap4.core.util.*; +import ucar.ma2.Array; +import ucar.ma2.DataType; +import ucar.ma2.IndexIterator; +import ucar.nc2.*; +import ucar.nc2.constants.CDM; +import ucar.nc2.dataset.*; +import ucar.nc2.util.CancelTask; +import java.io.IOException; +import java.util.*; +import ucar.nc2.write.CDLWriter; + +/** + * Wrap CDM source (NetcdfDataset) to Provide a DAP4 API. + * More or less the inverse of a DSP. + * This basically means wrapping various (CDM)Array + * object to look like DataVariable objects. + */ + +public class CDMWrap { + + ////////////////////////////////////////////////// + // Constants + + protected static final boolean DEBUG = false; + protected static final boolean DUMPCDL = false; + + // NetcdfDataset enhancement to use: need only coord systems + protected static Set ENHANCEMENT = EnumSet.of(NetcdfDataset.Enhance.CoordSystems); + + protected static final String FILLVALUE = "_FillValue"; + + ////////////////////////////////////////////////// + // Class variables + + protected static boolean nc4loaded = false; + + ////////////////////////////////////////////////// + // Instance variables + + protected String location = null; + protected NetcdfDataset ncdfile = null; + protected boolean closed = false; + protected DapDataset dmr = null; + + protected DMRFactory dmrfactory = null; + + // Keep various context-dependent maps between + // CDMNode instances and DapNode instances + // package access + + // Variable map + protected NodeMap varmap = new NodeMap<>(); + + protected Map variables = new HashMap<>(); + + + // Variable <-> DapStructure (basetype) map; compound types only + protected NodeMap compoundmap = new NodeMap<>(); + + // Map Variable <-> DapSequence vlen type + protected NodeMap vlenmap = new NodeMap<>(); + + // Map All other kinds of CDMNode <-> DapNode + protected NodeMap nodemap = new NodeMap<>(); + + ////////////////////////////////////////////////// + // Constructor(s) + + public CDMWrap() {} + + + ////////////////////////////////////////////////// + // Get/Set + + public DapDataset getDMR() { + return this.dmr; + } + + public CDMWrap setDMR(DapDataset dmr) { + this.dmr = dmr; + if (getDMR() != null) { + // Add some canonical attributes to the + getDMR().setDataset(getDMR()); + getDMR().setDapVersion(DapConstants.X_DAP_VERSION); + getDMR().setDMRVersion(DapConstants.X_DMR_VERSION); + getDMR().setNS(DapConstants.X_DAP_NS); + } + return this; + } + + public String getLocation() { + return this.location; + } + + public CDMWrap setLocation(String path) { + this.location = path; + return this; + } + + public CDMData getVariableData(DapVariable var) throws DapException { + Variable cdmvar = this.varmap.get(var); + if (cdmvar == null) + throw new DapException("Unknown variable: " + var); + CDMData vardata = this.variables.get(var); + if (vardata == null) { + ArrayScheme scheme = ArrayScheme.schemeFor(var); + try { + vardata = new CDMData(scheme, this, var, null); + vardata.setArray(cdmvar.read()); + } catch (IOException e) { + throw new DapException(e); + } + addVariableData(var, vardata); + } + return vardata; + } + + public void addVariableData(DapVariable var, CDMData cursor) { + this.variables.put(var, cursor); + } + + + public NetcdfDataset getNetcdfDataset() { + return this.ncdfile; + } + + ////////////////////////////////////////////////// + // Open/Close + + /** + * @param filepath - absolute path to a file + * @return CDMDSP instance + * @throws DapException + */ + public CDMWrap open(String filepath) throws DapException { + try { + NetcdfFile ncfile = createNetcdfFile(filepath, null); + NetcdfDataset ncd = new NetcdfDataset(ncfile, ENHANCEMENT); + return open(ncd); + } catch (IOException ioe) { + throw new DapException("CDMDSP: cannot process: " + filepath, ioe); + } + } + + /** + * @param ncd netcdf dataset + * @return the cdmdsp + * @throws DapException + */ + public CDMWrap open(NetcdfDataset ncd) throws DapException { + this.dmrfactory = new DMRFactory(); + this.ncdfile = ncd; + setLocation(this.ncdfile.getLocation()); + buildDMR(); + return this; + } + + public void close() throws IOException { + if (this.ncdfile != null) + this.ncdfile.close(); + } + + + ////////////////////////////////////////////////// + // Nodemap Management + + /* + * Make sure that we use the proper + * object in order to avoid identity + * problems. + */ + + /** + * Track generic CDMNode <-> DapNode + */ + protected void recordNode(CDMNode cdm, DapNode dap) { + assert this.nodemap.get(cdm) == null && this.nodemap.get(dap) == null; + this.nodemap.put(cdm, dap); + } + + /** + * Track Variable <-> DapVariable + */ + protected void recordVar(Variable cdm, DapVariable dap) { + cdm = CDMUtil.unwrap(cdm); + assert varmap.get(cdm) == null && varmap.get(dap) == null; + varmap.put(cdm, dap); + } + + /** + * Track Variable <-> DapStructure + */ + protected void recordStruct(Variable cdm, DapStructure dap) { + cdm = CDMUtil.unwrap(cdm); + assert this.nodemap.get(cdm) == null && this.nodemap.get(dap) == null; + compoundmap.put(cdm, dap); + } + + /** + * Track Variable <-> DapSequence + */ + protected void recordSeq(Variable cdm, DapSequence dap) { + cdm = CDMUtil.unwrap(cdm); + assert this.vlenmap.get(cdm) == null && this.vlenmap.get(dap) == null; + vlenmap.put(cdm, dap); + } + + /** + * Lookup a cdmnode in the cdmnodemap. + * Make sure that we use the proper + * object in order to avoid identity + * problems. + * + * @param cdmnode The CMDNode (variable, dimension, etc) to record + * @return The DapNode to which the cdmnode is to be mapped or null. + */ + /* + * protected DapNode + * lookupNode(CDMNode cdmnode) + * { + * CDMSort sort = cdmnode.getSort(); + * if(sort == CDMSort.VARIABLE || sort == CDMSort.STRUCTURE) { + * Variable basev = CDMUtil.unwrap((Variable) cdmnode); + * assert (basev != null) : "Unwrap() failed"; + * cdmnode = (CDMNode) basev; + * } + * return this.nodemap.get(cdmnode); + * } + */ + + ////////////////////////////////////////////////// + + /** + * Extract the metadata from the NetcdfDataset + * and build the DMR. + */ + + public void buildDMR() throws DapException { + if (getDMR() != null) + return; + try { + if (DUMPCDL) { + System.out.println("writecdl:"); + CDLWriter.writeCDL(this.ncdfile, System.out, false); + System.out.flush(); + } + // Use the file path to define the dataset name + String name = this.ncdfile.getLocation(); + // Normalize the name + name = DapUtil.canonicalpath(name); + // Remove any path prefix + int index = name.lastIndexOf('/'); + if (index >= 0) + name = name.substring(index + 1, name.length()); + // Initialize the root dataset node + setDMR((DapDataset) this.dmrfactory.newDataset(name).annotate(NetcdfDataset.class, this.ncdfile)); + // Map the CDM root group to this group + recordNode(this.ncdfile.getRootGroup(), getDMR()); + getDMR().setBase(DapUtil.canonicalpath(this.ncdfile.getLocation())); + + // Now recursively build the tree. Start by + // Filling the dataset with the contents of the ncfile + // root group. + fillgroup(getDMR(), this.ncdfile.getRootGroup()); + + // Add an order index to the tree + getDMR().sort(); + + // Now locate the coordinate variables for maps + + /* Walk looking for VariableDS instances */ + processmappedvariables(this.ncdfile.getRootGroup()); + + // Now set the view + getDMR().finish(); + + } catch (DapException e) { + setDMR(null); + throw new DapException(e); + } + } + + ////////////////////////////////////////////////// + // Actions + + protected void fillgroup(DapGroup dapgroup, Group cdmgroup) throws DapException { + // Create decls in dap group for Dimensions + for (Dimension cdmdim : cdmgroup.getDimensions()) { + DapDimension dapdim = builddim(cdmdim); + } + // Create decls in dap group for Enumerations + for (EnumTypedef cdmenum : cdmgroup.getEnumTypedefs()) { + String name = cdmenum.getShortName(); + DapEnumeration dapenum = buildenum(cdmenum); + dapenum.setShortName(name); + dapgroup.addDecl(dapenum); + } + // Create decls in dap group for vlen induced Sequences + // Do this before building compound types + for (Variable cdmvar0 : cdmgroup.getVariables()) { + Variable cdmvar = CDMUtil.unwrap(cdmvar0); + buildseqtypes(cdmvar); + } + // Create decls in dap group for Compound Types + for (Variable cdmvar0 : cdmgroup.getVariables()) { + Variable cdmvar = CDMUtil.unwrap(cdmvar0); + if (cdmvar.getDataType() != DataType.STRUCTURE && cdmvar.getDataType() != DataType.SEQUENCE) + continue; + DapStructure struct = buildcompoundtype(cdmvar, dapgroup); + } + + // Create decls in dap group for Variables + for (Variable cdmvar0 : cdmgroup.getVariables()) { + Variable cdmvar = CDMUtil.unwrap(cdmvar0); + DapNode newvar = buildvariable(cdmvar, dapgroup, cdmvar.getDimensions()); + } + // Create decls in dap group for subgroups + for (Group subgroup : cdmgroup.getGroups()) { + DapGroup newgroup = buildgroup(subgroup); + dapgroup.addDecl(newgroup); + } + // Create decls in dap group for group-level attributes + buildattributes(dapgroup, cdmgroup.attributes()); + } + + ////////////////////////////////////////////////// + // Declaration Builders + + protected DapDimension builddim(Dimension cdmdim) throws DapException { + if (cdmdim.isVariableLength()) + throw new DapException("* dimensions not supported"); + DapDimension dapdim = null; + long cdmsize = dapsize(cdmdim); + String name = cdmdim.getShortName(); + if (name != null && name.length() == 0) + name = null; + boolean shared = cdmdim.isShared(); + if (!shared) { + // Unlike the parser, since we are working + // from a NetcdfDataset instance, there might + // be multiple anonymous dimension objects + // the same size. So, just go ahead and create + // multiple instances. + dapdim = (DapDimension) dmrfactory.newDimension(null, cdmsize); + getDMR().addDecl(dapdim); + } else { // Non anonymous; create in current group + dapdim = (DapDimension) dmrfactory.newDimension(name, cdmsize); + dapdim.setShared(true); + if (cdmdim.isUnlimited()) { + dapdim.setUnlimited(true); + } + Group cdmparent = cdmdim.getGroup(); + DapGroup dapparent = (DapGroup) this.nodemap.get(cdmparent); + assert dapparent != null; + assert (dapparent != null); + dapparent.addDecl(dapdim); + } + recordNode(cdmdim, dapdim); + return dapdim; + } + + protected DapEnumeration buildenum(EnumTypedef cdmenum) throws DapException { + // Set the enum's basetype + DapType base = null; + switch (cdmenum.getBaseType()) { + case ENUM1: + base = DapType.INT8; + break; + case ENUM2: + base = DapType.INT16; + break; + case ENUM4: + default: + base = DapType.INT32; + break; + } + DapEnumeration dapenum = (DapEnumeration) dmrfactory.newEnumeration(cdmenum.getShortName(), base); + recordNode(cdmenum, dapenum); + // Create the enum constants + Map ecvalues = cdmenum.getMap(); + for (Map.Entry entry : ecvalues.entrySet()) { + String name = entry.getValue(); + assert (name != null); + int value = (int) entry.getKey(); + dapenum.addEnumConst(dmrfactory.newEnumConst(name, new Long(value))); + } + return dapenum; + } + + protected DapStructure buildcompoundtype(Variable cdmvar, DapNode parent) throws DapException { + cdmvar = CDMUtil.unwrap(cdmvar); + DapStructure struct; + if (cdmvar.getDataType() == DataType.STRUCTURE) + struct = (DapStructure) dmrfactory.newStructure(cdmvar.getShortName()); + else if (cdmvar.getDataType() == DataType.SEQUENCE) + struct = (DapStructure) dmrfactory.newSequence(cdmvar.getShortName()); + else + throw new DapException("Internal error"); + struct.setParent(parent); + recordStruct(cdmvar, struct); + Structure cdmstruct = (Structure) cdmvar; + List fields = cdmstruct.getVariables(); + // recurse to create compound types of any fields c + for (CDMNode node : fields) { + Variable cdmfield = (Variable) node; + List dimset = cdmfield.getDimensions(); + // Recurse on any nested compound types + if (cdmfield.getDataType() == DataType.STRUCTURE || cdmfield.getDataType() == DataType.SEQUENCE) { + DapStructure fieldstruct = buildcompoundtype(cdmfield, struct); + } + } + // Add the fields to this compound type + for (CDMNode node : fields) { + Variable cdmfield = (Variable) node; + DapType basetype = null; + switch (cdmfield.getDataType()) { + default: + basetype = CDMTypeFcns.cdmtype2daptype(cdmfield.getDataType()); + break; + case STRUCTURE: + case SEQUENCE: + basetype = compoundmap.get(cdmfield);// since no forward references + break; + } + // build the field variable + List fielddims = cdmfield.getDimensions(); + DapVariable dapfield; + if (CDMUtil.hasVLEN(cdmfield)) { + // Get the fake sequence associated with this vlen + DapSequence seq = vlenmap.get(cdmfield); + List coredims = getCoreDimset(fielddims); + // We need to build a variable whose basetype is the + // fake sequence rather than the cdmfield type + // First, build a variable using the existing cdmfield + dapfield = buildvariable(cdmfield, struct, coredims); + // Now modify it to use the fake sequence + dapfield.setBaseType(seq); + } else { + dapfield = buildvariable(cdmfield, struct, fielddims); + } + struct.addField(dapfield); + } + return struct; + } + + protected DapVariable buildvariable(Variable cdmbasevar, DapNode parent, List cdmdims) + throws DapException { + DapVariable dapvar = null; + CDMSort sort = cdmbasevar.getSort(); + switch (sort) { + case VARIABLE: + switch (cdmbasevar.getDataType()) { + default: + dapvar = buildatomicvar(cdmbasevar, parent); + break; + case ENUM1: + case ENUM2: + case ENUM4: + dapvar = buildenumvar(cdmbasevar); + break; + case OPAQUE: + dapvar = buildopaquevar(cdmbasevar); + break; + case STRING: + dapvar = buildstringvar(cdmbasevar); + break; + case STRUCTURE: + case SEQUENCE: + assert false : "Internal error"; // How could this ever happen? + break; + + } + builddimrefs(dapvar, cdmdims); + break; + case STRUCTURE: + dapvar = buildstructvar(cdmbasevar); + builddimrefs(dapvar, cdmdims); + break; + case SEQUENCE: + default: + assert false : "Internal Error"; + } + if (parent != null) + addToParent(parent, dapvar); + return dapvar; + } + + protected DapVariable buildatomicvar(Variable cdmvar, DapNode parent) throws DapException { + // Atomic => not opaque and not enum + DapType basetype = CDMTypeFcns.cdmtype2daptype(cdmvar.getDataType()); + if (basetype == null) + throw new DapException("DapFile: illegal CDM variable base type: " + cdmvar.getDataType()); + DapVariable dapvar = (DapVariable) dmrfactory.newVariable(cdmvar.getShortName(), basetype); + recordVar(cdmvar, dapvar); + buildattributes(dapvar, cdmvar.attributes()); + if (CDMUtil.hasVLEN(cdmvar)) { + // Get the fake sequence associated with this vlen + DapSequence seq = vlenmap.get(cdmvar); + List coredims = getCoreDimset(cdmvar.getDimensions()); + // We need to build a variable whose basetype is the + // fake sequence rather than the cdmfield type + // First, build a variable using the existing cdmfield + // Now modify it to use the fake sequence + dapvar.setBaseType(seq); + } + return dapvar; + } + + protected DapVariable buildopaquevar(Variable cdmvar) throws DapException { + assert (cdmvar.getDataType() == DataType.OPAQUE) : "Internal error"; + DapVariable dapvar = (DapVariable) dmrfactory.newVariable(cdmvar.getShortName(), DapType.OPAQUE); + recordVar(cdmvar, dapvar); + buildattributes(dapvar, cdmvar.attributes()); + Object osize = cdmvar.annotation(DapAttribute.UCARTAGOPAQUE); + if (osize != null) { + dapvar.addXMLAttribute(DapAttribute.UCARTAGOPAQUE, osize.toString()); + } + return dapvar; + } + + protected DapVariable buildstringvar(Variable cdmvar) throws DapException { + assert (cdmvar.getDataType() == DataType.STRING) : "Internal error"; + DapVariable dapvar = (DapVariable) dmrfactory.newVariable(cdmvar.getShortName(), DapType.STRING); + recordVar(cdmvar, dapvar); + buildattributes(dapvar, cdmvar.attributes()); + return dapvar; + } + + protected DapVariable buildenumvar(Variable cdmvar) throws DapException { + assert (cdmvar.getDataType() == DataType.ENUM1 || cdmvar.getDataType() == DataType.ENUM2 + || cdmvar.getDataType() == DataType.ENUM4) : "Internal error"; + + // Now, we need to locate the actual enumeration decl + EnumTypedef enumdef = cdmvar.getEnumTypedef(); + EnumTypedef trueenumdef = findMatchingEnum(enumdef); + // Modify the cdmvar + cdmvar.setEnumTypedef(trueenumdef); + // Now, map to a DapEnumeration + DapEnumeration dapenum = (DapEnumeration) this.nodemap.get(trueenumdef); + assert (dapenum != null); + DapVariable dapvar = (DapVariable) dmrfactory.newVariable(cdmvar.getShortName(), dapenum); + recordVar(cdmvar, dapvar); + buildattributes(dapvar, cdmvar.attributes()); + return dapvar; + } + + protected DapVariable buildstructvar(Variable cdmvar) throws DapException { + assert (cdmvar.getDataType() == DataType.STRUCTURE) : "Internal error"; + // Find the DapStructure that is the basetype for this var + DapStructure struct = compoundmap.get(cdmvar); + assert struct != null : "Internal Error"; + DapVariable dapvar = (DapVariable) dmrfactory.newVariable(cdmvar.getShortName(), struct); + recordVar(cdmvar, dapvar); + buildattributes(dapvar, cdmvar.attributes()); + return dapvar; + } + + /* + * Create a sequence from a variable with a + * variable length last dimension. + * Suppose we have cdm equivalent to this: + * T var[d1]...[dn]][*] + * We convert to the following + * + * + * + * ... + * + * + */ + + protected DapSequence buildseqtype(Variable cdmvar) throws DapException { + cdmvar = CDMUtil.unwrap(cdmvar); + assert (CDMUtil.hasVLEN(cdmvar)); + DataType dt = cdmvar.getDataType(); + DapType daptype = CDMTypeFcns.cdmtype2daptype(dt); + DapSequence seq = (DapSequence) dmrfactory.newSequence(cdmvar.getShortName()); + // fill DapSequence with a single field; note that the dimensions + // are elided because they will attach to the sequence variable, + // not the field + DapVariable field = dmrfactory.newVariable(cdmvar.getShortName(), daptype); + seq.addField(field); + field.setParent(seq); + recordSeq(cdmvar, seq); + return seq; + } + + /** + * Walk this variable, including fields, to construct sequence types + * for any contained vlen dimensions + * + * @param cdmvar variable to walk + */ + + protected void buildseqtypes(Variable cdmvar) throws DapException { + if (CDMUtil.hasVLEN(cdmvar)) { + buildseqtype(cdmvar); + } + if (cdmvar.getDataType() == DataType.STRUCTURE || cdmvar.getDataType() == DataType.SEQUENCE) { + Structure struct = (Structure) cdmvar; + List fields = struct.getVariables(); + for (int i = 0; i < fields.size(); i++) { + Variable field = fields.get(i); + buildseqtypes(field); // recurse for inner vlen dims + } + } + } + + protected void buildattributes(DapNode node, AttributeContainer attributes) throws DapException { + for (Attribute attr : attributes) { + if (!suppress(attr.getShortName())) { + DapAttribute dapattr = buildattribute(attr); + node.addAttribute(dapattr); + } + } + } + + protected DapAttribute buildattribute(Attribute cdmattr) throws DapException { + DapType attrtype = CDMTypeFcns.cdmtype2daptype(cdmattr.getDataType()); + EnumTypedef cdmenum = cdmattr.getEnumType(); + boolean enumfillvalue = (cdmattr.getShortName().equals(FILLVALUE) && cdmenum != null); + DapEnumeration dapenum = null; + + // We need to handle _FillValue specially if the + // the variable is enum typed. + if (enumfillvalue) { + cdmenum = findMatchingEnum(cdmenum); + // Make sure the cdm attribute has type enumx + if (!cdmenum.getBaseType().isEnum()) + throw new DapException("CDM _FillValue attribute type is not enumX"); + // Modify the attr + cdmattr.setEnumType(cdmenum); + // Now, map to a DapEnumeration + dapenum = (DapEnumeration) this.nodemap.get(cdmenum); + if (dapenum == null) + throw new DapException("Illegal CDM variable attribute type: " + cdmenum); + attrtype = dapenum; + } + if (attrtype == null) + throw new DapException("DapFile: illegal CDM variable attribute type: " + cdmattr.getDataType()); + DapAttribute dapattr = (DapAttribute) dmrfactory.newAttribute(cdmattr.getShortName(), attrtype); + recordNode(cdmattr, dapattr); + // Transfer the values + Array values = cdmattr.getValues(); + if (!validatecdmtype(cdmattr.getDataType(), values.getElementType())) + throw new DapException("Attr type versus attribute data mismatch: " + values.getElementType()); + IndexIterator iter = values.getIndexIterator(); + String[] valuelist = null; + Object vec = CDMTypeFcns.createVector(cdmattr.getDataType(), values.getSize()); + for (int i = 0; iter.hasNext(); i++) { + java.lang.reflect.Array.set(vec, i, iter.next()); + } + valuelist = (String[]) Convert.convert(DapType.STRING, attrtype, vec); + dapattr.setValues(valuelist); + return dapattr; + } + + /** + * Assign dimensions to a variable + * + * @param dapvar The variable to which we wish to assign dimensions + * @param cdmdims The cdm dimensions from which we will find the dimension info + */ + protected void builddimrefs(DapVariable dapvar, List cdmdims) throws DapException { + if (cdmdims == null || cdmdims.size() == 0) + return; + // It is unfortunately the case that the dimensions + // associated with the variable are not + // necessarily the same object as those dimensions + // as declared, so we need to use a non-trivial + // matching algorithm. + for (Dimension cdmdim : cdmdims) { + DapDimension dapdim = null; + if (cdmdim.isShared()) { + Dimension declareddim = finddimdecl(cdmdim); + if (declareddim == null) + throw new DapException("Unprocessed cdm dimension: " + cdmdim); + dapdim = (DapDimension) this.nodemap.get(declareddim); + assert dapdim != null; + } else if (cdmdim.isVariableLength()) {// ignore + continue; + } else {// anonymous + dapdim = builddim(cdmdim); + } + assert (dapdim != null) : "Internal error"; + dapvar.addDimension(dapdim); + } + } + + protected void processmappedvariables(Group g) throws DapException { + for (Variable v0 : g.getVariables()) { + Variable cdmvar = CDMUtil.unwrap(v0); + if (cdmvar == null) + throw new DapException("NetcdfDataset synthetic variable: " + v0); + DapNode dapvar = this.varmap.get(cdmvar); + if (dapvar == null) + throw new DapException("Unknown variable: " + cdmvar); + if (!(dapvar instanceof DapVariable)) + throw new DapException("CDMVariable not mapping to dap variable: " + cdmvar); + buildmaps((DapVariable) dapvar, v0); + } + } + + + /** + * @param dapvar The variable to which we wish to assign maps + * @param var The NetcdfDataset variable from which to extract coord system + */ + protected void buildmaps(DapVariable dapvar, Variable var) throws DapException { + StructureDS sds = null; + // See if this cdm variable has one (or more) coordinate system + List css = null; + if (var.getSort() == CDMSort.VARIABLE) { + VariableDS vds = (VariableDS) var; + css = vds.getCoordinateSystems(); + } else { + sds = (StructureDS) var; + css = sds.getCoordinateSystems(); + } + if (css != null && css.size() > 0) { + // Not sure what to do with multiple coordinate systems + // For now, only use the first + CoordinateSystem coordsystems = css.get(0); + for (CoordinateAxis axis : coordsystems.getCoordinateAxes()) { + // First step is to find the dap variable + // corresponding to the map + VariableDS vds = (VariableDS) axis.getOriginalVariable(); + if (vds != null) { + Variable v = CDMUtil.unwrap(vds); + if (v != null) { + DapVariable mapvar = varmap.get(v); + if (mapvar == null) + throw new DapException("Illegal map variable:" + v.toString()); + if (!mapvar.isAtomic()) + throw new DapException("Non-atomic map variable:" + v.toString()); + // Ignore maps where the variable is a structure or sequence + // and the map variable is a field within that structure/sequence. + boolean ignoremap = false; + if (!mapvar.isTopLevel()) { + DapNode parenttype = mapvar.getContainer(); + assert (dapvar.getSort() == DapSort.VARIABLE); + DapVariable parent = (DapVariable) dapvar; + assert (parent.getSort() == DapSort.STRUCTURE || parent.getSort() == DapSort.SEQUENCE); + assert (parent.getBaseType() == parenttype); + Variable cdmparent = (Variable) varmap.get(parent); + if (cdmparent == CDMUtil.unwrap(sds)) + ignoremap = true; + } + if (!ignoremap) { + DapMap map = (DapMap) dmrfactory.newMap(mapvar.getShortName()); + dapvar.addMap(map); + } + } + } + } + } + } + + protected DapGroup buildgroup(Group cdmgroup) throws DapException { + DapGroup dapgroup = (DapGroup) dmrfactory.newGroup(cdmgroup.getShortName()); + recordNode(cdmgroup, dapgroup); + dapgroup.setShortName(cdmgroup.getShortName()); + fillgroup(dapgroup, cdmgroup); + return dapgroup; + } + + ////////////////////////////////////////////////// + // Utilities + + /** + * Unfortunately, the CDM Iosp does not + * actually use the declared enums. Rather, + * for every enum type'd variable, a new + * enum decl is defined. So, we need + * to find the original enum decl that matches + * the variable's enum. + */ + + protected EnumTypedef findMatchingEnum(EnumTypedef varenum) throws DapException { + List candidates = new ArrayList<>(); + for (Map.Entry entry : this.nodemap.getCDMMap().entrySet()) { + CDMNode cdmnode = entry.getValue(); + if (cdmnode.getSort() != CDMSort.ENUMERATION) + continue; + // Compare the enumeration (note names will differ) + EnumTypedef target = (EnumTypedef) cdmnode; + // Ideally, we should test the types of the enums, + // but, unfortunately, the var enum is always enum4. + // if(target.getBaseType() != varenum.getBaseType()) + // continue; + Map targetmap = target.getMap(); + Map varmap = varenum.getMap(); + if (targetmap.size() != varmap.size()) + continue; + boolean match = true; // until otherwise shown + for (Map.Entry tpair : targetmap.entrySet()) { + String tname = tpair.getValue(); + int value = (int) tpair.getKey(); + boolean found = false; + for (Map.Entry vpair : varmap.entrySet()) { + if (tname.equals(vpair.getValue()) && value == (int) vpair.getKey()) { + found = true; + break; + } + } + if (!found) { + match = false; + break; + } + } + if (!match) + continue; + + // Save it unless it is shadowed by a closer enum + boolean shadowed = false; + for (EnumTypedef etd : candidates) { + if (shadows(etd.getGroup(), target.getGroup())) { + shadowed = true; + break; + } + } + if (!shadowed) + candidates.add(target); + } + + switch (candidates.size()) { + case 0: + throw new DapException("CDMDSP: No matching enum type decl: " + varenum.getShortName()); + case 1: + break; + default: + throw new DapException("CDMDSP: Multiple matching enum type decls: " + varenum.getShortName()); + } + return candidates.get(0); + } + + protected boolean shadows(Group parent, Group child) { + if (child == parent) + return true; + Group candidate = child; + do { + candidate = candidate.getGroup(); + } while (candidate != null && candidate != parent); + return (candidate == parent); + } + + // Convert cdm size to DapDimension size + protected long dapsize(Dimension cdmdim) { + assert (!cdmdim.isVariableLength()); + return (long) cdmdim.getLength(); + } + + protected boolean validatecdmtype(DataType datatype, Class typeclass) { + switch (datatype) { + case CHAR: + return typeclass == char.class; + case BYTE: + case UBYTE: + return typeclass == byte.class; + case SHORT: + case USHORT: + return typeclass == short.class; + case INT: + case UINT: + return typeclass == int.class; + case LONG: + case ULONG: + return typeclass == long.class; + case FLOAT: + return typeclass == float.class; + case DOUBLE: + return typeclass == double.class; + case STRING: + return typeclass == String.class; + case OPAQUE: + return typeclass == Byte[].class; + // For these, return the integer basetype + case ENUM1: + return typeclass == byte.class; + case ENUM2: + return typeclass == short.class; + case ENUM4: + return typeclass == int.class; + + // Undefined + case SEQUENCE: + case STRUCTURE: + default: + break; + } + return false; + } + + + protected Dimension finddimdecl(Dimension dimref) { + // Search on the full name, but be careful, + // the rule is that the declared dimension's fqn + // must be a prefix of the dimension reference. + for (Map.Entry entry : this.nodemap.getCDMMap().entrySet()) { + if (entry.getValue().getSort() != CDMSort.DIMENSION) + continue; + Dimension d = (Dimension) entry.getValue(); + if (isDimDeclFor(d, dimref)) + return d; + } + return null; + } + + protected boolean isDimDeclFor(Dimension decl, Dimension ref) { + if (!decl.isShared()) + return false; // Has no name + // First check shortname and size + if (!decl.getShortName().equals(ref.getShortName())) + return false; + if (decl.getLength() != ref.getLength()) + return false; + // Make sure they are in the same group + String dprefix = decl.getGroup().getFullName(); + String rprefix = ref.getGroup().getFullName(); + return (dprefix.equals(rprefix)); + } + + /* + * protected String + * fixvalue(Object o, DapType datatype) + * { + * TypeSort atype = datatype.getTypeSort(); + * if(o instanceof Character) { + * long l = (long) ((Character) o).charValue(); + * if(atype.isUnsigned()) + * l = l & 0xffL; + * o = Long.valueOf(l); + * } else if(o instanceof Float || o instanceof Double) { + * if(atype == TypeSort.Float32) + * o = Float.valueOf(((Number) o).floatValue()); + * else if(atype == TypeSort.Float64) + * o = Double.valueOf(((Number) o).doubleValue()); + * else + * assert false : "Internal error"; + * } else if(o instanceof Number) { + * long l = ((Number) o).longValue(); + * switch (atype) { + * case Char: + * case UInt8: + * l = l & 0xffL; + * break; + * case UInt16: + * l = l & 0xffffL; + * break; + * case UInt32: + * l = l & 0xffffffffL; + * break; + * default: + * break; + * } + * o = Long.valueOf(l); + * } else if(o instanceof String) { + * o = o.toString(); + * } else if(o instanceof ByteBuffer) { + * // leave it unchanged + * } else if(o instanceof byte[]) { + * o = ByteBuffer.wrap((byte[]) o); + * } else if(o instanceof Byte[]) { + * Byte[] ob = (Byte[]) o; + * byte[] bb = new byte[ob.length]; + * for(int i = 0; i < bb.length; i++) { + * bb[i] = (byte) ob[i]; + * } + * o = ByteBuffer.wrap(bb); + * } //else { // leave it unchanged + * return o; + * } + */ + + ////////////////////////////////////////////////// + + protected NetcdfFile createNetcdfFile(String location, CancelTask canceltask) throws DapException { + try { + NetcdfFile ncfile = NetcdfFiles.open(location, -1, canceltask); + return ncfile; + } catch (DapException de) { + if (DEBUG) + de.printStackTrace(); + throw de; + } catch (Exception e) { + if (DEBUG) + e.printStackTrace(); + throw new DapException(e); + } + } + + ////////////////////////////////////////////////// + // Utilities + + /** + * Strip vlen dimensions from a set of dimensions + * + * @param dimset + * @return subset of dimset with (trailing) vlen removed + * @throws DapException + */ + static List getCoreDimset(List dimset) throws DapException { + if (dimset == null) + return null; + List core = new ArrayList<>(); + int pos = -1; + int count = 0; + for (int i = 0; i < dimset.size(); i++) { + if (dimset.get(i).isVariableLength()) { + pos = i; + count++; + } else + core.add(dimset.get(i)); + } + if ((pos != dimset.size() - 1) || count > 1) + throw new DapException("Unsupported use of (*) Dimension"); + return core; + } + + /** + * Some attributes that are added by the NetcdfDataset + * need to be kept out of the DMR. This function + * defines that set. + * + * @param attrname A non-escaped attribute name to be tested for suppression + * @return true if the attribute should be suppressed, false otherwise. + */ + protected boolean suppress(String attrname) { + if (attrname.startsWith("_Coord")) + return true; + if (attrname.equals(CDM.UNSIGNED)) + return true; + return false; + } + + protected void addToParent(DapNode parent, DapVariable dapvar) throws DapException { + assert (parent != null); + switch (parent.getSort()) { + case GROUP: + case DATASET: + ((DapGroup) parent).addDecl(dapvar); + break; + case SEQUENCE: + case STRUCTURE: + dapvar.setParent(parent); + break; + default: + assert (false) : "Internal error"; + } + } + +} diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/ChunkWriter.java b/dap4/d4servlet/src/main/java/dap4/servlet/ChunkWriter.java index c100df4a28..7fc0409640 100644 --- a/dap4/d4servlet/src/main/java/dap4/servlet/ChunkWriter.java +++ b/dap4/d4servlet/src/main/java/dap4/servlet/ChunkWriter.java @@ -5,14 +5,18 @@ package dap4.servlet; +import dap4.core.ce.CEConstraint; +import dap4.core.dmr.DMRPrinter; +import dap4.core.dmr.DapDataset; import dap4.core.dmr.ErrorResponse; +import dap4.core.util.DapConstants; +import dap4.core.util.DapContext; import dap4.core.util.DapException; import dap4.core.util.DapUtil; import dap4.dap4lib.DapCodes; import dap4.dap4lib.RequestMode; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; + +import java.io.*; import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -21,9 +25,9 @@ public class ChunkWriter extends OutputStream { ////////////////////////////////////////////////// // Constants - static public boolean DEBUG = false; - static public boolean DUMPDATA = false; - static public boolean DEBUGHEADER = false; + public static boolean DEBUG = false; + public static boolean DUMPDATA = false; + public static boolean DEBUGHEADER = false; static final int MAXCHUNKSIZE = 0xFFFF; @@ -31,9 +35,7 @@ public class ChunkWriter extends OutputStream { static final int SIZEOF_INTEGER = 4; - static public final byte[] CRLF8 = DapUtil.extract(DapUtil.UTF8.encode(DapUtil.CRLF)); - - static public final String XMLDOCUMENTHEADER = ""; + public static final byte[] CRLF8 = DapUtil.extract(DapUtil.UTF8.encode(DapUtil.CRLF)); ////////////////////////////////////////////////// // Type declarations @@ -137,9 +139,6 @@ public void writeDSR(String dsr) throws IOException { dsr = dsr.substring(0, len) + DapUtil.CRLF; - // Add prefix - dsr = XMLDOCUMENTHEADER + "\n" + dsr; - // Convert the dsr to UTF-8 and then to byte[] byte[] dsr8 = DapUtil.extract(DapUtil.UTF8.encode(dsr)); sendDXR(dsr8); @@ -156,6 +155,19 @@ public void writeDSR(String dsr) throws IOException { * @throws IOException on IO related errors */ + public void cacheDMR(DapDataset dmr, DapContext cxt) throws IOException { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + CEConstraint ce = (CEConstraint) cxt.get(CEConstraint.class); + DapRequest drq = (DapRequest) cxt.get(DapRequest.class); + // Get the DMR as a string + DMRPrinter dapprinter = new DMRPrinter(dmr, ce, pw, drq.getFormat(), cxt); + dapprinter.print(); + pw.close(); + sw.close(); + cacheDMR(sw.toString()); + } + public void cacheDMR(String dmr) throws IOException { if (state != State.INITIAL) throw new DapException("Attempt to write DMR twice"); @@ -176,9 +188,6 @@ public void cacheDMR(String dmr) throws IOException { dmr = dmr.substring(0, len) + DapUtil.CRLF; - // Prepend the prefix - dmr = XMLDOCUMENTHEADER + "\n" + dmr; - // Convert the dmr to UTF-8 and then to byte[] this.dmr8 = DapUtil.extract(DapUtil.UTF8.encode(dmr)); @@ -199,9 +208,9 @@ void sendDXR(byte[] dxr8) throws IOException { state = State.END; } else {// mode == DATA // Prefix with chunk header - int flags = DapUtil.CHUNK_DATA; + int flags = DapConstants.CHUNK_DATA; if (this.writeorder == ByteOrder.LITTLE_ENDIAN) - flags |= DapUtil.CHUNK_LITTLE_ENDIAN; + flags |= DapConstants.CHUNK_LITTLE_ENDIAN; chunkheader(dxr8.length, flags, this.header); // write the header output.write(DapUtil.extract(this.header)); @@ -236,7 +245,7 @@ public void writeError(int httpcode, String msg, String cxt, String other) throw // clear any partial chunk chunk.clear(); // create an error header - int flags = DapUtil.CHUNK_ERROR | DapUtil.CHUNK_END; + int flags = DapConstants.CHUNK_ERROR | DapConstants.CHUNK_END; chunkheader(errbody8.length, flags, header); output.write(DapUtil.extract(header)); output.write(errbody8); @@ -270,7 +279,7 @@ void writeChunk(int flags) throws IOException { } - static public void chunkheader(int length, int flags, ByteBuffer hdrbuf) throws DapException { + public static void chunkheader(int length, int flags, ByteBuffer hdrbuf) throws DapException { if (length > MAXCHUNKSIZE || length < 0) throw new DapException("Illegal chunk size: " + length); int hdr = ((flags << 24) | length); @@ -332,7 +341,7 @@ public void close() throws IOException { // but do not close the underlying output stream state = State.DATA; // pretend - int flags = DapUtil.CHUNK_END; + int flags = DapConstants.CHUNK_END; writeChunk(flags); state = State.END; this.output.flush(); // Do not close @@ -426,7 +435,7 @@ public void write(byte[] b, int off, int len) throws IOException { int avail = chunk.remaining(); do { if (avail == 0) { - writeChunk(DapUtil.CHUNK_DATA); + writeChunk(DapConstants.CHUNK_DATA); avail = chunk.remaining(); } int towrite = (left < avail ? left : avail); diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/DSPFactory.java b/dap4/d4servlet/src/main/java/dap4/servlet/DSPFactory.java deleted file mode 100644 index e58e3ecd43..0000000000 --- a/dap4/d4servlet/src/main/java/dap4/servlet/DSPFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.servlet; - -/** - * Provide a factory for DSP instances - */ - -abstract public class DSPFactory { - - ////////////////////////////////////////////////// - // Constructor(s) - - public DSPFactory() { - // Subclasses should Register known DSP classes: order is important - // in event that two or more dsps can match a given file - // (e.q. FileDSP vs Nc4DSP). - // Only used in server - } - - - -} // DSPFactory - diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/DapCache.java b/dap4/d4servlet/src/main/java/dap4/servlet/DapCache.java deleted file mode 100644 index a73eb4dc10..0000000000 --- a/dap4/d4servlet/src/main/java/dap4/servlet/DapCache.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.servlet; - -import dap4.core.ce.CEConstraint; -import dap4.core.data.DSP; -import dap4.core.data.DSPRegistry; -import dap4.core.util.DapContext; -import dap4.core.util.DapException; -import dap4.dap4lib.DapCodes; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - - -/** - * Provide an LRU cache of DSPs. - * It is expected (for now) that this is only used on the server side. - * The cache key is assumed to be the DSP object. - * The cache is synchronized to avoid race conditions. - * Note that we do not have to release because Java - * uses garbage collection and entries will be purged - * if the LRU cache is full. - * Singleton class - */ - -abstract public class DapCache { - - ////////////////////////////////////////////////// - // Constants - - static final int MAXFILES = 100; // size of the cache - - static public final String MATCHMETHOD = "dspMatch"; - - ////////////////////////////////////////////////// - // Static variables - - /** - * Define a map of known DSP classes. - */ - static public DSPRegistry dspregistry = new DSPRegistry(); - - /** - * Define an lru cache of known DSP objects: oldest first. - */ - static protected List lru = new ArrayList(); - - // This should be set by any subclass - static protected DSPFactory factory = null; - - static public void setFactory(DSPFactory f) { - factory = f; - } - - static public DSPFactory getFactory() { - return factory; - } - - static public synchronized DSP open(String path, DapContext cxt) throws IOException { - assert cxt != null; - int lrusize = lru.size(); - for (int i = lrusize - 1; i >= 0; i--) { - DSP dsp = lru.get(i); - String dsppath = dsp.getLocation(); - if (dsppath.equals(path)) { - // move to the front of the queue to maintain LRU property - lru.remove(i); - lru.add(dsp); - CEConstraint.release(lru.get(0).getDMR()); - return dsp; - } - } - // No match found, create and initialize it. - // If cache is full, remove oldest entry - if (lrusize == MAXFILES) { - // make room - lru.remove(0); - CEConstraint.release(lru.get(0).getDMR()); - } - // Find dsp that can process this path - DSP dsp = dspregistry.findMatchingDSP(path, cxt); - if (dsp == null) - throw new DapException("Resource has no matching DSP: " + path).setCode(DapCodes.SC_FORBIDDEN); - dsp.setContext(cxt); - dsp.open(path); - lru.add(dsp); - return dsp; - } - - static synchronized public void flush() // for testing - throws Exception { - while (lru.size() > 0) { - DSP dsp = lru.get(0); - CEConstraint.release(dsp.getDMR()); - dsp.close(); - lru.remove(0); - } - } - - -} // DapCache diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/DapController.java b/dap4/d4servlet/src/main/java/dap4/servlet/DapController.java index 6ca67a28c8..413ddcfe87 100644 --- a/dap4/d4servlet/src/main/java/dap4/servlet/DapController.java +++ b/dap4/d4servlet/src/main/java/dap4/servlet/DapController.java @@ -7,73 +7,58 @@ package dap4.servlet; import dap4.core.ce.CEConstraint; -import dap4.core.data.ChecksumMode; -import dap4.core.data.DSP; -import dap4.core.dmr.DapAttribute; -import dap4.core.dmr.DapDataset; -import dap4.core.dmr.DapType; -import dap4.core.dmr.ErrorResponse; +import dap4.core.util.ChecksumMode; +import dap4.core.dmr.*; import dap4.core.util.*; import dap4.dap4lib.*; -import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; -import java.lang.reflect.Field; import java.net.MalformedURLException; import java.nio.ByteOrder; -import java.nio.charset.Charset; import java.util.Map; +import java.util.zip.Checksum; abstract public class DapController extends HttpServlet { - // Provide a way for test programs to pass info into the controller - static public boolean TESTING = false; ////////////////////////////////////////////////// // Constants - static public boolean DEBUG = false; - static public boolean DUMPDMR = false; - static public boolean DUMPDATA = false; + public static boolean DEBUG = false; - static public boolean PARSEDEBUG = false; - - static protected final String BIG_ENDIAN = "Big-Endian"; - static protected final String LITTLE_ENDIAN = "Little-Endian"; + protected static final String BIG_ENDIAN = "Big-Endian"; + protected static final String LITTLE_ENDIAN = "Little-Endian"; // Is this machine big endian? - static protected boolean IS_BIG_ENDIAN = (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN); + protected static boolean IS_BIG_ENDIAN = (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN); - static protected final String DMREXT = ".dmr"; - static protected final String DATAEXT = ".dap"; - static protected final String DSREXT = ".dsr"; - static protected final String[] ENDINGS = {DMREXT, DATAEXT, DSREXT}; + protected static final String DMREXT = ".dmr"; + protected static final String DATAEXT = ".dap"; + protected static final String DSREXT = ".dsr"; + protected static final String[] ENDINGS = {DMREXT, DATAEXT, DSREXT}; - static protected final String FAVICON = "favicon.ico"; // relative to resource dir + protected static final String FAVICON = "favicon.ico"; // relative to resource dir - static public final long DEFAULTBINARYWRITELIMIT = 100 * 1000000; // in bytes + public static final long DEFAULTBINARYWRITELIMIT = 100 * 1000000; // in bytes ////////////////////////////////////////////////// // static variables - // We need a singleton instance of a DapCache in order - // To avoid re-opening the same NetcdfFile instance. - // Assume: - // 1. This is subclassed only once and that class will fill in - // this DapCache instance. - - static protected DapCache cache = null; - ////////////////////////////////////////////////// // Static accessors - static protected void setCache(DapCache cache) { - DapController.cache = cache; - } - - static protected DapCache getCache() { - return DapController.cache; + public static String printDMR(DapDataset dmr) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + DMRPrinter printer = new DMRPrinter(dmr, pw); + try { + printer.print(); + pw.close(); + sw.close(); + } catch (IOException e) { + } + return sw.toString(); } ////////////////////////////////////////////////// @@ -81,12 +66,16 @@ static protected DapCache getCache() { protected boolean initialized = false; // Was initialize() called? + // Cache the value of getWebDontentRoot() + protected String webContentRoot = null; + + // Cache the value of getTestDataRoot() + protected String testDataRoot = null; + ////////////////////////////////////////////////// // Constructor(s) - public DapController() { - ChunkWriter.DUMPDATA = DUMPDATA; // pass it on - } + public DapController() {} ////////////////////////////////////////////////////////// // Abstract methods @@ -109,18 +98,6 @@ public DapController() { abstract protected void doCapabilities(DapRequest drq, DapContext cxt) throws IOException; - /** - * Convert a URL path into an absolute file path - * Note that it is assumed than any leading servlet prefix has been removed. - * - * @param drq dap request - * @param location suffix of url path - * @return - * @throws IOException - */ - - abstract public String getResourcePath(DapRequest drq, String location) throws DapException; - /** * Get the maximum # of bytes per request * @@ -135,6 +112,33 @@ public DapController() { */ abstract public String getServletID(); + /** + * The DAP4 code requires access to two absolute paths. + * 1. The path to a directory containing web content: + * - .template files + * - .ico files + * 2. The path to the directory containing the test data + */ + + /** + * Get the absolute address of the web-content directory + * + * @param drq dap request + * @return the web content directory absolute path + * @throws IOException + */ + abstract protected String getWebContentRoot(DapRequest drq) throws DapException; + + /** + * Convert a URL path for a dataset into an absolute file path + * + * @param drq dap request + * @param location suffix of url path + * @return path in a string builder so caller can extend. + * @throws IOException + */ + abstract protected String getResourcePath(DapRequest drq, String location) throws DapException; + ////////////////////////////////////////////////////////// public void init() { @@ -147,13 +151,12 @@ public void init() { * Initialize servlet/controller */ public void initialize() { + if (this.initialized) + return; this.initialized = true; } - ////////////////////////////////////////////////////////// - // Accessors - ////////////////////////////////////////////////////////// // Primary Controller Entry Point @@ -162,38 +165,20 @@ public void handleRequest(HttpServletRequest req, HttpServletResponse res) throw if (!this.initialized) initialize(); DapRequest daprequest = getRequestState(req, res); - String url = daprequest.getOriginalURL(); - StringBuilder info = new StringBuilder("doGet():"); - info.append(" dataset = "); - info.append(" url = "); - info.append(url); - if (DEBUG) { - System.err.println("DAP4 Servlet: processing url: " + daprequest.getOriginalURL()); - } - DapContext dapcxt = new DapContext(); - // Add entries to the context - dapcxt.put(HttpServletRequest.class, req); - dapcxt.put(HttpServletResponse.class, res); - dapcxt.put(DapRequest.class, daprequest); + DapContext dapcxt = buildDapContext(daprequest); - ByteOrder order = daprequest.getOrder(); - ChecksumMode checksummode = daprequest.getChecksumMode(); - dapcxt.put(Dap4Util.DAP4ENDIANTAG, order); - dapcxt.put(Dap4Util.DAP4CSUMTAG, checksummode); - // Transfer all other queries - Map queries = daprequest.getQueries(); - for (Map.Entry entry : queries.entrySet()) { - if (dapcxt.get(entry.getKey()) == null) { - dapcxt.put(entry.getKey(), entry.getValue()); - } + if (this.webContentRoot == null) { + this.webContentRoot = getWebContentRoot(daprequest); + this.webContentRoot = DapUtil.canonicalpath(this.webContentRoot); } + String url = daprequest.getURL(); if (url.endsWith(FAVICON)) { doFavicon(FAVICON, dapcxt); return; } - - String datasetpath = DapUtil.nullify(DapUtil.canonicalpath(daprequest.getDataset())); + String datasetpath = daprequest.getDatasetPath(); + datasetpath = DapUtil.nullify(DapUtil.canonicalpath(datasetpath)); try { if (datasetpath == null) { // This is the case where a request was made without a dataset; @@ -251,12 +236,12 @@ else if (t instanceof IOException) protected void doDSR(DapRequest drq, DapContext cxt) throws IOException { try { - DapDSR dsrbuilder = new DapDSR(); - String dsr = dsrbuilder.generate(drq.getURL()); + DapDSR dsrbuilder = new DapDSR(drq, cxt); + String dsr = dsrbuilder.generate(drq.getFormat(), drq.getDatasetPath(), drq.getDataset()); OutputStream out = drq.getOutputStream(); addCommonHeaders(drq);// Add relevant headers // Wrap the outputstream with a Chunk writer - ByteOrder order = (ByteOrder) cxt.get(Dap4Util.DAP4ENDIANTAG); + ByteOrder order = (ByteOrder) cxt.get(DapConstants.DAP4ENDIANTAG); ChunkWriter cw = new ChunkWriter(out, RequestMode.DSR, order); cw.writeDSR(dsr); cw.close(); @@ -273,31 +258,28 @@ protected void doDSR(DapRequest drq, DapContext cxt) throws IOException { protected void doDMR(DapRequest drq, DapContext cxt) throws IOException { // Convert the url to an absolute path - String realpath = getResourcePath(drq, drq.getDatasetPath()); - - DSP dsp = DapCache.open(realpath, cxt); - DapDataset dmr = dsp.getDMR(); - - /* Annotate with our endianness */ - ByteOrder order = (ByteOrder) cxt.get(Dap4Util.DAP4ENDIANTAG); - setEndianness(dmr, order); - - // Process any constraint view - CEConstraint ce = null; - String sce = drq.queryLookup(DapProtocol.CONSTRAINTTAG); - ce = CEConstraint.compile(sce, dmr); - setConstraint(dmr, ce); + String realpath = drq.getResourcePath(drq.getDatasetPath()); + + CDMWrap c4 = new CDMWrap().open(realpath); // Create the wrapper + DapDataset dmr = c4.getDMR(); + CEConstraint ce = constrainDapContext(cxt, dmr); + ChecksumMode csummode = (ChecksumMode) cxt.get(DapConstants.CHECKSUMTAG); + ByteOrder order = (ByteOrder) cxt.get(DapConstants.DAP4ENDIANTAG); + + // If the user calls for checksums, then we need to compute them + if (csummode == ChecksumMode.TRUE) { + Map checksummap = computeDMRChecksums(c4, cxt); + // Add to context + cxt.put("checksummap", checksummap); + } // Provide a PrintWriter for capturing the DMR. StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); // Get the DMR as a string - DMRPrinter dapprinter = new DMRPrinter(dmr, ce, pw, drq.getFormat()); - if (cxt.get(Dap4Util.DAP4TESTTAG) != null) - dapprinter.testprint(); - else - dapprinter.print(); + DMRPrinter dapprinter = new DMRPrinter(dmr, ce, pw, drq.getFormat(), cxt); + dapprinter.print(); pw.close(); sw.close(); @@ -307,11 +289,14 @@ protected void doDMR(DapRequest drq, DapContext cxt) throws IOException { addCommonHeaders(drq);// Add relevant headers - // Wrap the outputstream with a Chunk writer OutputStream out = drq.getOutputStream(); + // Wrap the outputstream with a Chunk writer ChunkWriter cw = new ChunkWriter(out, RequestMode.DMR, order); cw.cacheDMR(sdmr); cw.close(); + + c4.close(); + } /** @@ -326,45 +311,40 @@ protected void doDMR(DapRequest drq, DapContext cxt) throws IOException { protected void doData(DapRequest drq, DapContext cxt) throws IOException { // Convert the url to an absolute path - String realpath = getResourcePath(drq, drq.getDatasetPath()); - - DSP dsp = DapCache.open(realpath, cxt); - if (dsp == null) - throw new DapException("No such file: " + drq.getResourceRoot()); - DapDataset dmr = dsp.getDMR(); - if (DUMPDMR) { - printDMR(dmr); - System.err.println(printDMR(dmr)); - System.err.flush(); - } + String realpath = drq.getResourcePath(drq.getDatasetPath()); - /* Annotate with our endianness */ - ByteOrder order = (ByteOrder) cxt.get(Dap4Util.DAP4ENDIANTAG); - setEndianness(dmr, order); + CDMWrap c4 = new CDMWrap().open(realpath); + if (c4 == null) + throw new DapException("No such file: " + realpath); - // Process any constraint - CEConstraint ce = null; - String sce = drq.queryLookup(DapProtocol.CONSTRAINTTAG); - ce = CEConstraint.compile(sce, dmr); - setConstraint(dmr, ce); + DapDataset dmr = c4.getDMR(); + CEConstraint ce = constrainDapContext(cxt, dmr); + ChecksumMode csummode = (ChecksumMode) cxt.get(DapConstants.CHECKSUMTAG); + ByteOrder order = (ByteOrder) cxt.get(DapConstants.DAP4ENDIANTAG); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); + // If the user calls for checksums, then we need to compute them + // This, unfortunately, will require computation twice: one to insert + // into the DMR and one to insert into the serialized DAP stream. Sigh! + if (csummode == ChecksumMode.TRUE) { + Map checksummap = computeDMRChecksums(c4, cxt); + // Add to context + cxt.put("checksummap", checksummap); + } + // Get the DMR as a string - DMRPrinter dapprinter = new DMRPrinter(dmr, ce, pw, drq.getFormat()); + DMRPrinter dapprinter = new DMRPrinter(dmr, ce, pw, drq.getFormat(), cxt); dapprinter.print(); pw.close(); sw.close(); - String sdmr = sw.toString(); - if (DEBUG || DUMPDMR) - System.err.println("Sending: Data DMR:\n" + sdmr); - // Wrap the outputstream with a Chunk writer OutputStream out = drq.getOutputStream(); ChunkWriter cw = new ChunkWriter(out, RequestMode.DAP, order); cw.setWriteLimit(getBinaryWriteLimit()); + String sdmr = sw.toString(); cw.cacheDMR(sdmr); cw.flush(); @@ -384,43 +364,46 @@ protected void doData(DapRequest drq, DapContext cxt) throws IOException { */ case NONE: default: - DapSerializer writer = new DapSerializer(dsp, ce, cw, order, drq.getChecksumMode()); - writer.write(dsp.getDMR()); + DapSerializer writer = new DapSerializer(c4, ce, cw, order, drq.getChecksumMode()); + writer.write(c4.getDMR()); cw.flush(); cw.close(); break; } - // Should we dump data? - if (DUMPDATA) { - byte[] data = cw.getDump(); - if (data != null) - DapDump.dumpbytestream(data, cw.getWriteOrder(), "ChunkWriter.write"); - } + c4.close(); } ////////////////////////////////////////////////////////// // Utility Methods - protected void addCommonHeaders(DapRequest drq) throws IOException { + protected void addCommonHeaders(DapRequest drq) throws DapException { // Add relevant headers ResponseFormat format = drq.getFormat(); if (format == null) format = ResponseFormat.NONE; - DapProtocol.ContentType contentheaders = DapProtocol.contenttypes.get(drq.getMode()); - String header = contentheaders.getFormat(format); - if (header != null) { - header = header + "; charset=utf-8"; - drq.setResponseHeader("Content-Type", header); - } else - DapLog.error("Cannot determine response Content-Type"); - - // Not sure what this should be yet - // setHeader("Content-Description","?"); - - // Again, not sure what value to use - // setHeader("Content-Disposition","?"); - - // not legal drq.setResponseHeader("Content-Encoding", IS_BIG_ENDIAN ? BIG_ENDIAN : LITTLE_ENDIAN); + RequestMode mode = drq.getMode(); + if (mode == null) + mode = RequestMode.CAPABILITIES; + DapProtocol.ContentType contenttype = DapProtocol.contenttypes.get(DapProtocol.contentKey(mode, format)); + if (contenttype == null) + throw new DapException("Cannot find Content-Type for: " + mode.id() + "," + format.id()) + .setCode(DapCodes.SC_BAD_REQUEST); + // If we go by what OPeNDAP does, then the header rules are as follow: + // 1. Set the Content-Description to the application/vnd.opendap.dap4... + // 2. If the Response type is not-null, then use the appropriate mime type such as text/xml. + // 3. If the Response type is null, then use the same value as Content-Description. + // Unfortunately, my HTTP-foo is not good enough to handle rule 3; a web-browser does + // not seem to figure out the actual mime-type from the "application/vnd.opendap.dap4..." + // content type. So, we use a different rule: + // 3a. If the response type is null, then set Content-Type to the proper mime-type. + + // Rule 1. + drq.setResponseHeader("Content-Description", contenttype.contenttype); + + // Rules 2 and 3. + String header = contenttype.mimetype; + header = header + "; charset=utf-8"; + drq.setResponseHeader("Content-Type", header); } /** @@ -473,59 +456,64 @@ protected void senderror(DapRequest drq, int httpcode, Throwable t) throws IOExc } err.setContext(drq.getURL()); String errormsg = err.buildXML(); - drq.getResponse().sendError(httpcode, errormsg); + if (false) { + drq.getResponse().sendError(httpcode, errormsg); + } else { + OutputStream out = drq.getOutputStream(); + PrintWriter prw = new PrintWriter(new OutputStreamWriter(out, DapUtil.UTF8)); + prw.println(errormsg); + prw.flush(); + } } - /** - * Set special attribute: endianness : overwrite exiting value - * - * @param dmr - * @param order - * @throws DapException - */ - void setEndianness(DapDataset dmr, ByteOrder order) throws DapException { - DapAttribute a = dmr.findAttribute(DapUtil.LITTLEENDIANATTRNAME); - if (a == null) { - a = new DapAttribute(DapUtil.LITTLEENDIANATTRNAME, DapType.UINT8); - dmr.addAttribute(a); + public DapContext buildDapContext(DapRequest daprequest) throws DapException { + DapContext dapcxt = new DapContext(); + // Add entries to the context + dapcxt.put(DapRequest.class, daprequest); + ByteOrder order = daprequest.getOrder(); + if (order != null) { + dapcxt.put(DapConstants.DAP4ENDIANTAG, order); + ChecksumMode checksummode = daprequest.getChecksumMode(); + if (checksummode != null) + dapcxt.put(DapConstants.CHECKSUMTAG, ChecksumMode.asTrueFalse(checksummode)); + // Transfer all other queries + Map queries = daprequest.getQueries(); + for (Map.Entry entry : queries.entrySet()) { + if (dapcxt.get(entry.getKey()) == null) + dapcxt.put(entry.getKey(), entry.getValue()); + } } - // ByteOrder order = (ByteOrder) cxt.get(Dap4Util.DAP4ENDIANTAG); - String oz = (order == ByteOrder.BIG_ENDIAN ? "0" : "1"); - a.setValues(new String[] {oz}); + return dapcxt; } - /** - * Set special attribute: constraint : overwrite exiting value - * - * @param dmr dmr to annotate - * @param ce the new constraint - * @throws DapException - */ - void setConstraint(DapDataset dmr, CEConstraint ce) throws DapException { - if (ce == null) - return; - if (ce.isUniversal()) - return; - DapAttribute a = dmr.findAttribute(DapUtil.CEATTRNAME); - if (a == null) { - a = new DapAttribute(DapUtil.CEATTRNAME, DapType.STRING); - dmr.addAttribute(a); - } - String sce = ce.toConstraintString(); - a.setValues(new String[] {sce}); + public CEConstraint constrainDapContext(DapContext dapcxt, DapDataset dmr) throws DapException { + // Add additional entries to the context + // Process any constraint view + DapRequest drq = (DapRequest) dapcxt.get(DapRequest.class); + String sce = drq.queryLookup(DapConstants.CONSTRAINTTAG); + CEConstraint ce = CEConstraint.compile(sce, dmr); + dapcxt.put(CEConstraint.class, ce); + return ce; } - static public String printDMR(DapDataset dmr) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - DMRPrinter printer = new DMRPrinter(dmr, pw); + protected Map computeDMRChecksums(CDMWrap c4, DapContext cxt) throws DapException { + ByteOrder order = (ByteOrder) cxt.get(DapConstants.DAP4ENDIANTAG); + ChecksumMode csum = (ChecksumMode) cxt.get(DapConstants.CHECKSUMTAG); + CEConstraint ce = (CEConstraint) cxt.get(CEConstraint.class); + OutputStream out = new NullOutputStream(); + DapDataset dmr = ce.getDMR(); try { - printer.print(); - pw.close(); - sw.close(); - } catch (IOException e) { + ChunkWriter cw = new ChunkWriter(out, RequestMode.DAP, order); + cw.cacheDMR(dmr, cxt); + cw.setWriteLimit(1000000000); + DapSerializer writer = new DapSerializer(c4, ce, cw, order, csum); + writer.write(dmr); + cw.flush(); + cw.close(); + return writer.getChecksums(); + } catch (IOException ioe) { + throw new DapException(ioe); } - return sw.toString(); } } diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/DapDSR.java b/dap4/d4servlet/src/main/java/dap4/servlet/DapDSR.java index 01509c36c4..35e1429c83 100644 --- a/dap4/d4servlet/src/main/java/dap4/servlet/DapDSR.java +++ b/dap4/d4servlet/src/main/java/dap4/servlet/DapDSR.java @@ -5,11 +5,17 @@ package dap4.servlet; -import dap4.core.util.IndentWriter; +import dap4.core.util.*; import dap4.dap4lib.DapProtocol; import dap4.dap4lib.RequestMode; + +import javax.servlet.http.HttpServletResponse; +import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; import java.io.StringWriter; +import java.net.MalformedURLException; +import java.net.URL; /** * Generate the DSR for a dataset. @@ -23,105 +29,121 @@ public class DapDSR { static final boolean DEBUG = false; + static final String DSRXMLTEMPLATE = "/templates/dap4.dsr.xml.template"; + static final String DSRHTMLTEMPLATE = "/templates/dap4.dsr.html.template"; + + static final String URL_FORMAT = DapConstants.HTTPSCHEME + "//%s/%s/%s"; + ////////////////////////////////////////////////// - // Constructor(s) + // Static Variables - public DapDSR() {} + static private String dap4TestServerPropName = "d4ts"; + public static String dap4TestServer = null;; // mutable + protected static String servletprefix = null; + protected static String servletsuffix = null; + + static { + String d4ts = System.getProperty(dap4TestServerPropName); + if (d4ts != null && d4ts.length() > 0) + dap4TestServer = d4ts; + } ////////////////////////////////////////////////// - // Accessors + // Instance Variables + + DapRequest drq; + DapContext cxt; + + ////////////////////////////////////////////////// + // Constructor(s) + + public DapDSR(DapRequest drq, DapContext cxt) throws IOException { + this.drq = drq; + this.cxt = cxt; + + // Figure out the test server + if (this.dap4TestServer == null) { + try { + URL url = new URL(drq.getRequest().getRequestURL().toString()); + this.dap4TestServer = url.getHost(); + if (url.getPort() > 0) + this.dap4TestServer += ":" + url.getPort(); + this.servletprefix = drq.getRequest().getContextPath(); + this.servletprefix = DapUtil.relativize(this.servletprefix); + this.servletsuffix = drq.getRequest().getServletPath(); + + } catch (MalformedURLException mue) { + throw new DapException(mue).setCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + } + if (this.dap4TestServer == null) { + throw new DapException("Cannot determine test server host").setCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + if (this.servletprefix == null) { + throw new DapException("Cannot determine test servlet prefix") + .setCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + if (this.servletsuffix == null) { + throw new DapException("Cannot determine test servlet suffix") + .setCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + } ////////////////////////////////////////////////// // API - public String generate(String dataseturl) throws IOException { - StringWriter sw = new StringWriter(); - IndentWriter printer = new IndentWriter(sw); - printer.marginPrintln(""); - printer.outdent(); - printer.marginPrint(""); - printer.print(DapProtocol.X_DAP_VERSION); - printer.println(""); - printer.marginPrint(""); - printer.print(DapProtocol.X_DAP_SERVER); - printer.println(""); - - printer.marginPrintln(""); - printer.outdent(3); - printer.indent(); - printer.marginPrint(""); - printer.outdent(2); - printer.indent(); - printer.marginPrintln(""); - printer.outdent(); - printer.marginPrintln(""); - printer.marginPrintln(""); - printer.outdent(2); - printer.outdent(); - printer.marginPrintln(""); - - printer.marginPrintln(""); - printer.outdent(3); - printer.indent(); - printer.marginPrint(""); - printer.outdent(2); - printer.indent(); - printer.marginPrintln(""); - printer.outdent(); - printer.marginPrintln(""); - printer.marginPrintln(""); - printer.outdent(2); - printer.outdent(); - printer.marginPrintln(""); - - printer.marginPrintln(""); - printer.outdent(2); - printer.indent(); - printer.marginPrint(""); - printer.outdent(2); - printer.outdent(); - printer.marginPrintln(""); - printer.outdent(); - printer.marginPrintln(""); - - printer.flush(); - printer.close(); - sw.close(); - return sw.toString(); + public String generate(ResponseFormat format, String datasetpath, String dataset) throws IOException { + // Normalize to relative path + datasetpath = DapUtil.relativize(datasetpath); // Get the DSR template + String template = getTemplate(format); + StringBuilder dsr = new StringBuilder(template); + substitute(dsr, "DAP_VERSION", DapConstants.X_DAP_VERSION); + substitute(dsr, "DAP_SERVER", DapConstants.X_DAP_SERVER); + substitute(dsr, "DATASET", dataset); + // Compute the URL + String url = String.format(URL_FORMAT, this.dap4TestServer, this.servletprefix, datasetpath); + substitute(dsr, "URL", url); + return dsr.toString(); + } + + protected String getTemplate(ResponseFormat format) throws IOException { + StringBuilder buf = new StringBuilder(); + // Get template as resource stream + String template = null; + switch (format) { + case XML: + template = DSRXMLTEMPLATE; + break; + case NONE: + case HTML: + template = DSRHTMLTEMPLATE; + break; + default: + throw new IOException("Unsupported DSR Response Format: " + format.toString()); + } + String templatepath = drq.getWebContentPath(template); + try (InputStream stream = new FileInputStream(templatepath)) { + int ch; + while ((ch = stream.read()) >= 0) { + buf.append((char) ch); + } + } + return buf.toString(); + } + + protected void substitute(StringBuilder buf, String macro, String value) { + int from = 0; + String tag = "${" + macro + "}"; + int taglen = tag.length(); + int valuelen = value.length(); + for (;;) { + int index = buf.indexOf(tag, from); + if (index < 0) + break; + buf.replace(index, index + taglen, value); + from = index + valuelen; + } } + } // DapDSR diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/DapRequest.java b/dap4/d4servlet/src/main/java/dap4/servlet/DapRequest.java index 2474a65e73..811e7a0958 100644 --- a/dap4/d4servlet/src/main/java/dap4/servlet/DapRequest.java +++ b/dap4/d4servlet/src/main/java/dap4/servlet/DapRequest.java @@ -5,25 +5,14 @@ package dap4.servlet; -import dap4.core.data.ChecksumMode; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.core.util.ResponseFormat; -import dap4.dap4lib.Dap4Util; -import dap4.dap4lib.DapLog; +import dap4.core.util.*; import dap4.dap4lib.RequestMode; -import dap4.dap4lib.XURI; -import ucar.httpservices.HTTPUtil; -import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; -import java.net.MalformedURLException; import java.net.URISyntaxException; -import java.net.URL; import java.nio.ByteOrder; -import java.util.HashMap; import java.util.Map; /** @@ -42,67 +31,39 @@ public class DapRequest { static final boolean DEBUG = false; - static public final String WEBINFPATH = "/WEB-INF"; - static public final String RESOURCEDIRNAME = "resources"; - - static public final String CONSTRAINTTAG = "dap4.ce"; - - static public final ChecksumMode DEFAULTCSUM = ChecksumMode.DAP; + protected static final String WEBINFPATH = "WEB-INF"; + protected static final String RESOURCEDIRNAME = "resources"; ////////////////////////////////////////////////// // Instance variables - + protected DapController controller = null; protected HttpServletRequest request = null; protected HttpServletResponse response = null; - protected String url = null; // without any query and as with any modified dataset path - protected String querystring = null; - protected String server = null; // scheme + host + port - protected String controllerpath = null; // scheme + host + port + prefix of path thru servlet Notes - protected String datasetpath = null; // past controller path; char(0) != '/' + protected XURI xuri = null; // without any query and as with any modified dataset path protected RequestMode mode = null; // .dmr, .dap, or .dsr protected ResponseFormat format = null; // e.g. .xml when given .dmr.xml - protected Map queries = new HashMap(); - protected DapController controller = null; - protected ByteOrder order = ByteOrder.nativeOrder(); protected ChecksumMode checksummode = null; - protected String resourceroot = null; - protected ServletContext servletcontext = null; + // path from URL relative to the Servlet + protected String datasetpath = null; + + // The last path element from datasetpath + protected String dataset = null; ////////////////////////////////////////////////// // Constructor(s) public DapRequest(DapController controller, HttpServletRequest request, HttpServletResponse response) throws DapException { - this.controller = controller; this.request = request; this.response = response; - this.servletcontext = request.getServletContext(); - - // Figure out the absolute path to our resources directory - this.resourceroot = (String) this.request.getAttribute("RESOURCEDIR"); - if (this.resourceroot == null && this.servletcontext != null) { - try { - URL url = this.servletcontext.getResource(WEBINFPATH); - if (url == null) - this.resourceroot = null; - else { - if (!url.getProtocol().equals("file")) - throw new DapException("Cannot locate resource root"); - this.resourceroot = DapUtil.canonicalpath(url.getFile() + "/resources"); - } - } catch (MalformedURLException e) { - this.resourceroot = null; - } - if (this.resourceroot == null) - throw new DapException("Cannot locate resource root"); - } + this.controller = controller; try { - parse(); + parseURI(); // Pull Info from the URI } catch (IOException ioe) { throw new DapException(ioe); } @@ -136,83 +97,63 @@ public DapRequest(DapController controller, HttpServletRequest request, HttpServ * 7. The query part. */ - protected void parse() throws IOException { - this.url = request.getRequestURL().toString(); // does not include query - // The mock servlet code does not construct a query string, - // so if we are doing testing, construct from parametermap. - if (DapController.TESTING) { - this.querystring = makeQueryString(this.request); - } else { - this.querystring = request.getQueryString(); // raw (undecoded) - } - - XURI xuri; + protected void parseURI() throws IOException { try { - xuri = new XURI(this.url).parseQuery(this.querystring); + // Unfortunately getRequestURL does not include the query + StringBuffer fullurl = request.getRequestURL(); + if (request.getQueryString() != null) { + fullurl.append("?"); + fullurl.append(Escape.urlDecode(request.getQueryString())); + } + xuri = new XURI(fullurl.toString()); } catch (URISyntaxException e) { throw new IOException(e); } - // Now, construct various items - StringBuilder buf = new StringBuilder(); - buf.append(request.getScheme()); - buf.append("://"); - buf.append(request.getServerName()); - int port = request.getServerPort(); - if (port > 0) { - buf.append(":"); - buf.append(port); - } - this.server = buf.toString(); - - // There appears to be some inconsistency in how the url path is divided up - // depending on if this is a spring controller vs a raw servlet. - // Try to canonicalize so that context path always ends with id - // and servletpath does not start with it. - String id = controller.getServletID(); - String sp = DapUtil.canonicalpath(request.getServletPath()); - String cp = DapUtil.canonicalpath(request.getContextPath()); - if (!cp.endsWith(id)) // probably spring ; contextpath does not ends with id - cp = cp + "/" + id; - buf.append(cp); - this.controllerpath = buf.toString(); - sp = HTTPUtil.relpath(sp); - if (sp.startsWith(id)) // probably spring also - sp = sp.substring(id.length()); - - this.datasetpath = HTTPUtil.relpath(sp); - this.datasetpath = DapUtil.nullify(this.datasetpath); - - this.mode = null; + this.datasetpath = request.getServletPath(); + if (this.datasetpath.equals("/") || this.datasetpath.equals("")) + this.datasetpath = null; // canonical value if (this.datasetpath == null) { - // Presume mode is a capabilities request this.mode = RequestMode.CAPABILITIES; - this.format = ResponseFormat.HTML; } else { - // Decompose path by '.' - String[] pieces = this.datasetpath.split("[.]"); - // Search backward looking for the mode (dmr or dap) - // meanwhile capturing the format extension - int modepos = 0; - for (int i = pieces.length - 1; i >= 1; i--) {// ignore first piece - String ext = pieces[i]; - // We assume that the set of response formats does not interset the set of request modes - RequestMode mode = RequestMode.modeFor(ext); - ResponseFormat format = ResponseFormat.formatFor(ext); + String path = this.datasetpath; + // Break dataset path into prefix/ + dataset + int index = path.lastIndexOf('/'); + if (index < 0) + index = 0; + String prefix = path.substring(0, index); + String file = path.substring(index, path.length()); + file = DapUtil.relativize(file); + for (;;) { // Iterate until we find a non-mode|format extension or no extension + // Decompose dataset by '.' + index = file.lastIndexOf('.'); + if (index < 0) + index = file.length(); + String extension = file.substring(index, file.length()); + if (extension == null || extension.equals("")) + break; + // Figure out what this extension represents + int modepos = 0; + // We assume that the set of response formats does not intersect the set of request modes + RequestMode mode = RequestMode.modeFor(extension); + ResponseFormat format = ResponseFormat.formatFor(extension); + if (mode == null && format == null) + break; // stop here if (mode != null) { - // Stop here + if (this.mode != null) + throw new DapException("Multiple request modes specified: " + extension) + .setCode(HttpServletResponse.SC_BAD_REQUEST); this.mode = mode; - modepos = i; - break; } else if (format != null) { if (this.format != null) - throw new DapException("Multiple response formats specified: " + ext) + throw new DapException("Multiple response formats specified: " + extension) .setCode(HttpServletResponse.SC_BAD_REQUEST); this.format = format; } + file = file.substring(0, index); // Remove consumed extension } - // Set the datasetpath to the entire path before the mode defining extension. - if (modepos > 0) - this.datasetpath = DapUtil.join(pieces, ".", 0, modepos); + // Set the final global values + this.dataset = file; + this.datasetpath = prefix + "/" + this.dataset; } if (this.mode == null) @@ -220,12 +161,8 @@ protected void parse() throws IOException { if (this.format == null) this.format = ResponseFormat.NONE; - // Parse the query string into a Map - if (querystring != null && querystring.length() > 0) - this.queries = xuri.getQueryFields(); - // For testing purposes, get the desired endianness to use with replies - String p = queryLookup(Dap4Util.DAP4ENDIANTAG); + String p = queryLookup(DapConstants.DAP4ENDIANTAG); if (p != null) { Integer oz = DapUtil.stringToInteger(p); if (oz == null) @@ -234,19 +171,11 @@ protected void parse() throws IOException { this.order = (oz != 0 ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); } - // Ditto for no checksum - p = queryLookup(Dap4Util.DAP4CSUMTAG); + // Ditto for checksum + p = queryLookup(DapConstants.CHECKSUMTAG); if (p != null) { this.checksummode = ChecksumMode.modeFor(p); } - if (this.checksummode == null) - this.checksummode = DEFAULTCSUM; - - if (DEBUG) { - DapLog.debug("DapRequest: controllerpath =" + this.controllerpath); - DapLog.debug("DapRequest: extension=" + (this.mode == null ? "null" : this.mode.extension())); - DapLog.debug("DapRequest: datasetpath=" + this.datasetpath); - } } ////////////////////////////////////////////////// @@ -256,10 +185,6 @@ public ByteOrder getOrder() { return this.order; } - public String getResourceRoot() { - return this.resourceroot; - } - public ChecksumMode getChecksumMode() { return this.checksummode; } @@ -272,36 +197,55 @@ public HttpServletResponse getResponse() { return response; } - public OutputStream getOutputStream() throws IOException { - return response.getOutputStream(); + public String getWebContentRoot() throws DapException { + return controller.getWebContentRoot(this); } - public String getURL() { - return this.url; + public String getServletID() throws DapException { + return controller.getServletID(); } - public String getOriginalURL() { - return (this.querystring == null ? this.url : this.url + "?" + this.querystring); + /** + * Convert a URL path for a dataset into an absolute file path + * + * @param location suffix of url path + * @return path in a string builder so caller can extend. + * @throws IOException + */ + public String getResourcePath(String location) throws DapException { + return controller.getResourcePath(this, location); } - public String getDataset() { - return this.datasetpath; + /** + * Convert a URL path for a web-content related file into an absolute file path + * + * @param location suffix of url path + * @return path in a string builder so caller can extend. + * @throws IOException + */ + public String getWebContentPath(String location) throws DapException { + String path = getWebContentRoot(); + path = DapUtil.canonicalpath(path); + location = DapUtil.relativize(location); + path += "/" + location; + return path; } - public String getServer() { - return this.server; + public OutputStream getOutputStream() throws IOException { + return response.getOutputStream(); } - public ServletContext getServletContext() { - return this.servletcontext; + public String getURL() { + return this.xuri.toString(); } - public String getControllerPath() { - return this.controllerpath; + public String getDatasetPath() { + return this.datasetpath; } - public String getURLPath() { - return this.controllerpath + (this.datasetpath == null ? "" : this.datasetpath); + public String getDataset() { + // Strip off any leading prefix + return this.dataset; } public RequestMode getMode() { @@ -323,19 +267,11 @@ public void setResponseHeader(String name, String value) { } public String queryLookup(String name) { - return queries.get(name.toLowerCase()); + return this.xuri.getQueryFields().get(name.toLowerCase()); } public Map getQueries() { - return this.queries; - } - - public String getResourcePath(String relpath) throws IOException { - return controller.getResourcePath(this, relpath); - } - - public String getDatasetPath() { - return this.datasetpath; + return this.xuri.getQueryFields(); } static String makeQueryString(HttpServletRequest req) { diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/DapSerializer.java b/dap4/d4servlet/src/main/java/dap4/servlet/DapSerializer.java index 48bda0470b..843b0cd7cd 100644 --- a/dap4/d4servlet/src/main/java/dap4/servlet/DapSerializer.java +++ b/dap4/d4servlet/src/main/java/dap4/servlet/DapSerializer.java @@ -6,18 +6,17 @@ package dap4.servlet; import dap4.core.ce.CEConstraint; -import dap4.core.data.ChecksumMode; -import dap4.core.data.DSP; -import dap4.core.data.DataCursor; import dap4.core.dmr.*; -import dap4.core.util.DapException; -import dap4.core.util.Index; -import dap4.core.util.Odometer; -import dap4.core.util.Slice; +import dap4.core.interfaces.ArrayScheme; +import dap4.core.util.*; +import ucar.ma2.Index; + import java.io.IOException; import java.io.OutputStream; import java.nio.ByteOrder; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * Given a DSP, serialize @@ -30,11 +29,13 @@ public class DapSerializer { protected OutputStream stream = null; protected SerialWriter writer = null; - protected DSP dsp = null; + protected CDMWrap cdmwrap = null; protected CEConstraint ce = null; protected ByteOrder order = null; protected ChecksumMode checksummode = null; + protected Map checksums = null; // record variable checkums + ////////////////////////////////////////////////// // Constructor(s) @@ -43,28 +44,38 @@ public DapSerializer() {} /** * Primary constructor * - * @param dsp The DSP to write + * @param c4 The DSP to write * @param constraint Any applicable constraint * @param stream Write to this stream * @param order The byte order to use */ - public DapSerializer(DSP dsp, CEConstraint constraint, OutputStream stream, ByteOrder order, ChecksumMode mode) + public DapSerializer(CDMWrap c4, CEConstraint constraint, OutputStream stream, ByteOrder order, ChecksumMode mode) throws IOException { - this.dsp = dsp; + this.cdmwrap = c4; this.order = order; this.checksummode = mode; this.stream = stream; this.ce = constraint; } + ////////////////////////////////////////////////// + // Accessors + + public Map getChecksums() { + return this.checksums; + } + + ////////////////////////////////////////////////// + // Writers + public void write(DapDataset dmr) throws IOException { writer = new SerialWriter(this.stream, this.order, this.checksummode); writer.flush(); // If stream is ChunkWriter, then dump DMR // Iterate over the top-level variables in the constraint for (DapVariable var : dmr.getTopVariables()) { - if (!this.ce.references(var)) + if (!this.ce.references(var) || var.getCount() == 0) continue; - DataCursor vardata = this.dsp.getVariableData(var); + CDMData vardata = this.cdmwrap.getVariableData(var); if (vardata == null) throw new dap4.core.util.DapException("DapSerializer: cannot find Variable data " + var.getFQN()); writeVariable(vardata, writer); @@ -79,7 +90,7 @@ public void write(DapDataset dmr) throws IOException { * @param dst - where to write * @throws IOException */ - protected void writeVariable(DataCursor data, SerialWriter dst) throws IOException { + protected void writeVariable(CDMData data, SerialWriter dst) throws IOException { DapVariable template = (DapVariable) data.getTemplate(); dst.startVariable(); switch (data.getScheme()) { @@ -98,6 +109,12 @@ protected void writeVariable(DataCursor data, SerialWriter dst) throws IOExcepti assert false : "Unexpected variable type: " + data.toString(); } dst.endVariable(); + if (this.checksummode == ChecksumMode.TRUE) { + if (this.checksums == null) + this.checksums = new HashMap<>(); + long checksum = dst.getLastChecksum(); + this.checksums.put(template, (Long) checksum); + } } /** @@ -107,7 +124,7 @@ protected void writeVariable(DataCursor data, SerialWriter dst) throws IOExcepti * @param dst * @throws dap4.core.util.DapException */ - protected void writeAtomicVariable(DataCursor data, SerialWriter dst) throws IOException { + protected void writeAtomicVariable(CDMData data, SerialWriter dst) throws IOException { DapVariable template = (DapVariable) data.getTemplate(); assert (this.ce.references(template)); DapType basetype = template.getBaseType(); @@ -127,15 +144,15 @@ protected void writeAtomicVariable(DataCursor data, SerialWriter dst) throws IOE * @throws dap4.core.util.DapException */ - protected void writeStructure(DataCursor data, SerialWriter dst) throws IOException { + protected void writeStructure(CDMData data, SerialWriter dst) throws IOException { DapVariable template = (DapVariable) data.getTemplate(); DapStructure ds = (DapStructure) template.getBaseType(); assert (this.ce.references(template)); List slices = ce.getConstrainedSlices(template); - Odometer odom = Odometer.factory(slices); + Odometer odom = OdometerFactory.factory(slices, template.getDimensions()); while (odom.hasNext()) { Index index = odom.next(); - DataCursor[] instance = (DataCursor[]) data.read(index); + CDMData[] instance = (CDMData[]) data.read(index); writeStructure1(instance[0], dst); } } @@ -148,8 +165,8 @@ protected void writeStructure(DataCursor data, SerialWriter dst) throws IOExcept * @throws dap4.core.util.DapException */ - protected void writeStructure1(DataCursor instance, SerialWriter dst) throws IOException { - assert instance.getScheme() == DataCursor.Scheme.STRUCTURE; + protected void writeStructure1(CDMData instance, SerialWriter dst) throws IOException { + assert instance.getScheme() == ArrayScheme.STRUCTURE; DapVariable template = (DapVariable) instance.getTemplate(); assert (this.ce.references(template)); DapStructure ds = (DapStructure) template.getBaseType(); @@ -159,7 +176,7 @@ protected void writeStructure1(DataCursor instance, SerialWriter dst) throws IOE DapVariable field = fields.get(i); if (!this.ce.references(field)) continue; // not in the view - DataCursor df = (DataCursor) instance.readField(i); + CDMData df = (CDMData) instance.readField(i); writeVariable(df, dst); } } @@ -172,28 +189,18 @@ protected void writeStructure1(DataCursor instance, SerialWriter dst) throws IOE * @throws dap4.core.util.DapException */ - protected void writeSequence(DataCursor data, SerialWriter dst) throws IOException { + protected void writeSequence(CDMData data, SerialWriter dst) throws IOException { DapVariable template = (DapVariable) data.getTemplate(); DapSequence ds = (DapSequence) template.getBaseType(); assert (this.ce.references(template)); List slices = ce.getConstrainedSlices(template); - Odometer odom = Odometer.factory(slices); - if (false) - while (odom.hasNext()) { - Index index = odom.next(); - DataCursor[] instance = (DataCursor[]) data.read(index); - writeSequence1(instance[0], dst); - } - else { - DataCursor[] instances = (DataCursor[]) data.read(slices); - for (int i = 0; i < instances.length; i++) { - writeSequence1(instances[i], dst); - } - + Odometer odom = OdometerFactory.factory(slices, template.getDimensions()); + CDMData[] instances = (CDMData[]) data.read(slices); + for (int i = 0; i < instances.length; i++) { + writeSequence1(instances[i], dst); } } - /** * Write out a single Sequence of records * (Eventually use any filter in the DapVariable) @@ -203,14 +210,14 @@ protected void writeSequence(DataCursor data, SerialWriter dst) throws IOExcepti * @throws dap4.core.util.DapException */ - protected void writeSequence1(DataCursor instance, SerialWriter dst) throws IOException { + protected void writeSequence1(CDMData instance, SerialWriter dst) throws IOException { DapVariable template = (DapVariable) instance.getTemplate(); DapSequence seq = (DapSequence) template.getBaseType(); assert (this.ce.references(template)); long nrecs = instance.getRecordCount(); dst.writeCount(nrecs); for (long i = 0; i < nrecs; i++) { - DataCursor record = instance.readRecord(i); + CDMData record = instance.readRecord(i); writeRecord(record, dst); } } @@ -223,7 +230,7 @@ protected void writeSequence1(DataCursor instance, SerialWriter dst) throws IOEx * @throws dap4.core.util.DapException */ - protected void writeRecord(DataCursor record, SerialWriter dst) throws IOException { + protected void writeRecord(CDMData record, SerialWriter dst) throws IOException { DapVariable template = (DapVariable) record.getTemplate(); DapSequence seq = (DapSequence) template.getBaseType(); List fields = seq.getFields(); @@ -231,7 +238,7 @@ protected void writeRecord(DataCursor record, SerialWriter dst) throws IOExcepti DapVariable field = fields.get(i); if (!this.ce.references(field)) continue; // not in the view - DataCursor df = (DataCursor) record.readField(i); + CDMData df = (CDMData) record.readField(i); writeVariable(df, dst); } } diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/FixedValue.java b/dap4/d4servlet/src/main/java/dap4/servlet/FixedValue.java deleted file mode 100644 index 176d3e35c6..0000000000 --- a/dap4/d4servlet/src/main/java/dap4/servlet/FixedValue.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - - -package dap4.servlet; - -import dap4.core.dmr.TypeSort; -import dap4.core.dmr.DapType; -import dap4.core.util.DapException; -import dap4.dap4lib.Dap4Util; - -public class FixedValue extends Value { - - ////////////////////////////////////////////////// - // constants - - // We generate integer values by number of bits - - static protected long[] intvalues = { - - }; - - static protected long[] ulongvalues = { - - }; - - static protected double[] doublevalues = { - - }; - - static protected char[] charvalues = { - - }; - - static protected byte[] opaquevalues = {}; - - static protected String[] stringvalues = {}; - - static protected String[] urlvalues = {}; - - ////////////////////////////////////////////////// - // Constructors - - public FixedValue() {} - - ////////////////////////////////////////////////// - // Value Interface - - public ValueSource source() { - return ValueSource.FIXED; - } - - public Object nextValue(DapType basetype) throws DapException { - TypeSort atomtype = basetype.getTypeSort(); - switch (atomtype) { - case Int8: - case UInt8: - case Int16: - case UInt16: - case Int32: - case UInt32: - case Int64: - case UInt64: - return null; - - case Float32: - case Float64: - return null; - - case Char: - return null; - - case String: - return null; - - case URL: - return null; - - case Opaque: - return null; - - case Enum: - return null; - - default: - throw new DapException("Unexpected type: " + basetype); - } - } - - - public int nextCount(int max) throws DapException { - return 0; - } - - -} - diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/Generator.java b/dap4/d4servlet/src/main/java/dap4/servlet/Generator.java deleted file mode 100644 index 1a6f94a263..0000000000 --- a/dap4/d4servlet/src/main/java/dap4/servlet/Generator.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.servlet; - -import dap4.core.ce.CEConstraint; -import dap4.core.data.ChecksumMode; -import dap4.core.dmr.*; -import dap4.core.util.DapException; -import dap4.core.util.Odometer; -import dap4.core.util.Slice; -import dap4.dap4lib.DMRPrinter; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.nio.ByteOrder; -import java.util.List; -import static dap4.servlet.Value.ValueSource; - -/** - * Given a DMR, return: - * 1. A byte array (byte[]) containing serialized data - * and (optionally) the DMR - *

- * Requirements: - * 1. repeatability: given the same DMR, return the same byte array - *

- * Notes: - * 1. Two options are provided for generating values: - * a. use of a random number generator with a fixed seed. - * b. use of a pre-defined sequence of values with repetition - * when the sequence is exhausted (not yet implemented). - *

- * Additionally, provide two options for generating data from a DMR. - * 1. Automated generation of the data from the whole DMR. - * 2. Selective generation by starting at some variable - * in the DMR. This is useful when one wants more detailed - * control over e.g. the number of tuples in a sequence. - */ - -public class Generator extends DapSerializer { - static final boolean DEBUG = false; - - static final String LBRACE = "{"; - static final String RBRACE = "}"; - - static final int DEFALTCACHELIMIT = 4; // max cache size - - static final ByteOrder DEFAULTORDER = ByteOrder.LITTLE_ENDIAN; - - static final String DATADIR = "d4tests/src/test/data"; // relative to dap4 root - static final String TESTSRC = DATADIR + "/resources/testfiles"; - - static final String SERIALEXT = ".ser"; - static final String SRCEXT = ".dmr" + SERIALEXT; - static final String DSTEXT = ".dap" + SERIALEXT; - - static final int MAXROWS = 5; - - static int rowcount = 0; - - ////////////////////////////////////////////////// - // static methods - protected static boolean asciionly = true; - - static public void setASCII(boolean tf) { - asciionly = tf; - } - - static public int getRowCount() { - return rowcount; - } - - static public void setRowCount(int count) { - if (count >= 0) - rowcount = count; - } - - ////////////////////////////////////////////////// - // Instance variables - - protected Value values = null; // Value generator - protected ByteArrayOutputStream stream = null; - protected ChunkWriter cw = null; - protected boolean withdmr = true; - protected DapDataset dmr = null; - - ////////////////////////////////////////////////// - // Constructor(s) - - public Generator(DapDataset dmr, ValueSource src) throws DapException { - super(); - this.dmr = dmr; - if (src == null) - src = ValueSource.RANDOM; // default - switch (src) { - case FIXED: - case RANDOM: - default: - values = new RandomValue(); - break; - } - values.setASCII(asciionly); - SerialWriter.DEBUG = DEBUG; - } - - ////////////////////////////////////////////////// - // Generator - - public void generate(CEConstraint ce, ChunkWriter cw, boolean withdmr, ChecksumMode mode) throws DapException { - begin(ce, cw, withdmr, mode); - if (this.withdmr) - generateDMR(this.dmr); - dataset(this.dmr); - end(); - } - - public void begin(CEConstraint ce, ChunkWriter cw, boolean withdmr, ChecksumMode mode) throws DapException { - this.cw = cw; - if (ce == null) - ce = CEConstraint.getUniversal(this.dmr); - this.ce = ce; - this.order = cw.getWriteOrder(); - this.checksummode = mode; - this.withdmr = withdmr; - writer = new SerialWriter(this.cw, this.order, this.checksummode); - } - - public void end() throws DapException {} - - public void generateDMR(DapDataset dmr) throws DapException { - try { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - DMRPrinter dp = new DMRPrinter(dmr, this.ce, pw, null); - dp.print(); - pw.close(); - sw.close(); - String tmp = sw.toString(); - this.cw.cacheDMR(tmp); - this.cw.flush(); - } catch (Exception e) { - throw new DapException(e); - } - } - - ////////////////////////////////////////////////// - // Node specific generators - - public void dataset(DapDataset dmr) throws DapException { - // Iterate over the variables in order - for (DapVariable var : this.dmr.getTopVariables()) { - if (!this.ce.references(var)) - continue; - variable(var); - } - } - - public void variable(DapVariable dapvar) throws DapException { - writer.startVariable(); - if (dapvar.isAtomic()) - atomicVariable(dapvar); - else if (dapvar.isStructure()) - structureVariable(dapvar); - else if (dapvar.isSequence()) - sequenceVariable(dapvar); - else - throw new DapException("generate var: not a variable:" + dapvar.getFQN()); - try { - writer.endVariable(); - } catch (IOException ioe) { - throw new DapException(ioe); - } - } - - public void atomicVariable(DapVariable dapvar) throws DapException { - DapType basetype = dapvar.getBaseType(); - Odometer odom = null; - if (dapvar.getRank() == 0) {// scalar - odom = Odometer.factoryScalar(); - } else {// dimensioned - // get the slices from the constraint - List slices = ce.getConstrainedSlices(dapvar); - // Create an odometer from the slices - odom = Odometer.factory(slices, dapvar.getDimensions()); - } - while (odom.hasNext()) { - Object value = values.nextValue(basetype); - if (DEBUG) { - System.err.printf("generate: %s = %s%n", dapvar.getFQN(), stringify(value)); - System.err.flush(); - } - try { - assert (writer != null); - writer.writeAtomicArray(basetype, value); - } catch (IOException ioe) { - throw new DapException(ioe); - } - odom.next(); - } - } - - public void structureVariable(DapVariable var) throws DapException { - DapStructure struct = (DapStructure) var.getBaseType(); - List fields = struct.getFields(); - Odometer odom = null; - if (var.getRank() == 0) {// scalar - odom = Odometer.factoryScalar(); - } else {// dimensioned - List slices = ce.getConstrainedSlices(var); - odom = Odometer.factory(slices, var.getDimensions()); - } - while (odom.hasNext()) { - // generate a value for each field recursively - for (int i = 0; i < fields.size(); i++) { - DapVariable field = fields.get(i); - variable(field); - } - odom.next(); - } - } - - public void sequenceVariable(DapVariable var) throws DapException { - DapSequence seq = (DapSequence) var.getBaseType(); - List fields = seq.getFields(); - Odometer odom = null; - if (var.getRank() == 0) {// scalar - odom = Odometer.factoryScalar(); - } else {// dimensioned - List slices = ce.getConstrainedSlices(var); - odom = Odometer.factory(slices, var.getDimensions()); - } - try { - while (odom.hasNext()) { - // Decide how many rows for this sequence - int nrows = (rowcount == 0 ? this.values.nextCount(MAXROWS) : rowcount); - writer.writeAtomicArray(DapType.INT64, new long[] {nrows}); - for (int i = 0; i < nrows; i++) { - for (int j = 0; j < fields.size(); j++) { - DapVariable field = fields.get(j); - variable(field); - } - } - odom.next(); - } - } catch (IOException ioe) { - throw new DapException(ioe); - } - } - - protected String stringify(Object v) { - if (v.getClass().isArray()) - return stringify(java.lang.reflect.Array.get(v, 0)); - if (v instanceof Float || v instanceof Double) - return v.toString(); - if (v instanceof Byte) - return String.format("%01d 0x%01x", v, v); - if (v instanceof Short) - return String.format("%02d 0x%02x", v, v); - if (v instanceof Integer) - return String.format("%04d 0x%04x", v, v); - if (v instanceof Long) - return String.format("%08d 0x%08x", v, v); - if (v instanceof Character) - return String.format("'%c' 0x%02x", v, (short) v); - return v.toString(); - } - - -} - diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/MultiOdometer.java b/dap4/d4servlet/src/main/java/dap4/servlet/MultiOdometer.java new file mode 100644 index 0000000000..a2a9d348d2 --- /dev/null +++ b/dap4/d4servlet/src/main/java/dap4/servlet/MultiOdometer.java @@ -0,0 +1,155 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.servlet; + +import dap4.core.dmr.DapDimension; +import dap4.core.util.DapException; +import dap4.core.util.PowerSet; +import dap4.core.util.Slice; +import dap4.dap4lib.D4Index; + +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * An odometer capable of dealing with a Multi-slices. + */ + +public class MultiOdometer extends Odometer { + + protected static boolean DEBUG = false; + + ////////////////////////////////////////////////// + // Instance variables + + protected int current; // pointers into multslice list + protected long[] sizes; // # of subslices in each slice + protected List> slicesets; // Set of all combinations of slices + protected List odomset; // Odometers created from slicesets + + ////////////////////////////////////////////////// + // Constructor(s) + + public MultiOdometer() {} + + public MultiOdometer(List set) throws DapException { + this(set, null); + } + + public MultiOdometer(List set, List dimset) throws DapException { + super(set, dimset); + this.sizes = new long[this.rank]; + this.odomset = new ArrayList<>(); + for (int i = 0; i < this.rank; i++) { + Slice sl = set.get(i); + List subslices = sl.getSubSlices(); + this.sizes[i] = subslices.size(); + } + int truerank = this.rank; + if (truerank == 0) { + this.slicesets = null; + this.odomset = null; + } else { + PowerSet ps = new PowerSet(this.sizes); + long pssize = ps.getTotalSize(); + long[][] setindices = ps.getPowerSet(); + assert setindices.length == pssize; + this.slicesets = new ArrayList<>(); + if (DEBUG) { + System.err.printf("Multi: |slicesets| = %d%n", setindices.length); + System.err.println(ps.toString()); + } + // Create set of slice sets comprising this MultiOdometer + for (int i = 0; i < pssize; i++) { + long[] indexset = setindices[i]; + assert indexset.length == truerank; + // Pick out the desired set of slices + List subset = new ArrayList<>(); + for (int j = 0; j < this.rank; j++) { + Slice s0 = set.get(j); + Slice ss = s0.getSubSlice((int) indexset[j]); + subset.add(ss); + } + this.slicesets.add(subset); + } + assert this.slicesets.size() == pssize; + // Create set of odometers comprising this MultiOdometer + for (int i = 0; i < pssize; i++) { + Odometer sslodom = OdometerFactory.factory(this.slicesets.get(i), dimset); + this.odomset.add(sslodom); + } + } + this.current = 0; + } + + ////////////////////////////////////////////////// + + @Override + public String toString() { + StringBuilder buf = new StringBuilder(); + for (int i = 0; i < rank; i++) { + Slice s = slice(i); + if (i == current) + buf.append("*"); + buf.append(s.toString()); + buf.append(String.format("(%d)", s.getCount())); + } + return buf.toString(); + } + + ////////////////////////////////////////////////// + // Iterator API Overrides + + @Override + public boolean hasNext() { + if (this.current >= odomset.size()) + return false; + Odometer ocurrent = odomset.get(this.current); + if (ocurrent.hasNext()) + return true; + // Try to move to next odometer + this.current++; + return hasNext(); + } + + @Override + public D4Index next() { + if (this.current >= odomset.size()) + throw new NoSuchElementException(); + Odometer ocurrent = odomset.get(this.current); + assert ocurrent.hasNext(); + return ocurrent.next(); + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + /** + * Compute the total number of elements. + */ + @Override + public long totalSize() { + long size = 1; + for (int i = 0; i < this.rank; i++) { + size *= slice(i).getCount(); + } + return size; + } + + @Override + public List getSubOdometers() { + return this.odomset; + } + + @Override + public boolean isMulti() { + return true; + } + +} diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/NullOutputStream.java b/dap4/d4servlet/src/main/java/dap4/servlet/NullOutputStream.java new file mode 100644 index 0000000000..c0d96d5983 --- /dev/null +++ b/dap4/d4servlet/src/main/java/dap4/servlet/NullOutputStream.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 1998-2018 University Corporation for Atmospheric Research/Unidata + * See LICENSE for license information. + */ + +package dap4.servlet; + +import java.io.OutputStream; + +/** + * OutputStream that discards anything written to it. + * Roughly /dev/null + */ + +public class NullOutputStream extends OutputStream { + + @Override + public void write(byte[] b) {} + + @Override + public void write(byte[] b, int off, int len) {} + + public void write(int b) {} +} diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/Odometer.java b/dap4/d4servlet/src/main/java/dap4/servlet/Odometer.java new file mode 100644 index 0000000000..5414f3c0e8 --- /dev/null +++ b/dap4/d4servlet/src/main/java/dap4/servlet/Odometer.java @@ -0,0 +1,248 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.servlet; + +import dap4.core.dmr.DapDimension; +import dap4.core.util.DapException; +import dap4.core.util.Slice; +import dap4.dap4lib.D4Index; +import dap4.dap4lib.cdm.CDMUtil; +import ucar.ma2.Index; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * A classic implementation of an odometer + * taken from the netcdf-c code. + * Extended to provide iterator interface + */ + +public class Odometer implements Iterator { + + ////////////////////////////////////////////////// + // Types + + protected static enum STATE { + INITIAL, STARTED, DONE; + } + + ////////////////////////////////////////////////// + // Instance variables + + protected STATE state = STATE.INITIAL; + + protected int rank = 0; + protected List slices = null; + protected List dimset = null; + + // The current odometer indices + protected D4Index index; + + // precompute this.slices[i].getLast() - this.slices[i].getStride() + protected long[] endpoint; + + ////////////////////////////////////////////////// + // Constructor(s) + + protected Odometer() {} + + public Odometer(List set, List dimset) throws DapException { + if (set == null) + throw new DapException("Null slice list"); + assert (set != null && dimset != null); + if (set.size() != dimset.size()) { + if (!(dimset.size() == 0 && set.size() == 1)) + throw new DapException("Rank mismatch"); + } + this.rank = set.size(); + assert (this.rank > 0); + this.slices = new ArrayList<>(); + this.slices.addAll(set); + if (dimset != null) { + this.dimset = new ArrayList<>(); + this.dimset.addAll(dimset); + } + this.endpoint = new long[this.rank]; + int[] shape = new int[rank]; + for (int i = 0; i < this.rank; i++) + shape[i] = slices.get(i).getMax(); + this.index = new D4Index(shape); + reset(); + } + + protected void reset() { + try { + int[] newcounter = new int[this.rank]; + for (int i = 0; i < this.rank; i++) { + slices.get(i).finish(); + newcounter[i] = this.slices.get(i).getFirst(); + this.endpoint[i] = this.slices.get(i).getLast() - this.slices.get(i).getStride(); + } + this.index.set(newcounter); + } catch (DapException de) { + throw new IllegalArgumentException(de); + } + } + + public String toString() { + StringBuilder buf = new StringBuilder(); + int[] current = null; + if (this.index != null) + current = this.index.getCurrentCounter(); + for (int i = 0; i < rank; i++) { + if (i > 0) + buf.append(","); + if (dimset != null) + buf.append(dimset.get(i) != null ? dimset.get(i).getShortName() : "null"); + buf.append(this.slices.get(i).toString()); + buf.append(String.format("(%d)", this.slices.get(i).getCount())); + if (this.index != null) { + buf.append(String.format("@%d", current[i])); + } + } + return buf.toString(); + } + + ////////////////////////////////////////////////// + // Odometer API + + /** + * Return odometer rank + */ + public int rank() { + return this.rank; + } + + /** + * Return ith slice + */ + public Slice slice(int i) { + if (i < 0 || i >= this.rank) + throw new IllegalArgumentException(); + return this.slices.get(i); + } + + + public List getSlices() { + return this.slices; + } + + /** + * Compute the linear index + * from the current odometer indices. + */ + public long index() { + return index.currentElement(); + } + + /** + * Return current set of indices + */ + public D4Index indices() { + return this.index; + } + + /** + * Compute the total number of elements. + */ + public long totalSize() { + long size = 1; + for (int i = 0; i < this.rank; i++) { + size *= this.slices.get(i).getCount(); + } + return size; + } + + ////////////////////////////////////////////////// + // Iterator API + + @Override + public boolean hasNext() { + int stop = this.rank; + switch (this.state) { + case INITIAL: + return true; + case STARTED: + int i; + int[] cur = this.index.getCurrentCounter(); + for (i = stop - 1; i >= 0; i--) { // walk backwards + if (cur[i] <= this.endpoint[i]) + return true; + } + this.state = STATE.DONE; + break; + case DONE: + } + return false; + } + + @Override + public D4Index next() { + int i; + int lastpos = this.rank; + int firstpos = 0; + switch (this.state) { + case INITIAL: + this.state = STATE.STARTED; + break; + case STARTED: + i = step(firstpos, lastpos); + if (i < 0) + this.state = STATE.DONE; + break; + case DONE: + break; + } + if (this.state == STATE.DONE) + throw new NoSuchElementException(); + return indices(); + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + ////////////////////////////////////////////////// + + // on entry: indices are the last index set + // on exit, the indices are the next value + // return index of place where we have room to step; + // return -1 if we have completed. + public int step(int firstpos, int lastpos) { + int pos = -1; + int[] indices = this.index.getCurrentCounter(); + for (int i = lastpos - 1; i >= firstpos; i--) { // walk backwards + if (indices[i] > this.endpoint[i]) + indices[i] = this.slices.get(i).getFirst(); // reset this position + else { + indices[i] += this.slices.get(i).getStride(); // move to next indices + pos = i; + break; + } + } + this.index.set(indices); + return pos; + } + + public List getSubOdometers() { + List list = new ArrayList<>(); + list.add(this); + return list; + } + + public boolean isMulti() { + return false; + } + + public boolean isScalar() { + return false; + } + +} diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/OdometerFactory.java b/dap4/d4servlet/src/main/java/dap4/servlet/OdometerFactory.java new file mode 100644 index 0000000000..9bab179fe4 --- /dev/null +++ b/dap4/d4servlet/src/main/java/dap4/servlet/OdometerFactory.java @@ -0,0 +1,52 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.servlet; + +import dap4.core.dmr.DapDimension; +import dap4.core.util.DapException; +import dap4.core.util.DapUtil; +import dap4.core.util.Slice; + +import java.util.List; + +/** + * Factory class for Odometers + */ + +abstract public class OdometerFactory { + + public static Odometer factoryScalar() { + return new ScalarOdometer(); + } + + public static Odometer factory(List slices) throws DapException { + return factory(slices, null); + } + + public static Odometer factory(List slices, List dimset) throws DapException { + // check for scalar case + if (dimset != null && dimset.size() == 0) { + if (!DapUtil.isScalarSlices(slices)) + throw new DapException("Cannot build scalar odometer with non-scalar slices"); + return factoryScalar(); + } + boolean multi = false; + if (slices != null) { + for (int i = 0; i < slices.size(); i++) { + if (slices.get(i).getSort() == Slice.Sort.Multi) { + multi = true; + break; + } + } + } + if (slices == null || slices.size() == 0) + return factoryScalar(); + else if (multi) + return new MultiOdometer(slices, dimset); + else + return new Odometer(slices, dimset); + } +} diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/RandomValue.java b/dap4/d4servlet/src/main/java/dap4/servlet/RandomValue.java deleted file mode 100644 index 5eb629cd1e..0000000000 --- a/dap4/d4servlet/src/main/java/dap4/servlet/RandomValue.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - - -package dap4.servlet; - -import dap4.core.dmr.DapEnumConst; -import dap4.core.dmr.DapEnumeration; -import dap4.core.dmr.DapType; -import dap4.core.dmr.TypeSort; -import dap4.core.util.DapException; -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.util.List; -import java.util.Random; - -public class RandomValue extends Value { - ////////////////////////////////////////////////// - // Constants - - static final long SEED = 37L; - - ////////////////////////////////////////////////// - // Instance variables - - protected Random random = new Random(SEED); - - ////////////////////////////////////////////////// - // Constructor(s) - - public RandomValue() {} - - ////////////////////////////////////////////////// - // Accessors - - ////////////////////////////////////////////////// - // IValue Interface - - public ValueSource source() { - return ValueSource.RANDOM; - } - - public Object nextValue(DapType basetype) throws DapException { - Object value = null; - TypeSort atomtype = basetype.getTypeSort(); - if (atomtype.isIntegerType()) - value = nextInteger(basetype); - else if (atomtype.isFloatType()) - value = nextFloat(basetype); - else - switch (atomtype) { - case Char: - value = new char[] {nextString(random, 1, 32, 127).charAt(0)}; - break; - case String: - value = new String[] {nextString(random, MAXSTRINGSIZE, 32, 127)}; - break; - case URL: - value = new String[] {nextURL()}; - break; - case Opaque: - int length = 2 + (random.nextInt(MAXOPAQUESIZE) * 2); - byte[] bytes = new byte[length]; - random.nextBytes(bytes); - value = new ByteBuffer[] {ByteBuffer.wrap(bytes)};// order is irrelevant - break; - case Enum: - // Coverity[FB.BC_UNCONFIRMED_CAST] - value = nextEnum(((DapEnumeration) basetype)); - break; - case Int8: - case UInt8: - case Int16: - case UInt16: - case Int32: - case UInt32: - case Int64: - case UInt64: - case Float32: - case Float64: - default: - throw new DapException("Unexpected type: " + basetype); - } - if (DEBUG) { - System.err.printf("RandomValue.nextValue: (%s) %s", atomtype.toString(), value.toString()); - if (atomtype.isIntegerType()) { - Number nn = (Number) value; - System.err.printf(" 0x%x\n", nn.longValue()); - } else - System.err.println(); - } - return value; - } - - // return an integer type value (including long, but not floats) - public Object nextInteger(DapType basetype) throws DapException { - TypeSort atomtype = basetype.getTypeSort(); - if (!atomtype.isIntegerType()) - throw new DapException("Unexpected type: " + basetype); - boolean unsigned = atomtype.isUnsigned(); - switch (atomtype) { - case Int8: - return new byte[] {(byte) (random.nextInt(1 << 8) - (1 << 7))}; - case UInt8: - return new byte[] {(byte) (random.nextInt(1 << 8) & 0xFF)}; - case Int16: - return new short[] {(short) (random.nextInt(1 << 16) - (1 << 15))}; - case UInt16: - return new short[] {(short) (random.nextInt(1 << 16))}; - case Int32: - return new int[] {random.nextInt()}; - case UInt32: - long l = random.nextLong(); - l = l & 0xFFFFFFFF; - return new int[] {(int) l}; - case Int64: - return new long[] {random.nextLong()}; - case UInt64: - return new long[] {new BigInteger(64, random).longValue()}; - } - throw new DapException("Unexpected type: " + basetype); - } - - // return a float type value - public Object nextFloat(DapType basetype) throws DapException { - TypeSort atomtype = basetype.getTypeSort(); - switch (atomtype) { - case Float32: - return new float[] {random.nextFloat()}; - case Float64: - return new double[] {random.nextDouble()}; - default: - break; - } - throw new DapException("Unexpected type: " + basetype); - } - - Object nextEnum(DapEnumeration en) { - long l; - TypeSort basetype = en.getBaseType().getTypeSort(); - - // Collect the enum const values as BigIntegers - List ecnames = en.getNames(); - BigInteger[] econsts = new BigInteger[ecnames.size()]; - for (int i = 0; i < econsts.length; i++) { - DapEnumConst ec = en.lookup(ecnames.get(i)); - econsts[i] = BigInteger.valueOf(ec.getValue()); - if (basetype == TypeSort.UInt64) - econsts[i] = econsts[i].and(MASK); - } - - int index = random.nextInt(econsts.length); - l = econsts[index].longValue(); - Object val = null; - switch (basetype) { - case Int8: - val = new byte[] {(byte) l}; - break; - case UInt8: - val = new byte[] {(byte) (l & 0xFFL)}; - break; - case Int16: - val = new short[] {(short) l}; - break; - case UInt16: - val = new short[] {(short) (l & 0xFFFFL)}; - break; - case Int32: - val = new int[] {(int) l}; - break; - case UInt32: - val = new int[] {(int) (l & 0xFFFFFFFFL)}; - break; - case Int64: - val = new long[] {l}; - break; - case UInt64: - val = new long[] {l}; - break; - } - return val; - } - - String nextString(Random random, int maxlength, int min, int max) { - int length = random.nextInt(maxlength) + 1; - StringBuilder buf = new StringBuilder(); - if (asciionly && max > 127) - max = 127; - int range = (max + 1) - min; // min..max+1 -> 0..(max+1)-min - for (int i = 0; i < length; i++) { - int c = random.nextInt(range); // 0..(max+1)-min - c = c + min; // 0..(max+1)-min -> min..max+1 - buf.append((char) c); - } - return buf.toString(); - } - - static final String[] protocols = new String[] {"http", "https"}; - static final String legal = "abcdefghijklmnoqqrstuvwxyz" + "ABCDEFGHIJKLMNOQQRSTUVWXYZ" + "0123456789" + "_"; - - String nextURL() { - StringBuilder url = new StringBuilder(); - url.append(protocols[random.nextInt(protocols.length)]); - url.append("://"); - for (int i = 0; i < HOSTNSEG; i++) { - if (i > 0) - url.append("."); - for (int j = 0; j < MAXSEGSIZE; j++) { - int c; - do { - c = random.nextInt('z'); - } while (legal.indexOf(c) < 0); - url.append((char) c); - } - } - if (random.nextBoolean()) - url.append(String.format(":%d", random.nextInt(5000) + 1)); - for (int i = 0; i < PATHNSEG; i++) { - url.append("/"); - for (int j = 0; j < MAXSEGSIZE; j++) { - int c; - do { - c = random.nextInt('z'); - } while (legal.indexOf(c) < 0); - url.append((char) c); - } - } - return url.toString(); - } - - /** - * Return an integer in range 1..max inclusive. - * - * @param max - * @return random integer in range - * @throws DapException - */ - public int nextCount(int max) throws DapException { - int min = 1; - if (max < min || min < 1) - throw new DapException("bad range"); - int range = (max + 1) - min; // min..max+1 -> 0..(max+1)-min - int n = random.nextInt(range); // 0..(max+1)-min - n = n + min; // min..(max+1) - if (DEBUG) - System.err.println("RandomValue.nextCount: " + n); - return n; - } - -} diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/ScalarOdometer.java b/dap4/d4servlet/src/main/java/dap4/servlet/ScalarOdometer.java new file mode 100644 index 0000000000..b7b3508841 --- /dev/null +++ b/dap4/d4servlet/src/main/java/dap4/servlet/ScalarOdometer.java @@ -0,0 +1,55 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.servlet; + +import dap4.core.util.Slice; +import dap4.dap4lib.D4Index; + +import java.util.NoSuchElementException; + +/** + * A implementation of an odometer for scalar variables. + */ + +public class ScalarOdometer extends Odometer { + ////////////////////////////////////////////////// + // Constants + + public ScalarOdometer() { + this.state = STATE.INITIAL; + this.index = new D4Index(0); + this.slices = Slice.SCALARSLICES; + } + + public long index() { + return 0; + } + + public long totalSize() { + return 1; + } + + public boolean hasNext() { + return this.state != STATE.DONE; + } + + public D4Index next() { + if (this.state == STATE.DONE) + throw new NoSuchElementException(); + this.state = STATE.DONE; + return D4Index.SCALAR; + } + + public void remove() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isScalar() { + return true; + } + +} diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/SerialWriter.java b/dap4/d4servlet/src/main/java/dap4/servlet/SerialWriter.java index c987537803..98db4feab0 100644 --- a/dap4/d4servlet/src/main/java/dap4/servlet/SerialWriter.java +++ b/dap4/d4servlet/src/main/java/dap4/servlet/SerialWriter.java @@ -5,11 +5,10 @@ package dap4.servlet; -import dap4.core.data.ChecksumMode; -import dap4.core.data.DataCursor; import dap4.core.dmr.DapType; -import dap4.core.dmr.DapVariable; import dap4.core.dmr.TypeSort; +import dap4.core.util.ChecksumMode; +import dap4.core.util.DapConstants; import dap4.core.util.DapException; import dap4.core.util.DapUtil; import java.io.IOException; @@ -30,9 +29,10 @@ */ public class SerialWriter { - static public boolean DEBUG = false; // make it mutable - static public boolean DUMPDATA = false; // make it mutable - static public boolean DUMPCSUM = false; // make it mutable + + public static boolean DEBUG = false; // make it mutable + public static boolean DUMPDATA = false; // make it mutable + public static boolean DUMPCSUM = false; // make it mutable ////////////////////////////////////////////////// // Constants @@ -59,7 +59,7 @@ public class SerialWriter { protected java.util.zip.Checksum checksum; protected ChecksumMode checksummode = null; protected boolean serialize = true; // false=>we do not need to actually serialize - protected String lastchecksum = null; // checksum from last variable + protected long lastchecksum = 0; // checksum from last variable protected ByteBuffer crcbuffer = null; protected ByteBuffer countbuffer = null; @@ -75,11 +75,11 @@ public SerialWriter(OutputStream output, ByteOrder order, ChecksumMode mode) { .order(order); this.crcbuffer = ByteBuffer.allocate(4) // 4==sizeof(crc32 digest) .order(order); - if ("CRC32".equalsIgnoreCase(DapUtil.DIGESTER)) { + if ("CRC32".equalsIgnoreCase(DapConstants.DIGESTER)) { // use the one from java.util.zip.CRC32 this.checksum = new java.util.zip.CRC32(); } else - assert (false) : "No such checksum algorithm: " + DapUtil.DIGESTER; + assert (false) : "No such checksum algorithm: " + DapConstants.DIGESTER; } @@ -90,8 +90,8 @@ public void noSerialize(boolean tf) { this.serialize = !tf; } - public String getLastChecksum() { - return this.lastchecksum.toString(); + public long getLastChecksum() { + return this.lastchecksum; } ////////////////////////////////////////////////// @@ -106,7 +106,7 @@ public String getLastChecksum() { * platform's native encoding. */ - static public ByteBuffer encodeArray(DapType vtype, Object values, ByteOrder order) throws IOException { + public static ByteBuffer encodeArray(DapType vtype, Object values, ByteOrder order) throws IOException { TypeSort atomtype = vtype.getAtomicType(); assert values != null && values.getClass().isArray(); int count = Array.getLength(values); @@ -225,7 +225,7 @@ public void startVariable() { public void endVariable() throws IOException { depth--; - if (depth == 0 && this.checksummode.enabled(ChecksumMode.DAP)) { + if (depth == 0 && this.checksummode == ChecksumMode.TRUE) { long crc = this.checksum.getValue(); // get the digest value crc = (crc & 0x00000000FFFFFFFFL); /* crc is 32 bits */ crcbuffer.clear(); @@ -233,14 +233,14 @@ public void endVariable() throws IOException { byte[] csum = crcbuffer.array(); assert csum.length == 4; // convert to a string; write as a signed integer - this.lastchecksum = String.format("%08x", crc); + this.lastchecksum = crc; if (DEBUG) { System.err.print("checksum = " + this.lastchecksum); System.err.println(); } // Write out the digest in binary form // Do not use writeBytes because checksum is not itself checksummed - outputBytes(csum, 0, DapUtil.CHECKSUMSIZE); + outputBytes(csum, 0, DapConstants.CHECKSUMSIZE); } } @@ -296,7 +296,7 @@ public void writeAtomicArray(DapType daptype, Object values) throws IOException */ public void writeBytes(byte[] bytes, int len) throws IOException { outputBytes(bytes, 0, len); - if (this.checksummode.enabled(ChecksumMode.DAP)) { + if (this.checksummode == ChecksumMode.TRUE) { this.checksum.update(bytes, 0, len); if (DUMPCSUM) { System.err.print("SSS "); diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/SynDSP.java b/dap4/d4servlet/src/main/java/dap4/servlet/SynDSP.java deleted file mode 100644 index d7a6eb171b..0000000000 --- a/dap4/d4servlet/src/main/java/dap4/servlet/SynDSP.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.servlet; - -import dap4.core.data.DSP; -import dap4.core.util.DapContext; -import dap4.core.util.DapDump; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.dap4lib.ChunkInputStream; -import dap4.dap4lib.DapCodes; -import dap4.dap4lib.RequestMode; -import dap4.dap4lib.XURI; -import dap4.dap4lib.serial.D4DSP; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * Provide a DSP interface to synthetic data (see Generator.java). - */ - -public class SynDSP extends D4DSP { - static final protected boolean DEBUG = false; - - static protected final String[] SYNEXTENSIONS = new String[] {".dmr", ".syn"}; - - ////////////////////////////////////////////////// - // Instance variables - - protected byte[] raw = null; // Complete serialized binary databuffer - - ////////////////////////////////////////////////// - // Constructor(s) - - public SynDSP() { - super(); - } - - ////////////////////////////////////////////////// - // DSP API - - - /** - * A path is a Synthetic path if it ends in .dmr or .syn - * - * @param path - * @param context Any parameters that may help to decide. - * @return true if this path appears to be processible by this DSP - */ - public boolean dspMatch(String path, DapContext context) { - for (String ext : SYNEXTENSIONS) { - if (path.endsWith(ext)) - return true; - } - return false; - } - - @Override - public void close() {} - - @Override - public SynDSP open(String filepath) throws DapException { - // convert the relative path to real path - assert this.context != null; - if (filepath.startsWith("file:")) - try { - XURI xuri = new XURI(filepath); - filepath = xuri.getPath(); - } catch (URISyntaxException use) { - throw new DapException("Malformed filepath: " + filepath).setCode(DapCodes.SC_NOT_FOUND); - } - setLocation(filepath); - // Read the .dmr/.syn file - String document; - try { - try (FileInputStream stream = new FileInputStream(filepath);) { - document = DapUtil.readtextfile(stream); - } - } catch (IOException ioe) { - throw new DapException(ioe); - } - // Parse the dmr. - this.dmr = parseDMR(document); - - // Use the Generator to generate synthetic data for this dmr. - try { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ChunkWriter cw = new ChunkWriter(bos, RequestMode.DAP, ByteOrder.nativeOrder()); - Generator generator = new Generator(dmr, Value.ValueSource.RANDOM); - generator.generate(null, cw, true, getChecksumMode()); - cw.close(); - bos.close(); - byte[] raw = bos.toByteArray(); - if (DEBUG) - DapDump.dumpbytes(ByteBuffer.wrap(raw).order(getOrder()), true); - ByteArrayInputStream bis = new ByteArrayInputStream(raw); - ChunkInputStream crdr = new ChunkInputStream(bis, RequestMode.DAP, getOrder()); - // Skip the dmr - crdr.readDMR(); - this.raw = DapUtil.readbinaryfile(crdr); - super.build(dmr, this.raw, getOrder()); - return this; - } catch (IOException ioe) { - throw new DapException(ioe); - } - } - -} diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/URLMap.java b/dap4/d4servlet/src/main/java/dap4/servlet/URLMap.java deleted file mode 100644 index a1bb317ce5..0000000000 --- a/dap4/d4servlet/src/main/java/dap4/servlet/URLMap.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - - -package dap4.servlet; - -import dap4.core.util.DapException; - -/** - * Provide a map from url path -> file system path. - * The idea is that the space of url paths forms a tree - * with the paths in the tree being of varying length. - * Each leaf in the tree is associated with - * a file path prefix. It is assumed that if the suffix - * of the url (the part after the prefix from the map) - * is appended to the path associated with the leaf, then - * we will have a full file system path leading to - * the file (or directory) to which we the full url refers. - */ - -public interface URLMap { - - ////////////////////////////////////////////////// - // Type Decls - - // The result of a map is to produce multiple values as defined here. - public class Result { - public String prefix = null; - public String suffix = null; - - public String toString() { - return prefix + "->" + suffix; - } - } - - ////////////////////////////////////////////////// - // API - - /** - * Use some maximal prefix of the url path - * to locate the associated file path prefix. - * Return a Pair specifying: - * 1. Pair.prefix: path specifying the file path associated with - * the url prefix - * 2. Pair.suffix: the suffix of the url path that was not used. - * - * @param urlpath a string specifying the url path to be mapped - * @return Pair returning items 1 an 2 above. - * @throws DapException if the map fails - *

- * Note that this map does not deal with the whole url, only the path part - * because as a rule, the host+port is unknown at the time the map is built - * and also because there might be multiple hosts using the same map. - */ - public Result mapURL(String urlpath) throws DapException; - - /** - * Inverse of mapURL; returns a url path and suffix: U,S - * such that mapURL(U)+S = path - * Return a Pair specifying: - * 1. Pair.prefix: path specifying the url path associated with - * the file prefix - * 2. Pair.suffix: the suffix of the file path that was not used. - * - * @param path a string specifying the file path to be mapped - * @return Pair returning items 1 an 2 above. - * @throws DapException if the map fails - *

- * This is an optional operation and if not supported, - * throw UnsupportedOperationException. - */ - public Result mapPath(String path) throws DapException; - - /** - * Add an entry into the map. Any trailing / on urlprefix - * or leading / on file prefix will be removed. - * - * @param urlprefix - * @param fileprefix - */ - public void addEntry(String urlprefix, String fileprefix) throws DapException; - -} - diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/URLMapDefault.java b/dap4/d4servlet/src/main/java/dap4/servlet/URLMapDefault.java deleted file mode 100644 index f75ea2d050..0000000000 --- a/dap4/d4servlet/src/main/java/dap4/servlet/URLMapDefault.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - - -package dap4.servlet; - -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.dap4lib.XURI; -import java.io.*; -import java.net.URISyntaxException; -import java.util.*; -import dap4.servlet.URLMap.Result; - -/** - * Define a URL map that assumes that there some prefix - * of the urlpath that can be replaced by a path prefix - * and that everything else is the same. - * The mapping is carried out from a properties file - * that has lines of the form = - */ -public class URLMapDefault implements URLMap { - - ////////////////////////////////////////////////// - // Instance Variables - - SortedMap url2path = new TreeMap(); - SortedMap path2url = new TreeMap(); - - ////////////////////////////////////////////////// - // Constructor(s) - - public URLMapDefault() {} - - ////////////////////////////////////////////////// - // Accessors - - @Override - public void addEntry(String urlpath, String fileprefix) throws DapException { - // Canonicalize the urlpath - String urlprefix = DapUtil.canonicalpath(urlpath); - // Canonicalize the file path - fileprefix = DapUtil.canonicalpath(fileprefix); - url2path.put(urlprefix, fileprefix); // overwrite - path2url.put(fileprefix, urlprefix); // overwrite - } - - ////////////////////////////////////////////////// - // File loader - - public void load(String filepath) throws IOException { - String[] lines; - try (InputStream is = new FileInputStream(filepath);) { - String content = DapUtil.readtextfile(is); - lines = content.split("[\n]"); - } - for (String line : lines) { - String[] pieces = line.split("[=]"); - if (pieces.length != 2) - throw new IOException("File: " + filepath + "; malformed line: " + line); - addEntry(pieces[0], pieces[1]); - } - } - - ////////////////////////////////////////////////// - // URLMap API - - @Override - public Result mapURL(String urlpath) throws DapException { - // Canonicalize the urlpath - urlpath = DapUtil.canonicalpath(urlpath); - Result result = longestmatch(url2path, urlpath); - return result; - } - - @Override - public Result mapPath(String path) throws DapException { - // canonicalize path - path = DapUtil.canonicalpath(path); - Result result = longestmatch(path2url, path); - return result; - } - - protected Result longestmatch(SortedMap map, String prefix) { - Result result = new Result(); - List matches = new ArrayList<>(); - for (Map.Entry entry : map.entrySet()) { - if (prefix.startsWith(entry.getKey())) - matches.add(entry.getKey()); - } - String longestmatch = null; - if (map.get(prefix) != null) - longestmatch = prefix; - for (int i = 0; i < matches.size(); i++) { - String candidate = matches.get(i); - if (prefix.startsWith(candidate)) { - if (longestmatch == null || candidate.length() > longestmatch.length()) - longestmatch = candidate; - } - } - if (longestmatch != null) - result.prefix = map.get(longestmatch); - else - return null; - - /* - * // lastKey returns everything less than path, but - * // we need less-or-equal, so we have to do a separate - * // check for exact match - * result.prefix = map.get(prefix); - * if(result.prefix == null) { - * SortedMap submap = map.headMap(prefix); - * if(submap.size() == 0) - * return null; // prefix is not here in any form - * longestmatch = submap.lastKey(); - * result.prefix = (String) submap.get(longestmatch); - * } - */ - result.suffix = prefix.substring(longestmatch.length()); - if (result.prefix.endsWith("/")) - result.prefix = result.prefix.substring(0, result.prefix.length() - 1); - if (result.suffix.startsWith("/")) - result.suffix = result.suffix.substring(1); - return result; - } - - public String toString() { - StringBuilder buf = new StringBuilder(); - for (String url : url2path.keySet()) { - buf.append(url + " <=> " + url2path.get(url)); - } - return buf.toString(); - } -} - diff --git a/dap4/d4servlet/src/main/java/dap4/servlet/Value.java b/dap4/d4servlet/src/main/java/dap4/servlet/Value.java index 90632b0238..c5c88cd4f9 100644 --- a/dap4/d4servlet/src/main/java/dap4/servlet/Value.java +++ b/dap4/d4servlet/src/main/java/dap4/servlet/Value.java @@ -20,15 +20,15 @@ abstract public class Value { static final BigInteger MASK = new BigInteger("FFFFFFFFFFFFFFFF", 16); // default max values - static public final int MAXSTRINGSIZE = 10; - static public final int MAXOPAQUESIZE = 8; + public static final int MAXSTRINGSIZE = 10; + public static final int MAXOPAQUESIZE = 8; // For URL generation - static public final int MAXSEGSIZE = 8; - static public final int HOSTNSEG = 3; - static public final int PATHNSEG = 4; + public static final int MAXSEGSIZE = 8; + public static final int HOSTNSEG = 3; + public static final int PATHNSEG = 4; - static public enum ValueSource { + public static enum ValueSource { RANDOM, FIXED; } diff --git a/dap4/d4tests/build.gradle b/dap4/d4tests/build.gradle deleted file mode 100644 index 68447fce54..0000000000 --- a/dap4/d4tests/build.gradle +++ /dev/null @@ -1,69 +0,0 @@ -apply from: "$rootDir/gradle/any/dependencies.gradle" -apply from: "$rootDir/gradle/any/java-test-only.gradle" - -dependencies { - compile enforcedPlatform(project(':tds-platform')) - compile enforcedPlatform(project(':tds-testing-platform')) - - // A lot of these dependencies should be in the testRuntime config, not testCompile. - testCompile 'edu.ucar:dap4' - testCompile project(':dap4:dap4-servlet') - - testCompile(project(':dap4:d4ts')) { - exclude group: 'org.apache.logging.log4j' - } - - testCompile 'edu.ucar:cdm-core' - testCompile 'edu.ucar:httpservices' - - testCompile(project(':tds')) { - // depending on TDS does not seem right. Need to break out the parts that are important - // to other services and make that a separate subproject. - exclude group: 'org.apache.logging.log4j' - exclude group: 'org.apache.taglibs', module: 'taglibs-standard-spec' - exclude group: 'org.apache.taglibs', module: 'taglibs-standard-impl' - } - - testCompile 'javax.servlet:javax.servlet-api' - testCompile 'org.slf4j:slf4j-api' - - compile 'org.slf4j:slf4j-api' - runtime 'org.apache.logging.log4j:log4j-slf4j-impl' - testCompile 'org.apache.logging.log4j:log4j-web' - testRuntime 'ch.qos.logback:logback-classic' - - // Spring - compile 'org.springframework:spring-test' - compile 'org.springframework:spring-core' - compile 'org.springframework:spring-context' - compile 'org.springframework:spring-beans' - compile 'org.springframework:spring-web' - compile 'org.springframework:spring-webmvc' - - testCompile 'junit:junit' - testCompile project(':tds-test-utils') - testCompile 'edu.ucar:cdm-test-utils' -} - -test { - systemProperties['testargs'] = System.getProperty('testargs', '') - - include 'dap4/test/TestCDMClient.class' - include 'dap4/test/TestConstraints.class' - include 'dap4/test/TestDSP.class' - include 'dap4/test/TestDSR.class' - include 'dap4/test/TestNc4Iosp.class' - include 'dap4/test/TestParserCE.class' - include 'dap4/test/TestParserDMR.class' - include 'dap4/test/TestServlet.class' - include 'dap4/test/TestServletConstraints.class' - include 'dap4/test/TestFrontPage.class' - //include 'dap4/test/TestFilters.class' - //include 'dap4/test/TestH5Iosp.class' - //include 'dap4/test/TestHyrax.class' - //include 'dap4/test/TestPrinter.class' - //include 'dap4/test/TestSerial.class' -} - -test.dependsOn(':dap4:d4ts:AppWarBeforeIntegrationTest') -test.finalizedBy(':dap4:d4ts:AppWarAfterIntegrationTest') diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.2.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.2.raw.txt deleted file mode 100644 index 3aec08b1c9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.2.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_anon_dim.syn.2 { - variables: - int vu32(4); - string vu32:_DAP4_Checksum_CRC32 = "0x417bc794"; - - // global attributes: - string :_dap4.ce = "/vu32[0:3]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu32 = - {-1169720286, -920699049, -2088732436, 1060190036} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.raw.txt deleted file mode 100644 index 0819467d8f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.raw.txt +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_anon_dim.syn { - variables: - int vu32(6); - string vu32:_DAP4_Checksum_CRC32 = "0x1aca2718"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu32 = - {-1169720286, -920699049, -2088732436, 1060190036, -1123468835, 922940053} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.5.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.5.raw.txt deleted file mode 100644 index bfc1a9a698..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.5.raw.txt +++ /dev/null @@ -1,30 +0,0 @@ -netcdf test_atomic_array.nc.5 { - variables: - ubyte vu8(1, 2); - string vu8:_DAP4_Checksum_CRC32 = "0x1a9eb5b3"; - - double vd(1); - string vd:_DAP4_Checksum_CRC32 = "0x74c1a1f1"; - - string vs(1, 1); - string vs:_DAP4_Checksum_CRC32 = "0x15293f21"; - - opaque vo(1, 1); - string vo:_DAP4_Checksum_CRC32 = "0x225778dc"; - - // global attributes: - string :_dap4.ce = "/vu8[1][0:2:2];/vd[1];/vs[1][0];/vo[0][1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {3, 5} - } -vd = - {1024.8} -vs = - { "Καλημέα" - } -vo = 0xabcdef0000000000; - -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.8.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.8.raw.txt deleted file mode 100644 index 8c33c36312..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.8.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_atomic_array.nc.8 { - variables: - short v16(3); - string v16:_DAP4_Checksum_CRC32 = "0xb4fb7f89"; - - // global attributes: - string :_dap4.ce = "/v16[0:1,3]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v16 = - {1, 2, 4} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.9.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.9.raw.txt deleted file mode 100644 index 7137b40bd6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.9.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_atomic_array.nc.9 { - variables: - short v16(3); - string v16:_DAP4_Checksum_CRC32 = "0xa0d9e652"; - - // global attributes: - string :_dap4.ce = "/v16[3,0:1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v16 = - {4, 1, 2} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.raw.txt deleted file mode 100644 index 4aafbcac3b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.raw.txt +++ /dev/null @@ -1,63 +0,0 @@ -netcdf test_atomic_array { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - dimensions: - d1 = 1; - d2 = 2; - d3 = 3; - d4 = 4; - d5 = 5; - variables: - ubyte vu8(d2, d3); - string vu8:_DAP4_Checksum_CRC32 = "0xd42f6486"; - - short v16(d4); - string v16:_DAP4_Checksum_CRC32 = "0x92991416"; - - uint vu32(d2, d3); - string vu32:_DAP4_Checksum_CRC32 = "0x0c56f0f2"; - - double vd(d2); - string vd:_DAP4_Checksum_CRC32 = "0x7c09cbae"; - - char vc(d2); - string vc:_DAP4_Checksum_CRC32 = "0x63add807"; - - string vs(d2, d2); - string vs:_DAP4_Checksum_CRC32 = "0x672f70c4"; - - opaque vo(d1, d2); - string vo:_DAP4_Checksum_CRC32 = "0x2757560d"; - - enum cloud_class_t primary_cloud(d5); - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0xb58a627a"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {255, 1, 2}, - {3, 4, 5} - } -v16 = - {1, 2, 3, 4} -vu32 = - { - {5, 4, 3}, - {2, 1, 0} - } -vd = - {17.9, 1024.8} -vc = "@&" -vs = - { "hello world", "hello world", "hello world", "hello world" - } -vo = 0x0123456789abcdef, - 0x0123456789abcdef; - -primary_cloud = - {0, 2, 0, 1, 127} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.syn.raw.txt deleted file mode 100644 index e1388d3f78..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.syn.raw.txt +++ /dev/null @@ -1,63 +0,0 @@ -netcdf test_atomic_array.syn { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - dimensions: - d1 = 1; - d2 = 2; - d3 = 3; - d4 = 4; - d5 = 5; - variables: - ubyte vu8(d2, d3); - string vu8:_DAP4_Checksum_CRC32 = "0xd79bd598"; - - short v16(d4); - string v16:_DAP4_Checksum_CRC32 = "0xa40ee271"; - - uint vu32(d2, d3); - string vu32:_DAP4_Checksum_CRC32 = "0xa06ca308"; - - double vd(d2); - string vd:_DAP4_Checksum_CRC32 = "0x7ee0fb67"; - - char vc(d2); - string vc:_DAP4_Checksum_CRC32 = "0x7cee5238"; - - string vs(d2, d2); - string vs:_DAP4_Checksum_CRC32 = "0x9d474c4c"; - - opaque vo(d1, d2); - string vo:_DAP4_Checksum_CRC32 = "0xd4809521"; - - enum cloud_class_t primary_cloud(d5); - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x94b74cf7"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {186, 201, 131}, - {63, 189, 55} - } -v16 = - {-341, -21899, -13413, -22144} -vu32 = - { - {2367803413, 3586730583, 511843988}, - {3754752863, 2950934681, 2366232135} - } -vd = - {0.21787008119279183, 0.6024507919967678} -vc = "CO" -vs = - { "{S", "{S", "{S", "{S" - } -vo = 0xa2177aa7287c04fa8bb57bcdf76ec80f, - 0xa2177aa7287c04fa8bb57bcdf76ec80f; - -primary_cloud = - {2, 9, 6, 8, 3} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.nc.raw.txt deleted file mode 100644 index a6cd1e1933..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.nc.raw.txt +++ /dev/null @@ -1,72 +0,0 @@ -netcdf test_atomic_types { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - byte v8; - string v8:_DAP4_Checksum_CRC32 = "0x3fba6cad"; - - ubyte vu8; - string vu8:_DAP4_Checksum_CRC32 = "0xff000000"; - - short v16; - string v16:_DAP4_Checksum_CRC32 = "0xac6191df"; - - ushort vu16; - string vu16:_DAP4_Checksum_CRC32 = "0xffff0000"; - - int v32; - string v32:_DAP4_Checksum_CRC32 = "0x12477cdf"; - - uint vu32; - string vu32:_DAP4_Checksum_CRC32 = "0xffffffff"; - - long v64; - string v64:_DAP4_Checksum_CRC32 = "0xccfc5c3c"; - - ulong vu64; - string vu64:_DAP4_Checksum_CRC32 = "0x2144df1c"; - - float vf; - string vf:_DAP4_Checksum_CRC32 = "0x8c2a1365"; - - double vd; - string vd:_DAP4_Checksum_CRC32 = "0xf2bacb72"; - - char vc; - string vc:_DAP4_Checksum_CRC32 = "0xa4deae1d"; - - string vs; - string vs:_DAP4_Checksum_CRC32 = "0x3691a6d4"; - - opaque vo; - string vo:_DAP4_Checksum_CRC32 = "0xd24ddadd"; - - enum cloud_class_t primary_cloud; - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x3c0c8ea1"; - - enum cloud_class_t secondary_cloud; - string secondary_cloud:_FillValue = "Missing"; - string secondary_cloud:_DAP4_Checksum_CRC32 = "0x12b88320"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v8 =-128 -vu8 =255 -v16 =-32768 -vu16 =65535 -v32 =2147483647 -vu32 =4294967295 -v64 =9223372036854775807 -vu64 =18446744073709551615 -vf =3.1415927 -vd =3.141592653589793 -vc =@ -vs = "hello world" -vo = 0x0123456789abcdef; - -primary_cloud =2 -secondary_cloud =127 -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.syn.raw.txt deleted file mode 100644 index 3c302ef4a6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.syn.raw.txt +++ /dev/null @@ -1,72 +0,0 @@ -netcdf test_atomic_types.syn { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - byte v8; - string v8:_DAP4_Checksum_CRC32 = "0x140e363f"; - - ubyte vu8; - string vu8:_DAP4_Checksum_CRC32 = "0x30ba9599"; - - short v16; - string v16:_DAP4_Checksum_CRC32 = "0xe353db0e"; - - ushort vu16; - string vu16:_DAP4_Checksum_CRC32 = "0x31e23870"; - - int v32; - string v32:_DAP4_Checksum_CRC32 = "0xbad2143f"; - - uint vu32; - string vu32:_DAP4_Checksum_CRC32 = "0x32e54381"; - - long v64; - string v64:_DAP4_Checksum_CRC32 = "0x915dfe6e"; - - ulong vu64; - string vu64:_DAP4_Checksum_CRC32 = "0x9233006a"; - - float vf; - string vf:_DAP4_Checksum_CRC32 = "0x3d571922"; - - double vd; - string vd:_DAP4_Checksum_CRC32 = "0xffd91cad"; - - char vc; - string vc:_DAP4_Checksum_CRC32 = "0x09b9265b"; - - string vs; - string vs:_DAP4_Checksum_CRC32 = "0x81827ad8"; - - opaque vo; - string vo:_DAP4_Checksum_CRC32 = "0x2d29db8e"; - - enum cloud_class_t primary_cloud; - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x4c667a2e"; - - enum cloud_class_t secondary_cloud; - string secondary_cloud:_FillValue = "Missing"; - string secondary_cloud:_DAP4_Checksum_CRC32 = "0x4b0bbe37"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v8 =58 -vu8 =201 -v16 =896 -vu16 =16177 -v32 =-1123468835 -vu32 =2125143125 -v64 =3059391736915381031 -vu64 =11577488182652895291 -vf =0.5512972 -vd =0.7902673011288164 -vc =* -vs = "O,L?c8A%V" -vo = 0x46f169ef23cbaf9b1febd99e4e16cec9; - -primary_cloud =7 -secondary_cloud =3 -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum.nc.raw.txt deleted file mode 100644 index b666139c20..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum.nc.raw.txt +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_enum { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - enum cloud_class_t primary_cloud; - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x3c0c8ea1"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud =2 -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_2.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_2.nc.raw.txt deleted file mode 100644 index 62ee4d281a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_2.nc.raw.txt +++ /dev/null @@ -1,17 +0,0 @@ -netcdf test_enum_2 { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - - group: h { - variables: - enum cloud_class_t primary_cloud; - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x3c0c8ea1"; - - } - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -h/primary_cloud =2 -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.4.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.4.raw.txt deleted file mode 100644 index 82933a50d3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.4.raw.txt +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_enum_array.nc.4 { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - enum cloud_class_t primary_cloud(2); - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x04e840eb"; - - // global attributes: - string :_dap4.ce = "/primary_cloud[1:2:4]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud = - {2, 1} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.raw.txt deleted file mode 100644 index 0a2c146f56..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.raw.txt +++ /dev/null @@ -1,17 +0,0 @@ -netcdf test_enum_array { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - dimensions: - d5 = 5; - variables: - enum cloud_class_t primary_cloud(d5); - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0xb58a627a"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud = - {0, 2, 0, 1, 127} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_fill.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_fill.nc.raw.txt deleted file mode 100644 index 839f800bfe..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_fill.nc.raw.txt +++ /dev/null @@ -1,19 +0,0 @@ -netcdf test_fill { - variables: - ubyte uv8; - string uv8:_DAP4_Checksum_CRC32 = "0x6fbf1d91"; - - short v16; - string v16:_DAP4_Checksum_CRC32 = "0xc9139fe6"; - - uint uv32; - uv32:_FillValue = 17; - string uv32:_DAP4_Checksum_CRC32 = "0x8437b331"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -uv8 =240 -v16 =32700 -uv32 =111000 -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_groups1.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_groups1.nc.raw.txt deleted file mode 100644 index 253a698474..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_groups1.nc.raw.txt +++ /dev/null @@ -1,44 +0,0 @@ -netcdf test_groups1 { - dimensions: - dim1 = 5; - - group: g { - dimensions: - dim2 = 3; - - group: h { - dimensions: - dim3 = 7; - variables: - int v1(dim1); - string v1:_DAP4_Checksum_CRC32 = "0x1d1d272c"; - - float v2(dim2); - string v2:_DAP4_Checksum_CRC32 = "0x0fe72d43"; - - } - - group: i { - dimensions: - dim3 = 7; - variables: - int v1(dim1); - string v1:_DAP4_Checksum_CRC32 = "0xa9b4a0fb"; - - float v3(dim3); - string v3:_DAP4_Checksum_CRC32 = "0x29f1e312"; - - } - } - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -g/h/v1 = - {-876354855, -1761252264, 1723477387, -46827465, 1475147969} -g/h/v2 = - {12.0, -100.0, 9.96921E36} -g/i/v1 = - {2, 3, 5, 7, 11} -g/i/v3 = - {23.0, 29.0, 19.0, 31.0, 17.0, 37.0, 13.0} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_var.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_var.nc.raw.txt deleted file mode 100644 index 2b376e08ab..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_var.nc.raw.txt +++ /dev/null @@ -1,10 +0,0 @@ -netcdf test_one_var { - variables: - int t; - string t:_DAP4_Checksum_CRC32 = "0xc9e1efe6"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t =17 -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.1.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.1.raw.txt deleted file mode 100644 index 4b380edb65..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.1.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_one_vararray.nc.1 { - variables: - int t(1); - string t:_DAP4_Checksum_CRC32 = "0xb6a88010"; - - // global attributes: - string :_dap4.ce = "/t[1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {37} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.3.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.3.raw.txt deleted file mode 100644 index 7e65c1a454..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.3.raw.txt +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_one_vararray.nc.3 { - dimensions: - d2 = 2; - variables: - int t(d2); - string t:_DAP4_Checksum_CRC32 = "0x42dfb1d0"; - - // global attributes: - string :_dap4.ce = "/t[0:1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {17, 37} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.raw.txt deleted file mode 100644 index f76c579e38..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.raw.txt +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_one_vararray { - dimensions: - d2 = 2; - variables: - int t(d2); - string t:_DAP4_Checksum_CRC32 = "0x42dfb1d0"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {17, 37} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque.nc.raw.txt deleted file mode 100644 index 54dcb52c2b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque.nc.raw.txt +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_opaque { - variables: - opaque vo1; - string vo1:_DAP4_Checksum_CRC32 = "0xd24ddadd"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vo1 = 0x0123456789abcdef; - -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.7.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.7.raw.txt deleted file mode 100644 index 10d45fe22b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.7.raw.txt +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_opaque_array.nc.7 { - variables: - opaque vo2(1, 2); - string vo2:_DAP4_Checksum_CRC32 = "0xcca386bf"; - - // global attributes: - string :_dap4.ce = "/vo2[1][0:1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vo2 = 0xfedcba9876543210, - 0xfedcba9876543210; - -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.raw.txt deleted file mode 100644 index 0f2053e984..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.raw.txt +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_opaque_array { - dimensions: - d2 = 2; - variables: - opaque vo2(d2, d2); - string vo2:_DAP4_Checksum_CRC32 = "0x91581cda"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vo2 = 0x0123456789abcdef, - 0x0123456789abcdef, - 0x0123456789abcdef, - 0x0123456789abcdef; - -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_sequence_1.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_sequence_1.syn.raw.txt deleted file mode 100644 index 8fd1eb64bf..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_sequence_1.syn.raw.txt +++ /dev/null @@ -1,23 +0,0 @@ -netcdf test_sequence_1.syn { - variables: - - Sequence { - int i1; - short sh1; - } s(*); - string s:_DAP4_Checksum_CRC32 = "0x4ac0ac5e"; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - s = - { - i1 = - {-920699049 - } - sh1 = - {896 - } - } s -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.nc.6.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.nc.6.raw.txt deleted file mode 100644 index 5ca77032b5..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.nc.6.raw.txt +++ /dev/null @@ -1,34 +0,0 @@ -netcdf test_struct_array.nc.6 { - variables: - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s(2, 2); - string s:_DAP4_Checksum_CRC32 = "0x324d0ea6"; - - - // global attributes: - string :_dap4.ce = "/s[0:2:3][0:1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -s = - { - x =1 - y =-1 - } s(0) - { - x =17 - y =37 - } s(1) - { - x =-4 - y =12 - } s(2) - { - x =-8 - y =8 - } s(3) -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.syn.raw.txt deleted file mode 100644 index 76531f1451..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.syn.raw.txt +++ /dev/null @@ -1,78 +0,0 @@ -netcdf test_struct_array.syn { - dimensions: - dx = 4; - dy = 3; - variables: - float z(dx); - string z:_DAP4_Checksum_CRC32 = "0xbef06d05"; - - float t(dy); - string t:_DAP4_Checksum_CRC32 = "0x165934f0"; - - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s(dx, dy); - string s:_DAP4_Checksum_CRC32 = "0xd91a250e"; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -z = - {0.72765326, 0.785633, 0.513679, 0.24684471} -t = - {0.738422, 0.21488869, 0.49479842} -s = - { - x =712320147 - y =1268468519 - } s(0) - { - x =696298400 - y =989876086 - } s(1) - { - x =-1927163883 - y =-900795134 - } s(2) - { - x =-708236713 - y =1377500019 - } s(3) - { - x =511843988 - y =1699265896 - } s(4) - { - x =-540214433 - y =-914532520 - } s(5) - { - x =-1344032615 - y =-871416961 - } s(6) - { - x =-1928735161 - y =935744880 - } s(7) - { - x =-1509955773 - y =-1707460853 - } s(8) - { - x =1145911788 - y =-415231529 - } s(9) - { - x =-278269626 - y =-1682978013 - } s(10) - { - x =-1629885665 - y =-909240754 - } s(11) -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested.hdf5.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested.hdf5.raw.txt deleted file mode 100644 index fdd4aa1aad..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested.hdf5.raw.txt +++ /dev/null @@ -1,39 +0,0 @@ -netcdf test_struct_nested.hdf5 { - variables: - - Structure { - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } field1; - - - Structure { - int x; - int y; - } field2; - - } x; - string x:_DAP4_Checksum_CRC32 = "0xdfa7461b"; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - x = - { - field1 = - { - x = 1 - y = -2 - } field1(0) - field2 = - { - x = 255 - y = 90 - } field2(0) - } x(0) -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested3.hdf5.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested3.hdf5.raw.txt deleted file mode 100644 index a165d7033e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested3.hdf5.raw.txt +++ /dev/null @@ -1,31 +0,0 @@ -netcdf test_struct_nested3.hdf5 { - variables: - - Structure { - - Structure { - - Structure { - int field1; - } field2; - - } field3; - - } x; - string x:_DAP4_Checksum_CRC32 = "0xc9e1efe6"; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - x = - { - field3 = - { - field2 = - { - field1 = 17 - } field2(0) - } field3(0) - } x(0) -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_type.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_type.nc.raw.txt deleted file mode 100644 index 64832f765e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_type.nc.raw.txt +++ /dev/null @@ -1,21 +0,0 @@ -netcdf test_struct_type { - variables: - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s; - string s:_DAP4_Checksum_CRC32 = "0xcf8f9871"; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - s = - { - x = 1 - y = -2 - } s(0) -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_utf8.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_utf8.nc.raw.txt deleted file mode 100644 index e99cf54c4a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_utf8.nc.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_utf8 { - dimensions: - d2 = 2; - variables: - string vs(d2); - string vs:_DAP4_Checksum_CRC32 = "0xfce3cd28"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vs = "Καλημέα", "Καλημέα" -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.2.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.2.raw deleted file mode 100644 index 02521f8b96..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.2.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.raw deleted file mode 100644 index 90cf83423e..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.5.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.5.raw deleted file mode 100644 index 64f2028ca3..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.5.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.8.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.8.raw deleted file mode 100644 index 9c55a80646..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.8.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.9.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.9.raw deleted file mode 100644 index 6f17241329..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.9.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.raw deleted file mode 100644 index 9a6e307575..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.syn.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.syn.raw deleted file mode 100644 index 30138ab7b1..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.syn.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.nc.raw deleted file mode 100644 index 97ddca1028..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.syn.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.syn.raw deleted file mode 100644 index 906759bc74..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.syn.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum.nc.raw deleted file mode 100644 index ec69756822..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_2.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_2.nc.raw deleted file mode 100644 index d38f5337ff..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_2.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.4.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.4.raw deleted file mode 100644 index e89b3c55fd..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.4.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.raw deleted file mode 100644 index 60a17c7524..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_fill.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_fill.nc.raw deleted file mode 100644 index 151559c495..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_fill.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_groups1.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_groups1.nc.raw deleted file mode 100644 index fc6a4a66d7..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_groups1.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_var.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_var.nc.raw deleted file mode 100644 index 8b29a0bd17..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_var.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.1.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.1.raw deleted file mode 100644 index 814c0ed7bb..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.1.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.3.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.3.raw deleted file mode 100644 index 42ed5d7347..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.3.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.raw deleted file mode 100644 index 15ca928b3d..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque.nc.raw deleted file mode 100644 index 983427b986..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.7.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.7.raw deleted file mode 100644 index a7cfeb0f0c..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.7.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.raw deleted file mode 100644 index 10aa455370..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_sequence_1.syn.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_sequence_1.syn.raw deleted file mode 100644 index 6b83150005..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_sequence_1.syn.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_sequence_2.syn.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_sequence_2.syn.raw deleted file mode 100644 index 2b7c5072b7..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_sequence_2.syn.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.nc.6.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.nc.6.raw deleted file mode 100644 index f551cc1020..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.nc.6.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.syn.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.syn.raw deleted file mode 100644 index 06ce49201d..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.syn.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested.hdf5.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested.hdf5.raw deleted file mode 100644 index 9e3de4050b..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested.hdf5.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested3.hdf5.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested3.hdf5.raw deleted file mode 100644 index 8425a19ed3..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested3.hdf5.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_type.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_type.nc.raw deleted file mode 100644 index 2b3ffbf1bb..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_type.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_utf8.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_utf8.nc.raw deleted file mode 100644 index b1518cf6b8..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_utf8.nc.raw and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_anon_dim.syn.2.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_anon_dim.syn.2.raw.txt deleted file mode 100644 index 3aec08b1c9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_anon_dim.syn.2.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_anon_dim.syn.2 { - variables: - int vu32(4); - string vu32:_DAP4_Checksum_CRC32 = "0x417bc794"; - - // global attributes: - string :_dap4.ce = "/vu32[0:3]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu32 = - {-1169720286, -920699049, -2088732436, 1060190036} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.5.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.5.raw.txt deleted file mode 100644 index bfc1a9a698..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.5.raw.txt +++ /dev/null @@ -1,30 +0,0 @@ -netcdf test_atomic_array.nc.5 { - variables: - ubyte vu8(1, 2); - string vu8:_DAP4_Checksum_CRC32 = "0x1a9eb5b3"; - - double vd(1); - string vd:_DAP4_Checksum_CRC32 = "0x74c1a1f1"; - - string vs(1, 1); - string vs:_DAP4_Checksum_CRC32 = "0x15293f21"; - - opaque vo(1, 1); - string vo:_DAP4_Checksum_CRC32 = "0x225778dc"; - - // global attributes: - string :_dap4.ce = "/vu8[1][0:2:2];/vd[1];/vs[1][0];/vo[0][1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {3, 5} - } -vd = - {1024.8} -vs = - { "Καλημέα" - } -vo = 0xabcdef0000000000; - -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.8.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.8.raw.txt deleted file mode 100644 index 6c79c85f94..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.8.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_atomic_array.nc.8 { - variables: - short v16(3); - string v16:_DAP4_Checksum_CRC32 = "0xc592fc85"; - - // global attributes: - string :_dap4.ce = "/v16[1:2,2]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v16 = - {2, 3, 3} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.9.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.9.raw.txt deleted file mode 100644 index b367f16522..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.9.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_atomic_array.nc.9 { - variables: - short v16(3); - string v16:_DAP4_Checksum_CRC32 = "0xb6724845"; - - // global attributes: - string :_dap4.ce = "/v16[2,1:2]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v16 = - {3, 2, 3} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_enum_array.nc.4.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_enum_array.nc.4.raw.txt deleted file mode 100644 index 82933a50d3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_enum_array.nc.4.raw.txt +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_enum_array.nc.4 { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - enum cloud_class_t primary_cloud(2); - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x04e840eb"; - - // global attributes: - string :_dap4.ce = "/primary_cloud[1:2:4]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud = - {2, 1} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.1.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.1.raw.txt deleted file mode 100644 index 4b380edb65..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.1.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_one_vararray.nc.1 { - variables: - int t(1); - string t:_DAP4_Checksum_CRC32 = "0xb6a88010"; - - // global attributes: - string :_dap4.ce = "/t[1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {37} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.3.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.3.raw.txt deleted file mode 100644 index 7e65c1a454..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.3.raw.txt +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_one_vararray.nc.3 { - dimensions: - d2 = 2; - variables: - int t(d2); - string t:_DAP4_Checksum_CRC32 = "0x42dfb1d0"; - - // global attributes: - string :_dap4.ce = "/t[0:1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {17, 37} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_opaque_array.nc.7.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_opaque_array.nc.7.raw.txt deleted file mode 100644 index f7e6996969..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_opaque_array.nc.7.raw.txt +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_opaque_array.nc.7 { - variables: - opaque vo2(1, 2); - string vo2:_DAP4_Checksum_CRC32 = "0x3f3fa5d4"; - - // global attributes: - string :_dap4.ce = "/vo2[1][0,0]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vo2 = 0xfedcba9876543210, - 0xfedcba9876543210; - -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_struct_array.nc.6.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_struct_array.nc.6.raw.txt deleted file mode 100644 index 5ca77032b5..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_struct_array.nc.6.raw.txt +++ /dev/null @@ -1,34 +0,0 @@ -netcdf test_struct_array.nc.6 { - variables: - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s(2, 2); - string s:_DAP4_Checksum_CRC32 = "0x324d0ea6"; - - - // global attributes: - string :_dap4.ce = "/s[0:2:3][0:1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -s = - { - x =1 - y =-1 - } s(0) - { - x =17 - y =37 - } s(1) - { - x =-4 - y =12 - } s(2) - { - x =-8 - y =8 - } s(3) -} diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.2.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.2.raw.txt deleted file mode 100644 index 25034c5a30..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.2.raw.txt +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - -/vu32[0] = -1169720286 -/vu32[1] = -920699049 -/vu32[2] = -2088732436 -/vu32[3] = 1060190036 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.raw.txt deleted file mode 100644 index f6dd09784a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.raw.txt +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -/vu32[0] = -1169720286 -/vu32[1] = -920699049 -/vu32[2] = -2088732436 -/vu32[3] = 1060190036 -/vu32[4] = -1123468835 -/vu32[5] = 922940053 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.5.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.5.raw.txt deleted file mode 100644 index b4d1d6ce75..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.5.raw.txt +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -/vu8[0,0] = 3 -/vu8[0,1] = 5 -/vd[0] = 1024.800000 -/vs[0,0] = "Καλημέα" -/vo[0,0] = 0xABCDEF0000000000 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.8.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.8.raw.txt deleted file mode 100644 index 447e729347..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.8.raw.txt +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -/v16[0] = 1 -/v16[1] = 2 -/v16[2] = 4 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.9.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.9.raw.txt deleted file mode 100644 index 769a4618ee..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.9.raw.txt +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -/v16[0] = 4 -/v16[1] = 1 -/v16[2] = 2 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.raw.txt deleted file mode 100644 index 2e2bea3dd0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.raw.txt +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/vu8[0,0] = 255 -/vu8[0,1] = 1 -/vu8[0,2] = 2 -/vu8[1,0] = 3 -/vu8[1,1] = 4 -/vu8[1,2] = 5 -/v16[0] = 1 -/v16[1] = 2 -/v16[2] = 3 -/v16[3] = 4 -/vu32[0,0] = 5 -/vu32[0,1] = 4 -/vu32[0,2] = 3 -/vu32[1,0] = 2 -/vu32[1,1] = 1 -/vu32[1,2] = 0 -/vd[0] = 17.900000 -/vd[1] = 1024.800000 -/vc[0] = '@' -/vc[1] = '&' -/vs[0,0] = "hello\tworld" -/vs[0,1] = "\r\n" -/vs[1,0] = "Καλημέα" -/vs[1,1] = "abc" -/vo[0,0] = 0x0123456789ABCDEF -/vo[0,1] = 0xABCDEF0000000000 -/primary_cloud[0] = Clear -/primary_cloud[1] = Stratus -/primary_cloud[2] = Clear -/primary_cloud[3] = Cumulonimbus -/primary_cloud[4] = Missing - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.syn.raw.txt deleted file mode 100644 index 04ad7521e5..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.syn.raw.txt +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/vu8[0,0] = 186 -/vu8[0,1] = 201 -/vu8[0,2] = 131 -/vu8[1,0] = 63 -/vu8[1,1] = 189 -/vu8[1,2] = 55 -/v16[0] = -341 -/v16[1] = -21899 -/v16[2] = -13413 -/v16[3] = -22144 -/vu32[0,0] = 2367803413 -/vu32[0,1] = 3586730583 -/vu32[0,2] = 511843988 -/vu32[1,0] = 3754752863 -/vu32[1,1] = 2950934681 -/vu32[1,2] = 2366232135 -/vd[0] = 0.217870 -/vd[1] = 0.602451 -/vc[0] = 'C' -/vc[1] = 'O' -/vs[0,0] = "{S" -/vs[0,1] = "gb8^OE$" -/vs[1,0] = "4a/q%n9;5Y" -/vs[1,1] = "{fIl?T"\A[" -/vo[0,0] = 0xA2177AA7287C04FA8BB57BCDF76EC80F -/vo[0,1] = 0x34FA472AA9404DD543143CADED303A75 -/primary_cloud[0] = Stratus -/primary_cloud[1] = Cirrocumulus -/primary_cloud[2] = Nimbostratus -/primary_cloud[3] = Cirrostratus -/primary_cloud[4] = Stratocumulus - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.nc.raw.txt deleted file mode 100644 index cff7ae5f4d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.nc.raw.txt +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/v8 = -128 -/vu8 = 255 -/v16 = -32768 -/vu16 = 65535 -/v32 = 2147483647 -/vu32 = 4294967295 -/v64 = 9223372036854775807 -/vu64 = 18446744073709551615 -/vf = 3.141593 -/vd = 3.141593 -/vc = '@' -/vs = "hello\tworld" -/vo = 0x0123456789ABCDEF -/primary_cloud = Stratus -/secondary_cloud = Missing - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.syn.raw.txt deleted file mode 100644 index 6a7adb4fd4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.syn.raw.txt +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/v8 = 58 -/vu8 = 201 -/v16 = 896 -/vu16 = 16177 -/v32 = -1123468835 -/vu32 = 2125143125 -/v64 = 3059391736915381031 -/vu64 = 11577488182652895291 -/vf = 0.551297 -/vd = 0.790267 -/vc = '*' -/vs = "O,L?c8A%V" -/vo = 0x46F169EF23CBAF9B1FEBD99E4E16CEC9 -/primary_cloud = Altocumulus -/secondary_cloud = Stratocumulus - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum.nc.raw.txt deleted file mode 100644 index 8c8ce9ebb4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum.nc.raw.txt +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -/primary_cloud = Stratus - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_2.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_2.nc.raw.txt deleted file mode 100644 index f0402352be..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_2.nc.raw.txt +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - -/h/primary_cloud = Stratus - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.4.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.4.raw.txt deleted file mode 100644 index 0217409df8..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.4.raw.txt +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - -/primary_cloud[0] = Stratus -/primary_cloud[1] = Cumulonimbus - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.raw.txt deleted file mode 100644 index c23486baff..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.raw.txt +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - -/primary_cloud[0] = Clear -/primary_cloud[1] = Stratus -/primary_cloud[2] = Clear -/primary_cloud[3] = Cumulonimbus -/primary_cloud[4] = Missing - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_fill.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_fill.nc.raw.txt deleted file mode 100644 index dd457986b4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_fill.nc.raw.txt +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -/uv8 = 240 -/v16 = 32700 -/uv32 = 111000 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_groups1.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_groups1.nc.raw.txt deleted file mode 100644 index 431c26d8ea..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_groups1.nc.raw.txt +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -/g/h/v1[0] = -876354855 -/g/h/v1[1] = -1761252264 -/g/h/v1[2] = 1723477387 -/g/h/v1[3] = -46827465 -/g/h/v1[4] = 1475147969 -/g/h/v2[0] = 12.000000 -/g/h/v2[1] = -100.000000 -/g/h/v2[2] = 9969209968386869000000000000000000000.000000 -/g/i/v1[0] = 2 -/g/i/v1[1] = 3 -/g/i/v1[2] = 5 -/g/i/v1[3] = 7 -/g/i/v1[4] = 11 -/g/i/v3[0] = 23.000000 -/g/i/v3[1] = 29.000000 -/g/i/v3[2] = 19.000000 -/g/i/v3[3] = 31.000000 -/g/i/v3[4] = 17.000000 -/g/i/v3[5] = 37.000000 -/g/i/v3[6] = 13.000000 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_var.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_var.nc.raw.txt deleted file mode 100644 index c74172bddb..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_var.nc.raw.txt +++ /dev/null @@ -1,10 +0,0 @@ - - - -/t = 17 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.1.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.1.raw.txt deleted file mode 100644 index 18bedc8d51..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.1.raw.txt +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - -/t[0] = 37 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.3.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.3.raw.txt deleted file mode 100644 index 495c199edf..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.3.raw.txt +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - -/t[0] = 17 -/t[1] = 37 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.raw.txt deleted file mode 100644 index 1d2f858e48..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.raw.txt +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -/t[0] = 17 -/t[1] = 37 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque.nc.raw.txt deleted file mode 100644 index a0dbfd2e55..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque.nc.raw.txt +++ /dev/null @@ -1,10 +0,0 @@ - - - -/vo1 = 0x0123456789ABCDEF - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.7.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.7.raw.txt deleted file mode 100644 index 157a621f2a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.7.raw.txt +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - -/vo2[0,0] = 0xFEDCBA9876543210 -/vo2[0,1] = 0xFEDCBA9999999999 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.raw.txt deleted file mode 100644 index 91da77c407..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.raw.txt +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - -/vo2[0,0] = 0x0123456789ABCDEF -/vo2[0,1] = 0xABCDEF0000000000 -/vo2[1,0] = 0xFEDCBA9876543210 -/vo2[1,1] = 0xFEDCBA9999999999 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_1.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_1.syn.raw.txt deleted file mode 100644 index 0e347626ef..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_1.syn.raw.txt +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -/s = { - [ - /s.i1 = -920699049 - /s.sh1 = 896 - ]} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_2.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_2.syn.raw.txt deleted file mode 100644 index bc5c5110e6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_2.syn.raw.txt +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - -/s[0] = { - [ - /s.i1 = -920699049 - /s.sh1 = 896 - ]} -/s[1] = { - [ - /s.i1 = -1123468835 - /s.sh1 = -18686 - ] [ - /s.i1 = 2125143125 - /s.sh1 = -21899 - ] [ - /s.i1 = 1268468519 - /s.sh1 = -22144 - ] [ - /s.i1 = 989876086 - /s.sh1 = 3361 - ]} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.nc.6.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.nc.6.raw.txt deleted file mode 100644 index e142a33713..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.nc.6.raw.txt +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - -/s[0,0] = { - /s.x = 1 - /s.y = -1 -} -/s[0,1] = { - /s.x = 17 - /s.y = 37 -} -/s[1,0] = { - /s.x = -4 - /s.y = 12 -} -/s[1,1] = { - /s.x = -8 - /s.y = 8 -} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.syn.raw.txt deleted file mode 100644 index 0b856f51d9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.syn.raw.txt +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - -/z[0] = 0.727653 -/z[1] = 0.785633 -/z[2] = 0.513679 -/z[3] = 0.246845 -/t[0] = 0.738422 -/t[1] = 0.214889 -/t[2] = 0.494798 -/s[0,0] = { - /s.x = 712320147 - /s.y = 1268468519 -} -/s[0,1] = { - /s.x = 696298400 - /s.y = 989876086 -} -/s[0,2] = { - /s.x = -1927163883 - /s.y = -900795134 -} -/s[1,0] = { - /s.x = -708236713 - /s.y = 1377500019 -} -/s[1,1] = { - /s.x = 511843988 - /s.y = 1699265896 -} -/s[1,2] = { - /s.x = -540214433 - /s.y = -914532520 -} -/s[2,0] = { - /s.x = -1344032615 - /s.y = -871416961 -} -/s[2,1] = { - /s.x = -1928735161 - /s.y = 935744880 -} -/s[2,2] = { - /s.x = -1509955773 - /s.y = -1707460853 -} -/s[3,0] = { - /s.x = 1145911788 - /s.y = -415231529 -} -/s[3,1] = { - /s.x = -278269626 - /s.y = -1682978013 -} -/s[3,2] = { - /s.x = -1629885665 - /s.y = -909240754 -} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested.hdf5.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested.hdf5.raw.txt deleted file mode 100644 index 57c8557ac2..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested.hdf5.raw.txt +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - -/x = { - /x.field1 = { - /x.field1.x = 1 - /x.field1.y = -2 - } - /x.field2 = { - /x.field2.x = 255 - /x.field2.y = 90 - } -} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested3.hdf5.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested3.hdf5.raw.txt deleted file mode 100644 index ed42456ce6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested3.hdf5.raw.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - -/x = { - /x.field3 = { - /x.field3.field2 = { - /x.field3.field2.field1 = 17 - } - } -} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_type.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_type.nc.raw.txt deleted file mode 100644 index f15f61d6b3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_type.nc.raw.txt +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - -/s = { - /s.x = 1 - /s.y = -2 -} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_utf8.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_utf8.nc.raw.txt deleted file mode 100644 index 4df9309d37..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_utf8.nc.raw.txt +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -/vs[0] = "Καλημέα" -/vs[1] = "abc" - diff --git a/dap4/d4tests/src/test/data/resources/TestDSR/baseline/test1.dsr b/dap4/d4tests/src/test/data/resources/TestDSR/baseline/test1.dsr deleted file mode 100644 index 125939c27c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSR/baseline/test1.dsr +++ /dev/null @@ -1,29 +0,0 @@ - - - 4.0 - TDS-4 - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dap b/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dap deleted file mode 100644 index f36a08093f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dap +++ /dev/null @@ -1,3 +0,0 @@ -count=5 - -1169720286 18719 -2088732436 -16591 -1123468835 -18686 2125143125 -21899 1268468519 -22144 - checksum = 4aad97d4 diff --git a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dmr b/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dmr deleted file mode 100644 index 29109a2c04..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.2.dap b/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.2.dap deleted file mode 100644 index 7d7d18b90f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.2.dap +++ /dev/null @@ -1,3 +0,0 @@ -count=3 - -1169720286 18719 -2088732436 -16591 -1123468835 -18686 - checksum = 6a9c6608 diff --git a/dap4/d4tests/src/test/data/resources/TestFrontPage/baseline/test_frontpage.html b/dap4/d4tests/src/test/data/resources/TestFrontPage/baseline/test_frontpage.html deleted file mode 100644 index 51e228d2dd..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestFrontPage/baseline/test_frontpage.html +++ /dev/null @@ -1,296 +0,0 @@ - - -DAP4 Test Files - - - -

DAP4 Test Files

-

http://remotetest.unidata.ucar.edu/d4ts/{testfiles}

-
-

netCDF Based Test Files

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_atomic_array.nc: DMR.XML DAP DSR.XML
test_atomic_types.nc: DMR.XML DAP DSR.XML
test_enum.nc: DMR.XML DAP DSR.XML
test_enum1.nc: DMR.XML DAP DSR.XML
test_enum_2.nc: DMR.XML DAP DSR.XML
test_enum_array.nc: DMR.XML DAP DSR.XML
test_fill.nc: DMR.XML DAP DSR.XML
test_groups1.nc: DMR.XML DAP DSR.XML
test_misc1.nc: DMR.XML DAP DSR.XML
test_one_var.nc: DMR.XML DAP DSR.XML
test_one_vararray.nc: DMR.XML DAP DSR.XML
test_opaque.nc: DMR.XML DAP DSR.XML
test_opaque_array.nc: DMR.XML DAP DSR.XML
test_struct1.nc: DMR.XML DAP DSR.XML
test_struct_array.nc: DMR.XML DAP DSR.XML
test_struct_nested.nc: DMR.XML DAP DSR.XML
test_struct_nested3.nc: DMR.XML DAP DSR.XML
test_struct_type.nc: DMR.XML DAP DSR.XML
test_test.nc: DMR.XML DAP DSR.XML
test_unlim.nc: DMR.XML DAP DSR.XML
test_unlim1.nc: DMR.XML DAP DSR.XML
test_utf8.nc: DMR.XML DAP DSR.XML
test_vlen1.nc: DMR.XML DAP DSR.XML
test_vlen10.nc: DMR.XML DAP DSR.XML
test_vlen11.nc: DMR.XML DAP DSR.XML
test_vlen2.nc: DMR.XML DAP DSR.XML
test_vlen3.nc: DMR.XML DAP DSR.XML
test_vlen4.nc: DMR.XML DAP DSR.XML
test_vlen5.nc: DMR.XML DAP DSR.XML
test_vlen6.nc: DMR.XML DAP DSR.XML
test_vlen7.nc: DMR.XML DAP DSR.XML
test_vlen8.nc: DMR.XML DAP DSR.XML
test_vlen9.nc: DMR.XML DAP DSR.XML
test_zerodim.nc: DMR.XML DAP DSR.XML
tst_fills.nc: DMR.XML DAP DSR.XML
-

HDF5 Based Test Files

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_struct_nested.hdf5: DMR.XML DAP DSR.XML
test_struct_nested3.hdf5: DMR.XML DAP DSR.XML
test_vlen3.hdf5: DMR.XML DAP DSR.XML
test_vlen4.hdf5: DMR.XML DAP DSR.XML
test_vlen5.hdf5: DMR.XML DAP DSR.XML
-

Synthetic Based Test Files

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_anon_dim.syn: DMR.XML DAP DSR.XML
test_atomic_array.syn: DMR.XML DAP DSR.XML
test_atomic_types.syn: DMR.XML DAP DSR.XML
test_sequence_1.syn: DMR.XML DAP DSR.XML
test_sequence_2.syn: DMR.XML DAP DSR.XML
test_struct_array.syn: DMR.XML DAP DSR.XML
-
- diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.1.xml deleted file mode 100644 index 24f33b55bd..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.1.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - 1 - 2 - 3 - - - - some_large_hex_value - - - red - green - blue - - - 98.6 - - - barf - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.xml deleted file mode 100644 index e3d90ac6e0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - 1 - 2 - 3 - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_1.xml deleted file mode 100644 index eb2ba2bd26..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_1.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.1.xml deleted file mode 100644 index 14d9b2b378..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.1.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.xml deleted file mode 100644 index de25771186..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.1.xml deleted file mode 100644 index e2912f2f3c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.1.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - 1 - 2 - 3 - - - - some_large_hex_value - - - red - green - blue - - - 98.6 - - - barf - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.2.xml deleted file mode 100644 index e4bd6ea48c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.2.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.3.xml deleted file mode 100644 index b2e99a4064..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.3.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - 1 - 2 - 3 - - - - some_large_hex_value - - - red - green - blue - - - 98.6 - - - barf - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.4.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.4.xml deleted file mode 100644 index 98354ea298..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.4.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.5.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.5.xml deleted file mode 100644 index 822345c2e6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.5.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.xml deleted file mode 100644 index 7675f27e56..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.1.xml deleted file mode 100644 index e43ec4f81f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.xml deleted file mode 100644 index 7728abca32..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.1.xml deleted file mode 100644 index 8ae88fff55..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.1.xml +++ /dev/null @@ -1,53 +0,0 @@ - - dapVersion="4.0" dmrVersion="1.0"> - - - - - - - - - - - - 1 - 2 - 3 - - - - some_large_hex_value - - - - - - - - - - - - - - - 1 - 2 - 3 - - - - some_large_hex_value - - - red - green - blue - - - 98.6 - - - -
diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.xml deleted file mode 100644 index 7900313c64..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.1.xml deleted file mode 100644 index 0585fd7a24..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.1.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - 1 - 2 - 3 - - - - - - - - - - - - - 1 - 2 - 3 - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.2.xml deleted file mode 100644 index 92960908f8..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.2.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - 1 - 2 - 3 - - - - - - - - - - - - - - - - - - - 1 - 2 - 3 - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.xml deleted file mode 100644 index a88b5bf47d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.1.xml deleted file mode 100644 index 588a1ee931..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.1.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.2.xml deleted file mode 100644 index 25b9b59c51..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.2.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.3.xml deleted file mode 100644 index 5d04405d3d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.3.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.4.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.4.xml deleted file mode 100644 index aef2e07583..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.4.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.5.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.5.xml deleted file mode 100644 index 2e5bcacfee..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.5.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.xml deleted file mode 100644 index d2e55307d7..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_8.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_8.xml deleted file mode 100644 index 29a93fe87f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_8.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_1.xml deleted file mode 100644 index da6d955ac4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_1.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_10.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_10.xml deleted file mode 100644 index aac65a7955..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_10.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_11.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_11.xml deleted file mode 100644 index f661ce3517..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_11.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_2.xml deleted file mode 100644 index 45ab981649..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_3.xml deleted file mode 100644 index 356785c0e4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_3.xml +++ /dev/null @@ -1,12 +0,0 @@ - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_4.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_4.xml deleted file mode 100644 index e04b11ed9b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_4.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_5.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_5.xml deleted file mode 100644 index de24f7fdfa..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_5.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_6.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_6.xml deleted file mode 100644 index 88a4209425..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_6.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_7.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_7.xml deleted file mode 100644 index 00a22b0c81..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_7.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_8.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_8.xml deleted file mode 100644 index 61919cb9d3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_8.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_escaped_paths.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_escaped_paths.xml deleted file mode 100644 index afd82e7bf2..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_escaped_paths.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - 10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.dmr b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.dmr deleted file mode 100644 index 503b89e031..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.dmr +++ /dev/null @@ -1,10 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.xml deleted file mode 100644 index 503b89e031..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_10.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_10.xml deleted file mode 100644 index e87a967368..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_10.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_2.xml deleted file mode 100644 index 78e6928d1e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_2.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3.xml deleted file mode 100644 index 5068261867..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_1.xml deleted file mode 100644 index 5686798376..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_2.xml deleted file mode 100644 index 6f28cd48ae..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_3.xml deleted file mode 100644 index c8d6f24d51..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_4.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_4.xml deleted file mode 100644 index 416f4597e5..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_4.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - x_axis_value - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_5.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_5.xml deleted file mode 100644 index 5c844638ef..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_5.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_6.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_6.xml deleted file mode 100644 index 20e14a6f6a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_6.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_7.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_7.xml deleted file mode 100644 index d163b92912..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_7.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_8.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_8.xml deleted file mode 100644 index 4db2522603..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.1.xml deleted file mode 100644 index 0dacc20a66..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.1.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.xml deleted file mode 100644 index fd38d284d6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/hyrax.html b/dap4/d4tests/src/test/data/resources/TestHyrax/hyrax.html deleted file mode 100644 index e92d923650..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/hyrax.html +++ /dev/null @@ -1,380 +0,0 @@ - - -DAP4 Test Files - - - -

DAP4 Test Files

-

http://amazon.com/dap/reader/dap4/dap4.html

-
-

netCDF Based Test Files

- -
-

HDF5 Based Test Files

- -
-

Synthetic Based Test Files

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_simple_1.dmr: DMR (XML) DAP DSR
dmr-testsuite/test_array_10.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_11.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_1.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_2.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_3.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_4.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_5.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_6.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_7.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_8.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_10.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_1.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_2.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_3_error_1.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_3_error_2.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_3_error_3.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_3.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_4.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_5.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_6.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_7.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_8.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_9.1.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_9.xml: DMR (XML) DAP DSR
dmr-testsuite/test_escaped_paths.xml: DMR (XML) DAP DSR
D4-xml/DMR_0.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_0.xml: DMR (XML) DAP DSR
D4-xml/DMR_1.xml: DMR (XML) DAP DSR
D4-xml/DMR_2.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_2.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.2.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.3.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.4.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.5.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.xml: DMR (XML) DAP DSR
D4-xml/DMR_4.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_4.xml: DMR (XML) DAP DSR
D4-xml/DMR_5.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_5.xml: DMR (XML) DAP DSR
D4-xml/DMR_6.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_6.2.xml: DMR (XML) DAP DSR
D4-xml/DMR_6.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.2.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.3.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.4.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.5.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.xml: DMR (XML) DAP DSR
D4-xml/DMR_8.xml: DMR (XML) DAP DSR
-
- diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dap deleted file mode 100644 index a190c8fd5c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dap +++ /dev/null @@ -1,56 +0,0 @@ -netcdf test_atomic_array { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - dimensions: - d1 = 1; - d2 = 2; - d3 = 3; - d4 = 4; - d5 = 5; - variables: - ubyte vu8(d2, d3); - - short v16(d4); - - uint vu32(d2, d3); - - double vd(d2); - - char vc(d2); - - String vs(d2, d2); - - opaque vo(d1, d2); - - enum cloud_class_t primary_cloud(d5); - string primary_cloud:_FillValue = "Missing"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {255, 1, 2}, - {3, 4, 5} - } -v16 = - {1, 2, 3, 4} -vu32 = - { - {5, 4, 3}, - {2, 1, 0} - } -vd = - {17.9, 1024.8} -vc = "@&" -vs = - { "hello world", " -", "Καλημέα", "abc" - } -vo = 0x0123456789abcdef, - 0xabcdef0000000000; - -primary_cloud = - {0, 2, 0, 1, 127} -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dmr deleted file mode 100644 index 822a30cbc9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dmr +++ /dev/null @@ -1,31 +0,0 @@ -netcdf test_atomic_array { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - dimensions: - d1 = 1; - d2 = 2; - d3 = 3; - d4 = 4; - d5 = 5; - variables: - ubyte vu8(d2, d3); - - short v16(d4); - - uint vu32(d2, d3); - - double vd(d2); - - char vc(d2); - - String vs(d2, d2); - - opaque vo(d1, d2); - - enum cloud_class_t primary_cloud(d5); - string primary_cloud:_FillValue = "Missing"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dap deleted file mode 100644 index 205e48eb6d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dap +++ /dev/null @@ -1,57 +0,0 @@ -netcdf test_atomic_types { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - byte v8; - - ubyte vu8; - - short v16; - - ushort vu16; - - int v32; - - uint vu32; - - long v64; - - ulong vu64; - - float vf; - - double vd; - - char vc; - - String vs; - - opaque vo; - - enum cloud_class_t primary_cloud; - string primary_cloud:_FillValue = "Missing"; - - enum cloud_class_t secondary_cloud; - string secondary_cloud:_FillValue = "Missing"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v8 =-128 -vu8 =255 -v16 =-32768 -vu16 =65535 -v32 =2147483647 -vu32 =4294967295 -v64 =9223372036854775807 -vu64 =18446744073709551615 -vf =3.1415927 -vd =3.141592653589793 -vc =@ -vs = "hello world" -vo = 0x0123456789abcdef; - -primary_cloud =2 -secondary_cloud =127 -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dmr deleted file mode 100644 index d771557b7f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dmr +++ /dev/null @@ -1,40 +0,0 @@ -netcdf test_atomic_types { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - byte v8; - - ubyte vu8; - - short v16; - - ushort vu16; - - int v32; - - uint vu32; - - long v64; - - ulong vu64; - - float vf; - - double vd; - - char vc; - - String vs; - - opaque vo; - - enum cloud_class_t primary_cloud; - string primary_cloud:_FillValue = "Missing"; - - enum cloud_class_t secondary_cloud; - string secondary_cloud:_FillValue = "Missing"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dap deleted file mode 100644 index 7723b215c7..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dap +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_enum { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - enum cloud_class_t primary_cloud; - string primary_cloud:_FillValue = "Missing"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud =2 -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dmr deleted file mode 100644 index 0b98070c42..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dmr +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_enum { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - enum cloud_class_t primary_cloud; - string primary_cloud:_FillValue = "Missing"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dap deleted file mode 100644 index 6bc8a7ac6d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dap +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_enum_array { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - dimensions: - d5 = 5; - variables: - enum cloud_class_t primary_cloud(d5); - string primary_cloud:_FillValue = "Missing"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud = - {0, 2, 0, 1, 127} -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dmr deleted file mode 100644 index 0ba318f4b9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dmr +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_enum_array { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - dimensions: - d5 = 5; - variables: - enum cloud_class_t primary_cloud(d5); - string primary_cloud:_FillValue = "Missing"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dap deleted file mode 100644 index cf8dae631c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dap +++ /dev/null @@ -1,9 +0,0 @@ -netcdf test_one_var { - variables: - int t; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t =17 -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dmr deleted file mode 100644 index 2f331bc8d9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dmr +++ /dev/null @@ -1,7 +0,0 @@ -netcdf test_one_var { - variables: - int t; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dap deleted file mode 100644 index 6c047673ba..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dap +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_one_vararray { - dimensions: - d2 = 2; - variables: - int t(d2); - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {17, 37} -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dmr deleted file mode 100644 index ff9f4f085d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dmr +++ /dev/null @@ -1,9 +0,0 @@ -netcdf test_one_vararray { - dimensions: - d2 = 2; - variables: - int t(d2); - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dap deleted file mode 100644 index b62c9b8688..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dap +++ /dev/null @@ -1,67 +0,0 @@ -netcdf test_struct_array { - dimensions: - dx = 4; - dy = 3; - variables: - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s(dx, dy); - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -s = - { - x =1 - y =-1 - } s(0) - { - x =17 - y =37 - } s(1) - { - x =-32767 - y =32767 - } s(2) - { - x =-1 - y =3 - } s(3) - { - x =-2 - y =2 - } s(4) - { - x =-3 - y =1 - } s(5) - { - x =-4 - y =12 - } s(6) - { - x =-8 - y =8 - } s(7) - { - x =-12 - y =4 - } s(8) - { - x =-5 - y =15 - } s(9) - { - x =-10 - y =10 - } s(10) - { - x =-15 - y =5 - } s(11) -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dmr deleted file mode 100644 index 8699a2aa57..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dmr +++ /dev/null @@ -1,17 +0,0 @@ -netcdf test_struct_array { - dimensions: - dx = 4; - dy = 3; - variables: - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s(dx, dy); - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dap deleted file mode 100644 index 19f3ca3f32..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dap +++ /dev/null @@ -1,38 +0,0 @@ -netcdf test_struct_nested { - variables: - - Structure { - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } field1; - - - Structure { - int x; - int y; - } field2; - - } x; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - x = - { - field1 = - { - x = 1 - y = -2 - } x.field1(0) - field2 = - { - x = 255 - y = 90 - } x.field2(0) - } x(0) -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dmr deleted file mode 100644 index 8cb6375d5a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dmr +++ /dev/null @@ -1,24 +0,0 @@ -netcdf test_struct_nested { - variables: - - Structure { - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } field1; - - - Structure { - int x; - int y; - } field2; - - } x; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dap deleted file mode 100644 index 084f785c8c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dap +++ /dev/null @@ -1,21 +0,0 @@ -netcdf test_struct_type { - variables: - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - s = - { - x = 1 - y = -2 - } s(0) -} - diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dmr deleted file mode 100644 index 17f3955052..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dmr +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_struct_type { - variables: - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dap deleted file mode 100644 index 3c411cc3c6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dap +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_vlen1 { - variables: - int x(*); - string x:_CoordinateAxisType = "GeoX"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -x = - {1, 3, 5, 7} -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dmr deleted file mode 100644 index 66e15af40f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dmr +++ /dev/null @@ -1,8 +0,0 @@ -netcdf test_vlen1 { - variables: - int x(*); - string x:_CoordinateAxisType = "GeoX"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dap deleted file mode 100644 index 8628cb9931..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dap +++ /dev/null @@ -1,21 +0,0 @@ -netcdf test_vlen2 { - dimensions: - d3 = 3; - d2 = 2; - variables: - int x(d3, d2, *); - string x:_CoordinateAxisType = "GeoX"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - x = - { - {1, 3, 5, 7}, - {100, 200}, - {-1, -2}, - {1, 3, 5, 7}, - {100, 200}, - {-1, -2} - } -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dmr deleted file mode 100644 index a28e65320e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dmr +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_vlen2 { - dimensions: - d3 = 3; - d2 = 2; - variables: - int x(d3, d2, *); - string x:_CoordinateAxisType = "GeoX"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dap deleted file mode 100644 index aaef5daf73..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dap +++ /dev/null @@ -1,17 +0,0 @@ -netcdf test_vlen3 { - variables: - - Structure { - int f1(*); - } v1; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - v1 = - { - f1 = - {1, 3, 5, 7} - } v1(0) -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dmr deleted file mode 100644 index ecef24cd25..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dmr +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_vlen3 { - variables: - - Structure { - int f1(*); - } v1; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dap deleted file mode 100644 index 0c62ce086b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dap +++ /dev/null @@ -1,20 +0,0 @@ -netcdf test_vlen4 { - variables: - - Structure { - int f1(2, *); - } v1; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - v1 = - { - f1 = - { - {1, 3, 5, 7}, - {100, 200} - } - } v1(0) -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dmr deleted file mode 100644 index 357edd6da2..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dmr +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_vlen4 { - variables: - - Structure { - int f1(2, *); - } v1; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dap deleted file mode 100644 index 8e92721907..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dap +++ /dev/null @@ -1,23 +0,0 @@ -netcdf test_vlen5 { - dimensions: - d2 = 2; - variables: - - Structure { - int v(*); - } v1(d2); - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v1 = - { - v = - {1, 3, 5, 7} - } v1(0) - { - v = - {100, 200} - } v1(1) -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dmr deleted file mode 100644 index 5785af6152..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dmr +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_vlen5 { - dimensions: - d2 = 2; - variables: - - Structure { - int v(*); - } v1(d2); - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_anon_dim.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_anon_dim.syn.dmp deleted file mode 100644 index 8bfb4671ca..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_anon_dim.syn.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.nc.dmp deleted file mode 100644 index 52f093929b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.nc.dmp +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.syn.dmp deleted file mode 100644 index 3519a327b0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.syn.dmp +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.nc.dmp deleted file mode 100644 index aef3b9eda0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.nc.dmp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.syn.dmp deleted file mode 100644 index f7a05c2e72..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.syn.dmp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum.nc.dmp deleted file mode 100644 index 10841fbc27..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum.nc.dmp +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_2.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_2.nc.dmp deleted file mode 100644 index e29149a244..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_2.nc.dmp +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_array.nc.dmp deleted file mode 100644 index bfa1765093..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_array.nc.dmp +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_fill.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_fill.nc.dmp deleted file mode 100644 index 2d1ba264b4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_fill.nc.dmp +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_groups1.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_groups1.nc.dmp deleted file mode 100644 index 80f918edc6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_groups1.nc.dmp +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_var.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_var.nc.dmp deleted file mode 100644 index 89016b1816..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_var.nc.dmp +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_vararray.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_vararray.nc.dmp deleted file mode 100644 index 8f199d1cb1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_vararray.nc.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque.nc.dmp deleted file mode 100644 index 1214eb28eb..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque.nc.dmp +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque_array.nc.dmp deleted file mode 100644 index b79939de67..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque_array.nc.dmp +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_1.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_1.syn.dmp deleted file mode 100644 index 29109a2c04..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_1.syn.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_2.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_2.syn.dmp deleted file mode 100644 index 4194cf19d4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_2.syn.dmp +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.nc.dmp deleted file mode 100644 index 8dabe14882..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.nc.dmp +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.syn.dmp deleted file mode 100644 index 909d78befa..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.syn.dmp +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested.hdf5.dmp deleted file mode 100644 index 376824981e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested.hdf5.dmp +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested3.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested3.hdf5.dmp deleted file mode 100644 index 03ac53d23c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested3.hdf5.dmp +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_type.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_type.nc.dmp deleted file mode 100644 index 4e2adb0c1d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_type.nc.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_utf8.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_utf8.nc.dmp deleted file mode 100644 index 74115be967..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_utf8.nc.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen1.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen1.nc.dmp deleted file mode 100644 index b30754e1b2..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen1.nc.dmp +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen2.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen2.nc.dmp deleted file mode 100644 index cea92859ec..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen2.nc.dmp +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen3.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen3.hdf5.dmp deleted file mode 100644 index dbad545664..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen3.hdf5.dmp +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen5.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen5.hdf5.dmp deleted file mode 100644 index 20cc09a17b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen5.hdf5.dmp +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/testall.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/testall.dmp deleted file mode 100644 index 9b57107614..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/testall.dmp +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.nc.dmr deleted file mode 100644 index 29a61e7c8b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.nc.dmr +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.syn.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.syn.dmr deleted file mode 100644 index 3519a327b0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.syn.dmr +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.nc.dmr deleted file mode 100644 index aef3b9eda0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.nc.dmr +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.syn.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.syn.dmr deleted file mode 100644 index ec5ed7d9f7..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.syn.dmr +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum.nc.dmr deleted file mode 100644 index 10841fbc27..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum.nc.dmr +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum_array.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum_array.nc.dmr deleted file mode 100644 index bfa1765093..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum_array.nc.dmr +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_groups1.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_groups1.nc.dmr deleted file mode 100644 index 80f918edc6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_groups1.nc.dmr +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_var.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_var.nc.dmr deleted file mode 100644 index 89016b1816..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_var.nc.dmr +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_vararray.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_vararray.nc.dmr deleted file mode 100644 index 8f199d1cb1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_vararray.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_array.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_array.nc.dmr deleted file mode 100644 index 8dabe14882..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_array.nc.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested.hdf5.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested.hdf5.dmr deleted file mode 100644 index 376824981e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested.hdf5.dmr +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested3.hdf5.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested3.hdf5.dmr deleted file mode 100644 index 03ac53d23c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested3.hdf5.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_type.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_type.nc.dmr deleted file mode 100644 index 4e2adb0c1d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_type.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_utf8.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_utf8.nc.dmr deleted file mode 100644 index 74115be967..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_utf8.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen1.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen1.nc.dmr deleted file mode 100644 index b30754e1b2..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen1.nc.dmr +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen2.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen2.nc.dmr deleted file mode 100644 index cea92859ec..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen2.nc.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen3.hdf5.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen3.hdf5.dmr deleted file mode 100644 index dbad545664..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen3.hdf5.dmr +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen5.hdf5.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen5.hdf5.dmr deleted file mode 100644 index 20cc09a17b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen5.hdf5.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/testall.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/testall.dmr deleted file mode 100644 index 0e2bf5de38..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/testall.dmr +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 - - - abcd "hello" "quoted" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1.txt b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1.txt deleted file mode 100644 index 73b06f4c1f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Constraint tests for ce1_dmr.txt -/a[1] -/b[10:16] -/c[8:2:15] -/a[1];/b[10:16];/c[8:2:15] -/d[1][0:2:2];/a[1];/e[1][0];/f[0][1] -/s[0:3][0:2].x;/s[0:3][0:2].y - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1_dmr.txt b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1_dmr.txt deleted file mode 100644 index e3b4d952be..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1_dmr.txt +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc1.xml b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc1.xml deleted file mode 100644 index 16d8b476e3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc2.xml b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc2.xml deleted file mode 100644 index e92d76698d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc2.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_1.xml b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_1.xml deleted file mode 100644 index 985fb24ba0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_1.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_2.xml b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_2.xml deleted file mode 100644 index 60a1956ff4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_2.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/testall.xml b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/testall.xml deleted file mode 100644 index dfe668a95c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/testall.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 - - - abcd \"hello\" "quoted" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_aaa.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_aaa.nc.dmp deleted file mode 100644 index 54fdf0828f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_aaa.nc.dmp +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - -vs(0) = "Καλημέα" ; -vs(1) = "abc" ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.0.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.0.dmp deleted file mode 100644 index 9ee80fe4bb..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.0.dmp +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - -vu8(0,0) = 3 ; -vu8(0,1) = 5 ; -vd(0) = 1024.800000 ; -vs(0,0) = " -" ; -vo(0,0) = 0xABCDEF0000000000 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.1.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.1.dmp deleted file mode 100644 index e076c6ee23..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.1.dmp +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.dmp deleted file mode 100644 index bdea13973c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.dmp +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -vu8(0,0) = 255 ; -vu8(0,1) = 1 ; -vu8(0,2) = 2 ; -vu8(1,0) = 3 ; -vu8(1,1) = 4 ; -vu8(1,2) = 5 ; -v16(0) = 1 ; -v16(1) = 2 ; -v16(2) = 3 ; -v16(3) = 4 ; -vu32(0,0) = 5 ; -vu32(0,1) = 4 ; -vu32(0,2) = 3 ; -vu32(1,0) = 2 ; -vu32(1,1) = 1 ; -vu32(1,2) = 0 ; -vd(0) = 17.900000 ; -vd(1) = 1024.800000 ; -vc(0) = '@' ; -vc(1) = '&' ; -vs(0,0) = "hello world" ; -vs(0,1) = "abc" ; -vs(1,0) = " -" ; -vs(1,1) = "Καλημέα" ; -vo(0,0) = 0x0123456789ABCDEF ; -vo(0,1) = 0xABCDEF0000000000 ; -primary_cloud(0) = Clear ; -primary_cloud(1) = Stratus ; -primary_cloud(2) = Clear ; -primary_cloud(3) = Cumulonimbus ; -primary_cloud(4) = Missing ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.ncdump deleted file mode 100644 index b9507deedf..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.ncdump +++ /dev/null @@ -1,57 +0,0 @@ -netcdf null { - types: - enum cloud_class_t { 'Clear' = 0, 'Cumulonimbus' = 1, 'Stratus' = 2, 'Stratocumulus' = 3, 'Cumulus' = 4, 'Altostratus' = 5, 'Nimbostratus' = 6, 'Altocumulus' = 7, 'Missing' = 127, 'Cirrostratus' = 8, 'Cirrocumulus' = 9, 'Cirrus' = 10}; - - dimensions: - d1 = 1; - d2 = 2; - d3 = 3; - d4 = 4; - d5 = 5; - variables: - byte vu8(d2=2, d3=3); - :_Unsigned = "true"; - - short v16(d4=4); - - int vu32(d2=2, d3=3); - :_Unsigned = "true"; - - double vd(d2=2); - - char vc(d2=2); - - String vs(d2=2, d2=2); - - opaque vo(d1=1, d2=2); - - String primary_cloud(d5=5); - :_FillValue = "Missing"; - - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {-1, 1, 2}, - {3, 4, 5} - } -v16 = - {1, 2, 3, 4} -vu32 = - { - {5, 4, 3}, - {2, 1, 0} - } -vd = - {17.9, 1024.8} -vc = "@&" -vs = - { "hello world", "abc", " -", "Καλημέρα" - } -vo = 0x0123456789abcdef, - 0xabcdef0000000000, - -primary_cloud = "Clear", "Clear", "Clear", "Clear", "Clear" -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.dmp deleted file mode 100644 index e26e76d516..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.dmp +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -v8 = -128 ; -vu8 = 255 ; -v16 = -32768 ; -vu16 = 65535 ; -v32 = 2147483647 ; -vu32 = 4294967295 ; -v64 = 9223372036854775807 ; -vu64 = 18446744073709551615 ; -vf = 3.141593 ; -vd = 3.141593 ; -vc = '@' ; -vs = "hello world" ; -vo = 0x0123456789ABCDEF ; -primary_cloud = Stratus ; -secondary_cloud = Missing ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.ncdump deleted file mode 100644 index 62a82936ef..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.ncdump +++ /dev/null @@ -1,61 +0,0 @@ -netcdf null { - types: - enum cloud_class_t { 'Clear' = 0, 'Cumulonimbus' = 1, 'Stratus' = 2, 'Stratocumulus' = 3, 'Cumulus' = 4, 'Altostratus' = 5, 'Nimbostratus' = 6, 'Altocumulus' = 7, 'Missing' = 127, 'Cirrostratus' = 8, 'Cirrocumulus' = 9, 'Cirrus' = 10}; - - variables: - byte v8; - - byte vu8; - :_Unsigned = "true"; - - short v16; - - short vu16; - :_Unsigned = "true"; - - int v32; - - int vu32; - :_Unsigned = "true"; - - long v64; - - long vu64; - :_Unsigned = "true"; - - float vf; - - double vd; - - char vc; - - String vs; - - opaque vo; - - String primary_cloud; - :_FillValue = "Missing"; - - String secondary_cloud; - :_FillValue = "Missing"; - - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v8 =-128 -vu8 =-1 -v16 =-32768 -vu16 =-1 -v32 =2147483647 -vu32 =-1 -v64 =9223372036854775807 -vu64 =-1 -vf =3.1415927 -vd =3.141592653589793 -vc =@ -vs = "hello world" -vo = 0x0123456789abcdef, - -primary_cloud = "Stratus" -secondary_cloud = "Unknown enum value=60" -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum.nc.dmp deleted file mode 100644 index 5708512c59..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum.nc.dmp +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -primary_cloud = Stratus ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.0.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.0.dmp deleted file mode 100644 index c08e20fe0f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.0.dmp +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -primary_cloud(0) = Clear ; -primary_cloud(1) = Stratus ; -primary_cloud(2) = Clear ; -primary_cloud(3) = Cumulonimbus ; -primary_cloud(4) = Missing ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.1.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.1.dmp deleted file mode 100644 index 02fa4ec7e5..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.1.dmp +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -primary_cloud(0) = Stratus ; -primary_cloud(1) = Cumulonimbus ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.dmp deleted file mode 100644 index b82a1e1091..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.dmp +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -primary_cloud(0) = Clear ; -primary_cloud(1) = Stratus ; -primary_cloud(2) = Clear ; -primary_cloud(3) = Cumulonimbus ; -primary_cloud(4) = Missing ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.dmp deleted file mode 100644 index 2458e100dd..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.dmp +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.ncdump deleted file mode 100644 index d0ff04ed22..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.ncdump +++ /dev/null @@ -1,7 +0,0 @@ -netcdf null { - dimensions: - dim1 = 5; - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.dmp deleted file mode 100644 index 07327c9df8..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.dmp +++ /dev/null @@ -1,5 +0,0 @@ - - - - -t = 17 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.ncdump deleted file mode 100644 index f9b96a90ca..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.ncdump +++ /dev/null @@ -1,9 +0,0 @@ -netcdf null { - variables: - int t; - - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t =17 -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.0.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.0.dmp deleted file mode 100644 index b42a52d67e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.0.dmp +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - -t(0) = 17 ; -t(1) = 37 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.1.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.1.dmp deleted file mode 100644 index 5cd368ebb4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.1.dmp +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - -t(0) = 37 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.dmp deleted file mode 100644 index b42a52d67e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.dmp +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - -t(0) = 17 ; -t(1) = 37 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.0.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.0.dmp deleted file mode 100644 index d9cf704dcf..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.0.dmp +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - -Struct { -s.x = 1 ; -s.y = -1 ; -} s(0); -Struct { -s.x = 17 ; -s.y = 37 ; -} s(1); -Struct { -s.x = -4 ; -s.y = 12 ; -} s(2); -Struct { -s.x = -8 ; -s.y = 8 ; -} s(3); diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.dmp deleted file mode 100644 index 13448edf44..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.dmp +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - -Struct { -s.x = 1 ; -s.y = -1 ; -} s(0); -Struct { -s.x = 17 ; -s.y = 37 ; -} s(1); -Struct { -s.x = -32767 ; -s.y = 32767 ; -} s(2); -Struct { -s.x = -1 ; -s.y = 3 ; -} s(3); -Struct { -s.x = -2 ; -s.y = 2 ; -} s(4); -Struct { -s.x = -3 ; -s.y = 1 ; -} s(5); -Struct { -s.x = -4 ; -s.y = 12 ; -} s(6); -Struct { -s.x = -8 ; -s.y = 8 ; -} s(7); -Struct { -s.x = -12 ; -s.y = 4 ; -} s(8); -Struct { -s.x = -5 ; -s.y = 15 ; -} s(9); -Struct { -s.x = -10 ; -s.y = 10 ; -} s(10); -Struct { -s.x = -15 ; -s.y = 5 ; -} s(11); diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.ncdump deleted file mode 100644 index 296e936377..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.ncdump +++ /dev/null @@ -1,26 +0,0 @@ -netcdf null { - dimensions: - dx = 2; - variables: - - Structure { - int x; - :_CoordinateAxisType = "GeoX"; - int y; - :_CoordinateAxisType = "GeoY"; - } x(dx=2); - - - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -x = - { - x =1 - y =-2 - } x(0) - { - x =17 - y =37 - } x(1) -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_nested.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_nested.hdf5.dmp deleted file mode 100644 index ab0a96abaa..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_nested.hdf5.dmp +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - -Struct { -Struct { -x.field1.x = 1 ; -x.field1.y = -2 ; -} x.field1; -Struct { -x.field2.x = 255 ; -x.field2.y = 90 ; -} x.field2; -} x; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.dmp deleted file mode 100644 index 9bf70f993e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -Struct { -s.x = 1 ; -s.y = -2 ; -} s; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.ncdump deleted file mode 100644 index a7a7e096a9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.ncdump +++ /dev/null @@ -1,18 +0,0 @@ -netcdf null { - variables: - - Structure { - int x; - :_CoordinateAxisType = "GeoX"; - int y; - :_CoordinateAxisType = "GeoY"; - } x; - - - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -x = x =1 - y =-2 - -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_utf8.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_utf8.nc.dmp deleted file mode 100644 index 54fdf0828f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_utf8.nc.dmp +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - -vs(0) = "Καλημέα" ; -vs(1) = "abc" ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen1.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen1.nc.dmp deleted file mode 100644 index d341f2cefc..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen1.nc.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -x(0) = 1 ; -x(1) = 3 ; -x(2) = 5 ; -x(3) = 7 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen2.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen2.nc.dmp deleted file mode 100644 index f530233504..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen2.nc.dmp +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - -x(0,0) = 1,3,5,7 ; -x(0,1) = 100,200 ; -x(1,0) = -1,-2 ; -x(1,1) = 1,3,5,7 ; -x(2,0) = 100,200 ; -x(2,1) = -1,-2 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen3.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen3.hdf5.dmp deleted file mode 100644 index 1197da6c2f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen3.hdf5.dmp +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - -Struct { -v1.f1(0) = 1 ; -v1.f1(1) = 3 ; -v1.f1(2) = 5 ; -v1.f1(3) = 7 ; -} v1; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen5.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen5.hdf5.dmp deleted file mode 100644 index 341c6ecfe9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen5.hdf5.dmp +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - -Struct { -v1.v(0) = 1 ; -v1.v(1) = 3 ; -v1.v(2) = 5 ; -v1.v(3) = 7 ; -} v1(0); -Struct { -v1.v(0) = 100 ; -v1.v(1) = 200 ; -} v1(1); diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dap deleted file mode 100644 index 82d8047804..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dap +++ /dev/null @@ -1 +0,0 @@ - [0] -1169720286 [1] -920699049 [2] -2088732436 [3] 1060190036 [4] -1123468835 [5] 922940053 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dmr deleted file mode 100644 index acfbb02341..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dmr +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dap deleted file mode 100644 index 59a60fbd3b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dap +++ /dev/null @@ -1,8 +0,0 @@ - [0] 255 [1] 1 [2] 2 [3] 3 [4] 4 [5] 5 - [0] 1 [1] 2 [2] 3 [3] 4 - [0] 5 [1] 4 [2] 3 [3] 2 [4] 1 [5] 0 - [0] 17.9000 [1] 1024.80 - [0] '@' [1] '&' - [0] "hello\tworld" [1] "\r\n" [2] "Καλημέα" [3] "abc" - [0] 0x0123456789ABCDEF [1] 0xABCDEF0000000000 - [0] 0 [1] 2 [2] 0 [3] 1 [4] 127 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dmr deleted file mode 100644 index 2fbda80066..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dmr +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dap deleted file mode 100644 index 8bc6508fd1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dap +++ /dev/null @@ -1,8 +0,0 @@ - [0] 186 [1] 201 [2] 131 [3] 63 [4] 189 [5] 55 - [0] -341 [1] -21899 [2] -13413 [3] -22144 - [0] 2367803413 [1] 3586730583 [2] 511843988 [3] 3754752863 [4] 2950934681 [5] 2366232135 - [0] 0.217870 [1] 0.602451 - [0] 'C' [1] 'O' - [0] "{S" [1] "gb8^OE$" [2] "4a/q%n9;5Y" [3] "{fIl?T\"\\A[" - [0] 0xA2177AA7287C04FA8BB57BCDF76EC80F [1] 0x34FA472AA9404DD543143CADED303A75 - [0] 2 [1] 9 [2] 6 [3] 8 [4] 3 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dmr deleted file mode 100644 index 4d46c86746..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dmr +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dap deleted file mode 100644 index 0b6fb8911a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dap +++ /dev/null @@ -1,15 +0,0 @@ - -128 - 255 - -32768 - 65535 - 2147483647 - 4294967295 - 9223372036854775807 - 18446744073709551615 - 3.14159 - 3.14159 - '@' - "hello\tworld" - 0x0123456789ABCDEF - 2 - 127 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dmr deleted file mode 100644 index 760b27b8cc..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dmr +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dap deleted file mode 100644 index 4fe0dfa020..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dap +++ /dev/null @@ -1,15 +0,0 @@ - 58 - 201 - 896 - 16177 - -1123468835 - 2125143125 - 3059391736915381031 - 11577488182652895291 - 0.551297 - 0.790267 - '*' - "O,L?c8A%V" - 0x46F169EF23CBAF9B1FEBD99E4E16CEC9 - 7 - 3 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dmr deleted file mode 100644 index ad57f898be..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dmr +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dap deleted file mode 100644 index 671900d5f1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 2 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dmr deleted file mode 100644 index c6b90cdbb6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dmr +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_2.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_2.nc.dap deleted file mode 100644 index 671900d5f1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_2.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 2 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_2.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_2.nc.dmr deleted file mode 100644 index 906e9bd87f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_2.nc.dmr +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_array.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_array.nc.dap deleted file mode 100644 index d13e008917..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_array.nc.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 0 [1] 2 [2] 0 [3] 1 [4] 127 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_array.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_array.nc.dmr deleted file mode 100644 index 9566d108d1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_array.nc.dmr +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_fill.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_fill.nc.dap deleted file mode 100644 index 3bf1930073..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_fill.nc.dap +++ /dev/null @@ -1,3 +0,0 @@ - 240 - 32700 - 111000 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_fill.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_fill.nc.dmr deleted file mode 100644 index f42b2d3e1f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_fill.nc.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_groups1.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_groups1.nc.dap deleted file mode 100644 index 0af89ec492..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_groups1.nc.dap +++ /dev/null @@ -1,4 +0,0 @@ - [0] -876354855 [1] -1761252264 [2] 1723477387 [3] -46827465 [4] 1475147969 - [0] 12.0000 [1] -100.000 [2] 9.96921e+36 - [0] 2 [1] 3 [2] 5 [3] 7 [4] 11 - [0] 23.0000 [1] 29.0000 [2] 19.0000 [3] 31.0000 [4] 17.0000 [5] 37.0000 [6] 13.0000 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_groups1.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_groups1.nc.dmr deleted file mode 100644 index 5932834dad..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_groups1.nc.dmr +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dap deleted file mode 100644 index d193859153..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 17 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dmr deleted file mode 100644 index f48bc09fc3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dmr +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dap deleted file mode 100644 index cef7e62967..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 17 37 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dmr deleted file mode 100644 index 4e2b7d2430..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dmr +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dap deleted file mode 100644 index 8fc9b352ad..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 0x0123456789ABCDEF diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dmr deleted file mode 100644 index d094bcf790..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dmr +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dap deleted file mode 100644 index 41b22527f4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 0x0123456789ABCDEF [1] 0xABCDEF0000000000 [2] 0xFEDCBA9876543210 [3] 0xFEDCBA9999999999 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dmr deleted file mode 100644 index fca0f6e7e1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dmr +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dap deleted file mode 100644 index c8e824f78e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dap +++ /dev/null @@ -1,2 +0,0 @@ -count=1 - -920699049 896 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dmr deleted file mode 100644 index bf34e35c7d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dmr +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dap deleted file mode 100644 index 3d99a97450..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dap +++ /dev/null @@ -1,5 +0,0 @@ -count=1 - -920699049 896 -count=4 - -1123468835 -18686 2125143125 -21899 1268468519 -22144 989876086 3361 - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dmr deleted file mode 100644 index c9d9a09ad3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.nc.dmr deleted file mode 100644 index ebb845e9e9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.nc.dmr +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dap deleted file mode 100644 index 9518dd1bd8..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dap +++ /dev/null @@ -1,15 +0,0 @@ - [0] 0.727653 [1] 0.785633 [2] 0.513679 [3] 0.246845 - [0] 0.738422 [1] 0.214889 [2] 0.494798 - [0] 712320147 1268468519 - [0] 696298400 989876086 - [0] -1927163883 -900795134 - [1] -708236713 1377500019 - [1] 511843988 1699265896 - [1] -540214433 -914532520 - [2] -1344032615 -871416961 - [2] -1928735161 935744880 - [2] -1509955773 -1707460853 - [3] 1145911788 -415231529 - [3] -278269626 -1682978013 - [3] -1629885665 -909240754 - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dmr deleted file mode 100644 index 381b032492..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dmr +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dap deleted file mode 100644 index 2e043ab8fe..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dap +++ /dev/null @@ -1 +0,0 @@ - 1 -2 255 90 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dmr deleted file mode 100644 index 945da2f1b4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dmr +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dap deleted file mode 100644 index d193859153..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dap +++ /dev/null @@ -1 +0,0 @@ - 17 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dmr deleted file mode 100644 index 3dd3a8eb5a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dap deleted file mode 100644 index 6e0cb49e1d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 1 -2 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dmr deleted file mode 100644 index 691c85d70d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dmr +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dap deleted file mode 100644 index eb9b6ef983..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dap +++ /dev/null @@ -1,3 +0,0 @@ - [0] "Καλημέα" - [1] "abc" - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dmr deleted file mode 100644 index 6330f7b085..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dmr +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dap deleted file mode 100644 index a69de268a4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dap +++ /dev/null @@ -1 +0,0 @@ - 3125247010 3374268247 2206234860 1060190036 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dmr b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dmr deleted file mode 100644 index 058bb28134..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dap deleted file mode 100644 index 7420b43453..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dap +++ /dev/null @@ -1,4 +0,0 @@ - [0] 3 [1] 5 - [0] 1024.80 - [0] "Καλημέα" - [0] 0xABCDEF0000000000 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dmr b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dmr deleted file mode 100644 index 83af129bb7..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dmr +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dap deleted file mode 100644 index 9c060c2015..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 1 [1] 2 [2] 4 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dmr b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dmr deleted file mode 100644 index 97a6e53fa5..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dap deleted file mode 100644 index b7fc1fa5bd..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 4 [1] 1 [2] 2 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dmr b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dmr deleted file mode 100644 index b1cf68eac1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dap deleted file mode 100644 index 8277a7de56..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 2 [1] 1 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dmr b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dmr deleted file mode 100644 index 963404a513..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dmr +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dap deleted file mode 100644 index e9082c0001..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dap +++ /dev/null @@ -1 +0,0 @@ - 37 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dmr b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dmr deleted file mode 100644 index 7909a15ec2..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dap deleted file mode 100644 index cef7e62967..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dap +++ /dev/null @@ -1 +0,0 @@ - 17 37 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dmr b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dmr deleted file mode 100644 index f8c3ff5ae3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dap deleted file mode 100644 index 2c0819195e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 0xFEDCBA9876543210 [1] 0xFEDCBA9999999999 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dmr b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dmr deleted file mode 100644 index 049b37d03e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dap deleted file mode 100644 index af7758ecde..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dap +++ /dev/null @@ -1 +0,0 @@ - 1 -1 17 37 -4 12 -8 8 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dmr b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dmr deleted file mode 100644 index 47626a73d0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dmr +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/Makefile b/dap4/d4tests/src/test/data/resources/testfiles/Makefile deleted file mode 100644 index fda8984011..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/Makefile +++ /dev/null @@ -1,75 +0,0 @@ -NC=\ -test_one_var \ -test_one_vararray \ -test_atomic_types \ -test_atomic_array \ -test_enum \ -test_enum_2 \ -test_enum_array \ -test_groups1 \ -test_struct_type \ -test_struct_array \ -test_misc1 \ -test_vlen1 \ -test_vlen2 \ -test_opaque \ -test_opaque_array \ -test_fill \ -test_utf8 - -HDF5=\ -test_struct_nested \ -test_struct_nested3 \ -test_vlen3 \ -test_vlen4 \ -test_vlen5 - -C=tst_fills tst_h5fill - -BUGS= - -all:: all2 all3 - -all1: - for x in ${C} ; do \ - gcc -g -O0 -o $$x.exe $$x.c -L/usr/local/lib -lnetcdf -lcurl -lhdf5 -lhdf5_hl ; \ - ./$$x ; \ - done - -all2: - for x in ${NC} ${HDF5} ; do ncgen -k3 $${x}.cdl ; done - -all3: - for x in ${HDF5} ; do cp $${x}.nc $${x}.hdf5 ; done - -clean:: - rm -f *.nc; rm -f *.hdf5; rm -f *.h5 - for x in ${C} ; do rm -f $$x.exe ; done - rm -fr dump - - -verify: - rm -fr dump - mkdir dump - for x in ${NC} ; do ncdump $${x}.nc > dump/$${x}.cdl ; done - for x in ${HDF5} ; do ncdump $${x}.hdf5 > dump/$${x}.cdl ; done - for x in ${NC} ${HDF5} ; do \ - echo $${x}.cdl ; \ - diff -wBb $${x}.cdl dump/$${x}.cdl ; \ - done - -UI=f:/git/thredds/ui/target/toolsUI-4.4.0-SNAPSHOT.jar -F=test_test - -# note -vall fails -x:: - rm -f ${F}.hdf5 ${F}.nc - ncgen -k3 -o ${F}.nc ${F}.cdl - cp ${F}.nc ${F}.hdf5 - java -cp ${UI} ucar.nc2.NCdumpW ${F}.hdf5 - -# ncdump ${F}.hdf5 - -t:: - ncgen -k3 -o ${F}.nc ${F}.cdl - ncdump ${F}.nc diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_aaa.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_aaa.nc.dmr deleted file mode 100644 index a8d498be14..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_aaa.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_array.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_array.nc.dmr deleted file mode 100644 index 9e0dd4e355..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_array.nc.dmr +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_types.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_types.nc.dmr deleted file mode 100644 index 88340335c2..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_types.nc.dmr +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum.nc.dmr deleted file mode 100644 index 7126f07378..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum.nc.dmr +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum1.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum1.nc.dmr deleted file mode 100644 index dca662dfc9..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum1.nc.dmr +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum2.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum2.nc.dmr deleted file mode 100644 index 6cfd3fa18c..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum2.nc.dmr +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum_array.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum_array.nc.dmr deleted file mode 100644 index dd8b966f98..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum_array.nc.dmr +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_groups1.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_groups1.nc.dmr deleted file mode 100644 index 80f918edc6..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_groups1.nc.dmr +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_numeric_types.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_numeric_types.nc.dmr deleted file mode 100644 index 57cb8ca453..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_numeric_types.nc.dmr +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_var.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_var.nc.dmr deleted file mode 100644 index 89016b1816..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_var.nc.dmr +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_vararray.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_vararray.nc.dmr deleted file mode 100644 index 8f199d1cb1..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_vararray.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_opaque_type.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_opaque_type.nc.dmr deleted file mode 100644 index 298d5f9c8e..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_opaque_type.nc.dmr +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_string_type.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_string_type.nc.dmr deleted file mode 100644 index 4b7615450f..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_string_type.nc.dmr +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct1.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct1.nc.dmr deleted file mode 100644 index 9612148ceb..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct1.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_array.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_array.nc.dmr deleted file mode 100644 index 8dabe14882..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_array.nc.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.hdf5.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.hdf5.dmr deleted file mode 100644 index 376824981e..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.hdf5.dmr +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.nc.dmr deleted file mode 100644 index f42d82a6ba..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.nc.dmr +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_type.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_type.nc.dmr deleted file mode 100644 index 4e2adb0c1d..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_type.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_utf8.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_utf8.nc.dmr deleted file mode 100644 index 74115be967..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_utf8.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen1.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen1.nc.dmr deleted file mode 100644 index b8086d06d1..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen1.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen2.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen2.nc.dmr deleted file mode 100644 index f5ebdb60b9..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen2.nc.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.hdf5.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.hdf5.dmr deleted file mode 100644 index 13041f5136..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.hdf5.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.nc.dmr deleted file mode 100644 index b8729a4e15..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.nc.dmr +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen4.hdf5.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen4.hdf5.dmr deleted file mode 100644 index 09398765d6..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen4.hdf5.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen5.hdf5.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen5.hdf5.dmr deleted file mode 100644 index 2cd00c88d1..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen5.hdf5.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/doit b/dap4/d4tests/src/test/data/resources/testfiles/doit deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_anon_dim.syn b/dap4/d4tests/src/test/data/resources/testfiles/test_anon_dim.syn deleted file mode 100644 index 221f7ac725..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_anon_dim.syn +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.cdl deleted file mode 100644 index ea901a8db6..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.cdl +++ /dev/null @@ -1,39 +0,0 @@ -netcdf test_atomic_array { -types: - opaque(8) o_t; - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -dimensions: - d1 = 1; - d2 = 2; - d3 = 3; - d4 = 4; - d5 = 5; -variables: - ubyte vu8(d2,d3); - short v16(d4); - uint vu32(d2,d3); - double vd(d2); - char vc(d2); - string vs(d2,d2); - o_t vo(d1,d2); - cloud_class_t primary_cloud(d5) ; - cloud_class_t primary_cloud:_FillValue = Missing ; - -data: - vu8 = - 255, 1, 2, - 3, 4, 5 ; - v16 = 1, 2, 3, 4 ; - vu32 = - 5, 4, 3, - 2, 1, 0 ; - vd = 17.9, 1024.8 ; - vc = '@', '&' ; - vs = "hello\tworld", "\r\n", "Καλημέα", "abc" ; - vo = - 0X0123456789ABCDEF, 0XABCDEF0000000000 ; - primary_cloud = Clear, Stratus, Clear, Cumulonimbus, _ ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.nc deleted file mode 100644 index 26cb578f8a..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.ncdump deleted file mode 100644 index 2a9d0f1966..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.ncdump +++ /dev/null @@ -1,48 +0,0 @@ -netcdf test_atomic_array { -types: - opaque(8) o_t ; - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -dimensions: - d1 = 1 ; - d2 = 2 ; - d3 = 3 ; - d4 = 4 ; - d5 = 5 ; -variables: - ubyte vu8(d2, d3) ; - short v16(d4) ; - uint vu32(d2, d3) ; - double vd(d2) ; - char vc(d2) ; - string vs(d2, d2) ; - o_t vo(d1, d2) ; - cloud_class_t primary_cloud(d5) ; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - - vu8 = - 255, 1, 2, - 3, 4, 5 ; - - v16 = 1, 2, 3, 4 ; - - vu32 = - 5, 4, 3, - 2, 1, 0 ; - - vd = 17.9, 1024.8 ; - - vc = "@&" ; - - vs = - "hello\tworld", "\r\n", - "Καλημέα", "abc" ; - - vo = - 0X0123456789ABCDEF, 0XABCDEF0000000000 ; - - primary_cloud = Clear, Stratus, Clear, Cumulonimbus, _ ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.syn b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.syn deleted file mode 100644 index 86d46ceb7d..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.syn +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.cdl deleted file mode 100644 index d43301a201..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.cdl +++ /dev/null @@ -1,42 +0,0 @@ -netcdf test_atomic_types { -types: - opaque(8) o_t; - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - byte v8; - ubyte vu8; - short v16; - ushort vu16; - int v32; - uint vu32; - int64 v64; - uint64 vu64; - float vf; - double vd; - char vc; - string vs; - o_t vo; - cloud_class_t primary_cloud; - cloud_class_t primary_cloud:_FillValue = Missing ; - cloud_class_t secondary_cloud; - cloud_class_t secondary_cloud:_FillValue = Missing ; -data: - v8 = -128; - vu8 = 255; - v16 = -32768; - vu16 = 65535; - v32 = 2147483647; - vu32 = 4294967295; - v64 = 9223372036854775807; - vu64 = 18446744073709551615; - vf = 3.1415926535897932384626433832795; - vd = 3.141592653589793238462643383279502884197169399375105820974944592; - vc = '@'; - vs = "hello\tworld"; - vo = 0x0123456789abcdef; - primary_cloud = Stratus; - secondary_cloud = _; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.ncdump deleted file mode 100644 index dd4d209c48..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.ncdump +++ /dev/null @@ -1,57 +0,0 @@ -netcdf test_atomic_types { -types: - opaque(8) o_t ; - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - byte v8 ; - ubyte vu8 ; - short v16 ; - ushort vu16 ; - int v32 ; - uint vu32 ; - int64 v64 ; - uint64 vu64 ; - float vf ; - double vd ; - char vc ; - string vs ; - o_t vo ; - cloud_class_t primary_cloud ; - cloud_class_t primary_cloud:_FillValue = Missing ; - cloud_class_t secondary_cloud ; - cloud_class_t secondary_cloud:_FillValue = Missing ; -data: - - v8 = -128 ; - - vu8 = 255 ; - - v16 = -32768 ; - - vu16 = _ ; - - v32 = 2147483647 ; - - vu32 = _ ; - - v64 = 9223372036854775807 ; - - vu64 = 18446744073709551615 ; - - vf = 3.141593 ; - - vd = 3.14159265358979 ; - - vc = "@" ; - - vs = "hello\tworld" ; - - vo = 0X0123456789ABCDEF ; - - primary_cloud = Stratus ; - - secondary_cloud = _ ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.syn b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.syn deleted file mode 100644 index d6f19ef663..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.syn +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_enum.cdl deleted file mode 100644 index 6cd1ceb34b..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.cdl +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_enum { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - cloud_class_t primary_cloud; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - primary_cloud = Stratus; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_enum.nc deleted file mode 100644 index 39a1db3688..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_enum.ncdump deleted file mode 100644 index 7a7ca86e1b..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.ncdump +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_enum { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - cloud_class_t primary_cloud ; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - - primary_cloud = Stratus ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.cdl deleted file mode 100644 index da9c770a8b..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.cdl +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_enum1 { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - cloud_class_t primary_cloud; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - primary_cloud = Stratus; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.nc deleted file mode 100644 index 39a1db3688..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.ncdump deleted file mode 100644 index 7aea061a3b..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.ncdump +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_enum1 { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - cloud_class_t primary_cloud ; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - - primary_cloud = Stratus ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.cdl deleted file mode 100644 index ef6ab50d1d..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.cdl +++ /dev/null @@ -1,15 +0,0 @@ -// Test cross group enum references -netcdf test_enum_2 { - types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; - group: h { - variables: - /cloud_class_t primary_cloud; - /cloud_class_t primary_cloud:_FillValue = Missing ; - data: - primary_cloud = Stratus; - } -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.nc deleted file mode 100644 index ff30729699..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.ncdump deleted file mode 100644 index b651551733..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.ncdump +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_enum_2 { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; - -group: h { - variables: - cloud_class_t primary_cloud ; - cloud_class_t primary_cloud:_FillValue = Missing ; - data: - - primary_cloud = Stratus ; - } // group h -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.cdl deleted file mode 100644 index d395990b64..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.cdl +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_enum_array { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -dimensions: - d5 = 5; -variables: - cloud_class_t primary_cloud(d5); - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - primary_cloud = Clear, Stratus, Clear, Cumulonimbus, _ ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.ncdump deleted file mode 100644 index 1c5944620a..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.ncdump +++ /dev/null @@ -1,15 +0,0 @@ -netcdf test_enum_array { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -dimensions: - d5 = 5 ; -variables: - cloud_class_t primary_cloud(d5) ; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - - primary_cloud = Clear, Stratus, Clear, Cumulonimbus, _ ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_fill.cdl deleted file mode 100644 index 7d2af998fc..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.cdl +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_fill { -variables: - ubyte uv8; - short v16; - uint uv32; - uv32:_FillValue=17; -data: - uv8 = 240; - v16 = 32700; - uv32 = 111000; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_fill.nc deleted file mode 100644 index 35e817fd5a..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_fill.ncdump deleted file mode 100644 index 5ca0494ef7..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.ncdump +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_fill { -variables: - ubyte uv8 ; - short v16 ; - uint uv32 ; - uv32:_FillValue = 17U ; -data: - - uv8 = 240 ; - - v16 = 32700 ; - - uv32 = 111000 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.cdl deleted file mode 100644 index bde2677083..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.cdl +++ /dev/null @@ -1,35 +0,0 @@ -netcdf test_groups1 { -dimensions: - dim1 = 5 ; - -group: g { - dimensions: - dim2 = 3 ; - - group: h { - dimensions: - dim3 = 7 ; - variables: - int v1(dim1); - float v2(dim2); - data: - - v1 = -876354855, -1761252264, 1723477387, -46827465, 1475147969; - - v2 = 12, -100, _ ; - } // group h - - group: i { - dimensions: - dim3 = 7 ; - variables: - int v1(dim1); - float v3(dim3); - data: - - v1 = 2, 3, 5, 7, 11 ; - - v3 = 23, 29, 19, 31, 17, 37, 13 ; - } // group i -} // group g -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.nc deleted file mode 100644 index b4fe34704f..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.ncdump deleted file mode 100644 index d351478dbe..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.ncdump +++ /dev/null @@ -1,35 +0,0 @@ -netcdf test_groups1 { -dimensions: - dim1 = 5 ; - -group: g { - dimensions: - dim2 = 3 ; - - group: h { - dimensions: - dim3 = 7 ; - variables: - int v1(dim1) ; - float v2(dim2) ; - data: - - v1 = -876354855, -1761252264, 1723477387, -46827465, 1475147969 ; - - v2 = 12, -100, _ ; - } // group h - - group: i { - dimensions: - dim3 = 7 ; - variables: - int v1(dim1) ; - float v3(dim3) ; - data: - - v1 = 2, 3, 5, 7, 11 ; - - v3 = 23, 29, 19, 31, 17, 37, 13 ; - } // group i - } // group g -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_misc1.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_misc1.nc deleted file mode 100644 index 36fbab844d..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_misc1.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.cdl deleted file mode 100644 index f5edd1268f..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.cdl +++ /dev/null @@ -1,6 +0,0 @@ -netcdf test_one_var { -variables: - int t; -data: - t = 17; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.nc deleted file mode 100644 index 4169d2d296..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.ncdump deleted file mode 100644 index f4ab177bd6..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.ncdump +++ /dev/null @@ -1,7 +0,0 @@ -netcdf test_one_var { -variables: - int t ; -data: - - t = 17 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.cdl deleted file mode 100644 index 78d1ef14de..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.cdl +++ /dev/null @@ -1,8 +0,0 @@ -netcdf test_one_vararray { -dimensions: - d2 = 2; -variables: - int t(d2); -data: - t = 17, 37; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.ncdump deleted file mode 100644 index 964677c450..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.ncdump +++ /dev/null @@ -1,9 +0,0 @@ -netcdf test_one_vararray { -dimensions: - d2 = 2 ; -variables: - int t(d2) ; -data: - - t = 17, 37 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.cdl deleted file mode 100644 index 5cc4e7abb3..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.cdl +++ /dev/null @@ -1,8 +0,0 @@ -netcdf test_opaque { -types: - opaque(8) o_t; -variables: - o_t vo1; -data: - vo1 = 0X0123456789ABCDEF ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.nc deleted file mode 100644 index ae6b866e9d..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.ncdump deleted file mode 100644 index 97de1aedbf..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.ncdump +++ /dev/null @@ -1,9 +0,0 @@ -netcdf test_opaque { -types: - opaque(8) o_t ; -variables: - o_t vo1 ; -data: - - vo1 = 0X0123456789ABCDEF ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.cdl deleted file mode 100644 index bd33119964..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.cdl +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_opaque_array { -types: - opaque(8) o_t; -dimensions: - d2 = 2; -variables: - o_t vo2(d2,d2); -data: - vo2 = - 0X0123456789ABCDEF, 0XABCDEF0000000000, - 0XFEDCBA9876543210, 0XFEDCBA9999999999; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.ncdump deleted file mode 100644 index 4a7e2f1825..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.ncdump +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_opaque_array { -types: - opaque(8) o_t ; -dimensions: - d2 = 2 ; -variables: - o_t vo2(d2, d2) ; -data: - - vo2 = - 0X0123456789ABCDEF, 0XABCDEF0000000000, - 0XFEDCBA9876543210, 0XFEDCBA9999999999 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_1.syn b/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_1.syn deleted file mode 100644 index 355f652977..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_1.syn +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_2.syn b/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_2.syn deleted file mode 100644 index 4aa6576faf..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_2.syn +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.cdl deleted file mode 100644 index 005f897c52..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.cdl +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_struct_type { - types: - compound c_t { - int x ; - int y ; - }; // c_t -variables: - c_t s; -data: - s = {1,-2}; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.nc deleted file mode 100644 index 2a988dc2fe..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.ncdump deleted file mode 100644 index 1b2c36e6f7..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.ncdump +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_struct1 { -types: - compound c_t { - int x ; - int y ; - }; // c_t -variables: - c_t s ; -data: - - s = {1, -2} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.cdl deleted file mode 100644 index bc5f723006..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.cdl +++ /dev/null @@ -1,18 +0,0 @@ -netcdf test_struct_array { -types: - compound c_t { - int x ; - int y ; - }; // c_t -dimensions: - dx = 4; - dy = 3; -variables: - c_t s(dx,dy); -data: - s = -/*[0][0..2]*/ {1, -1}, {17, 37}, {-32767, 32767}, -/*[1][0..2]*/ {-1, 3}, {-2, 2}, {-3, 1}, -/*[2][0..2]*/ {-4, 12}, {-8, 8}, {-12, 4}, -/*[3][0..2]*/ {-5, 15}, {-10, 10}, {-15, 5} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.ncdump deleted file mode 100644 index c306c05595..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.ncdump +++ /dev/null @@ -1,19 +0,0 @@ -netcdf test_struct_array { -types: - compound c_t { - int x ; - int y ; - }; // c_t -dimensions: - dx = 4 ; - dy = 3 ; -variables: - c_t s(dx, dy) ; -data: - - s = - {1, -1}, {17, 37}, {-32767, 32767}, - {-1, 3}, {-2, 2}, {-3, 1}, - {-4, 12}, {-8, 8}, {-12, 4}, - {-5, 15}, {-10, 10}, {-15, 5} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.syn b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.syn deleted file mode 100644 index dfe5cf7484..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.syn +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.cdl deleted file mode 100644 index 399d8954ef..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.cdl +++ /dev/null @@ -1,15 +0,0 @@ -netcdf test_struct_nested { - types: - compound s1_t { - int x ; - int y ; - }; // s1_t - compound s2_t { - s1_t field1 ; - s1_t field2 ; - }; // s2_t -variables: - s2_t x; -data: - x = {{1,-2}, {255, 90}}; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.hdf5 b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.hdf5 deleted file mode 100644 index f49856fa34..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.hdf5 and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.nc deleted file mode 100644 index 42f2e6a7ea..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.ncdump deleted file mode 100644 index 16c71d22bf..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.ncdump +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_struct_nested { -types: - compound s1_t { - int x ; - int y ; - }; // s1_t - compound s2_t { - s1_t field1 ; - s1_t field2 ; - }; // s2_t -variables: - s2_t x ; -data: - - x = {{1, -2}, {255, 90}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.cdl deleted file mode 100644 index e52eba8179..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.cdl +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_struct_nested3 { - types: - compound s1_t { - int field1 ; - }; // s1_t - compound s2_t { - s1_t field2 ; - }; // s2_t - compound s3_t { - s2_t field3 ; - }; // s2_t -variables: - s3_t x; -data: - x = {{{17}}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.hdf5 b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.hdf5 deleted file mode 100644 index 7e0173c94a..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.hdf5 and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.nc deleted file mode 100644 index c8cc68e0d6..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.ncdump deleted file mode 100644 index a3a6cb40e2..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.ncdump +++ /dev/null @@ -1,17 +0,0 @@ -netcdf test_struct_nested3 { -types: - compound s1_t { - int field1 ; - }; // s1_t - compound s2_t { - s1_t field2 ; - }; // s2_t - compound s3_t { - s2_t field3 ; - }; // s3_t -variables: - s3_t x ; -data: - - x = {{{17}}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.cdl deleted file mode 100644 index 005f897c52..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.cdl +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_struct_type { - types: - compound c_t { - int x ; - int y ; - }; // c_t -variables: - c_t s; -data: - s = {1,-2}; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.nc deleted file mode 100644 index 2a988dc2fe..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.ncdump deleted file mode 100644 index 6fc0c77b50..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.ncdump +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_struct_type { -types: - compound c_t { - int x ; - int y ; - }; // c_t -variables: - c_t s ; -data: - - s = {1, -2} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_test.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_test.cdl deleted file mode 100644 index 684d1c5002..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_test.cdl +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_test { - -types: - byte enum enum_t {c1=1, c2=2, c3=3}; - -variables: - enum_t v1; - -data: - v1 = c1; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_test.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_test.nc deleted file mode 100644 index 56638925f8..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_test.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_test.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_test.ncdump deleted file mode 100644 index 936c3cfeef..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_test.ncdump +++ /dev/null @@ -1,9 +0,0 @@ -netcdf test_test { -types: - byte enum enum_t {c1 = 1, c2 = 2, c3 = 3} ; -variables: - enum_t v1 ; -data: - - v1 = c1 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.cdl deleted file mode 100644 index e300442837..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.cdl +++ /dev/null @@ -1,27 +0,0 @@ -netcdf test_unlim1 { -dimensions: - lat = 3 ; - lon = 2 ; - time = UNLIMITED ; // (2 currently) -variables: - float lat(lat) ; - lat:units = "degrees_north" ; - float lon(lon) ; - lon:units = "degrees_east" ; - double time(time) ; - time:units = "seconds since 2009-01-01" ; - float pr(time, lat, lon) ; - pr:standard_name = "air_pressure_at_sea_level" ; - pr:units = "hPa" ; - -// global attributes: - :title = "example for workshop" ; -data: - pr = - 0, 1, - 2, 3, - 4, 5, - 10, 11, - 12, 13, - 14, 15 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.ncdump deleted file mode 100644 index da7d31a211..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.ncdump +++ /dev/null @@ -1,34 +0,0 @@ -netcdf test_unlim1 { -dimensions: - lat = 3 ; - lon = 2 ; - time = UNLIMITED ; // (2 currently) -variables: - float lat(lat) ; - lat:units = "degrees_north" ; - float lon(lon) ; - lon:units = "degrees_east" ; - double time(time) ; - time:units = "seconds since 2009-01-01" ; - float pr(time, lat, lon) ; - pr:standard_name = "air_pressure_at_sea_level" ; - pr:units = "hPa" ; - -// global attributes: - :title = "example for workshop" ; -data: - - lat = _, _, _ ; - - lon = _, _ ; - - time = _, _ ; - - pr = - 0, 1, - 2, 3, - 4, 5, - 10, 11, - 12, 13, - 14, 15 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_utf8.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_utf8.cdl deleted file mode 100644 index 14025f5a36..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_utf8.cdl +++ /dev/null @@ -1,8 +0,0 @@ -netcdf test_utf8 { -dimensions: - d2 = 2; -variables: - string vs(d2); -data: - vs = "Καλημέα" , "abc"; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_utf8.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_utf8.ncdump deleted file mode 100644 index d9429c1be3..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_utf8.ncdump +++ /dev/null @@ -1,9 +0,0 @@ -netcdf test_utf8 { -dimensions: - d2 = 2 ; -variables: - string vs(d2) ; -data: - - vs = "Καλημέα", "abc" ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.cdl deleted file mode 100644 index 3ec2f06543..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.cdl +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_vlen1 { - -types: - int(*) vlen_t; - -variables: - vlen_t x; - -data: - x = {1, 3, 5, 7}; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.ncdump deleted file mode 100644 index 68140f424e..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.ncdump +++ /dev/null @@ -1,9 +0,0 @@ -netcdf test_vlen1 { -types: - int(*) vlen_t ; -variables: - vlen_t x ; -data: - - x = {1, 3, 5, 7} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.cdl deleted file mode 100644 index ebdf6ce624..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.cdl +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_vlen10 { - -types: - compound c_t {int x; float y;}; - c_t(*) v_t; - -variables: - v_t v; - -data: - - v = {{17,30.7}, {19,101.1}}; -} - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.ncdump deleted file mode 100644 index 432a625790..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.ncdump +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_vlen10 { -types: - compound c_t { - int x ; - float y ; - }; // c_t - c_t(*) v_t ; -variables: - v_t v ; -data: - - v = {{17, 30.7}, {19, 101.1}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.cdl deleted file mode 100644 index 98c0575603..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.cdl +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_vlen11 { - -types: - int(*) v1_t; - v1_t(*) v2_t; - -variables: - v2_t v; - -data: - v = {{1, 3, 5, 7},{100,200}} ; -} - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.ncdump deleted file mode 100644 index 806ec725c1..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.ncdump +++ /dev/null @@ -1,10 +0,0 @@ -netcdf test_vlen11 { -types: - int(*) v1_t ; - v1_t(*) v2_t ; -variables: - v2_t v ; -data: - - v = {{1, 3, 5, 7}, {100, 200}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.cdl deleted file mode 100644 index 8e3a578c18..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.cdl +++ /dev/null @@ -1,15 +0,0 @@ -netcdf test_vlen2 { - -types: - int(*) vlen_t; - -dimensions: - d3=3; - d2=2; - -variables: - vlen_t x(d3,d2); - -data: - x = {1, 3, 5, 7}, {100,200}, {-1,-2},{1, 3, 5, 7}, {100,200}, {-1,-2}; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.nc deleted file mode 100644 index dd2d4a2f1e..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.ncdump deleted file mode 100644 index 0398d71252..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.ncdump +++ /dev/null @@ -1,15 +0,0 @@ -netcdf test_vlen2 { -types: - int(*) vlen_t ; -dimensions: - d3 = 3 ; - d2 = 2 ; -variables: - vlen_t x(d3, d2) ; -data: - - x = - {1, 3, 5, 7}, {100, 200}, - {-1, -2}, {1, 3, 5, 7}, - {100, 200}, {-1, -2} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.cdl deleted file mode 100644 index a4365fe4b9..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.cdl +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_vlen3 { - -types: - int(*) v_t; - compound c_t {v_t f1;}; - -variables: - c_t v1; - -data: - v1 = {{1, 3, 5, 7}} ; -} - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.ncdump deleted file mode 100644 index 84e768b57f..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.ncdump +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_vlen3 { -types: - int(*) v_t ; - compound c_t { - v_t f1 ; - }; // c_t -variables: - c_t v1 ; -data: - - v1 = {{1, 3, 5, 7}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.cdl deleted file mode 100644 index b6db7ff2e7..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.cdl +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_vlen4 { - -types: - int(*) v_t; - compound c_t {v_t f1(2);}; - -variables: - c_t v1; - -data: - v1 = {{{1, 3, 5, 7},{100,200}}} ; -} - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.ncdump deleted file mode 100644 index 3f3e8ac2c4..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.ncdump +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_vlen4 { -types: - int(*) v_t ; - compound c_t { - v_t f1(2) ; - }; // c_t -variables: - c_t v1 ; -data: - - v1 = {{{1, 3, 5, 7}, {100, 200}}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.cdl deleted file mode 100644 index 11d8efa54a..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.cdl +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_vlen5 { - -types: - int(*) v_t; - compound c_t {v_t v;}; - -dimensions: - d2=2; - -variables: - c_t v1(d2); - -data: - v1 = {{1, 3, 5, 7}},{{100,200}} ; -} - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.ncdump deleted file mode 100644 index aaf9eec519..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.ncdump +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_vlen5 { -types: - int(*) v_t ; - compound c_t { - v_t v ; - }; // c_t -dimensions: - d2 = 2 ; -variables: - c_t v1(d2) ; -data: - - v1 = {{1, 3, 5, 7}}, {{100, 200}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.cdl deleted file mode 100644 index b116583de5..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.cdl +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_vlen6 { - -types: - int(*) v_t; - -dimensions: - d=2; - -variables: - v_t v1(d); - -data: - - v1 = {1,3,5,7}, {17,19} ; -} - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.ncdump deleted file mode 100644 index bbe124ecaf..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.ncdump +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_vlen6 { -types: - int(*) v_t ; -dimensions: - d = 2 ; -variables: - v_t v1(d) ; -data: - - v1 = {1, 3, 5, 7}, {17, 19} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.cdl deleted file mode 100644 index 3711750729..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.cdl +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_vlen7 { - -types: - int(*) v_t; - -dimensions: - d=1; - -variables: - v_t v1(d); - -data: - - v1 = {17,19,21} ; -} - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.ncdump deleted file mode 100644 index 8826f39f77..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.ncdump +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_vlen7 { -types: - int(*) v_t ; -dimensions: - d = 1 ; -variables: - v_t v1(d) ; -data: - - v1 = {17, 19, 21} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.cdl deleted file mode 100644 index f7522a93dd..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.cdl +++ /dev/null @@ -1,19 +0,0 @@ -netcdf test_vlen8 { - -types: - int(*) v_t; - -dimensions: - d1=2; - d2=2; - -variables: - v_t v1(d1,d2); - -data: - - v1 = - {1,3,5,7}, {17,19}, - {11,33,55,77}, {717,919}; -} - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.nc deleted file mode 100644 index 9546ef1c64..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.ncdump deleted file mode 100644 index c498cb64f5..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.ncdump +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_vlen8 { -types: - int(*) v_t ; -dimensions: - d1 = 2 ; - d2 = 2 ; -variables: - v_t v1(d1, d2) ; -data: - - v1 = - {1, 3, 5, 7}, {17, 19}, - {11, 33, 55, 77}, {717, 919} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.cdl deleted file mode 100644 index 4244c2425c..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.cdl +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_vlen9 { - -types: - compound c_t {int x; float y;}; - c_t(*) v_t; - -dimensions: - d=2; - -variables: - v_t v(d); - -data: - - v = {{17,30.7}}, {{19,101.1},{2,1.0}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.ncdump deleted file mode 100644 index 506c9ab6aa..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.ncdump +++ /dev/null @@ -1,15 +0,0 @@ -netcdf test_vlen9 { -types: - compound c_t { - int x ; - float y ; - }; // c_t - c_t(*) v_t ; -dimensions: - d = 2 ; -variables: - v_t v(d) ; -data: - - v = {{17, 30.7}}, {{19, 101.1}, {2, 1}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.cdl deleted file mode 100644 index 6afadd0a51..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.cdl +++ /dev/null @@ -1,23 +0,0 @@ -netcdf test_zerodim { -dimensions: - lat = 6 ; - lon = 4 ; - time = UNLIMITED ; // (0 currently) - unlim = UNLIMITED ; // (3 currently) -variables: - float lat(lat) ; - lat:units = "degrees_north" ; - float lon(lon) ; - lon:units = "degrees_east" ; - double time(time) ; - time:units = "seconds since 2009-01-01" ; - float pr(time, lat, lon) ; - pr:standard_name = "air_pressure_at_sea_level" ; - pr:units = "hPa" ; - float var(unlim) ; - -// global attributes: - :title = "example for workshop" ; -data: - var = 0, 1, 3 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.nc deleted file mode 100644 index 85ecf70d96..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.ncdump deleted file mode 100644 index e13baa0d39..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.ncdump +++ /dev/null @@ -1,28 +0,0 @@ -netcdf test_zerodim { -dimensions: - lat = 6 ; - lon = 4 ; - time = UNLIMITED ; // (0 currently) - unlim = UNLIMITED ; // (3 currently) -variables: - float lat(lat) ; - lat:units = "degrees_north" ; - float lon(lon) ; - lon:units = "degrees_east" ; - double time(time) ; - time:units = "seconds since 2009-01-01" ; - float pr(time, lat, lon) ; - pr:standard_name = "air_pressure_at_sea_level" ; - pr:units = "hPa" ; - float var(unlim) ; - -// global attributes: - :title = "example for workshop" ; -data: - - lat = _, _, _, _, _, _ ; - - lon = _, _, _, _ ; - - var = 0, 1, 3 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.c b/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.c deleted file mode 100644 index dd7844a837..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.c +++ /dev/null @@ -1,51 +0,0 @@ -/* This is part of the netCDF package. Copyright 2008 University - Corporation for Atmospheric Research/Unidata See COPYRIGHT file for - conditions of use. See www.unidata.ucar.edu for more info. - - Create a test file with default fill values for variables of each type. - - $Id: tst_fills.c,v 1.12 2009/03/17 01:22:42 ed Exp $ -*/ - -#include -#include -#include - -#define FILE_NAME "tst_fills.nc" -#define VAR1 "uv8" -# define TYPE1 NC_UBYTE -# define DATA1 240 -#define VAR2 "v16" -# define TYPE2 NC_SHORT -# define DATA2 32700 -#define VAR3 "uv32" -# define TYPE3 NC_INT -# define FILL3 17 -# define DATA3 111000 - -#define ERR abort() - - -int -main(int argc, char **argv) -{ - int ncid; - int varid1, varid2, varid3; - int fill3 = FILL3; - - printf("\n*** Testing fill values.\n"); - - if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR; - if (nc_def_var(ncid, VAR1, TYPE1, 0, NULL, &varid1)) ERR; - if (nc_def_var(ncid, VAR2, TYPE2, 0, NULL, &varid2)) ERR; - if (nc_def_var(ncid, VAR3, TYPE3, 0, NULL, &varid3)) ERR; - if (nc_def_var_fill(ncid, varid3, 0, &fill3)) ERR; - - if (nc_enddef(ncid)) ERR; - - {unsigned char data = DATA1; if (nc_put_var(ncid,varid1,&data)) ERR;} - {short data = DATA2; if (nc_put_var(ncid,varid2,&data)) ERR;} - {unsigned int data = DATA3; if (nc_put_var(ncid,varid3,&data)) ERR;} -} - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.nc b/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.nc deleted file mode 100644 index f45e6600f6..0000000000 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.nc and /dev/null differ diff --git a/dap4/d4tests/src/test/java/dap4/test/D4TSController.java b/dap4/d4tests/src/test/java/dap4/test/D4TSController.java deleted file mode 100644 index 10ccd3f52e..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/D4TSController.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.test; - -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.d4ts.D4TSServlet; -import dap4.dap4lib.DapCodes; -import dap4.servlet.DapRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; - - -/* - * This is an extension of D4TSServlet to allow it to be tested - * as using Spring mocking - */ - -@Controller -@RequestMapping("/d4ts") -public class D4TSController extends D4TSServlet { - - @Autowired - private ServletContext servletContext; - - ////////////////////////////////////////////////// - // Constructor(s) - - public D4TSController() { - super(); - } - - ////////////////////////////////////////////////// - - @RequestMapping("**") - public void handleRequest(HttpServletRequest req, HttpServletResponse res) throws IOException { - super.handleRequest(req, res); - } - - @Override - public String getResourcePath(DapRequest drq, String location) throws DapException { - String prefix = drq.getResourceRoot(); - if (prefix == null) - throw new DapException("Cannot find location resource: " + location).setCode(DapCodes.SC_NOT_FOUND); - location = DapUtil.canonicalpath(location); - String datasetfilepath = DapUtil.canonjoin(prefix, location); - // See if it really exists and is readable and of proper type - File dataset = new File(datasetfilepath); - if (!dataset.exists()) { - String msg = String.format("Requested file does not exist: prefix=%s location=%s datasetfilepath=%s", prefix, - location, datasetfilepath); - throw new DapException(msg).setCode(HttpServletResponse.SC_NOT_FOUND); - } - if (!dataset.canRead()) - throw new DapException("Requested file not readable: " + datasetfilepath) - .setCode(HttpServletResponse.SC_FORBIDDEN); - return datasetfilepath; - } - -} diff --git a/dap4/d4tests/src/test/java/dap4/test/DapTestCommon.java b/dap4/d4tests/src/test/java/dap4/test/DapTestCommon.java deleted file mode 100644 index d35e467d6e..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/DapTestCommon.java +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Copyright (c) 2021 University Corporation for Atmospheric Research/Unidata - * See LICENSE for license information. - */ - -package dap4.test; - -import dap4.core.data.DSPRegistry; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.dap4lib.FileDSP; -import dap4.servlet.DapCache; -import dap4.servlet.DapController; -import dap4.servlet.SynDSP; -import org.apache.http.Header; -import org.apache.http.HttpResponse; -import org.apache.http.HttpVersion; -import org.apache.http.client.methods.HttpRequestBase; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.message.BasicHttpResponse; -import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.mock.web.MockHttpServletResponse; -import org.springframework.mock.web.MockServletContext; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.web.WebAppConfiguration; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; -import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder; -import thredds.test.util.TdsTestDir; -import thredds.test.util.TdsUnitTestCommon; -import thredds.core.DatasetManager; -import thredds.core.TdsRequestedDataset; -import thredds.server.dap4.Dap4Controller; -import ucar.httpservices.HTTPMethod; -import ucar.httpservices.HTTPUtil; -import ucar.nc2.NetcdfFile; -import ucar.nc2.ffi.netcdf.NetcdfClibrary; -import ucar.nc2.jni.netcdf.Nc4prototypes; - -import javax.servlet.ServletException; -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.net.URI; -import java.util.Collection; -import java.util.List; - -@ContextConfiguration -@WebAppConfiguration("file:src/test/data") -abstract public class DapTestCommon extends TdsUnitTestCommon { - - ////////////////////////////////////////////////// - // Constants - - static final String DEFAULTTREEROOT = "dap4"; - - static public final String FILESERVER = "file://localhost:8080"; - - static public final String CONSTRAINTTAG = "dap4.ce"; - static public final String ORDERTAG = "ucar.littleendian"; - static public final String NOCSUMTAG = "ucar.nochecksum"; - static public final String TRANSLATETAG = "ucar.translate"; - static public final String TESTTAG = "ucar.testing"; - - static final String D4TESTDIRNAME = "d4tests"; - - // Equivalent to the path to the webapp/d4ts for testing purposes - static protected final String DFALTRESOURCEPATH = "/src/test/data/resources"; - static protected Class NC4IOSP = ucar.nc2.jni.netcdf.Nc4Iosp.class; - - ////////////////////////////////////////////////// - // Type decls - - static class Mocker { - public MockHttpServletRequest req = null; - public MockHttpServletResponse resp = null; - public MockServletContext context = null; - public DapController controller = null; - public String url = null; - public String servletname = null; - public DapTestCommon parent = null; - - public Mocker(String servletname, String url, DapTestCommon parent) throws Exception { - this(servletname, url, new Dap4Controller(), parent); - } - - public Mocker(String servletname, String url, DapController controller, DapTestCommon parent) throws Exception { - this.parent = parent; - this.url = url; - this.servletname = servletname; - if (controller != null) - setController(controller); - String testdir = parent.getResourceRoot(); - // There appears to be bug in the spring core.io code - // such that it assumes absolute paths start with '/'. - // So, check for windows drive and prepend 'file:/' as a hack. - if (DapUtil.hasDriveLetter(testdir)) - testdir = "/" + testdir; - testdir = "file:" + testdir; - this.context = new MockServletContext(testdir); - URI u = HTTPUtil.parseToURI(url); - this.req = new MockHttpServletRequest(this.context, "GET", u.getPath()); - this.resp = new MockHttpServletResponse(); - req.setMethod("GET"); - setup(); - } - - protected void setController(DapController ct) throws ServletException { - this.controller = ct; - } - - /** - * The spring mocker is not very smart. - * Given the url it should be possible - * to initialize a lot of its fields. - * Instead, it requires the user to so do. - * The request elements to set are: - * - servletpath - * - protocol - * - querystring - * - servername - * - serverport - * - contextpath - * - pathinfo - * - servletpath - */ - protected void setup() throws Exception { - this.req.setCharacterEncoding("UTF-8"); - this.req.setServletPath("/" + this.servletname); - URI url = HTTPUtil.parseToURI(this.url); - this.req.setProtocol(url.getScheme()); - this.req.setQueryString(url.getQuery()); - this.req.setServerName(url.getHost()); - this.req.setServerPort(url.getPort()); - String path = url.getPath(); - if (path != null) {// probably more complex than it needs to be - String prefix = null; - String suffix = null; - if (path.equals("/" + this.servletname) || path.equals("/" + this.servletname + "/")) { - // path is just servlet tag - prefix = "/" + this.servletname; - suffix = "/"; - } else { - int i; - String[] pieces = path.split("[/]"); - for (i = 0; i < pieces.length; i++) { // find servletname piece - if (pieces[i].equals(this.servletname)) - break; - } - if (i >= pieces.length) // not found - throw new IllegalArgumentException("DapTestCommon"); - prefix = DapUtil.join(pieces, "/", 0, i); - suffix = DapUtil.join(pieces, "/", i + 1, pieces.length); - } - this.req.setContextPath(DapUtil.absolutize(prefix)); - this.req.setPathInfo(suffix); - this.req.setServletPath(DapUtil.absolutize(suffix)); - } - } - - public byte[] execute() throws IOException { - if (this.controller == null) - throw new DapException("Mocker: no controller"); - this.controller.handleRequest(this.req, this.resp); - return this.resp.getContentAsByteArray(); - } - } - - // Mocking Support Class for HTTPMethod - - static public class MockExecutor implements HTTPMethod.Executor { - protected String resourcepath = null; - - public MockExecutor(String resourcepath) { - this.resourcepath = resourcepath; - } - - // HttpHost targethost,HttpClient httpclient,HTTPSession session - public HttpResponse execute(HttpRequestBase rq) throws IOException { - URI uri = rq.getURI(); - DapController controller = getController(uri); - StandaloneMockMvcBuilder mvcbuilder = MockMvcBuilders.standaloneSetup(controller); - mvcbuilder.setValidator(new TestServlet.NullValidator()); - MockMvc mockMvc = mvcbuilder.build(); - MockHttpServletRequestBuilder mockrb = MockMvcRequestBuilders.get(uri); - // We need to use only the path part - mockrb.servletPath(uri.getPath()); - // Move any headers from rq to mockrb - Header[] headers = rq.getAllHeaders(); - for (int i = 0; i < headers.length; i++) { - Header h = headers[i]; - mockrb.header(h.getName(), h.getValue()); - } - // Since the url has the query parameters, - // they will automatically be parsed and added - // to the rb parameters. - - // Finally set the resource dir - mockrb.requestAttr("RESOURCEDIR", this.resourcepath); - - // Now invoke the servlet - MvcResult result; - try { - result = mockMvc.perform(mockrb).andReturn(); - } catch (Exception e) { - throw new IOException(e); - } - - // Collect the output - MockHttpServletResponse res = result.getResponse(); - byte[] byteresult = res.getContentAsByteArray(); - - // Convert to HttpResponse - HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, res.getStatus(), ""); - if (response == null) - throw new IOException("HTTPMethod.executeMock: Response was null"); - Collection keys = res.getHeaderNames(); - // Move headers to the response - for (String key : keys) { - List values = res.getHeaders(key); - for (String v : values) { - response.addHeader(key, v); - } - } - ByteArrayEntity entity = new ByteArrayEntity(byteresult); - String sct = res.getContentType(); - entity.setContentType(sct); - response.setEntity(entity); - return response; - } - - protected DapController getController(URI uri) throws IOException { - String path = uri.getPath(); - path = HTTPUtil.canonicalpath(path); - assert path.startsWith("/"); - String[] pieces = path.split("[/]"); - assert pieces.length >= 2; - // Path is absolute, so pieces[0] will be empty - // so pieces[1] should determine the controller - DapController controller; - if ("d4ts".equals(pieces[1])) { - controller = new D4TSController(); - } else if ("thredds".equals(pieces[1])) { - controller = new Dap4Controller(); - } else - throw new IOException("Unknown controller type " + pieces[1]); - return controller; - } - } - - static class TestFilter implements FileFilter { - boolean debug; - boolean strip; - String[] extensions; - - public TestFilter(boolean debug, String[] extensions) { - this.debug = debug; - this.strip = strip; - this.extensions = extensions; - } - - public boolean accept(File file) { - boolean ok = false; - if (file.isFile() && file.canRead()) { - // Check for proper extension - String name = file.getName(); - if (name != null) { - for (String ext : extensions) { - if (name.endsWith(ext)) - ok = true; - } - } - if (!ok && debug) - System.err.println("Ignoring: " + file.toString()); - } - return ok; - } - - static void filterfiles(String path, List matches, String... extensions) { - File testdirf = new File(path); - assert (testdirf.canRead()); - TestFilter tf = new TestFilter(DEBUG, extensions); - File[] filelist = testdirf.listFiles(tf); - for (int i = 0; i < filelist.length; i++) { - File file = filelist[i]; - if (file.isDirectory()) - continue; - String fname = DapUtil.canonicalpath(file.getAbsolutePath()); - matches.add(fname); - } - } - } - - ////////////////////////////////////////////////// - // Static variables - - static protected String dap4root = null; - static protected String dap4testroot = null; - static protected String dap4resourcedir = null; - - static { - dap4root = locateDAP4Root(threddsroot); - if (dap4root == null) - System.err.println("Cannot locate /dap4 parent dir"); - dap4testroot = canonjoin(dap4root, D4TESTDIRNAME); - dap4resourcedir = canonjoin(dap4testroot, DFALTRESOURCEPATH); - } - - ////////////////////////////////////////////////// - // Static methods - - - static protected String getD4TestsRoot() { - return dap4testroot; - } - - static protected String getResourceRoot() { - return dap4resourcedir; - } - - static String locateDAP4Root(String threddsroot) { - String root = threddsroot; - if (root != null) - root = root + "/" + DEFAULTTREEROOT; - // See if it exists - File f = new File(root); - if (!f.exists() || !f.isDirectory()) - root = null; - return root; - } - - ////////////////////////////////////////////////// - // Instance variables - - - protected String d4tsserver = null; - - protected String title = "Dap4 Testing"; - - public DapTestCommon() { - this("DapTest"); - } - - public DapTestCommon(String name) { - super(name); - - this.d4tsserver = TdsTestDir.dap4TestServer; - if (DEBUG) - System.err.println("DapTestCommon: d4tsServer=" + d4tsserver); - } - - /** - * Try to get the system properties - */ - protected void setSystemProperties() { - String testargs = System.getProperty("testargs"); - if (testargs != null && testargs.length() > 0) { - String[] pairs = testargs.split("[ ]*[,][ ]*"); - for (String pair : pairs) { - String[] tuple = pair.split("[ ]*[=][ ]*"); - String value = (tuple.length == 1 ? "" : tuple[1]); - if (tuple[0].length() > 0) - System.setProperty(tuple[0], value); - } - } - if (System.getProperty("nodiff") != null) - prop_diff = false; - if (System.getProperty("baseline") != null) - prop_baseline = true; - if (System.getProperty("nogenerate") != null) - prop_generate = false; - if (System.getProperty("debug") != null) - prop_debug = true; - if (System.getProperty("visual") != null) - prop_visual = true; - if (System.getProperty("ascii") != null) - prop_ascii = true; - if (System.getProperty("utf8") != null) - prop_ascii = false; - if (prop_baseline && prop_diff) - prop_diff = false; - prop_controls = System.getProperty("controls", ""); - } - - ////////////////////////////////////////////////// - // Overrideable methods - - ////////////////////////////////////////////////// - // Accessor - - public void setTitle(String title) { - this.title = title; - } - - public String getTitle() { - return this.title; - } - - ////////////////////////////////////////////////// - // Instance Utilities - - public void visual(String header, String captured) { - if (!captured.endsWith("\n")) - captured = captured + "\n"; - // Dump the output for visual comparison - System.err.println("\n" + header + ":"); - System.err.println("---------------"); - System.err.print(captured); - System.err.println("---------------"); - System.err.flush(); - } - - protected void findServer(String path) throws DapException { - String svc = "http://" + this.d4tsserver + "/d4ts"; - if (!checkServer(svc)) - System.err.println("D4TS Server not reachable: " + svc); - // Since we will be accessing it thru NetcdfDataset, we need to change the schema. - d4tsserver = "dap4://" + d4tsserver + "/d4ts"; - } - - ////////////////////////////////////////////////// - - public String getDAP4Root() { - return this.dap4root; - } - - @Override - public String getResourceDir() { - return this.dap4resourcedir; - } - - /** - * Unfortunately, mock does not appear to always - * do proper initialization - */ - static protected void mockSetup() { - TdsRequestedDataset.setDatasetManager(new DatasetManager()); - } - - - static protected void testSetup() { - DapController.TESTING = true; - DapCache.dspregistry.register(FileDSP.class, DSPRegistry.FIRST); - DapCache.dspregistry.register(SynDSP.class, DSPRegistry.FIRST); - try { - // Always prefer Nc4Iosp over HDF5 - NetcdfFile.iospDeRegister(NC4IOSP); - NetcdfFile.registerIOProviderPreferred(NC4IOSP, ucar.nc2.iosp.hdf5.H5iosp.class); - // Print out the library version - System.err.printf("Netcdf-c library version: %s%n", getCLibraryVersion()); - System.err.flush(); - } catch (Exception e) { - System.err.println("Cannot load ucar.nc2.jni.netcdf.Nc4Iosp"); - } - } - - static protected MvcResult perform(String url, MockMvc mockMvc, String respath, String... params) throws Exception { - MockHttpServletRequestBuilder rb = MockMvcRequestBuilders.get(url).servletPath(url); - if (params.length > 0) { - if (params.length % 2 == 1) - throw new Exception("Illegal query params"); - for (int i = 0; i < params.length; i += 2) { - if (params[i] != null) { - rb.param(params[i], params[i + 1]); - } - } - } - assert respath != null; - String realdir = canonjoin(dap4testroot, respath); - rb.requestAttr("RESOURCEDIR", realdir); - MvcResult result = mockMvc.perform(rb).andReturn(); - return result; - } - - - static void printDir(String path) { - File testdirf = new File(path); - assert (testdirf.canRead()); - File[] filelist = testdirf.listFiles(); - System.err.println("\n*******************"); - System.err.printf("Contents of %s:%n", path); - for (int i = 0; i < filelist.length; i++) { - File file = filelist[i]; - String fname = file.getName(); - System.err.printf("\t%s%s%n", fname, (file.isDirectory() ? "/" : "")); - } - System.err.println("*******************"); - System.err.flush(); - } - - static public String getCLibraryVersion() { - Nc4prototypes nc4 = NetcdfClibrary.getForeignFunctionInterface(); - return (nc4 == null ? "Unknown" : nc4.nc_inq_libvers()); - } -} - diff --git a/dap4/d4tests/src/test/java/dap4/test/Diff.j b/dap4/d4tests/src/test/java/dap4/test/Diff.j deleted file mode 100644 index 4c516837a1..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/Diff.j +++ /dev/null @@ -1,794 +0,0 @@ -// Diff -- text file difference utility. -// See full docu-comment at beginning of Diff class. - -/* Copyright (c) Ian F. Darwin, http://www.darwinsys.com/, 1996-2002. - * All rights reserved. Software written by Ian F. Darwin and others. - * $Id: LICENSE,v 1.8 2004/02/09 03:33:38 ian Exp $ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * Java, the Duke mascot, and all variants of Sun's Java 'steaming coffee cup' - logo are trademarks of Sun Microsystems. Sun's, and James Gosling's, - * pioneering role in inventing and promulgating (and standardizing) the Java - * language and environment is gratefully acknowledged. - * - * The pioneering role of Dennis Ritchie and Bjarne Stroustrup, of AT&T, for - * inventing predecessor languages C and C+is also gratefully acknowledged. - */ - -package dap4.test; - -import java.io.*; - - -/** - * This is the info kept per-file. - */ -class fileInfo { - - static final int MAXLINECOUNT = 20000; - - BufferedReader file; /* File handle that is open for read. */ - public int maxLine; /* After input done, # lines in file. */ - node symbol[]; /* The symtab handle of each line. */ - int other[]; /* Map of line# to line# in other file */ - /* ( -1 means don't-know ). */ - /* Allocated AFTER the lines are read. */ - - /** - * Normal constructor with one filename; file is opened and saved. - */ - public fileInfo(String filename) throws Exception { - symbol = new node[MAXLINECOUNT + 2]; - other = null; // allocated later! - file = new BufferedReader(new FileReader(filename)); - } - - public fileInfo(Reader rdr) throws Exception { - symbol = new node[MAXLINECOUNT + 2]; - other = null; // allocated later! - file = new BufferedReader(rdr); - } - - // This is done late, to be same size as # lines in input file. - - void alloc() { - other = new int[symbol.length + 2]; - } -}; - -/** - * diff Text file difference utility. - * ---- Copyright 1987, 1989 by Donald C. Lindsay, - * School of Computer Science, Carnegie Mellon University. - * Copyright 1982 by Symbionics. - * Use without fee is permitted when not for direct commercial - * advantage, and when credit to the source is given. Other uses - * require specific permission. - *

- * Converted from C to Java by Ian F. Darwin, http://www.darwinsys.com/, January, 1997. - * Copyright 1997, Ian F. Darwin. - *

- * Conversion is NOT FULLY TESTED. - *

- * USAGE: diff oldfile newfile - *

- * This program assumes that "oldfile" and "newfile" are text files. - * The program writes to stdout a description of the changes which would - * transform "oldfile" into "newfile". - *

- * The printout is in the form of commands, each followed by a block of - * text. The text is delimited by the commands, which are: - *

- * DELETE AT n - * ..deleted lines - *

- * INSERT BEFORE n - * ..inserted lines - *

- * n MOVED TO BEFORE n - * ..moved lines - *

- * n CHANGED FROM - * ..old lines - * CHANGED TO - * ..newer lines - *

- * The line numbers all refer to the lines of the oldfile, as they are - * numbered before any commands are applied. - * The text lines are printed as-is, without indentation or prefixing. The - * commands are printed in upper case, with a prefix of ">>>>", so that - * they will stand out. Other schemes may be preferred. - * Files which contain more than MAXLINECOUNT lines cannot be processed. - * This can be fixed by changing "symbol" to a Vector. - * The algorithm is taken from Communications of the ACM, Apr78 (21, 4, 264-), - * "A Technique for Isolating Differences Between Files." - * Ignoring I/O, and ignoring the symbol table, it should take O(N) time. - * This implementation takes fixed space, plus O(U) space for the symbol - * table (where U is the number of unique lines). Methods exist to change - * the fixed space to O(N) space. - * Note that this is not the only interesting file-difference algorithm. In - * general, different algorithms draw different conclusions about the - * changes that have been made to the oldfile. This algorithm is sometimes - * "more right", particularly since it does not consider a block move to be - * an insertion and a (separate) deletion. However, on some files it will be - * "less right". This is a consequence of the fact that files may contain - * many identical lines (particularly if they are program source). Each - * algorithm resolves the ambiguity in its own way, and the resolution - * is never guaranteed to be "right". However, it is often excellent. - * This program is intended to be pedagogic. Specifically, this program was - * the basis of the Literate Programming column which appeared in the - * Communications of the ACM (CACM), in the June 1989 issue (32, 6, - * 740-755). - * By "pedagogic", I do not mean that the program is gracefully worded, or - * that it showcases language features or its algorithm. I also do not mean - * that it is highly accessible to beginners, or that it is intended to be - * read in full, or in a particular order. Rather, this program is an - * example of one professional's style of keeping things organized and - * maintainable. - * The program would be better if the "print" variables were wrapped into - * a struct. In general, grouping related variables in this way improves - * documentation, and adds the ability to pass the group in argument lists. - * This program is a de-engineered version of a program which uses less - * memory and less time. The article points out that the "symbol" arrays - * can be implemented as arrays of pointers to arrays, with dynamic - * allocation of the subarrays. (In C, macros are very useful for hiding - * the two-level accesses.) In Java, a Vector would be used. This allows an - * extremely large value for MAXLINECOUNT, without dedicating fixed arrays. - * (The "other" array can be allocated after the input phase, when the exact - * sizes are known.) The only slow piece of code is the "strcmp" in the tree - * descent: it can be speeded up by keeping a hash in the tree node, and - * only using "strcmp" when two hashes happen to be equal. - *

- * Change Log - * ---------- - * 1Jan97 Ian F. Darwin: first working rewrite in Java, based entirely on - * D.C.Lindsay's reasonable C version. - * Changed comments from /***************** to /**, shortened, added - * whitespace, used tabs more, etc. - * 6jul89 D.C.Lindsay, CMU: fixed portability bug. Thanks, Gregg Wonderly. - * Just changed "char ch" to "int ch". - * Also added comment about way to improve code. - * 10jun89 D.C.Lindsay, CMU: posted version created. - * Copyright notice changed to ACM style, and Dept. is now School. - * ACM article referenced in docn. - * 26sep87 D.C.Lindsay, CMU: publication version created. - * Condensed all 1982/83 change log entries. - * Removed all command line options, and supporting code. This - * simplified the input code (no case reduction etc). It also - * simplified the symbol table, which was capable of remembering - * offsets into files (instead of strings), and trusting (!) hash - * values to be unique. - * Removed dynamic allocation of arrays: now fixed static arrays. - * Removed speed optimizations in symtab package. - * Removed string compression/decompression code. - * Recoded to Unix standards from old Lattice/MSDOS standards. - * (This affected only the #include's and the IO.) - * Some renaming of variables, and rewording of comments. - * 1982/83 D.C.Lindsay, Symbionics: created. - * - * @author Ian F. Darwin, Java version - * @author D. C. Lindsay, C version (1982-1987) - * @version Java version 0.9, 1997 - */ - -public class Diff { - - /** - * block len > any possible real block len - */ - final int UNREAL = Integer.MAX_VALUE; - - /** - * Keeps track of information about file1 and file2 - */ - fileInfo oldinfo, newinfo; - - PrintWriter printer = null; - - String identifier = ""; - - - /** - * blocklen is the info about found blocks. It will be set to 0, except - * at the line#s where blocks start in the old file. At these places it - * will be set to the # of lines in the block. During printout , - * this # will be reset to -1 if the block is printed as a MOVE block - * (because the printout phase will encounter the block twice, but - * must only print it once.) - * The array declarations are to MAXLINECOUNT+2 so that we can have two - * extra lines (pseudolines) at line# 0 and line# MAXLINECOUNT+1 - * (or less). - */ - int blocklen[]; - - /** - * main - entry point when used standalone. - * NOTE: no routines return error codes or throw any local - * exceptions. Instead, any routine may complain - * to stderr and then exit with error to the system. - */ - public static void main(String argstrings[]) throws Exception { - if (argstrings.length != 2) { - System.err.println("Usage: diff oldfile newfile"); - System.exit(1); - } - Diff d = new Diff("Diff"); - d.doDiff(argstrings[0], argstrings[1]); - return; - } - - /** - * Construct a Diff object. - */ - public Diff(String id) { - identifier = id; - } - - - /* Do comparison against two Reader streams */ - - public boolean doDiff(Reader oldFile, Reader newFile, Writer out) throws Exception { - this.printer = new PrintWriter(out); - oldinfo = new fileInfo(oldFile); - newinfo = new fileInfo(newFile); - return process(); - } - - public boolean doDiff(Reader oldFile, Reader newFile) throws Exception { - Writer w = new OutputStreamWriter(System.out); - return doDiff(oldFile, newFile, w); - } - - /* Do comparison against two string streams */ - - public boolean doDiff(String data1, String data2, Writer out) throws Exception { - if(data1 == null || data2 == null) return false; - return doDiff(new StringReader(data1), new StringReader(data2), out); - } - - public boolean doDiff(String data1, String data2) throws Exception { - return doDiff(data1, data2, new OutputStreamWriter(System.out)); - } - - boolean process() throws Exception { - /* we don't process until we know both files really do exist. */ - inputscan(oldinfo); - inputscan(newinfo); - - /* Now that we've read all the lines, allocate some arrays. - */ - blocklen = new int[(oldinfo.maxLine > newinfo.maxLine ? - oldinfo.maxLine : newinfo.maxLine) + 2]; - oldinfo.alloc(); - newinfo.alloc(); - - /* Now do the work, and print the results. */ - transform(); - return printout(); - } - - static boolean isBlankLine(String s) - { - int index = 0; - int len = s.length(); - for(index=len-1;index>=0;index--) { - if(" \t\r".indexOf(s.charAt(index)) < 0) return false; - } - return true; - } - - /** - * inputscan Reads the file specified by pinfo.file. - * --------- Places the lines of that file in the symbol table. - * Sets pinfo.maxLine to the number of lines found. - */ - void inputscan(fileInfo pinfo) throws IOException { - String linebuffer; - pinfo.maxLine = 0; - while ((linebuffer = pinfo.file.readLine()) != null) { - if(!isBlankLine(linebuffer)) - storeline(linebuffer, pinfo); - } - } - - /** - * storeline Places line into symbol table. - * --------- Expects pinfo.maxLine initted: increments. - * Places symbol table handle in pinfo.ymbol. - * Expects pinfo is either oldinfo or newinfo. - */ - void storeline(String linebuffer, fileInfo pinfo) { - int linenum = ++pinfo.maxLine; /* note, no line zero */ - if (linenum > fileInfo.MAXLINECOUNT) { - System.err.println("MAXLINECOUNT exceeded, must stop."); - System.exit(1); - } - pinfo.symbol[linenum] = node.addSymbol(this, linebuffer, pinfo == oldinfo, linenum); - } - - /* - * transform - * Analyzes the file differences and leaves its findings in - * the global arrays oldinfo.other, newinfo.other, and blocklen. - * Expects both files in symtab. - * Expects valid "maxLine" and "symbol" in oldinfo and newinfo. - */ - - void transform() { - int oldline, newline; - int oldmax = oldinfo.maxLine + 2; /* Count pseudolines at */ - int newmax = newinfo.maxLine + 2; /* ..front and rear of file */ - - for (oldline = 0; oldline < oldmax; oldline++) - oldinfo.other[oldline] = -1; - for (newline = 0; newline < newmax; newline++) - newinfo.other[newline] = -1; - - scanunique(); /* scan for lines used once in both files */ - scanafter(); /* scan past sure-matches for non-unique blocks */ - scanbefore(); /* scan backwards from sure-matches */ - scanblocks(); /* find the fronts and lengths of blocks */ - } - - /* - * scanunique - * Scans for lines which are used exactly once in each file. - * Expects both files in symtab, and oldinfo and newinfo valid. - * The appropriate "other" array entries are set to the line# in - * the other file. - * Claims pseudo-lines at 0 and XXXinfo.maxLine+1 are unique. - */ - - void scanunique() { - int oldline, newline; - node psymbol; - - for (newline = 1; newline <= newinfo.maxLine; newline++) { - psymbol = newinfo.symbol[newline]; - if (psymbol.symbolIsUnique()) { // 1 use in each file - oldline = psymbol.linenum; - newinfo.other[newline] = oldline; // record 1-1 map - oldinfo.other[oldline] = newline; - } - } - newinfo.other[0] = 0; - oldinfo.other[0] = 0; - newinfo.other[newinfo.maxLine + 1] = oldinfo.maxLine + 1; - oldinfo.other[oldinfo.maxLine + 1] = newinfo.maxLine + 1; - } - - /* - * scanafter - * Expects both files in symtab, and oldinfo and newinfo valid. - * Expects the "other" arrays contain positive #s to indicate - * lines that are unique in both files. - * For each such pair of places, scans past in each file. - * Contiguous groups of lines that match non-uniquely are - * taken to be good-enough matches, and so marked in "other". - * Assumes each other[0] is 0. - */ - - void scanafter() { - int oldline, newline; - - for (newline = 0; newline <= newinfo.maxLine; newline++) { - oldline = newinfo.other[newline]; - if (oldline >= 0) { /* is unique in old & new */ - for (; ;) { /* scan after there in both files */ - if (++oldline > oldinfo.maxLine) break; - if (oldinfo.other[oldline] >= 0) break; - if (++newline > newinfo.maxLine) break; - if (newinfo.other[newline] >= 0) break; - - /* oldline & newline exist, and - aren't already matched */ - - if (newinfo.symbol[newline] != - oldinfo.symbol[oldline]) break; // not same - - newinfo.other[newline] = oldline; // record a match - oldinfo.other[oldline] = newline; - } - } - } - } - - /** - * scanbefore - * As scanafter, except scans towards file fronts. - * Assumes the off-end lines have been marked as a match. - */ - void scanbefore() { - int oldline, newline; - - for (newline = newinfo.maxLine + 1; newline > 0; newline--) { - oldline = newinfo.other[newline]; - if (oldline >= 0) { /* unique in each */ - for (; ;) { - if (--oldline <= 0) break; - if (oldinfo.other[oldline] >= 0) break; - if (--newline <= 0) break; - if (newinfo.other[newline] >= 0) break; - - /* oldline and newline exist, - and aren't marked yet */ - - if (newinfo.symbol[newline] != - oldinfo.symbol[oldline]) break; // not same - - newinfo.other[newline] = oldline; // record a match - oldinfo.other[oldline] = newline; - } - } - } - } - - /** - * scanblocks - Finds the beginnings and lengths of blocks of matches. - * Sets the blocklen array (see definition). - * Expects oldinfo valid. - */ - void scanblocks() { - int oldline, newline; - int oldfront = 0; // line# of front of a block in old, or 0 - int newlast = -1; // newline's value during prev. iteration - - for (oldline = 1; oldline <= oldinfo.maxLine; oldline++) - blocklen[oldline] = 0; - blocklen[oldinfo.maxLine + 1] = UNREAL; // starts a mythical blk - - for (oldline = 1; oldline <= oldinfo.maxLine; oldline++) { - newline = oldinfo.other[oldline]; - if (newline < 0) oldfront = 0; /* no match: not in block */ - else { /* match. */ - if (oldfront == 0) oldfront = oldline; - if (newline != (newlast + 1)) oldfront = oldline; - ++blocklen[oldfront]; - } - newlast = newline; - } - } - - /* The following are global to printout's subsidiary routines */ - // enum{ idle, delete, insert, movenew, moveold, - // same, change } printstatus; - public static final int - idle = 0, delete = 1, insert = 2, movenew = 3, moveold = 4, - same = 5, change = 6; - int printstatus; - boolean anyprinted; - int printoldline, printnewline; // line numbers in old & new file - - /** - * printout - Prints summary to stdout. - * Expects all databuffer structures have been filled out. - * - * @return true if differences detected - */ - boolean printout() { - printstatus = idle; - anyprinted = false; - for (printoldline = printnewline = 1; ;) { - if (printoldline > oldinfo.maxLine) { - newconsume(); - break; - } - if (printnewline > newinfo.maxLine) { - oldconsume(); - break; - } - if (newinfo.other[printnewline] < 0) { - if (oldinfo.other[printoldline] < 0) - showchange(); - else - showinsert(); - } else if (oldinfo.other[printoldline] < 0) - showdelete(); - else if (blocklen[printoldline] < 0) - skipold(); - else if (oldinfo.other[printoldline] == printnewline) - showsame(); - else - showmove(); - } - if (anyprinted == true) println(">>>> "+identifier+": End of differences."); - else println(">>>> "+identifier+": Files are identical."); - return anyprinted; - } - - /* - * newconsume Part of printout. Have run out of old file. - * Print the rest of the new file, as inserts and/or moves. - */ - - void newconsume() { - for (; ;) { - if (printnewline > newinfo.maxLine) - break; /* end of file */ - if (newinfo.other[printnewline] < 0) showinsert(); - else showmove(); - } - } - - /** - * oldconsume Part of printout. Have run out of new file. - * Process the rest of the old file, printing any - * parts which were deletes or moves. - */ - void oldconsume() { - for (; ;) { - if (printoldline > oldinfo.maxLine) - break; /* end of file */ - printnewline = oldinfo.other[printoldline]; - if (printnewline < 0) showdelete(); - else if (blocklen[printoldline] < 0) skipold(); - else showmove(); - } - } - - /** - * showdelete Part of printout. - * Expects printoldline is at a deletion. - */ - void showdelete() { - if (printstatus != delete) - println(">>>> DELETE AT " + printoldline); - printstatus = delete; - oldinfo.symbol[printoldline].showSymbol(); - anyprinted = true; - printoldline++; - } - - /* - * showinsert Part of printout. - * Expects printnewline is at an insertion. - */ - - void showinsert() { - if (printstatus == change) println(">>>> CHANGED TO"); - else if (printstatus != insert) - println(">>>> INSERT BEFORE " + printoldline); - printstatus = insert; - newinfo.symbol[printnewline].showSymbol(); - anyprinted = true; - printnewline++; - } - - /** - * showchange Part of printout. - * Expects printnewline is an insertion. - * Expects printoldline is a deletion. - */ - void showchange() { - if (printstatus != change) - println(">>>> " + printoldline + " CHANGED FROM"); - printstatus = change; - oldinfo.symbol[printoldline].showSymbol(); - anyprinted = true; - printoldline++; - } - - /** - * skipold Part of printout. - * Expects printoldline at start of an old block that has - * already been announced as a move. - * Skips over the old block. - */ - void skipold() { - printstatus = idle; - for (; ;) { - if (++printoldline > oldinfo.maxLine) - break; /* end of file */ - if (oldinfo.other[printoldline] < 0) - break; /* end of block */ - if (blocklen[printoldline] != 0) - break; /* start of another */ - } - } - - /** - * skipnew Part of printout. - * Expects printnewline is at start of a new block that has - * already been announced as a move. - * Skips over the new block. - */ - void skipnew() { - int oldline; - printstatus = idle; - for (; ;) { - if (++printnewline > newinfo.maxLine) - break; /* end of file */ - oldline = newinfo.other[printnewline]; - if (oldline < 0) - break; /* end of block */ - if (blocklen[oldline] != 0) - break; /* start of another */ - } - } - - /** - * showsame Part of printout. - * Expects printnewline and printoldline at start of - * two blocks that aren't to be displayed. - */ - void showsame() { - int count; - printstatus = idle; - if (newinfo.other[printnewline] != printoldline) { - System.err.println("BUG IN LINE REFERENCING"); - System.exit(1); - } - count = blocklen[printoldline]; - printoldline += count; - printnewline += count; - } - - /** - * showmove Part of printout. - * Expects printoldline, printnewline at start of - * two different blocks ( a move was done). - */ - void showmove() { - int oldblock = blocklen[printoldline]; - int newother = newinfo.other[printnewline]; - int newblock = blocklen[newother]; - - if (newblock < 0) skipnew(); // already printed. - else if (oldblock >= newblock) { // assume new's blk moved. - blocklen[newother] = -1; // stamp block as "printed". - println(">>>> " + newother + - " THRU " + (newother + newblock - 1) + - " MOVED TO BEFORE " + printoldline); - for (; newblock > 0; newblock--, printnewline++) - newinfo.symbol[printnewline].showSymbol(); - anyprinted = true; - printstatus = idle; - - } else /* assume old's block moved */ - skipold(); /* target line# not known, display later */ - } - - /** - * Convenience wrapper for println - */ - public void println(String s) { - printer.println(s); - printer.flush(); - } - -}; // end of main class! - -/** - * Class "node". The symbol table routines in this class all - * understand the symbol table format, which is a binary tree. - * The methods are: addSymbol, symbolIsUnique, showSymbol. - */ -class node { /* the tree is made up of these nodes */ - - static Diff diff = null; - static node panchor = null; /* symtab is a tree hung from this */ - static final int freshnode = 0, - oldonce = 1, newonce = 2, bothonce = 3, other = 4; - - node pleft, pright; - int linenum; - int /* enum linestates */ linestate; - String line; - - /** - * Construct a new symbol table node and fill in its fields. - * - * @param pline string A line of the text file - */ - public node(String pline) { - pleft = pright = null; - linestate = freshnode; - /* linenum field is not always valid */ - line = pline; - } - - /** - * matchsymbol Searches tree for a match to the line. - * - * @param pline String pline, a line of text - * If node's linestate == freshnode, then created the node. - */ - static node matchsymbol(String pline) { - int comparison; - node pnode = panchor; - if (panchor == null) return panchor = new node(pline); - for (; ;) { - comparison = linecompare(pnode.line,pline); - if (comparison == 0) return pnode; /* found */ - - if (comparison < 0) { - if (pnode.pleft == null) { - pnode.pleft = new node(pline); - return pnode.pleft; - } - pnode = pnode.pleft; - } - if (comparison > 0) { - if (pnode.pright == null) { - pnode.pright = new node(pline); - return pnode.pright; - } - pnode = pnode.pright; - } - } - /* NOTE: There are return stmts, so control does not get here. */ - } - - /** - * addSymbol(String pline) - Saves line into the symbol table. - * Returns a handle to the symtab entry for that unique line. - * If inoldfile nonzero, then linenum is remembered. - */ - static node addSymbol(Diff diff, String pline, boolean inoldfile, int linenum) { - node.diff = diff; - node pnode; - pnode = matchsymbol(pline); /* find the node in the tree */ - if (pnode.linestate == freshnode) { - pnode.linestate = inoldfile ? oldonce : newonce; - } else { - if ((pnode.linestate == oldonce && !inoldfile) || - (pnode.linestate == newonce && inoldfile)) - pnode.linestate = bothonce; - else pnode.linestate = other; - } - if (inoldfile) pnode.linenum = linenum; - return pnode; - } - - /** - * symbolIsUnique Arg is a ptr previously returned by addSymbol. - * -------------- Returns true if the line was added to the - * symbol table exactly once with inoldfile true, - * and exactly once with inoldfile false. - */ - boolean symbolIsUnique() { - return (linestate == bothonce); - } - - /** - * showSymbol Prints the line to stdout. - */ - void showSymbol() { - diff.printer.println(line); - } - static String compact(String line){ - // trim and remove return characters - String[] pieces = line.trim().split("\r"); - line = ""; for(String s: pieces) line = line +s; - // Break line on whitespace and compact - pieces = line.split("[ \t\n][ \t\n]*"); - line = ""; for(String s: pieces) line = line + s; - return line; - } - - static int linecompare(String line1, String line2) - { - return compact(line1).compareToIgnoreCase(compact(line2)); - } - -} diff --git a/dap4/d4tests/src/test/java/dap4/test/Dump.java b/dap4/d4tests/src/test/java/dap4/test/Dump.java deleted file mode 100644 index 7ebe022f0a..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/Dump.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - - -package dap4.test; - -import dap4.core.util.DapUtil; -import dap4.core.util.Escape; -import java.io.IOException; -import java.io.InputStream; -import java.math.BigInteger; -import java.nio.BufferUnderflowException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -public class Dump { - - ////////////////////////////////////////////////// - // Constants - - static public boolean DUMPCSUM = false; - - static final String LBRACE = "{"; - static final String RBRACE = "}"; - - static final BigInteger MASK = new BigInteger("FFFFFFFFFFFFFFFF", 16); - - ////////////////////////////////////////////////// - // Type decls - - // Place to insert the command list - static public interface Commands { - public void run(Dump printer) throws IOException; - } - - ////////////////////////////////////////////////// - // Instance databuffer - - protected ByteBuffer reader = null; - protected boolean checksumming = true; - protected ByteOrder remoteorder = null; - protected StringBuilder buf = null; - protected java.util.zip.Checksum localchecksum; - protected int lastchecksum = 0; - - ////////////////////////////////////////////////// - // Constructor(s) - - public Dump() {} - - ////////////////////////////////////////////////// - // Command processing - - public String dumpdata(InputStream stream, boolean checksumming, ByteOrder remoteorder, Commands commands) - throws IOException { - // Hack for debugging; use a bytebuffer internally - this.reader = ByteBuffer.wrap(DapUtil.readbinaryfile(stream)); - this.checksumming = checksumming; - this.remoteorder = remoteorder; - this.buf = new StringBuilder(); - commands.run(this); - return this.buf.toString(); - } - - public int printcount() throws IOException { - ByteBuffer bytes = checksum(8); - long l = bytes.getLong(); - buf.append(String.format("count=%d%n", l)); - return (int) l; - } - - public void printvalue(char cmd, int typesize, int... indices) throws IOException { - long l = 0; - ByteBuffer bytes = null; - // for strings and opaque, the typesize is zero - if (typesize == 0) { - bytes = checksum(8); - l = bytes.getLong(); - bytes = checksum((int) l); - } else - bytes = checksum(typesize); - if (indices != null && indices.length > 0) { - for (int index : indices) { - buf.append(" [" + Integer.toString(index) + "]"); - } - } - buf.append(" "); - int switcher = (((int) cmd) << 4) + typesize; - switch (switcher) { - case ('S' << 4) + 1: - byte b = bytes.get(); - l = ((long) b); - buf.append(String.format("%d", l)); - break; - case ('U' << 4) + 1: - b = bytes.get(); - l = ((long) b) & 0xFF; - buf.append(String.format("%d", l)); - break; - case ('C' << 4) + 0: - case ('C' << 4) + 1: - l = ((long) bytes.get()) & 0x7F; - buf.append(String.format("'%c'", (char) (l & 0xFF))); - break; - case ('S' << 4) + 2: - short s = bytes.getShort(); - l = ((long) s); - buf.append(String.format("%d", l)); - break; - case ('U' << 4) + 2: - s = bytes.getShort(); - l = ((long) s) & 0xFFFFL; - buf.append(String.format("%d", l)); - break; - case ('S' << 4) + 4: - int i = bytes.getInt(); - l = ((long) i); - buf.append(String.format("%d", l)); - break; - case ('U' << 4) + 4: - i = bytes.getInt(); - l = ((long) i) & 0xFFFFFFFFL; - buf.append(String.format("%d", l)); - break; - case ('S' << 4) + 8: - l = bytes.getLong(); - l = ((long) l); - buf.append(String.format("%d", l)); - break; - case ('U' << 4) + 8: // We have to convert to BigInteger to get this right - l = bytes.getLong(); - l = ((long) l); - BigInteger big = BigInteger.valueOf(l); - big = big.and(MASK); - buf.append(String.format("%s", big.toString())); - break; - case ('F' << 4) + 4: - Float f = bytes.getFloat(); - buf.append(String.format("%g", f)); - break; - case ('F' << 4) + 8: - Double d = bytes.getDouble(); - buf.append(String.format("%g", d)); - break; - case ('T' << 4) + 0: - // Read the text - buf.append('"' + Escape.backslashEscape(new String(bytes.array(), DapUtil.UTF8), "\"") + '"'); - break; - case ('O' << 4) + 0: - buf.append("0x"); - for (i = 0; i < bytes.limit(); i++) { - int uint8 = bytes.get(); - char c = hexchar((uint8 >> 4) & 0xF); - buf.append(c); - c = hexchar((uint8) & 0xF); - buf.append(c); - } - break; - default: - assert false; - } - } - - public void verifychecksum() throws IOException { - if (!checksumming) - return; - int localcrc32 = endchecksum(); - // Get the checksum from the input stream - ByteBuffer bbuf = readn(DapUtil.CHECKSUMSIZE); - int remotecrc32 = bbuf.getInt(); - assert localcrc32 == remotecrc32; - newline(); - } - - public void newline() { - buf.append("\n"); - } - - public void startchecksum() { - if (this.localchecksum == null) - this.localchecksum = new java.util.zip.CRC32(); - this.localchecksum.reset(); - } - - protected int endchecksum() { - long crc = this.localchecksum.getValue(); // get the digest value - crc = (crc & 0x00000000FFFFFFFFL); /* crc is 32 bits */ - this.lastchecksum = (int) crc; - return this.lastchecksum; - } - - protected byte[] readnbytes(int n) throws IOException { - byte[] bytes = new byte[n]; - try { - this.reader.get(bytes); - } catch (BufferUnderflowException e) { - throw new IOException("Short DATADMR"); - } - return bytes; - } - - protected ByteBuffer readn(int n) throws IOException { - byte[] bytes = readnbytes(n); - ByteBuffer result = ByteBuffer.wrap(bytes).order(this.remoteorder); - return result; - } - - protected ByteBuffer checksum(int n) throws IOException { - byte[] bytes = readnbytes(n); - localchecksum.update(bytes, 0, n); - if (DUMPCSUM) { - System.err.print("CCC "); - for (int i = 0; i < n; i++) { - System.err.printf("%02x", bytes[i]); - } - System.err.println(); - } - ByteBuffer result = ByteBuffer.wrap(bytes).order(this.remoteorder); - return result; - } - - public void format(String s) { - buf.append(String.format(s)); - } - - char hexchar(int i) { - return "0123456789ABCDEF".charAt((i & 0xF)); - } - -} diff --git a/dap4/d4tests/src/test/java/dap4/test/GenerateRaw.java b/dap4/d4tests/src/test/java/dap4/test/GenerateRaw.java deleted file mode 100644 index 6956c8d1ae..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/GenerateRaw.java +++ /dev/null @@ -1,400 +0,0 @@ -package dap4.test; - -import dap4.core.ce.parser.CEParserImpl; -import dap4.core.util.DapDump; -import dap4.core.util.Escape; -import dap4.dap4lib.ChunkInputStream; -import dap4.dap4lib.DSPPrinter; -import dap4.dap4lib.FileDSP; -import dap4.dap4lib.RequestMode; -import dap4.servlet.DapController; -import dap4.servlet.Generator; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.mock.web.MockHttpServletResponse; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder; -import thredds.server.dap4.Dap4Controller; -import ucar.unidata.util.test.category.NotJenkins; -import ucar.unidata.util.test.category.NotPullRequest; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.List; - - -/** - * This program is actually a feeder to provide - * testdata for use by the netcdf-c library. - * It operates by capturing the on-wire data - * that would be produced by a request to thredds - * to fufill a request for a dataset. This is - * referred to as raw data. - *

- * In operation, and for each test dataset, - * a .dmr file is placed in - * .../dap4/d4tests/src/test/data/resources/dmrtestfiles - * and a .dap file is placed in - * .../dap4/d4tests/src/test/data/resources/daptestfiles - * The .dap file is the complete captured - * on-the-wire data. The other, with the extension .dmr, - * is just the dmr for that dataset. - *

- * This program is setup as a Junit Test. - * It is a modified version of TestServletConstraints. - * As a rule, this program should only be invoked when new - * test cases are available (see GenerateRaw#defineAlltestcases). - * No harm will occur if it is accidentally run. - *

- * On the netcdf-c side, there is a program -- dap4_test/maketests.sh -- - * that extracts files from the {dmr,dap}testfiles directories and from the - * testfiles directory (for .cdl files). It stores the dmr files in dmrtestfiles, - * the dap files in daptestfiles, and the cdl (if available) in - * cdltestfiles. - */ - -@Category({NotJenkins.class, NotPullRequest.class}) // must call explicitly in intellij -public class GenerateRaw extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static public boolean GENERATE = false; - static public boolean DEBUG = false; - static public boolean DEBUGDATA = false; - static public boolean PARSEDEBUG = false; - static public boolean CEPARSEDEBUG = false; - static public boolean SHOWTESTCASES = false; - - static public boolean USEBIG = false; - static public boolean NOCSUM = false; - - static public boolean USED4TS = false; - - static public boolean USEDAPDMR = true; - - ////////////////////////////////////////////////// - // Constants - - // static protected final String RESOURCEPATH = "/src/test/data/resources"; // wrt getTestInputFilesDir - static protected final String RAWDIR = "/rawtestfiles"; - static protected final String DAPDIR = "/daptestfiles"; - static protected final String DMRDIR = "/dmrtestfiles"; - - // constants for Fake Request - static protected final String FAKEURLPREFIX = (USED4TS ? "/d4ts" : "/dap4"); - - static protected final String RESOURCEPATH = "/src/test/data/resources"; // wrt getTestInputFilesDir - - ////////////////////////////////////////////////// - // Type Declarations - - static protected class TestCase { - static String resourceroot = null; - - static public void setRoots(String resource) { - resourceroot = canonicalpath(resource); - } - - static public String resourcepath() { - return resourceroot; - } - - public String dataset; - public String prefix; - public String suffix; // extensions - public String ce; - public boolean bigendian; - public boolean nochecksum; - public int id; - - public TestCase(String dataset) { - this(0, dataset, null); - } - - public TestCase(int id, String dataset, String ce) { - dataset = canonicalpath(dataset); - // The prefix is everything before the final file name - int index = dataset.lastIndexOf("/"); - if (index < 0) { - prefix = null; - } else { - prefix = canonicalpath(dataset.substring(0, index)); - dataset = dataset.substring(index + 1); - } - // pull off the extensions - index = dataset.indexOf("."); - if (index < 0) { - suffix = ""; - } else { - suffix = dataset.substring(index); - dataset = dataset.substring(0, index); - } - this.dataset = dataset; - this.ce = (ce == null ? null : Escape.urlEncodeQuery(ce)); - this.id = id; - this.bigendian = false; - this.nochecksum = false; - } - - public TestCase setBigEndian(boolean tf) { - this.bigendian = tf; - return this; - } - - public TestCase setNoChecksum(boolean tf) { - this.nochecksum = tf; - return this; - } - - public String inputpath() { - return canonjoin(resourceroot, this.prefix); - } - - public String generatepath(String dir) { - String s = canonjoin(this.resourcepath(), dir, this.dataset); - if (this.id > 0) - s = s + "." + String.format("%d", this.id); - return s + this.suffix; - } - - public String makeurl() { - String url = canonjoin(FAKEURLPREFIX, this.prefix, this.dataset) + this.suffix + ".dap"; - return url; - } - - public String makequery() { - if (this.ce == null) - return null; - return this.ce; - } - - public boolean matches(String name) { - String thisname = this.dataset + this.suffix; - return thisname.equals(name); - } - - } - - ////////////////////////////////////////////////// - // Instance variables - - protected MockMvc mockMvc; - - protected List alltestcases = new ArrayList<>(); - - protected List chosentests = new ArrayList<>(); - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - StandaloneMockMvcBuilder mvcbuilder = USED4TS ? MockMvcBuilders.standaloneSetup(new D4TSController()) - : MockMvcBuilders.standaloneSetup(new Dap4Controller()); - mvcbuilder.setValidator(new TestServlet.NullValidator()); - this.mockMvc = mvcbuilder.build(); - testSetup(); - if (prop_ascii) - Generator.setASCII(true); - TestCase.setRoots(getResourceRoot()); - defineAlltestcases(); - choosetests(); - if (USEDAPDMR) { - String dapdir = canonjoin(TestCase.resourcepath(), DAPDIR); - String dmrdir = canonjoin(TestCase.resourcepath(), DMRDIR); - File dapfile = new File(dapdir); - if (!dapfile.exists()) - dapfile.mkdirs(); - File dmrfile = new File(dmrdir); - if (!dmrfile.exists()) - dmrfile.mkdirs(); - } else { - String rawdir = canonjoin(TestCase.resourcepath(), RAWDIR); - File rawfile = new File(rawdir); - if (!rawfile.exists()) - rawfile.mkdirs(); - } - - } - - ////////////////////////////////////////////////// - // Define inputs - - protected void choosetests() { - if (false) { - chosentests = locate("test_atomic_array.nc"); - // chosentests = locate(5); - prop_visual = true; - prop_generate = false; - DapController.DUMPDMR = true; - } else { - prop_generate = true; - for (TestCase input : alltestcases) { - chosentests.add(input); - } - } - } - - ////////////////////////////////////////////////// - // Junit test methods - - @Test - public void generate() throws Exception { - Assert.assertFalse("No test cases specified", chosentests.size() == 0); - for (TestCase tc : chosentests) { - doOne(tc); - } - } - - ////////////////////////////////////////////////// - // Primary test method - - protected void doOne(TestCase tc) throws Exception { - String inputpath = tc.inputpath(); - String dappath; - String dmrpath; - if (USEDAPDMR) { - dappath = tc.generatepath(DAPDIR) + ".dap"; - dmrpath = tc.generatepath(DMRDIR) + ".dmr"; - } else { - dappath = tc.generatepath(RAWDIR) + ".dap"; - dmrpath = tc.generatepath(RAWDIR) + ".dmr"; - } - - String url = tc.makeurl(); - - String ce = tc.makequery(); - - System.err.println("Input: " + inputpath); - System.err.println("Generated (DMR):" + dmrpath); - System.err.println("Generated (DAP):" + dappath); - System.err.println("URL: " + url); - if (ce != null) - System.err.println("CE: " + ce); - - if (CEPARSEDEBUG) - CEParserImpl.setGlobalDebugLevel(1); - - String little = tc.bigendian ? "0" : "1"; - String nocsum = tc.nochecksum ? "1" : "0"; - MvcResult result; - if (ce == null) { - result = perform(url, this.mockMvc, RESOURCEPATH, DapTestCommon.ORDERTAG, little, DapTestCommon.NOCSUMTAG, nocsum, - DapTestCommon.TRANSLATETAG, "nc4"); - } else { - result = perform(url, this.mockMvc, RESOURCEPATH, DapTestCommon.CONSTRAINTTAG, ce, DapTestCommon.ORDERTAG, little, - DapTestCommon.NOCSUMTAG, nocsum, DapTestCommon.TRANSLATETAG, "nc4"); - } - - // Collect the output - MockHttpServletResponse res = result.getResponse(); - byte[] byteresult = res.getContentAsByteArray(); - - if (prop_debug || DEBUGDATA) { - DapDump.dumpbytestream(byteresult, ByteOrder.nativeOrder(), "GenerateRaw"); - } - - // Dump the dap serialization into a file - if (prop_generate || GENERATE) - writefile(dappath, byteresult); - - // Dump the dmr into a file by extracting from the dap serialization - ByteArrayInputStream bytestream = new ByteArrayInputStream(byteresult); - ChunkInputStream reader = new ChunkInputStream(bytestream, RequestMode.DAP, ByteOrder.nativeOrder()); - String sdmr = reader.readDMR(); // Read the DMR - if (prop_generate || GENERATE) - writefile(dmrpath, sdmr); - - if (prop_visual) { - visual(tc.dataset + ".dmr", sdmr); - FileDSP src = new FileDSP(); - src.open(byteresult); - StringWriter writer = new StringWriter(); - DSPPrinter printer = new DSPPrinter(src, writer); - printer.print(); - printer.close(); - writer.close(); - String sdata = writer.toString(); - visual(tc.dataset + ".dap", sdata); - } - } - - ////////////////////////////////////////////////// - - protected void defineAlltestcases() { - add(new TestCase("testfiles/test_atomic_array.nc"), new TestCase("testfiles/test_atomic_array.syn"), - new TestCase("testfiles/test_atomic_types.nc"), new TestCase("testfiles/test_atomic_types.syn"), - new TestCase("testfiles/test_enum.nc"), new TestCase("testfiles/test_enum_2.nc"), - new TestCase("testfiles/test_enum_array.nc"), new TestCase("testfiles/test_fill.nc"), - new TestCase("testfiles/test_groups1.nc"), new TestCase("testfiles/test_one_var.nc"), - new TestCase("testfiles/test_one_vararray.nc"), new TestCase("testfiles/test_anon_dim.syn"), - new TestCase("testfiles/test_unlim1.nc"), new TestCase("testfiles/test_utf8.nc"), - new TestCase("testfiles/test_opaque.nc"), new TestCase("testfiles/test_opaque_array.nc"), - new TestCase("testfiles/test_sequence_1.syn"), new TestCase("testfiles/test_sequence_2.syn"), - new TestCase("testfiles/test_struct_array.nc"), new TestCase("testfiles/test_struct_array.syn"), - new TestCase("testfiles/test_struct_nested.nc"), new TestCase("testfiles/test_struct_nested3.nc"), - new TestCase("testfiles/test_struct_nested3.nc"), new TestCase("testfiles/test_struct1.nc"), - new TestCase("testfiles/test_struct_type.nc"), new TestCase("testfiles/test_vlen1.nc"), - new TestCase("testfiles/test_vlen2.nc"), new TestCase("testfiles/test_vlen3.nc"), - new TestCase("testfiles/test_vlen4.nc"), // vlen inside a compound - new TestCase("testfiles/test_vlen5.nc"), new TestCase("testfiles/test_vlen6.nc"), - new TestCase("testfiles/test_vlen7.nc"), new TestCase("testfiles/test_vlen8.nc"), - (USED4TS ? new TestCase("testfiles/test_vlen9.nc") : null), // vlen of compound not handled - (USED4TS ? new TestCase("testfiles/test_vlen10.nc") : null), // CDM cannot handle nesting - (USED4TS ? new TestCase("testfiles/test_vlen11.nc") : null), // CDM cannot handle vlen of vlen - - // Constrained generation - new TestCase(1, "testfiles/test_one_vararray.nc", "/t[1]"), - new TestCase(2, "testfiles/test_anon_dim.syn", "/vu32[0:3]"), - new TestCase(3, "testfiles/test_one_vararray.nc", "/t"), - new TestCase(4, "testfiles/test_enum_array.nc", "/primary_cloud[1:2:4]"), - new TestCase(5, "testfiles/test_atomic_array.nc", "/vu8[1][0:2:2];/vd[1];/vs[1][0];/vo[0][1]"), - new TestCase(6, "testfiles/test_struct_array.nc", "/s[0:2:3][0:1]"), - new TestCase(7, "testfiles/test_opaque_array.nc", "/vo2[1][0:1]"), - new TestCase(8, "testfiles/test_atomic_array.nc", "/v16[0:1,3]"), - new TestCase(9, "testfiles/test_atomic_array.nc", "/v16[3,0:1]")); - if (SHOWTESTCASES) { - for (TestCase tc : alltestcases) { - System.err.println(tc.dataset); - } - } - } - - ////////////////////////////////////////////////// - // Utility methods - - protected void add(TestCase... cases) { - for (TestCase tc : cases) { - if (tc != null) - this.alltestcases.add(tc); - } - } - - // Locate the test cases with given prefix or id - List locate(Object tag) { - List results = new ArrayList(); - if (tag instanceof Integer) { - for (TestCase ct : this.alltestcases) { - if (ct.id == (Integer) tag) { - results.add(ct); - break; - } - } - } else if (tag instanceof String) { - for (TestCase ct : this.alltestcases) { - if (ct.matches((String) tag)) { - results.add(ct); - break; - } - } - } - return results; - } -} diff --git a/dap4/d4tests/src/test/java/dap4/test/Synthesize.java b/dap4/d4tests/src/test/java/dap4/test/Synthesize.java deleted file mode 100644 index edc50f4c7b..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/Synthesize.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - - -package dap4.test; - -import dap4.core.dmr.DapType; -import dap4.core.util.DapException; -import dap4.servlet.SerialWriter; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -public class Synthesize { - - ////////////////////////////////////////////////// - // Constants - - static final int MAXSIZE = 8; - - static final BigInteger MASK = new BigInteger("FFFFFFFFFFFFFFFF", 16); - - ////////////////////////////////////////////////// - // Type decls - - // Place to insert the command list - static public interface Commands { - public void run(Synthesize reader) throws IOException; - } - - ////////////////////////////////////////////////// - // Instance databuffer - - public boolean checksumming = true; - public ByteOrder order = null; - public byte[] tmp = new byte[MAXSIZE]; - public ByteBuffer bbtmp = ByteBuffer.wrap(tmp); - public ByteArrayOutputStream writer = new ByteArrayOutputStream(); - - ////////////////////////////////////////////////// - // Constructor(s) - - public Synthesize() {} - - ////////////////////////////////////////////////// - // Accessors - - public byte[] getBytes() { - return writer.toByteArray(); - } - - - ////////////////////////////////////////////////// - // Command processing - - public void synthesize(boolean checksumming, ByteOrder order, Commands commands) throws IOException { - this.checksumming = checksumming; - this.order = order; - this.bbtmp.order(order); - commands.run(this); - } - - ////////////////////////////////////////////////// - // Commands - - public void putcount(long count) throws IOException { - bbtmp.position(0); - bbtmp.putLong(count); - writer.write(tmp, 0, bbtmp.position()); - } - - public void putvalue(DapType daptype, Object value) throws IOException { - int typesize = daptype.getSize(); - if (daptype.isFixedSize()) { - ByteBuffer tmp = SerialWriter.encodeArray(daptype, value, this.order); - } else if (daptype == DapType.STRING) { - String s = (String) value; - putcount(s.length()); - } else if (daptype == DapType.OPAQUE) { - ByteBuffer b = (ByteBuffer) value; - int len = b.position(); - putcount(len); - b.position(0); - for (int i = 0; i < len; i++) - writer.write(b.get()); - b.position(len); - } else - throw new DapException("Synthesize.putvalue: illegal type: " + daptype); - } - - public void putchecksum(ByteBuffer b) throws IOException { - if (!checksumming) - return; - int len = b.position(); - b.position(0); - for (int i = 0; i < len; i++) - writer.write(b.get()); - b.position(len); - } - -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestCDMClient.java b/dap4/d4tests/src/test/java/dap4/test/TestCDMClient.java deleted file mode 100644 index ac064a4cf7..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestCDMClient.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (c) 1998-2021 University Corporation for Atmospheric Research/Unidata - * See LICENSE for license information. - */ - -package dap4.test; - -import dap4.core.util.DapUtil; -import dap4.servlet.DapCache; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import thredds.test.util.TdsTestDir; -import thredds.test.util.TdsUnitTestCommon; -import ucar.nc2.dataset.NetcdfDataset; - -import java.io.*; -import java.lang.invoke.MethodHandles; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; - -/** - * Test Client side access - */ - -public class TestCDMClient extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean DEBUG = false; - - ////////////////////////////////////////////////// - // Constants - - static final String BASEEXTENSION = ".txt"; - static final String INPUTEXTENSION = ".raw"; - - static final String DAP4TAG = "#protocol=dap4"; - - static final String DATADIR = "src/test/data/resources"; // relative to dap4 root - static final String BASELINEDIR = "TestCDMClient/baseline"; - static final String TESTCDMINPUT = "TestCDMClient/testinput"; - static final String TESTFILESINPUT = "testfiles"; - - static final String[] EXCLUDEDFILETESTS = new String[] {"test_sequence_2.syn.raw"}; - - ////////////////////////////////////////////////// - // Type Declarations - - static class TestCase { - static private String root = null; - - static void setRoot(String r) { - root = r; - } - - static String getRoot() { - return root; - } - - ///////////////////////// - - private String title; - private String dataset; - private String ext; - private boolean checksumming; - private String testpath; - private String baselinepath; - private String url; - - TestCase(String url) { - this(url, true); - } - - TestCase(String url, boolean csum) { - try { - URL u = new URL(url); - this.title = u.getPath(); - } catch (MalformedURLException e) { - this.title = "unknown"; - } - this.checksumming = csum; - this.url = url; - try { - URL u = new URL(url); - this.testpath = DapUtil.canonicalpath(u.getPath()); - int i = this.testpath.lastIndexOf('/'); - assert i > 0; - this.dataset = this.testpath.substring(i + 1, this.testpath.length()); - // strip off any raw extension - if (this.dataset.endsWith(INPUTEXTENSION)) - this.dataset = this.dataset.substring(0, this.dataset.length() - INPUTEXTENSION.length()); - this.baselinepath = root + "/" + BASELINEDIR + "/" + this.dataset + INPUTEXTENSION + BASEEXTENSION; - } catch (MalformedURLException e) { - throw new IllegalArgumentException(url); - } - } - - public String getURL() { - return this.url + DAP4TAG; - } - - public String getPath() { - return this.testpath; - } - - public String getDataset() { - return this.dataset; - } - - public String getBaseline() { - return this.baselinepath; - } - - public String getTitle() { - return this.title; - } - - public String toString() { - return this.url; - } - } - - ////////////////////////////////////////////////// - // Instance variables - - // Test cases - - protected List alltestcases = new ArrayList(); - protected List chosentests = new ArrayList(); - - protected String resourceroot = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - DapCache.flush(); - testSetup(); - this.resourceroot = getResourceRoot(); - TestCase.setRoot(resourceroot); - defineAllTestcases(); - chooseTestcases(); - } - - // convert an extension to a file or url prefix - String prefix(String scheme, String ext) { - if (ext.charAt(0) == '.') - ext = ext.substring(1); - if (scheme.startsWith("http")) { - return "http://" + TdsTestDir.dap4TestServer + "/d4ts"; - } else if (scheme.equals("file")) { - if (ext.equals("raw")) - return "file:/" + this.resourceroot + "/" + TESTCDMINPUT; - } - throw new IllegalArgumentException(); - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("file:", "test_atomic_array.nc.raw"); - prop_visual = true; - prop_baseline = false; - } else { - prop_baseline = false; - for (TestCase tc : alltestcases) { - chosentests.add(tc); - } - } - } - - void defineAllTestcases() { - System.err.printf("pwd=%s%n", System.getProperty("user.dir")); - List matches = new ArrayList<>(); - String dir = TestCase.getRoot() + "/" + TESTCDMINPUT; - TestFilter.filterfiles(dir, matches, "raw"); - for (String f : matches) { - boolean excluded = false; - for (String x : EXCLUDEDFILETESTS) { - if (f.endsWith(x)) { - excluded = true; - break; - } - } - if (!excluded) { - add(f); - } - } - } - - protected void add(String path) { - File f = new File(path); - if (!f.exists()) - System.err.println("Non existent file test case: " + path); - else if (!f.canRead()) - System.err.println("Unreadable file test case: " + path); - String ext = path.substring(path.lastIndexOf('.'), path.length()); - String url = "file://" + path; - try { - URL u = new URL(url); - System.err.printf("Testcase: add: %s path=%s%n", u.toString(), u.getPath()); - } catch (MalformedURLException e) { - System.err.println("Malformed file test case: " + url); - } - TestCase tc = new TestCase(url); - for (TestCase t : this.alltestcases) { - assert !t.getURL().equals(tc.getURL()) : "Duplicate TestCases: " + t; - } - this.alltestcases.add(tc); - } - - ////////////////////////////////////////////////// - // Junit test method - @Test - public void testCDMClient() throws Exception { - for (TestCase testcase : chosentests) { - doOneTest(testcase); - } - System.err.println("*** PASS"); - } - - ////////////////////////////////////////////////// - // Primary test method - void doOneTest(TestCase testcase) throws Exception { - System.err.println("Testcase: " + testcase.getURL()); - System.err.println("Baseline: " + testcase.getBaseline()); - - NetcdfDataset ncfile; - try { - ncfile = TdsUnitTestCommon.openDatasetDap4Tests(testcase.getURL()); - } catch (Exception e) { - e.printStackTrace(); - throw new Exception("File open failed: " + testcase.getURL(), e); - } - assert ncfile != null; - - String datasetname = testcase.getDataset(); - String data = dumpdata(ncfile, datasetname); - - if (prop_visual) { - visual(testcase.getTitle() + ".dap", data); - } - String baselinefile = testcase.getBaseline(); - - if (prop_baseline) - writefile(baselinefile, data); - else if (prop_diff) { // compare with baseline - // Read the baseline file(s) - String baselinecontent = readfile(baselinefile); - System.err.println("Comparison: vs " + baselinefile); - Assert.assertTrue("*** FAIL", same(getTitle(), baselinecontent, data)); - } - } - - String dumpmetadata(NetcdfDataset ncfile, String datasetname) throws Exception { - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - // Print the meta-databuffer using these args to NcdumpW - String dump = ""; - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } - return dump; - } - - String dumpdata(NetcdfDataset ncfile, String datasetname) throws Exception { - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - String dump = ""; - // Dump the databuffer - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } - return dump; - } - - ////////////////////////////////////////////////// - // Utility methods - - // Locate the test cases with given prefix - List locate(String scheme, String s) { - return locate(scheme, s, null); - } - - List locate(String scheme, String s, List list) { - if (list == null) - list = new ArrayList<>(); - int matches = 0; - for (TestCase ct : this.alltestcases) { - if (!ct.getURL().startsWith(scheme)) - continue; - if (ct.getPath().endsWith(s)) { - matches++; - list.add(ct); - } - } - assert matches > 0 : "No such testcase: " + s; - return list; - } - - static boolean report(String msg) { - System.err.println(msg); - return false; - } - -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestConstraints.java b/dap4/d4tests/src/test/java/dap4/test/TestConstraints.java deleted file mode 100644 index 307be71fa5..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestConstraints.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 1998-2021 University Corporation for Atmospheric Research/Unidata - * See LICENSE for license information. - */ - -package dap4.test; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import thredds.test.util.TdsTestDir; -import thredds.test.util.TdsUnitTestCommon; -import ucar.httpservices.HTTPMethod; -import ucar.nc2.dataset.NetcdfDataset; -import ucar.unidata.util.test.category.NotPullRequest; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; - -/** - * Test at the NetcdfDataset level - */ -@Category(NotPullRequest.class) -public class TestConstraints extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean DEBUG = false; - - static final public boolean DEBUGSERVER = true; - - ////////////////////////////////////////////////// - // Constants - - static final boolean NCDUMP = true; // Use NcDumpW instead of D4Print - - static final String BASEEXTENSION = "raw.txt"; - static final String TESTEXTENSION = ".raw"; - - static final String DAP4TAG = "protocol=dap4"; - - static protected final String SERVLETPATH = "d4ts"; - static protected final String RESOURCEPATH = "/src/test/data/resources"; - static protected final String TESTINPUTPATH = "/testfiles"; - static protected final String BASELINEDIR = "/TestConstraints/baseline"; - - ////////////////////////////////////////////////// - // Type Declarations - - static class TestCase { - static String servletpath = null; - static String baselinedir = null; - static String server = null; - - static public void setRoots(String servletpath, String baselinedir, String server) { - TestCase.baselinedir = baselinedir; - TestCase.servletpath = servletpath; - TestCase.server = server; - } - - static boolean[] idcheck = new boolean[2048]; - - ////////////////////////////////////////////////// - - String title; - String dataset; - String constraint; - int id; - - TestCase(int id, String dataset, String constraint) { - if (idcheck[id]) - throw new IllegalStateException("two tests with same id"); - if (constraint != null && constraint.length() == 0) - constraint = null; - this.constraint = constraint; - this.title = dataset + (constraint == null ? "" : "?" + constraint); - this.dataset = dataset; - this.id = id; - idcheck[id] = true; - } - - String getbaseline() { - return canonjoin(this.baselinedir, dataset) + "." + id + "." + BASEEXTENSION; - } - - String makeurl() { - StringBuilder url = new StringBuilder(); - url.append("dap4://"); - url.append(server); - url.append("/"); - url.append(servletpath); - url.append(TESTINPUTPATH); - url.append("/"); - url.append(dataset); - if (constraint != null) { - url.append("?"); - url.append(CONSTRAINTTAG); - url.append("="); - url.append(constraint); - } - url.append("#"); - url.append(DAP4TAG); - return url.toString(); - } - - String makeName() { - return this.dataset + "." + this.id; - } - - public String toString() { - return makeurl(); - } - } - - ////////////////////////////////////////////////// - // Instance variables - - // Test cases - - protected List alltestcases = new ArrayList(); - protected List chosentests = new ArrayList(); - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - String root = getDAP4Root(); - if (root == null) - throw new Exception("dap4 root cannot be located"); - testSetup(); - if (DEBUGSERVER) - HTTPMethod.MOCKEXECUTOR = new MockExecutor(getResourceRoot()); - TestCase.setRoots(SERVLETPATH, canonjoin(getResourceRoot(), BASELINEDIR), TdsTestDir.dap4TestServer); - defineAllTestcases(); - chooseTestcases(); - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests.add(locate1(4)); - prop_visual = true; - } else { - prop_baseline = false; - prop_visual = false; - for (TestCase tc : alltestcases) { - chosentests.add(tc); - } - } - } - - void defineAllTestcases() { - alltestcases.add(new TestCase(1, "test_one_vararray.nc", "t[1]")); - alltestcases.add(new TestCase(2, "test_anon_dim.syn", "vu32[0:3]")); - alltestcases.add(new TestCase(3, "test_one_vararray.nc", "t")); - alltestcases.add(new TestCase(4, "test_enum_array.nc", "primary_cloud[1:2:4]")); - alltestcases.add(new TestCase(5, "test_atomic_array.nc", "vu8[1][0:2:2];vd[1];vs[1][0];vo[0][1]")); - alltestcases.add(new TestCase(6, "test_struct_array.nc", "s[0:2:3][0:1]")); - alltestcases.add(new TestCase(7, "test_opaque_array.nc", "vo2[1:1][0,0]")); - alltestcases.add(new TestCase(8, "test_atomic_array.nc", "v16[1:2,2]")); - alltestcases.add(new TestCase(9, "test_atomic_array.nc", "v16[2,1:2]")); - } - - ////////////////////////////////////////////////// - // Junit test method - @Test - public void testConstraints() throws Exception { - for (TestCase testcase : chosentests) { - doOneTest(testcase); - } - } - - ////////////////////////////////////////////////// - // Primary test method - void doOneTest(TestCase testcase) throws Exception { - System.err.println("Testcase: " + testcase.makeurl()); - System.err.println("Baseline: " + testcase.getbaseline()); - - String url = testcase.makeurl(); - NetcdfDataset ncfile = null; - try { - ncfile = TdsUnitTestCommon.openDatasetDap4Tests(url); - } catch (Exception e) { - throw e; - } - - // Patch the ncfile to change dataset name - String datasetname = extractDatasetname(url, Integer.toString(testcase.id)); - - String metadata = (NCDUMP ? ncdumpmetadata(ncfile, datasetname) : null); - String data = (NCDUMP ? ncdumpdata(ncfile, datasetname) : null); - - if (prop_visual) { - visual("DMR: " + url, metadata); - visual("DAP: " + url, data); - } - - String testoutput = (NCDUMP ? data : metadata + data); - - if (prop_baseline) - writefile(testcase.getbaseline(), testoutput); - - if (prop_diff) { // compare with baseline - // Read the baseline file(s) - String baselinecontent = readfile(testcase.getbaseline()); - System.err.println("Comparison:"); - Assert.assertTrue("***Fail", same(getTitle(), baselinecontent, testoutput)); - } - } - - ////////////////////////////////////////////////// - // Dump methods - - String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - String metadata = null; - String dump = ""; - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - // Print the meta-databuffer using these args to NcdumpW - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - if (!ok) { - System.err.println("NcdumpW failed"); - } - return dump; - } - - String ncdumpdata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - String dump = ""; - - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Dump the databuffer - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - if (!ok) { - System.err.println("NcdumpW failed"); - } - return dump; - } - - ////////////////////////////////////////////////// - // Utility methods - - // Locate the test cases with given index - TestCase locate1(int index) { - List results = new ArrayList(); - for (TestCase ct : this.alltestcases) { - if (ct.id == index) - return ct; - } - return null; - } - - // Locate the test cases with given prefix - TestCase locate1(String prefix) { - List tests = locate(prefix); - assert tests.size() > 0; - return tests.get(0); - } - - // Locate the test cases with given prefix and optional constraint - List locate(String prefix) { - List results = new ArrayList(); - for (TestCase ct : this.alltestcases) { - if (!ct.title.equals(prefix)) - continue; - results.add(ct); - } - return results; - } - - static boolean report(String msg) { - System.err.println(msg); - return false; - } - - -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestDSP.java b/dap4/d4tests/src/test/java/dap4/test/TestDSP.java deleted file mode 100644 index 98dcba4078..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestDSP.java +++ /dev/null @@ -1,365 +0,0 @@ -package dap4.test; - -import dap4.core.data.DSP; -import dap4.core.util.DapContext; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.dap4lib.DMRPrinter; -import dap4.dap4lib.DSPPrinter; -import dap4.dap4lib.FileDSP; -import dap4.dap4lib.HttpDSP; -import dap4.dap4lib.netcdf.Nc4DSP; -import dap4.servlet.DapCache; -import dap4.servlet.SynDSP; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import thredds.test.util.TdsTestDir; -import java.io.File; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -/** - * Test some of the DSP classes: - * AbstractDSP: tested by all the other DSPs - * CDMDSP: tested elsewhere (TestServlet) - * HttpDSP: tested elsewhere (TestCDMClient) - * FileDSP: tested here - * Nc4DSP: tested here - * SynDSP: tested here - * D4DSP: tested because superclass of FileDSP, HttpDSP, and SynDSP - * ThreddsDSP: not directly tested anywhere yet - */ -public class TestDSP extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean DEBUG = false; - static final boolean SHOWTESTCASES = true; - - static final String BASEEXTENSION = "txt"; - - static final String DAP4TAG = "#protocol=dap4"; - - ////////////////////////////////////////////////// - // Constants - - static final String DATADIR = "src/test/data/resources"; // relative to dap4 root - static final String BASELINEDIR = "TestDSP/baseline"; - static final String TESTCDMINPUT = "TestCDMClient/testinput"; - static final String TESTDSPINPUT = "TestDSP/testinput"; - static final String TESTFILESINPUT = "testfiles"; - - static final String[] EXCLUDEDFILETESTS = new String[] {}; - - ////////////////////////////////////////////////// - // Type Declarations - - static class TestCase { - static protected String root = null; - - static void setRoot(String r) { - root = r; - } - - static String getRoot() { - return root; - } - - ///////////////////////// - - private String title; - private String dataset; - private boolean checksumming; - private String testpath; - private String baselinepath; - private String url; - - TestCase(String url) { - this(url, true); - } - - TestCase(String url, boolean csum) { - this.title = dataset; - this.checksumming = csum; - this.url = url; - try { - URL u = new URL(url); - this.testpath = DapUtil.canonicalpath(u.getPath()); - int i = this.testpath.lastIndexOf('/'); - assert i > 0; - this.dataset = this.testpath.substring(i + 1, this.testpath.length()); - // strip off any raw extension - this.baselinepath = root + "/" + BASELINEDIR + "/" + this.dataset + "." + BASEEXTENSION; - } catch (MalformedURLException e) { - throw new IllegalArgumentException(url); - } - } - - public String getURL() { - return this.url + DAP4TAG; - } - - public String getPath() { - return this.testpath; - } - - public String getDataset() { - return this.dataset; - } - - public String getBaseline() { - return this.baselinepath; - } - - public String getTitle() { - return this.title; - } - - public String toString() { - return this.url; - } - } - - ////////////////////////////////////////////////// - // Static variables and methods - - protected DSP dspFor(String surl) { - URL url; - try { - url = new URL(surl); - } catch (MalformedURLException mue) { - throw new IllegalArgumentException("Malformed url: " + surl); - } - String proto = url.getProtocol(); - String path = url.getPath(); - int dot = path.lastIndexOf('.'); - if (dot < 0) - dot = path.length(); - String ext = path.substring(dot, path.length()); - DSP dsp = null; - try { - if ("file".equals(proto)) { - // discriminate on the extensions - if (".raw".equals(ext)) { - dsp = new FileDSP(); - } else if (".syn".equals(ext)) { - dsp = new SynDSP(); - } - if (".nc".equals(ext)) { - dsp = new Nc4DSP(); - } - } else if ("http".equals(proto) || "https".equals(url.getProtocol())) { - dsp = new HttpDSP(); - } else - throw new IllegalArgumentException("Cannot determine DSP class for: " + surl); - } catch (DapException de) { - throw new IllegalArgumentException("Cannot create DSP for: " + surl); - } - if (DEBUG) - System.err.printf("DSP: %s%n", dsp.getClass().getName()); - return dsp; - } - ////////////////////////////////////////////////// - // Instance variables - - // Test cases - - protected List alltestcases = new ArrayList(); - protected List chosentests = new ArrayList(); - - protected String resourceroot = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - DapCache.flush(); - this.resourceroot = getResourceRoot(); - this.resourceroot = DapUtil.absolutize(this.resourceroot); // handle problem of windows paths - TestCase.setRoot(resourceroot); - defineAllTestcases(); - chooseTestcases(); - } - - // convert an extension to a file or url prefix - String prefix(String scheme, String ext) { - if (ext.charAt(0) == '.') - ext = ext.substring(1); - if (scheme.startsWith("http")) { - return "http://" + TdsTestDir.dap4TestServer + "/d4ts"; - } else if (scheme.equals("file")) { - if (ext.equals("raw")) - return "file:/" + this.resourceroot + "/" + TESTCDMINPUT; - if (ext.equals("syn")) - return "file:/" + this.resourceroot + "/" + TESTDSPINPUT; - if (ext.equals("nc")) - return "file:/" + this.resourceroot + "/" + TESTFILESINPUT; - } - throw new IllegalArgumentException(); - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("file:", "test_struct_nested3.hdf5.raw"); - prop_visual = true; - prop_baseline = false; - } else { - prop_baseline = false; - for (TestCase tc : alltestcases) { - if (DEBUG) - System.err.printf("Test case: %s%n", tc.dataset); - chosentests.add(tc); - } - } - } - - void defineAllTestcases() { - List matches = new ArrayList<>(); - String dir = TestCase.root + "/" + TESTCDMINPUT; - TestFilter.filterfiles(dir, matches, "raw"); - if (false) { - dir = TestCase.root + "/" + TESTFILESINPUT; - TestFilter.filterfiles(dir, matches, "nc", "syn"); - } - for (String f : matches) { - boolean excluded = false; - for (String x : EXCLUDEDFILETESTS) { - if (f.indexOf(x) >= 0) { - excluded = true; - break; - } - } - if (!excluded) - add("file:/" + f); - } - if (SHOWTESTCASES) { - for (int i = 0; i < this.alltestcases.size(); i++) { - TestCase tc = this.alltestcases.get(i); - System.err.printf("ALLTESTS: %s%n", tc.getURL()); - } - } - } - - protected void add(String url) { - try { - URL u = new URL(url); - File f = new File(u.getPath()); - if (!f.canRead()) { - System.err.println("Unreadable file test case: " + url); - } - } catch (MalformedURLException e) { - System.err.println("Malformed file test case: " + url); - } - String ext = url.substring(url.lastIndexOf('.'), url.length()); - TestCase tc = new TestCase(url); - for (TestCase t : this.alltestcases) { - assert !t.getURL().equals(tc.getURL()) : "Duplicate TestCases: " + t; - } - this.alltestcases.add(tc); - } - - ////////////////////////////////////////////////// - // Junit test method - @Test - public void testDSP() throws Exception { - for (TestCase testcase : chosentests) { - doOneTest(testcase); - } - System.err.println("*** PASS"); - } - - ////////////////////////////////////////////////// - // Primary test method - void doOneTest(TestCase testcase) throws Exception { - System.err.println("Testcase: " + testcase.getURL()); - System.err.println("Baseline: " + testcase.getBaseline()); - - DSP dsp = dspFor(testcase.getURL()); - - dsp.setContext(new DapContext()); - dsp.open(testcase.getURL()); - - String metadata = dumpmetadata(dsp); - if (prop_visual) - visual(testcase.getURL() + ".dmr", metadata); - String data = dumpdata(dsp); - if (prop_visual) - visual(testcase.getURL() + ".dap", data); - - String baselinefile = testcase.getBaseline(); - - String testoutput = metadata + data; - - if (prop_baseline) - writefile(baselinefile, testoutput); - else if (prop_diff) { // compare with baseline - // Read the baseline file(s) - String baselinecontent = readfile(baselinefile); - System.err.println("Comparison: vs " + baselinefile); - Assert.assertTrue("*** FAIL", same(getTitle(), baselinecontent, testoutput)); - } - } - - String dumpmetadata(DSP dsp) throws Exception { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - // Print the meta-databuffer using these args to NcdumpW - DMRPrinter p = new DMRPrinter(dsp.getDMR(), pw); - p.testprint(); - pw.close(); - sw.close(); - return sw.toString(); - } - - String dumpdata(DSP dsp) throws Exception { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - // Print the meta-databuffer using these args to NcdumpW - DSPPrinter p = new DSPPrinter(dsp, pw).flag(DSPPrinter.Flags.CONTROLCHAR); - p.print(); - pw.close(); - sw.close(); - return sw.toString(); - } - - ////////////////////////////////////////////////// - // Utility methods - - // Locate the test cases with given prefix - List locate(String scheme, String s) { - return locate(scheme, s, null); - } - - List locate(String scheme, String s, List list) { - if (list == null) - list = new ArrayList<>(); - int matches = 0; - for (TestCase ct : this.alltestcases) { - if (!ct.getURL().startsWith(scheme)) - continue; - if (ct.getPath().endsWith(s)) { - matches++; - list.add(ct); - } - } - assert matches > 0 : "No such testcase: " + s; - return list; - } - - static boolean report(String msg) { - System.err.println(msg); - return false; - } - - -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestDSR.java b/dap4/d4tests/src/test/java/dap4/test/TestDSR.java deleted file mode 100644 index f869570ff7..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestDSR.java +++ /dev/null @@ -1,100 +0,0 @@ -package dap4.test; - - -import dap4.core.data.DSPRegistry; -import dap4.dap4lib.FileDSP; -import dap4.servlet.DapCache; -import dap4.servlet.Generator; -import dap4.servlet.SynDSP; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.mock.web.MockHttpServletResponse; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder; -import thredds.server.dap4.Dap4Controller; -import java.lang.invoke.MethodHandles; - -/** - * TestDSR verifies the DSR page - * generation code - */ - -public class TestDSR extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static protected final boolean DEBUG = false; - - ////////////////////////////////////////////////// - // Constants - - static protected final String RESOURCEPATH = "/src/test/data/resources"; // wrt getTestInputFilesDir - static protected final String TESTINPUTDIR = "/testfiles"; - static protected final String BASELINEDIR = "/TestDSR/baseline"; - - // constants for Fake Request - static protected final String FAKEDATASET = "test1"; - static protected String FAKEURLPREFIX = "/d4ts"; - static protected String FAKEURLPATH = FAKEURLPREFIX + "/" + FAKEDATASET; - - ////////////////////////////////////////////////// - // Instance variables - - ////////////////////////////////////////////////// - // Instance variables - MockMvc mockMvc = null; - protected String resourceroot = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - StandaloneMockMvcBuilder mvcbuilder = MockMvcBuilders.standaloneSetup(new D4TSController()); - mvcbuilder.setValidator(new TestServlet.NullValidator()); - this.mockMvc = mvcbuilder.build(); - testSetup(); - DapCache.dspregistry.register(FileDSP.class, DSPRegistry.FIRST); - DapCache.dspregistry.register(SynDSP.class, DSPRegistry.FIRST); - if (prop_ascii) - Generator.setASCII(true); - this.resourceroot = getResourceRoot(); - // this.datasetpath = getResourceRoot(); - } - - ////////////////////////////////////////////////// - // Junit test methods - - @Test - public void testDSR() throws Exception { - String url = FAKEURLPATH; // no file specified - - // Figure out the baseline - String baselinepath = canonjoin(this.resourceroot, BASELINEDIR, FAKEDATASET) + ".dsr"; - - MvcResult result = perform(url, this.mockMvc, RESOURCEPATH); - - // Collect the output - MockHttpServletResponse res = result.getResponse(); - byte[] byteresult = res.getContentAsByteArray(); - - // Convert the raw output to a string - String dsr = new String(byteresult, UTF8); - - if (prop_visual) - visual("TestDSR", dsr); - - if (prop_baseline) { - writefile(baselinepath, dsr); - } else if (prop_diff) { // compare with baseline - // Read the baseline file - String baselinecontent = readfile(baselinepath); - System.out.println("DSR Comparison:"); - Assert.assertTrue("***Fail", same(getTitle(), baselinecontent, dsr)); - } - } -} - diff --git a/dap4/d4tests/src/test/java/dap4/test/TestFilters.java b/dap4/d4tests/src/test/java/dap4/test/TestFilters.java deleted file mode 100644 index 8ed1ca90b5..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestFilters.java +++ /dev/null @@ -1,287 +0,0 @@ -package dap4.test; - -import dap4.dap4lib.ChunkInputStream; -import dap4.core.util.*; -import dap4.dap4lib.RequestMode; -import dap4.servlet.Generator; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.lang.invoke.MethodHandles; -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.*; - -/** - * TestFilter tests server side - * filter processing. - */ - -public class TestFilters extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - ////////////////////////////////////////////////// - // Constants - - static String DATADIR = "src/test/data"; // relative to dap4 root - static String TESTDATADIR = DATADIR + "/resources/"; - static String BASELINEDIR = DATADIR + "/resources/TestFilters/baseline"; - static String TESTINPUTDIR = DATADIR + "/resources/testfiles"; - - // constants for Fake Request - static String FAKEURLPREFIX = "http://localhost:8080/d4ts"; - - static final BigInteger MASK = new BigInteger("FFFFFFFFFFFFFFFF", 16); - - static protected final int DEFAULTROWCOUNT = 5; - - ////////////////////////////////////////////////// - // Type Declarations - - static class ConstraintTest { - static String root = null; - - static ConstraintTest[] alltests; - - static { - alltests = new ConstraintTest[2048]; - Arrays.fill(alltests, null); - } - - String title; - String dataset; - String constraint; - boolean xfail; - Dump.Commands template; - String testinputpath; - String baselinepath; - int id; - int rowcount = DEFAULTROWCOUNT; - - ConstraintTest(int id, String dataset, String ce) { - this(id, dataset, 0, ce, null, true); - } - - ConstraintTest(int id, String dataset, String ce, Dump.Commands template) { - this(id, dataset, 0, ce, template, false); - } - - ConstraintTest(int id, String dataset, int rows, String ce, Dump.Commands template) { - this(id, dataset, rows, ce, template, false); - } - - ConstraintTest(int id, String dataset, int rows, String ce, Dump.Commands template, boolean xfail) { - if (alltests[id] != null) - throw new IllegalStateException("two tests with same id"); - this.id = id; - this.title = dataset + (ce == null ? "" : ("?" + ce)); - this.dataset = dataset; - this.constraint = ce; - this.xfail = xfail; - this.template = template; - this.testinputpath = root + "/" + TESTINPUTDIR + "/" + dataset; - this.baselinepath = root + "/" + BASELINEDIR + "/" + dataset + "." + String.valueOf(this.id); - this.rowcount = rows == 0 ? DEFAULTROWCOUNT : rows; - alltests[id] = this; - } - - String makeurl(RequestMode ext) { - String url = FAKEURLPREFIX + "/" + dataset; - if (ext != null) - url += "." + ext.toString(); - if (constraint != null) { - url += "?" + CONSTRAINTTAG + "="; - String ce = constraint; - // Escape it - // ce = Escape.urlEncodeQuery(ce); - url += ce; - } - return url; - } - - public String toString() { - return makeurl(null); - } - } - - protected String getTestFilesDir() { - return TESTINPUTDIR; - } - - ////////////////////////////////////////////////// - // Instance variables - - // Misc variables - boolean isbigendian = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN; - - // Test cases - - List alltestcases = new ArrayList(); - - List chosentests = new ArrayList(); - - String datasetpath = null; - - String testroot = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - this.testroot = getTestFilesDir(); - this.datasetpath = this.testroot + "/" + DATADIR; - defineAllTestcases(this.testroot); - chooseTestcases(); - } - - ////////////////////////////////////////////////// - // Define test cases - - protected void chooseTestcases() { - if (false) { - chosentests = locate(1); - } else { - for (ConstraintTest tc : alltestcases) - chosentests.add(tc); - } - } - - protected void defineAllTestcases(String root) { - ConstraintTest.root = root; - this.alltestcases.add(new ConstraintTest(1, "test_sequence_1.syn", "/s", new Dump.Commands() { - public void run(Dump printer) throws IOException { - int count = printer.printcount(); - for (int j = 0; j < count; j++) { - printer.printvalue('S', 4); - printer.printvalue('S', 2); - } - printer.newline(); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new ConstraintTest(2, "test_sequence_1.syn", "/s|i1<0", new Dump.Commands() { - public void run(Dump printer) throws IOException { - int count = printer.printcount(); - for (int j = 0; j < count; j++) { - printer.printvalue('S', 4); - printer.printvalue('S', 2); - } - printer.newline(); - printer.verifychecksum(); - } - })); - - } - - ////////////////////////////////////////////////// - // Junit test methods - @Test - public void testFilters() throws Exception { - boolean pass = true; - for (ConstraintTest testcase : chosentests) { - if (!doOneTest(testcase)) - pass = false; - } - Assert.assertTrue("***Fail: TestServletConstraints", pass); - } - - ////////////////////////////////////////////////// - // Primary test method - boolean doOneTest(ConstraintTest testcase) throws Exception { - boolean pass = true; - System.out.println("Testcase: " + testcase.toString()); - Generator.setRowCount(testcase.rowcount); - pass = dodata(testcase); - return pass; - } - - boolean dodata(ConstraintTest testcase) throws Exception { - boolean pass = true; - String baseline; - RequestMode mode = RequestMode.DAP; - String methodurl = testcase.makeurl(mode); - - Mocker mocker = new Mocker("dap4", methodurl, this); - byte[] byteresult = null; - - try { - byteresult = mocker.execute(); - } catch (Throwable t) { - t.printStackTrace(); - return false; - } - - if (prop_debug) { - ByteOrder order = (isbigendian ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN); - DapDump.dumpbytes(ByteBuffer.wrap(byteresult).order(order), true); - } - - // Setup a ChunkInputStream - ByteArrayInputStream bytestream = new ByteArrayInputStream(byteresult); - - ChunkInputStream reader = new ChunkInputStream(bytestream, RequestMode.DAP, ByteOrder.nativeOrder()); - - String sdmr = reader.readDMR(); // Read the DMR - if (prop_visual) - visual(methodurl, sdmr); - - Dump printer = new Dump(); - String sdata = printer.dumpdata(reader, true, reader.getRemoteByteOrder(), testcase.template); - - if (prop_visual) - visual(testcase.title + ".dap", sdata); - - if (prop_baseline) - writefile(testcase.baselinepath + ".dap", sdata); - - if (prop_diff) { - // compare with baseline - // Read the baseline file - System.out.println("Note Comparison:"); - String baselinecontent = readfile(testcase.baselinepath + ".dap"); - pass = same(getTitle(), baselinecontent, sdata); - System.out.println(pass ? "Pass" : "Fail"); - } - - return pass; - } - - ////////////////////////////////////////////////// - // Utility methods - - // Locate the test cases with given prefix - List locate(Object pattern) { - List results = new ArrayList(); - for (ConstraintTest ct : this.alltestcases) { - if (pattern instanceof String) { - if (ct.title.equals(pattern.toString())) - results.add(ct); - } else if (pattern instanceof Integer) { - if (ct.id == (Integer) pattern) - results.add(ct); - } - } - return results; - } - ////////////////////////////////////////////////// - // Stand alone - - static public void main(String[] argv) { - try { - new TestServlet().testServlet(); - } catch (Exception e) { - System.err.println("*** FAIL"); - e.printStackTrace(); - System.exit(1); - } - System.err.println("*** PASS"); - System.exit(0); - }// main - -} - diff --git a/dap4/d4tests/src/test/java/dap4/test/TestFrontPage.java b/dap4/d4tests/src/test/java/dap4/test/TestFrontPage.java deleted file mode 100644 index c0a9f0207f..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestFrontPage.java +++ /dev/null @@ -1,101 +0,0 @@ -package dap4.test; - -import dap4.core.data.DSPRegistry; -import dap4.core.util.DapUtil; -import dap4.dap4lib.FileDSP; -import dap4.servlet.DapCache; -import dap4.servlet.Generator; -import dap4.servlet.SynDSP; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.mock.web.MockHttpServletResponse; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder; -import java.lang.invoke.MethodHandles; - -/** - * TestFrontPage verifies the front page - * generation code - */ - -public class TestFrontPage extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean DEBUG = false; - - ////////////////////////////////////////////////// - // Constants - - static protected final String RESOURCEPATH = "/src/test/data/resources"; // wrt getTestInputFilesDir - static protected final String TESTINPUTDIR = "/testfiles"; - static protected final String BASELINEDIR = "/TestFrontPage/baseline"; - /* - * static protected String DATADIR = "src/test/data"; // relative to dap4 root - * static protected String TESTDATADIR = DATADIR + "/resources/"; - * static protected String BASELINEDIR = "/TestServlet/baseline"; - * static protected String TESTINPUTDIR = DATADIR + "/resources/testfiles"; - */ - - static protected String TESTFILE = "test_frontpage.html"; - - // constants for Fake Request - static protected String FAKEURLPREFIX = "/d4ts"; - - ////////////////////////////////////////////////// - // Instance variables - MockMvc mockMvc = null; - protected String resourceroot = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - StandaloneMockMvcBuilder mvcbuilder = MockMvcBuilders.standaloneSetup(new D4TSController()); - mvcbuilder.setValidator(new TestServlet.NullValidator()); - this.mockMvc = mvcbuilder.build(); - testSetup(); - DapCache.dspregistry.register(FileDSP.class, DSPRegistry.FIRST); - DapCache.dspregistry.register(SynDSP.class, DSPRegistry.FIRST); - if (prop_ascii) - Generator.setASCII(true); - this.resourceroot = getResourceRoot(); - } - - ////////////////////////////////////////////////// - // Junit test methods - - @Test - public void testFrontPage() throws Exception { - String url = FAKEURLPREFIX; // no file specified - - // Figure out the baseline - String baselinepath = canonjoin(this.resourceroot, BASELINEDIR, TESTFILE); - - MvcResult result = perform(url, this.mockMvc, RESOURCEPATH); - - // Collect the output - MockHttpServletResponse res = result.getResponse(); - byte[] byteresult = res.getContentAsByteArray(); - - // Convert the raw output to a string - String html = new String(byteresult, UTF8); - - if (DEBUG || prop_visual) - visual("Front Page", html); - - if (prop_baseline) { - writefile(baselinepath, html); - } else if (prop_diff) { // compare with baseline - // Read the baseline file - String baselinecontent = readfile(baselinepath); - System.out.println("HTML Comparison:"); - Assert.assertTrue("***Fail", same(getTitle(), baselinecontent, html)); - } - } - -} // class TestFrontPage diff --git a/dap4/d4tests/src/test/java/dap4/test/TestH5Iosp.java b/dap4/d4tests/src/test/java/dap4/test/TestH5Iosp.java deleted file mode 100644 index 82f3cf94ac..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestH5Iosp.java +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (c) 1998-2021 John Caron and University Corporation for Atmospheric Research/Unidata - * See LICENSE for license information. - */ - -package dap4.test; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import thredds.test.util.TdsUnitTestCommon; -import ucar.nc2.dataset.NetcdfDataset; -import ucar.unidata.util.test.category.NotJenkins; - -import java.io.*; -import java.lang.invoke.MethodHandles; -import java.math.BigInteger; -import java.nio.ByteOrder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; - -@Category(NotJenkins.class) -public class TestH5Iosp extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static protected final boolean DEBUG = false; - - static protected final boolean NCDUMP = true; - - static protected final Mode mode = Mode.BOTH; - - ////////////////////////////////////////////////// - // Constants - - static protected String DATADIR = "src/test/data"; // relative to dap4 root - static protected String TESTDATADIR = DATADIR + "/resources/"; - static protected String BASELINEDIR = DATADIR + "/resources/TestIosp/baseline"; - static protected String TESTINPUTDIR = DATADIR + "/resources/testfiles"; - - static protected final BigInteger MASK = new BigInteger("FFFFFFFFFFFFFFFF", 16); - - ////////////////////////////////////////////////// - // Type Declarations - - static protected class H5IospTest { - static String root = null; - String title; - String dataset; - String testinputpath; - String baselinepath; - - H5IospTest(String dataset) { - this.title = dataset; - this.dataset = dataset; - this.testinputpath = root + "/" + TESTINPUTDIR + "/" + dataset; - this.baselinepath = root + "/" + BASELINEDIR + "/" + dataset + ".hdf5"; - } - - public String toString() { - return dataset; - } - } - - static protected enum Mode { - DMR, DATA, BOTH; - } - - ////////////////////////////////////////////////// - // Instance variables - - // Misc variables - protected boolean isbigendian = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN; - - // Test cases - - protected List alltestcases = new ArrayList(); - - protected List chosentests = new ArrayList(); - - protected String datasetpath = null; - - protected String testroot = null; - - ////////////////////////////////////////////////// - @Before - public void setup() throws Exception { - this.testroot = getTestFilesDir(); - File f = new File(testroot + "/" + BASELINEDIR); - if (!f.exists()) - f.mkdir(); - this.datasetpath = this.testroot + "/" + DATADIR; - defineAllTestcases(this.testroot); - chooseTestcases(); - } - - protected String getTestFilesDir() { - return TESTINPUTDIR; - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("test_enum.nc"); - // chosentests.add(new H5IospTest("test_test.nc")); - } else { - for (H5IospTest tc : alltestcases) { - chosentests.add(tc); - } - } - } - - void defineAllTestcases(String root) { - H5IospTest.root = root; - this.alltestcases.add(new H5IospTest("test_one_var.nc")); - this.alltestcases.add(new H5IospTest("test_one_vararray.nc")); - this.alltestcases.add(new H5IospTest("test_atomic_types.nc")); - this.alltestcases.add(new H5IospTest("test_atomic_array.nc")); - this.alltestcases.add(new H5IospTest("test_enum.nc")); - this.alltestcases.add(new H5IospTest("test_enum_array.nc")); - this.alltestcases.add(new H5IospTest("test_struct_type.nc")); - this.alltestcases.add(new H5IospTest("test_struct_array.nc")); - this.alltestcases.add(new H5IospTest("test_struct_nested.nc")); - this.alltestcases.add(new H5IospTest("test_vlen1.nc")); - this.alltestcases.add(new H5IospTest("test_vlen2.nc")); - this.alltestcases.add(new H5IospTest("test_vlen3.nc")); - this.alltestcases.add(new H5IospTest("test_vlen4.nc")); - this.alltestcases.add(new H5IospTest("test_vlen5.nc")); - } - - - ////////////////////////////////////////////////// - // Junit test methods - - @Test - public void testH5Iosp() throws Exception { - for (H5IospTest testcase : chosentests) { - if (!doOneTest(testcase)) { - Assert.assertTrue(false); - } - } - } - - ////////////////////////////////////////////////// - // Primary test method - boolean doOneTest(H5IospTest testcase) throws Exception { - boolean pass = true; - - System.out.println("Testcase: " + testcase.testinputpath); - - NetcdfDataset ncfile = TdsUnitTestCommon.openDatasetDap4Tests(testcase.testinputpath); - - String metadata = null; - String data = null; - if (mode == Mode.DMR || mode == Mode.BOTH) { - metadata = (NCDUMP ? ncdumpmetadata(ncfile, testcase.dataset) : null); - if (prop_visual) - visual("Meta Data: ", metadata); - } - if (mode == Mode.DATA || mode == Mode.BOTH) { - data = (NCDUMP ? ncdumpdata(ncfile, testcase.dataset) : null); - if (prop_visual) - visual("Data: ", data); - } - - String baselinefile = String.format("%s", testcase.baselinepath); - if (prop_baseline) { - if (mode == Mode.DMR || mode == Mode.BOTH) - writefile(baselinefile + ".dmr", metadata); - if (mode == Mode.DATA || mode == Mode.BOTH) - writefile(baselinefile + ".dap", data); - } else if (prop_diff) { // compare with baseline - String baselinecontent = null; - if (mode == Mode.DMR || mode == Mode.BOTH) { - // Read the baseline file(s) - System.out.println("DMR Comparison:"); - baselinecontent = readfile(baselinefile + ".dmr"); - pass = pass && same(getTitle(), baselinecontent, metadata); - System.out.println(pass ? "Pass" : "Fail"); - } - if (mode == Mode.DATA || mode == Mode.BOTH) { - System.out.println("DATA Comparison:"); - baselinecontent = readfile(baselinefile + ".dap"); - pass = pass && same(getTitle(), baselinecontent, data); - System.out.println(pass ? "Pass" : "Fail"); - } - } - return pass; - } - - ////////////////////////////////////////////////// - // Utility methods - - boolean report(String msg) { - System.err.println(msg); - prop_generate = false; - return false; - } - - - // Locate the test cases with given prefix - List locate(String prefix) { - List results = new ArrayList(); - for (H5IospTest ct : this.alltestcases) { - if (ct.dataset.startsWith(prefix)) - results.add(ct); - } - return results; - } - ////////////////////////////////////////////////// - // Stand alone - - static public void main(String[] argv) { - try { - new TestH5Iosp().testH5Iosp(); - } catch (Exception e) { - System.err.println("*** FAIL"); - e.printStackTrace(); - System.exit(1); - } - System.err.println("*** PASS"); - System.exit(0); - }// main - - ////////////////////////////////////////////////// - // Dump methods - - String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - String metadata = null; - String dump = ""; - - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Print the meta-databuffer using these args to NcdumpW - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - return shortenFileName(dump, ncfile.getLocation()); - } - - String ncdumpdata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - // Dump the databuffer - String dump = ""; - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - return shortenFileName(dump, ncfile.getLocation()); - } - -} - diff --git a/dap4/d4tests/src/test/java/dap4/test/TestHyrax.java b/dap4/d4tests/src/test/java/dap4/test/TestHyrax.java deleted file mode 100644 index af27184b70..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestHyrax.java +++ /dev/null @@ -1,396 +0,0 @@ -/* - * Copyright (c) 1998-2021 John Caron and University Corporation for Atmospheric Research/Unidata - * See LICENSE for license information. - */ - -package dap4.test; - -import dap4.core.util.DapUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import thredds.test.util.TdsUnitTestCommon; -import ucar.nc2.dataset.NetcdfDataset; -import ucar.unidata.util.test.category.NotJenkins; -import ucar.unidata.util.test.category.NotPullRequest; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; - -/** - * Test OpenDap Server at the NetcdfDataset level - */ -public class TestHyrax extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean DEBUG = false; - - static final boolean NCDUMP = true; // Use NcDumpW instead of NCPrint - - static final String EXTENSION = (NCDUMP ? "ncdump" : "dmp"); - - static final String TESTEXTENSION = "dmr"; - - // Mnemonic - static final boolean HEADERONLY = false; - - static final String IP = "ec2-54-204-231-163"; - ////////////////////////////////////////////////// - // Constants - - static final String DATADIR = "src/test/data"; // relative to dap4 root - static final String TESTDATADIR = DATADIR + "/resources/TestHyrax"; - static final String BASELINEDIR = TESTDATADIR + "/baseline"; - - // Define the names of the xfail tests - static final String[] XFAIL_TESTS = {"test_struct_array.nc"}; - - // Order is important; testing reachability is in the order - // listed - static final String[] SOURCES = - new String[] {"hyrax", "http://" + IP + ".compute-1.amazonaws.com:8080/opendap/data/reader/dap4/dap4.html", - "dap4://" + IP + ".compute-1.amazonaws.com:8080/opendap/data/reader/dap4"}; - - static boolean isXfailTest(String t) { - for (String s : XFAIL_TESTS) { - if (s.equals(t)) - return true; - } - return false; - } - - ////////////////////////////////////////////////// - // Type Declarations - - static class Source { - public String name; - public String testurl; - public String prefix; - - public Source(String name, String testurl, String prefix) { - this.name = name; - this.prefix = prefix; - this.testurl = testurl; - } - } - - static class ClientTest { - static String root = null; - static String server = null; - static int counter = 0; - - boolean checksumming = true; - boolean xfail = false; - boolean headeronly = false; - - String title; - String dataset; // path minus the server url part. - String datasetpath; // Hyrax test databuffer is segregated into multiple directories - String baselinepath; - String constraint; - int id; - - ClientTest(String dataset) { - this(0, dataset, null); - } - - ClientTest(int id, String datasetpath, String constraint) { - // Break off the final file set name - int index = datasetpath.lastIndexOf('/'); - this.dataset = datasetpath.substring(index + 1, datasetpath.length()); - this.datasetpath = datasetpath; - this.title = this.dataset; - this.id = id; - this.constraint = (constraint.length() == 0 ? null : constraint); - this.baselinepath = root + "/" + BASELINEDIR + "/" + dataset; - if (this.constraint != null) - this.baselinepath += ("." + String.valueOf(this.id)); - } - - public ClientTest nochecksum() { - this.checksumming = false; - return this; - } - - public ClientTest xfail() { - this.xfail = true; - return this; - } - - public ClientTest headeronly() { - this.headeronly = true; - return this; - } - - String makeurl() { - String url = url = server + "/" + datasetpath; - if (constraint != null) - url += ("?" + constraint); - return url; - } - - public String toString() { - return dataset; - } - } - - ////////////////////////////////////////////////// - // Instance variables - - // Test cases - - List alltestcases = new ArrayList(); - List chosentests = new ArrayList(); - - String resourceroot = null; - String datasetpath = null; - - String sourceurl = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - this.resourceroot = getResourceRoot(); - this.resourceroot = DapUtil.absolutize(this.resourceroot); // handle problem of windows paths - System.out.println("Using source url " + this.sourceurl); - defineAllTestcases(this.resourceroot, this.sourceurl); - chooseTestcases(); - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("dmr-testsuite/test_array_7.xml"); - } else { - for (ClientTest tc : alltestcases) { - chosentests.add(tc); - } - } - } - - boolean defineAllTestcases(String root, String server) { - - boolean what = HEADERONLY; - - ClientTest.root = root; - ClientTest.server = server; - if (false) { - alltestcases.add(new ClientTest(1, "D4-xml/DMR_4.xml", "b1")); - } - if (false) { - alltestcases.add(new ClientTest("test_simple_1.dmr")); - // deleted: alltestcases.add(new TestCase("dmr-testsuite/testall.xml")); - } - if (false) { - alltestcases.add(new ClientTest("dmr-testsuite/test_array_1.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_2.xml")); - strings: alltestcases.add(new ClientTest("dmr-testsuite/test_array_3.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_4.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_5.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_6.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_7.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_8.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_10.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_11.xml")); - - } - if (false) { - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_1.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_2.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_3.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_4.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_5.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_6.xml")); - // sequence: alltestcases.add(new TestCase("dmr-testsuite/test_simple_7.xml")); - // sequence: alltestcases.add(new TestCase("dmr-testsuite/test_simple_8.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_9.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_9.1.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_10.xml")); - } - if (false) { - // alltestcases.add(new TestCase("D4-xml/DMR_0.1.xml")); needs fixing - alltestcases.add(new ClientTest("D4-xml/DMR_0.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_1.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_2.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_2.1.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.1.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.2.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.3.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.4.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.5.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_4.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_4.1.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_5.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_5.1.xml")); - // serial: alltestcases.add(new TestCase("D4-xml/DMR_6.xml")); - // serial: alltestcases.add(new TestCase("D4-xml/DMR_6.1.xml")); - // serial: alltestcases.add(new TestCase("D4-xml/DMR_6.2.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.1.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.2.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.3.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.4.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.5.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_8.xml")); - } - - if (false) { - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_3_error_1.xml").xfail()); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_3_error_2.xml").xfail()); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_3_error_3.xml").xfail()); - } - for (ClientTest test : alltestcases) { - if (what == HEADERONLY) - test.headeronly(); - } - return true; - } - - ////////////////////////////////////////////////// - // Junit test method - - @Test - @Category({NotJenkins.class, NotPullRequest.class}) - public void testHyrax() throws Exception { - boolean pass = true; - for (ClientTest testcase : chosentests) { - if (!doOneTest(testcase)) - pass = false; - } - Assert.assertTrue("*** Fail: TestHyrax", pass); - } - - ////////////////////////////////////////////////// - // Primary test method - boolean doOneTest(ClientTest testcase) throws Exception { - boolean pass = true; - System.out.println("Testcase: " + testcase.dataset); - String url = testcase.makeurl(); - NetcdfDataset ncfile = null; - try { - ncfile = TdsUnitTestCommon.openDatasetDap4Tests(url); - } catch (Exception e) { - System.err.println(testcase.xfail ? "XFail" : "Fail"); - e.printStackTrace(); - return testcase.xfail; - } - String usethisname = TdsUnitTestCommon.extractDatasetname(url, null); - String metadata = (NCDUMP ? ncdumpmetadata(ncfile, usethisname) : null); - if (prop_visual) { - visual(testcase.title + ".dmr", metadata); - } - - String data = null; - if (!testcase.headeronly) { - data = (NCDUMP ? ncdumpdata(ncfile, usethisname) : null); - if (prop_visual) { - visual(testcase.title + ".dap", data); - } - } - - String testoutput = (testcase.headeronly ? metadata : (NCDUMP ? data : metadata + data)); - - String baselinefile = testcase.baselinepath + "." + EXTENSION; - - if (prop_baseline) - writefile(baselinefile, testoutput); - - if (prop_diff) { // compare with baseline - // Read the baseline file(s) - String baselinecontent = readfile(baselinefile); - System.out.println("Comparison: vs " + baselinefile); - pass = pass && same(getTitle(), baselinecontent, testoutput); - System.out.println(pass ? "Pass" : "Fail"); - } - return pass; - } - - - String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) throws Exception { - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - String dump = ""; - // Print the meta-databuffer using these args to NcdumpW - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } - - return dump; - } - - String ncdumpdata(NetcdfDataset ncfile, String datasetname) throws Exception { - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Dump the databuffer - String dump = ""; - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } - - return dump; - } - - ////////////////////////////////////////////////// - // Utility methods - - - // Locate the test cases with given prefix - List locate(String prefix) { - List results = new ArrayList(); - for (ClientTest ct : this.alltestcases) { - if (!ct.datasetpath.startsWith(prefix)) - continue; - results.add(ct); - } - return results; - } - - static boolean report(String msg) { - System.err.println(msg); - return false; - } - - - ////////////////////////////////////////////////// - // Stand alone - - static public void main(String[] argv) { - try { - new TestHyrax().testHyrax(); - } catch (Exception e) { - System.err.println("*** FAIL"); - e.printStackTrace(); - System.exit(1); - } - System.err.println("*** PASS"); - System.exit(0); - }// main - -} // class TestHyrax - diff --git a/dap4/d4tests/src/test/java/dap4/test/TestNc4Iosp.java b/dap4/d4tests/src/test/java/dap4/test/TestNc4Iosp.java deleted file mode 100644 index 6e7ab506fd..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestNc4Iosp.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 1998-2021 John Caron and University Corporation for Atmospheric Research/Unidata - * See LICENSE for license information. - */ - -package dap4.test; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import thredds.test.util.TdsUnitTestCommon; -import ucar.nc2.dataset.NetcdfDataset; -import ucar.unidata.util.test.category.NotPullRequest; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.lang.invoke.MethodHandles; -import java.math.BigInteger; -import java.nio.ByteOrder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; - -@Category(NotPullRequest.class) -public class TestNc4Iosp extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static protected final boolean DEBUG = false; - - static protected final boolean NCDUMP = true; - - static protected final Mode mode = Mode.BOTH; - - static String previousJnaEncoding = System.getProperty("jna.encoding"); - - ////////////////////////////////////////////////// - // Constants - - static protected final String RESOURCEPATH = "/src/test/data/resources"; // wrt getTestInputFilesDIr - static protected final String TESTINPUTDIR = "/testfiles"; - static protected final String BASELINEDIR = "/TestIosp/baseline"; - - static protected final BigInteger MASK = new BigInteger("FFFFFFFFFFFFFFFF", 16); - - ////////////////////////////////////////////////// - // Type Declarations - - static protected class Nc4IospTest { - static String inputroot = null; - static String baselineroot = null; - - static public void setRoots(String input, String baseline) { - inputroot = input; - baselineroot = baseline; - } - - String title; - String dataset; - String testinputpath; - String baselinepath; - - Nc4IospTest(String dataset) { - this.title = dataset; - this.dataset = dataset; - this.testinputpath = canonjoin(this.inputroot, dataset); - this.baselinepath = canonjoin(this.baselineroot, dataset) + ".nc4"; - } - - public String toString() { - return dataset; - } - } - - static protected enum Mode { - DMR, DATA, BOTH; - } - - ////////////////////////////////////////////////// - // Instance variables - - // Misc variables - protected boolean isbigendian = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN; - - // Test cases - - protected List alltestcases = new ArrayList(); - - protected List chosentests = new ArrayList(); - - protected String datasetpath = null; - - protected String root = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - this.root = getResourceRoot(); - testSetup(); - Nc4IospTest.setRoots(canonjoin(getResourceRoot(), TESTINPUTDIR), canonjoin(getResourceRoot(), BASELINEDIR)); - defineAllTestcases(); - chooseTestcases(); - } - - protected String getTestFilesDir() { - return ""; - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("test_struct_array.nc"); - prop_visual = true; - prop_debug = true; - // chosentests.add(new Nc4IospTest("test_test.nc")); - } else { - prop_baseline = false; - for (Nc4IospTest tc : alltestcases) { - chosentests.add(tc); - } - } - } - - void defineAllTestcases() { - this.alltestcases.add(new Nc4IospTest("test_one_var.nc")); - this.alltestcases.add(new Nc4IospTest("test_one_vararray.nc")); - this.alltestcases.add(new Nc4IospTest("test_atomic_types.nc")); - this.alltestcases.add(new Nc4IospTest("test_atomic_array.nc")); - this.alltestcases.add(new Nc4IospTest("test_enum.nc")); - this.alltestcases.add(new Nc4IospTest("test_enum_array.nc")); - this.alltestcases.add(new Nc4IospTest("test_struct_type.nc")); - this.alltestcases.add(new Nc4IospTest("test_struct_array.nc")); - this.alltestcases.add(new Nc4IospTest("test_struct_nested.nc")); - this.alltestcases.add(new Nc4IospTest("test_vlen1.nc")); - this.alltestcases.add(new Nc4IospTest("test_vlen2.nc")); - this.alltestcases.add(new Nc4IospTest("test_vlen3.nc")); - this.alltestcases.add(new Nc4IospTest("test_vlen4.nc")); - this.alltestcases.add(new Nc4IospTest("test_vlen5.nc")); - } - - - ////////////////////////////////////////////////// - // Junit test methods - - @Test - public void testNc4Iosp() throws Exception { - for (Nc4IospTest testcase : chosentests) { - doOneTest(testcase); - } - } - - ////////////////////////////////////////////////// - // Primary test method - void doOneTest(Nc4IospTest testcase) throws Exception { - System.err.println("Testcase: " + testcase.testinputpath); - - NetcdfDataset ncfile = TdsUnitTestCommon.openDatasetDap4Tests(testcase.testinputpath); - - String metadata = null; - String data = null; - if (mode == Mode.DMR || mode == Mode.BOTH) { - metadata = (NCDUMP ? ncdumpmetadata(ncfile, testcase.dataset) : null); - if (prop_visual) - visual("Meta Data: ", metadata); - } - if (mode == Mode.DATA || mode == Mode.BOTH) { - data = (NCDUMP ? ncdumpdata(ncfile, testcase.dataset) : null); - if (prop_visual) - visual("Data: ", data); - } - - String baselinefile = String.format("%s", testcase.baselinepath); - System.err.println("Testpath: " + testcase.testinputpath); - System.err.println("Baseline: " + baselinefile); - if (prop_baseline) { - if (mode == Mode.DMR || mode == Mode.BOTH) - writefile(baselinefile + ".dmr", metadata); - if (mode == Mode.DATA || mode == Mode.BOTH) - writefile(baselinefile + ".dap", data); - } else if (prop_diff) { // compare with baseline - String baselinecontent = null; - if (mode == Mode.DMR || mode == Mode.BOTH) { - // Read the baseline file(s) - System.err.println("DMR Comparison:"); - try { - baselinecontent = readfile(baselinefile + ".dmr"); - boolean pass = same(getTitle(), baselinecontent, metadata); - Assert.assertTrue("***Fail", pass); - } catch (IOException ioe) { - Assert.assertTrue("baselinefile" + ".dmr: " + ioe.getMessage(), false); - } - } - if (mode == Mode.DATA || mode == Mode.BOTH) { - System.err.println("DATA Comparison:"); - try { - baselinecontent = readfile(baselinefile + ".dap"); - Assert.assertTrue("***Data Fail", same(getTitle(), baselinecontent, data)); - - } catch (IOException ioe) { - Assert.assertTrue("baselinefile" + ".dap: " + ioe.getMessage(), false); - } - } - } - } - - ////////////////////////////////////////////////// - // Utility methods - - boolean report(String msg) { - System.err.println(msg); - prop_generate = false; - return false; - } - - - // Locate the test cases with given prefix - List locate(String prefix) { - List results = new ArrayList(); - for (Nc4IospTest ct : this.alltestcases) { - if (ct.dataset.startsWith(prefix)) - results.add(ct); - } - return results; - } - - ////////////////////////////////////////////////// - // Dump methods - - String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - String metadata = null; - String dump = ""; - - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Print the meta-databuffer using these args to NcdumpW - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - // return shortenFileName(sw.toString(), ncfile.getLocation()); - return dump; - } - - String ncdumpdata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - String dump = ""; - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Dump the databuffer - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - // return shortenFileName(sw.toString(), ncfile.getLocation()); - return dump; - } -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestParserCE.java b/dap4/d4tests/src/test/java/dap4/test/TestParserCE.java deleted file mode 100644 index 3acb391e0e..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestParserCE.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.test; - - -import dap4.core.ce.CECompiler; -import dap4.core.ce.CEConstraint; -import dap4.core.ce.parser.CEParserImpl; -import dap4.core.dmr.DMRFactory; -import dap4.core.dmr.DapDataset; -import dap4.core.dmr.parser.DOM4Parser; -import dap4.core.dmr.parser.Dap4Parser; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.io.IOException; -import java.lang.invoke.MethodHandles; -import java.util.ArrayList; -import java.util.List; - -public class TestParserCE extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - ////////////////////////////////////////////////// - // Constants - static final boolean DUMPDMR = false; - static final boolean DMRPARSEDEBUG = false; - static final boolean CEPARSEDEBUG = false; - - static final String TESTCASEDIR = "src/test/data/resources/TestParsers"; // relative to dap4 root - - static final boolean USEDOM = false; - - ////////////////////////////////////////////////// - // Type decls - static class TestSet { - public String dmr; - public String constraint; - public String expected = null; - public String[] debug = null; - public int id = 0; - - public TestSet(int id, String cedmr, String ces, String expected) throws IOException { - this.id = id; - this.dmr = cedmr; - this.constraint = ces; - this.expected = expected; - } - - public TestSet setdebug(String[] debug) { - this.debug = debug; - return this; - } - - public TestSet setdebug(String debug) { - return setdebug(new String[] {debug}); - } - - public String toString() { - return constraint; - } - - } - - ////////////////////////////////////////////////// - // Instance methods - - // All test cases - List alltestsets = new ArrayList<>(); - List chosentests = new ArrayList<>(); - - DapDataset dmr = null; - - ////////////////////////////////////////////////// - @Before - public void setup() { - try { - defineAllTestCases(); - chooseTestcases(); - } catch (IOException ioe) { - ioe.printStackTrace(); - } - } - - ////////////////////////////////////////////////// - // Misc. methods - - protected void chooseTestcases() { - if (false) { - chosentests = locate(7); - assert chosentests.size() > 0 : "Not tests chosen"; - } else { - for (TestSet tc : alltestsets) { - chosentests.add(tc); - } - } - } - - // Locate the test cases - List locate(Object ce) { - List results = new ArrayList<>(); - for (TestSet ct : this.alltestsets) { - if (ce instanceof String) { - if (ct.constraint.equals(ce)) - results.add(ct); - } else if (ce instanceof Integer) { - if (ct.id == ((Integer) ce)) - results.add(ct); - } - } - return results; - } - - protected void defineAllTestCases() throws IOException { - alltestsets.add(new TestSet(1, CE1_DMR, "/a[1]", "/a[1]")); - alltestsets.add(new TestSet(2, CE1_DMR, "/b[10:16]", "/b[10:16]")); - alltestsets.add(new TestSet(3, CE1_DMR, "/c[8:2:15]", "/c[8:2:15]")); - alltestsets.add(new TestSet(4, CE1_DMR, "/a[1];/b[10:16];/c[8:2:15]", "/a[1];/b[10:16];/c[8:2:15]")); - alltestsets - .add(new TestSet(5, CE1_DMR, "/d[1][0:2:2];/a[1];/e[1][0];/f[0][1]", "/d[1][0:2:2];/a[1];/e[1][0];/f[0][1]")); - alltestsets.add(new TestSet(6, CE1_DMR, "/s[0:3][0:2].x;/s[0:3][0:2].y", "/s[0:3][0:2]")); - alltestsets.add(new TestSet(7, CE1_DMR, "/seq|i1<0", "/seq|i1<0")); - alltestsets.add(new TestSet(8, CE1_DMR, "/seq|00,i1<10")); - alltestsets.add(new TestSet(9, CE2_DMR, "vo[1:1][0,0]", "/vo[1][0,0]")); - } - - ////////////////////////////////////////////////// - // Junit test method - - @Test - public void testParserCE() throws Exception { - for (TestSet testset : chosentests) { - if (!doOneTest(testset)) { - Assert.assertTrue(false); - System.exit(1); - } - } - } - - boolean doOneTest(TestSet testset) throws Exception { - boolean pass = true; - - System.out.println("Test Set: " + testset.constraint); - - if (DUMPDMR) { - visual("DMR:", testset.dmr); - } - - // Create the DMR tree - System.out.println("Parsing DMR"); - Dap4Parser parser; - if (!USEDOM) - parser = new DOM4Parser(new DMRFactory()); - if (DMRPARSEDEBUG) - parser.setDebugLevel(1); - boolean parseok = parser.parse(testset.dmr); - if (parseok) - dmr = parser.getDMR(); - if (dmr == null) - parseok = false; - if (!parseok) - throw new Exception("DMR Parse failed"); - System.out.flush(); - System.err.flush(); - - // Iterate over the constraints - String results = ""; - CEConstraint ceroot = null; - System.out.println("constraint: " + testset.constraint); - System.out.flush(); - CEParserImpl ceparser = null; - try { - ceparser = new CEParserImpl(dmr); - if (CEPARSEDEBUG) - ceparser.setDebugLevel(1); - parseok = ceparser.parse(testset.constraint); - CECompiler compiler = new CECompiler(); - ceroot = compiler.compile(dmr, ceparser.getCEAST()); - } catch (Exception e) { - e.printStackTrace(); - parseok = false; - } - if (ceroot == null) - parseok = false; - if (!parseok) - throw new Exception("CE Parse failed"); - - // Dump the parsed CE for comparison purposes - String cedump = ceroot.toConstraintString(); - if (prop_visual) - visual("|" + testset.constraint + "|", cedump); - results += (cedump + "\n"); - if (prop_diff) { // compare with baseline - // Read the baseline file - String baselinecontent = testset.expected; - pass = same(getTitle(), baselinecontent, results); - } - return pass; - } - - - //////////////////////////////////// - // Data for the tests - - String CE1_DMR = "" + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + ""; - - - String CE2_DMR = "" + " " - + " " + " " + " " + " " + ""; -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestParserDMR.java b/dap4/d4tests/src/test/java/dap4/test/TestParserDMR.java deleted file mode 100644 index 39b0779c6e..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestParserDMR.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.test; - -import dap4.core.dmr.DMRFactory; -import dap4.core.dmr.DapDataset; -import dap4.core.dmr.ErrorResponse; -import dap4.core.dmr.parser.DOM4Parser; -import dap4.core.dmr.parser.Dap4Parser; -import dap4.core.dmr.parser.ParseUtil; -import dap4.dap4lib.DMRPrinter; -import org.junit.Assert; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.io.File; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.util.ArrayList; -import java.util.List; - - -public class TestParserDMR extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean PARSEDEBUG = false; - - // Do a special test to compare the dmr parser print output - // to the original input. This will often fail in non-essential - // ways, so it must be verified by hand. - static final boolean BACKCOMPARE = false; - - ////////////////////////////////////////////////// - // Constants - // Define the input set(s) - static protected final String DIR1 = "/TestParsers/dmrset"; // relative to dap4 root - static protected final String DIR2 = "/TestServlet/baseline"; // relative to dap4 root - static protected final String BASELINE = "/TestParsers/baseline"; // relative to dap4 root - - ////////////////////////////////////////////////// - - static protected class TestCase { - static public String resourceroot = null; - - String name; - String dir; - String ext; - String input; - String baseline; - - public TestCase(String dir, String name, String ext) { - this.name = name; - this.dir = dir; - this.ext = ext; - this.input = resourceroot + dir + "/" + name + "." + ext; - this.baseline = resourceroot + BASELINE + "/" + name + "." + "dmp"; - } - } - ////////////////////////////////////////////////// - // Instance methods - - // Test cases - protected List alltestcases = new ArrayList(); - protected List chosentests = new ArrayList(); - protected int flags = ParseUtil.FLAG_NONE; - protected boolean debug = false; - - ////////////////////////////////////////////////// - - public TestParserDMR() { - super(); - setControls(); - defineTestCases(); - chooseTestcases(); - } - - ////////////////////////////////////////////////// - // Misc. methods - - protected void chooseTestcases() { - if (false) { - chosentests = locate("test_struct_nested.hdf5"); - prop_visual = true; - assert chosentests.size() > 0 : "No tests chosen"; - } else { - for (TestCase tc : alltestcases) { - chosentests.add(tc); - } - } - } - - // Locate the test cases with given prefix - List locate(String prefix) { - List results = new ArrayList(); - for (TestCase ct : this.alltestcases) { - if (ct.name.startsWith(prefix)) - results.add(ct); - } - return results; - } - - protected void defineTestCases() { - String root = getResourceRoot(); - TestCase.resourceroot = root; - loadDir(DIR1, "dmr"); - loadDir(DIR2, "dmr"); - } - - void loadDir(String dirsuffix, String... extensions) { - File dir = new File(TestCase.resourceroot + dirsuffix); - File[] filelist = dir.listFiles(); - for (int i = 0; i < filelist.length; i++) { - File file = filelist[i]; - String name = file.getName(); - // check the extension - String match = null; - for (String ext : extensions) { - if (name.endsWith(ext)) { - match = ext; - break; - } - } - if (match != null) { - String basename = name.substring(0, name.length() - (match.length() + 1)); - TestCase ct = new TestCase(dirsuffix, basename, match); - addtestcase(ct); - } - } - } - - protected void addtestcase(TestCase ct) { - if (DEBUG) { - System.err.printf("Adding Test: input=%s%n", ct.input); - if (!new File(ct.input).exists()) - System.err.printf(" +++%s does not exist%n", ct.input); - System.err.printf(" baseline=%s%n", ct.baseline); - if (!new File(ct.baseline).exists()) - System.err.printf(" ***%s does not exist%n", ct.baseline); - System.err.flush(); - } - this.alltestcases.add(ct); - } - - void setControls() { - if (prop_controls == null) - return; - flags = ParseUtil.FLAG_NOCR; // always - for (int i = 0; i < prop_controls.length(); i++) { - char c = prop_controls.charAt(i); - switch (c) { - case 'w': - flags |= ParseUtil.FLAG_TRIMTEXT; - break; - case 'l': - flags |= ParseUtil.FLAG_ELIDETEXT; - break; - case 'e': - flags |= ParseUtil.FLAG_ESCAPE; - break; - case 'T': - flags |= ParseUtil.FLAG_TRACE; - break; - case 'd': - debug = true; - break; - default: - System.err.println("unknown X option: " + c); - break; - } - } - } - - ////////////////////////////////////////////////// - // Junit test method - - @Test - public void testParser() throws Exception { - int ntests = 0; - for (TestCase testcase : chosentests) { - ntests++; - doOneTest(testcase); - } - Assert.assertTrue("***Pass ", true); - } - - void doOneTest(TestCase testcase) throws Exception { - String document; - int i, c; - - String testinput = testcase.input; - String baseline = testcase.baseline; - - System.err.println("Testcase: " + testinput); - System.err.println("Baseline: " + baseline); - System.err.flush(); - - document = readfile(testinput); - - Dap4Parser parser = new DOM4Parser(new DMRFactory()); - if (PARSEDEBUG || debug) - parser.setDebugLevel(1); - - if (!parser.parse(document)) - throw new Exception("DMR Parse failed: " + testinput); - DapDataset dmr = parser.getDMR(); - ErrorResponse err = parser.getErrorResponse(); - if (err != null) - System.err.println("Error response:\n" + err.buildXML()); - if (dmr == null) { - System.err.println("No dataset created"); - return; - } - - // Dump the parsed DMR for comparison purposes - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - DMRPrinter dapprinter = new DMRPrinter(dmr, pw); - dapprinter.testprint(); - pw.close(); - sw.close(); - String testresult = sw.toString(); - - // Read the baseline file - String baselinecontent; - if (BACKCOMPARE) - baselinecontent = document; - else - baselinecontent = readfile(baseline); - if (prop_visual) { - visual("Baseline", baselinecontent); - visual("Output", testresult); - } - - if (prop_baseline) { - writefile(baseline, testresult); - } else if (prop_diff) { // compare with baseline - Assert.assertTrue("Files are different", same(getTitle(), baselinecontent, testresult)); - } - } -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestPrinter.java b/dap4/d4tests/src/test/java/dap4/test/TestPrinter.java deleted file mode 100644 index d22ff1ac97..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestPrinter.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.test; - -import dap4.cdm.nc2.DapNetcdfFile; -import dap4.core.dmr.DapDataset; -import dap4.core.util.*; -import dap4.core.data.DSP; -import dap4.dap4lib.DMRPrinter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ucar.nc2.*; -import java.io.IOException; -import java.io.PrintWriter; -import java.lang.invoke.MethodHandles; -import java.util.Map; - -/** - * Dump DMR and/or data part of a DSP - */ - -public class TestPrinter { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - ////////////////////////////////////////////////// - // Constants - - // Could use enumset, but it is so ugly, - // so use good old OR'able flags - static final int NILFLAGS = 0; - static final int PERLINE = 1; // print xml attributes 1 per line - static final int NONAME = 2; // do not print name xml attribute - static final int NONNIL = 4; // print empty xml attributes - - ////////////////////////////////////////////////// - // Instance Variables - - protected NetcdfFile ncfile = null; // dsp can be extracted from this - protected DSP dsp = null; - protected DapDataset dmr = null; - protected PrintWriter writer = null; - protected Map varmap = null; - protected IndentWriter printer = null; - - ////////////////////////////////////////////////// - // Constructor(s) - - public TestPrinter(NetcdfFile ncfile, PrintWriter writer) { - try { - setDataset(ncfile); - } catch (DapException de) { - System.err.println("Bad NetcdfFile"); - System.exit(1); - } - setWriter(writer); - setVarMap(null); - } - - public TestPrinter(DSP dsp, PrintWriter writer) { - try { - setDSP(dsp); - } catch (DapException de) { - System.err.println("Bad DSP"); - System.exit(1); - } - setWriter(writer); - setVarMap(null); - } - - ////////////////////////////////////////////////// - // Accessors - - public void setWriter(PrintWriter writer) { - this.writer = writer; - this.printer = new IndentWriter(writer); - } - - public void setDataset(NetcdfFile ncfile) throws DapException { - this.ncfile = ncfile; - setDSP(((DapNetcdfFile) this.ncfile).getDSP()); - } - - public void setDSP(DSP dsp) throws DapException { - this.dsp = dsp; - this.dmr = dsp.getDMR(); - } - - public void setVarMap(Map map) { - this.varmap = map; - } - - ////////////////////////////////////////////////// - // Print methods - - public void flush() throws IOException { - printer.flush(); - writer.flush(); - } - - /** - * Print the CDM metadata for a NetcdfFile object in DMR format - * - * @throws IOException - */ - - public void print() throws IOException { - printer.setIndent(0); - DMRPrinter dmrprinter = new DMRPrinter(this.dmr, writer); - dmrprinter.print(); - dmrprinter.flush(); - } - -} // class TestPrinter diff --git a/dap4/d4tests/src/test/java/dap4/test/TestSerial.java b/dap4/d4tests/src/test/java/dap4/test/TestSerial.java deleted file mode 100644 index f3fab97bfd..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestSerial.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (c) 1998-2021 John Caron and University Corporation for Atmospheric Research/Unidata - * See LICENSE for license information. - */ - -package dap4.test; - -import dap4.core.util.DapUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import thredds.test.util.TdsTestDir; -import thredds.test.util.TdsUnitTestCommon; -import ucar.nc2.dataset.NetcdfDataset; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; - -/** - * Test at the NetcdfDataset level; access .ser files on server. - */ -public class TestSerial extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static protected final boolean DEBUG = false; - - static protected final String TESTINPUTDIR = "/testfiles"; - - static protected final boolean NCDUMP = true; // Use NcDumpW instead of D4Print - - static protected final String EXTENSION = (NCDUMP ? "ncdump" : "dmp"); - - static protected final String DAP4TAG = "#dap4"; - - static protected final String[] EMPTY = new String[] {""}; - - ////////////////////////////////////////////////// - // Constants - - static protected final String DATADIR = "src/test/data"; // relative to dap4 root - static protected final String TESTDATADIR = DATADIR + "/resources/TestCDMClient"; - static protected final String BASELINEDIR = TESTDATADIR + "/baseline"; - - static protected final String alpha = "abcdefghijklmnopqrstuvwxyz" + "abcdefghijklmnopqrstuvwxyz".toUpperCase(); - - ////////////////////////////////////////////////// - // Type Declarations - - static protected class ClientTest { - static protected String root = null; - static protected String server = null; - - String title; - String dataset; - String baselinepath; - String[] constraints; - - ClientTest(String dataset) { - this(dataset, EMPTY); - } - - ClientTest(String dataset, String[] constraints) { - this.title = dataset; - this.dataset = dataset; - this.baselinepath = root + "/" + BASELINEDIR + "/" + dataset; - assert constraints != null && constraints.length > 0; - this.constraints = constraints; - } - - String makeurl(String ce) { - StringBuilder url = new StringBuilder(); - url.append("http://"); - url.append(this.server); - url.append("/d4ts"); - url.append("/"); - url.append(TESTINPUTDIR); - url.append("/"); - url.append(this.dataset); - url.append("."); - url.append("nc"); - url.append(DAP4TAG); - if (ce != null && ce.length() > 0) { - url.append("?"); - url.append(DapTestCommon.CONSTRAINTTAG); - url.append("="); - url.append(ce); - } - return url.toString(); - } - - public String toString() { - StringBuilder buf = new StringBuilder(); - buf.append(dataset); - buf.append("{"); - if (constraints != null) - for (int i = 0; i < constraints.length; i++) { - if (i > 0) - buf.append(","); - String ce = constraints[i]; - buf.append(ce == null ? "all" : ce); - } - buf.append("}"); - return buf.toString(); - } - } - - ////////////////////////////////////////////////// - // Instance variables - - // Test cases - - protected List alltestcases = new ArrayList(); - protected List chosentests = new ArrayList(); - - protected String resourceroot = null; - protected String datasetpath = null; - - protected String sourceurl = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - this.resourceroot = getResourceRoot(); - this.resourceroot = DapUtil.absolutize(this.resourceroot); - this.datasetpath = this.resourceroot + "/" + BASELINEDIR; - // findServer(this.datasetpath); - // this.sourceurl = this.d4tsserver; - this.sourceurl = TdsTestDir.dap4TestServer; - System.out.println("Using source url " + this.sourceurl); - defineAllTestcases(this.resourceroot, this.sourceurl); - chooseTestcases(); - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("test_atomic_array"); - } else { - for (ClientTest tc : alltestcases) { - chosentests.add(tc); - } - } - } - - void defineAllTestcases(String root, String server) { - ClientTest.root = root; - ClientTest.server = server; - alltestcases.add(new ClientTest("test_one_var")); - alltestcases.add(new ClientTest("test_atomic_types")); - alltestcases.add(new ClientTest("test_atomic_array")); - - } - - ////////////////////////////////////////////////// - // Junit test method - - @Test - public void testSerial() throws Exception { - for (ClientTest testcase : chosentests) { - if (!doOneTest(testcase)) { - Assert.assertTrue(false); - } - } - } - - ////////////////////////////////////////////////// - // Primary test method - boolean doOneTest(ClientTest testcase) throws Exception { - boolean pass = true; - int testcounter = 0; - - System.out.println("Testcase: " + testcase.dataset); - - String[] constraints = testcase.constraints; - for (int i = 0; i < constraints.length; i++) { - String url = testcase.makeurl(constraints[i]); - NetcdfDataset ncfile = null; - try { - ncfile = TdsUnitTestCommon.openDatasetDap4Tests(url); - } catch (Exception e) { - throw e; - } - - String usethisname = TdsUnitTestCommon.extractDatasetname(url, null); - String metadata = (NCDUMP ? ncdumpmetadata(ncfile, usethisname) : null); - String data = (NCDUMP ? ncdumpdata(ncfile, usethisname) : null); - - if (prop_visual) { - visual("DMR: " + url, metadata); - visual("DAP: " + url, data); - } - - String testoutput = (NCDUMP ? data : metadata + data); - - String baselinefile = String.format("%s.nc.%s", testcase.baselinepath, EXTENSION); - if (prop_baseline) - writefile(baselinefile, testoutput); - - if (prop_diff) { // compare with baseline - // Read the baseline file(s) - String baselinecontent = readfile(baselinefile); - System.out.println("Comparison:"); - pass = pass && same(getTitle(), baselinecontent, testoutput); - System.out.println(pass ? "Pass" : "Fail"); - } - } - return pass; - } - - ////////////////////////////////////////////////// - // Dump methods - - String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - String metadata = null; - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Print the meta-databuffer using these args to NcdumpW - ok = false; - String dump = ""; - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - return dump; - } - - String ncdumpdata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Dump the databuffer - String dump = ""; - ok = false; - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - return dump; - } - - ////////////////////////////////////////////////// - // Utility methods - - - // Locate the test cases with given prefix - ClientTest locate1(String prefix) { - List tests = locate(prefix); - assert tests.size() > 0; - return tests.get(0); - } - - // Locate the test cases with given prefix and optional constraint - List locate(String prefix) { - List results = new ArrayList(); - for (ClientTest ct : this.alltestcases) { - if (!ct.dataset.startsWith(prefix)) - continue; - results.add(ct); - } - return results; - } - - static protected boolean report(String msg) { - System.err.println(msg); - return false; - } - //////////////////////////////////////// - // Stand alone - - static public void main(String[] argv) { - try { - new TestConstraints().testConstraints(); - } catch (Exception e) { - System.err.println("*** FAIL"); - e.printStackTrace(); - System.exit(1); - } - System.err.println("*** PASS"); - System.exit(0); - }// main - -} // class TestConstraints diff --git a/dap4/d4tests/src/test/java/dap4/test/TestServlet.java b/dap4/d4tests/src/test/java/dap4/test/TestServlet.java deleted file mode 100644 index c9ba6bb1f0..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestServlet.java +++ /dev/null @@ -1,860 +0,0 @@ -/* - * Copyright 2016, University Corporation for Atmospheric Research - * See the LICENSE.txt file for more information. - */ - -package dap4.test; - -import dap4.core.dmr.parser.DOM4Parser; -import dap4.core.util.DapDump; -import dap4.dap4lib.ChunkInputStream; -import dap4.dap4lib.RequestMode; -import dap4.servlet.DapCache; -import dap4.servlet.Generator; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.springframework.mock.web.MockHttpServletResponse; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder; -import org.springframework.validation.Errors; -import org.springframework.validation.Validator; -import thredds.server.dap4.Dap4Controller; -import ucar.nc2.jni.netcdf.Nc4Iosp; -import ucar.nc2.jni.netcdf.Nc4wrapper; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.math.BigInteger; -import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.List; -import ucar.unidata.util.test.category.NotPullRequest; - -/** - * TestServlet has multiple purposes. - * 1. It tests the d4tsservlet. - * 2. It (optionally) stores the serialized raw databuffer - * for datasets into files., These files are then used to - * test client side deserialization (see TestCDMClient). - */ - -/* - * Normally, we would like to use Spring applicationContext - * and autowiring for this class. - * This can work under, say, Jenkins or GitHub Actions, but - * it fails under Intellij at the moment because of Mocking. - * I have managed to get it to work partly, but currently it - * crashes trying to initialize the ChronicleMap cache. - * It should be noted that AFAIK none of the Mocking tests will - * work under Intellij; TestServlet is just one example. - * - * I have included the necessary changes marked with the tag - * USESPRING to remind me of what needs to be done someday. - */ - -/* - * USESPRING - * - * @RunWith(SpringJUnit4ClassRunner.class) - * - * @WebAppConfiguration - * - * @ContextConfiguration( - * locations = {"/WEB-INF/applicationContext.xml", "/WEB-INF/spring-servlet.xml"}, - * loader = MockTdsContextLoader.class) - */ - -// non-deterministic failure on GitHub Actions - no need to hold up PRs for now (and will still barf on Jenkins) -@Category(NotPullRequest.class) -public class TestServlet extends DapTestCommon { - static final boolean USESPRING = false; - - static public boolean DEBUG = false; - static public boolean DEBUGDATA = false; - static public boolean PARSEDEBUG = false; - - static public boolean USEBIG = false; - static public boolean NOCSUM = false; - - ////////////////////////////////////////////////// - // Constants - - static protected final String RESOURCEPATH = "/src/test/data/resources"; // wrt getTestInputFilesDir - static protected final String TESTINPUTDIR = "/testfiles"; - static protected final String BASELINEDIR = "/TestServlet/baseline"; - static protected final String GENERATEDIR = "/TestCDMClient/testinput"; - - // constants for Fake Request - static protected final String FAKEURLPREFIX = "/dap4"; - - static protected final BigInteger MASK = new BigInteger("FFFFFFFFFFFFFFFF", 16); - - // Define the file extensions of interest for generation - static protected final String[] GENEXTENSIONS = new String[] {".raw.dap", ".raw.dmr"}; - - ////////////////////////////////////////////////// - // Type Declarations - - static protected class TestCase { - static String inputroot = null; - static String baselineroot = null; - static String generateroot = null; - - static public void setRoots(String input, String baseline, String generate) { - inputroot = input; - baselineroot = baseline; - generateroot = generate; - } - - protected String title; - protected String dataset; - protected String[] extensions; - protected boolean checksumming; - protected Dump.Commands template; - protected String testinputpath; - protected String baselinepath; - protected String generatepath; - - public TestCase(String dataset, String extensions, boolean checksumming) { - this(dataset, extensions, checksumming, null); - } - - public TestCase(String dataset, String extensions, boolean checksumming, Dump.Commands template) { - this.title = dataset; - this.dataset = dataset; - this.extensions = extensions.split(","); - this.template = template; - this.checksumming = checksumming; - this.testinputpath = canonjoin(this.inputroot, dataset); - this.baselinepath = canonjoin(this.baselineroot, dataset); - this.generatepath = canonjoin(this.generateroot, dataset); - } - - String makeurl(RequestMode ext) { - String u = canonjoin(FAKEURLPREFIX, canonjoin(TESTINPUTDIR, dataset)) + "." + ext.toString(); - return u; - } - - public String toString() { - return dataset; - } - } - - ////////////////////////////////////////////////// - // Instance variables - - protected MockMvc mockMvc; - - // Test cases - - protected List alltestcases = new ArrayList(); - - protected List chosentests = new ArrayList(); - - /* - * USESPRING - * - * @Autowired - * private WebApplicationContext wac; - */ - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - super.bindstd(); - Nc4wrapper.TRACE = false; - // if(DEBUGDATA) DapController.DUMPDATA = true; - /* - * USESPRING - * this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - * else - */ - { - StandaloneMockMvcBuilder mvcbuilder = MockMvcBuilders.standaloneSetup(new Dap4Controller()); - mvcbuilder.setValidator(new TestServlet.NullValidator()); - this.mockMvc = mvcbuilder.build(); - } - testSetup(); - if (prop_ascii) - Generator.setASCII(true); - TestCase.setRoots(canonjoin(getResourceRoot(), TESTINPUTDIR), canonjoin(getResourceRoot(), BASELINEDIR), - canonjoin(getResourceRoot(), GENERATEDIR)); - defineAllTestcases(); - chooseTestcases(); - } - - @After - public void cleanup() throws Exception { - super.unbindstd(); - Nc4wrapper.TRACE = false; - } - - ////////////////////////////////////////////////// - // Define test cases - - protected void chooseTestcases() { - if (false) { - chosentests = locate("test_struct_type.nc"); - prop_visual = true; - prop_generate = false; - prop_baseline = false; - } else { - prop_baseline = false; - prop_generate = false; - for (TestCase tc : alltestcases) { - chosentests.add(tc); - } - } - } - - - ////////////////////////////////////////////////// - // Junit test methods - - @Test - public void testServlet() throws Exception { - Nc4Iosp.setLogLevel(5); - try { - DapCache.flush(); - for (TestCase testcase : chosentests) { - doOneTest(testcase); - } - } finally { - Nc4Iosp.setLogLevel(0); - } - } - - ////////////////////////////////////////////////// - // Primary test method - - void doOneTest(TestCase testcase) throws Exception { - System.err.println("Testcase: " + testcase.testinputpath); - System.err.println("Baseline: " + testcase.baselinepath); - if (PARSEDEBUG) - DOM4Parser.setGlobalDebugLevel(1); - for (String extension : testcase.extensions) { - RequestMode ext = RequestMode.modeFor(extension); - switch (ext) { - case DMR: - dodmr(testcase); - break; - case DAP: - dodata(testcase); - break; - default: - Assert.assertTrue("Unknown extension", false); - } - } - } - - void dodmr(TestCase testcase) throws Exception { - String url = testcase.makeurl(RequestMode.DMR); - String little = (USEBIG ? "0" : "1"); - String nocsum = (NOCSUM ? "1" : "0"); - MvcResult result = perform(url, this.mockMvc, RESOURCEPATH, DapTestCommon.ORDERTAG, little, DapTestCommon.NOCSUMTAG, - nocsum, DapTestCommon.TESTTAG, "true"); - - // Collect the output - MockHttpServletResponse res = result.getResponse(); - byte[] byteresult = res.getContentAsByteArray(); - - // Test by converting the raw output to a string - String sdmr = new String(byteresult, UTF8); - - if (prop_visual) - visual(testcase.title + ".dmr", sdmr); - if (prop_baseline) { - writefile(testcase.baselinepath + ".dmr", sdmr); - } else if (prop_diff) { // compare with baseline - // Read the baseline file - String baselinecontent = readfile(testcase.baselinepath + ".dmr"); - System.err.println("DMR Comparison"); - Assert.assertTrue("***Fail", same(getTitle(), baselinecontent, sdmr)); - } - } - - void dodata(TestCase testcase) throws Exception { - String url = testcase.makeurl(RequestMode.DAP); - String little = (USEBIG ? "0" : "1"); - String nocsum = (NOCSUM ? "1" : "0"); - MvcResult result = perform(url, this.mockMvc, RESOURCEPATH, DapTestCommon.ORDERTAG, little, DapTestCommon.NOCSUMTAG, - nocsum, DapTestCommon.TESTTAG, "true"); - // Collect the output - MockHttpServletResponse res = result.getResponse(); - byte[] byteresult = res.getContentAsByteArray(); - - if (DEBUGDATA) { - DapDump.dumpbytestream(byteresult, ByteOrder.nativeOrder(), "TestServlet.dodata"); - } - - if (prop_generate) { - // Dump the serialization into a file; this also includes the dmr - String target = testcase.generatepath + ".raw"; - writefile(target, byteresult); - } - - // Setup a ChunkInputStream - ByteArrayInputStream bytestream = new ByteArrayInputStream(byteresult); - - ChunkInputStream reader = new ChunkInputStream(bytestream, RequestMode.DAP, ByteOrder.nativeOrder()); - - String sdmr = reader.readDMR(); // Read the DMR - if (prop_visual) - visual(testcase.title + ".dmr.dap", sdmr); - - Dump printer = new Dump(); - String sdata = printer.dumpdata(reader, testcase.checksumming, reader.getRemoteByteOrder(), testcase.template); - - if (prop_visual) - visual(testcase.title + ".dap", sdata); - - if (prop_baseline) - writefile(testcase.baselinepath + ".dap", sdata); - - if (prop_diff) { - // compare with baseline - // Read the baseline file - System.err.println("Data Comparison:"); - String baselinecontent = readfile(testcase.baselinepath + ".dap"); - Assert.assertTrue("***Fail", same(getTitle(), baselinecontent, sdata)); - } - } - - ////////////////////////////////////////////////// - - protected void defineAllTestcases() { - this.alltestcases.add(new TestCase("test_fill.nc", "dmr,dap", true, // 0 - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('U', 1); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('S', 2); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('U', 4); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_one_var.nc", "dmr,dap", true, // 0 - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 4); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_opaque.nc", "dmr,dap", true, // 0 - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('O', 0); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_opaque_array.nc", "dmr,dap", true, // 0 - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 4; i++) { - printer.printvalue('O', 0, i); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_one_vararray.nc", "dmr,dap", true, // 1 - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 4); - printer.printvalue('S', 4); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_enum.nc", "dmr,dap", true, // - // S1 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 1); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_enum_2.nc", "dmr,dap", true, // - // S1 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 1); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_enum_array.nc", "dmr,dap", true, // 3 - // 5 S1 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 5; i++) { - printer.printvalue('U', 1, i); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_atomic_types.nc", "dmr,dap", true, // 4 - // S1 U1 S2 U2 S4 U4 S8 U8 F4 F8 C1 T O S1 S1 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 1); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('U', 1); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('S', 2); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('U', 2); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('S', 4); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('U', 4); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('S', 8); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('U', 8); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('F', 4); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('F', 8); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('C', 1); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('T', 0); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('O', 0); - printer.verifychecksum(); - printer.startchecksum(); - printer.startchecksum(); - printer.printvalue('S', 1); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('S', 1); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_atomic_array.nc", "dmr,dap", true, // 5 - // 6 U1 4 S2 6 U4 2 F8 2 C1 4 T 2 O 5 S1 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 6; i++) { - printer.printvalue('U', 1, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 4; i++) { - printer.printvalue('S', 2, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 6; i++) { - printer.printvalue('U', 4, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - printer.printvalue('F', 8, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - printer.printvalue('C', 1, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 4; i++) { - printer.printvalue('T', 0, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - printer.printvalue('O', 0, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 5; i++) { - printer.printvalue('S', 1, i); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_groups1.nc", "dmr,dap", true, // 6 - // 5 S4 3 F4 5 S4 7 F4", - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 5; i++) { - printer.printvalue('S', 4, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 3; i++) { - printer.printvalue('F', 4, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 5; i++) { - printer.printvalue('S', 4, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 7; i++) { - printer.printvalue('F', 4, i); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_struct_type.nc", "dmr,dap", true, // 7 - // { S4 S4 } - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 4); - printer.printvalue('S', 4); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_utf8.nc", "dmr,dap", true, // 9 - // 2 { S4 S4 } - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - printer.printvalue('T', 0, i); - printer.format("%n"); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_struct_nested.hdf5", "dmr,dap", true, // 10 - // { { S4 S4 } { S4 S4 } } - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 4); - printer.printvalue('S', 4); - printer.printvalue('S', 4); - printer.printvalue('S', 4); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_struct_nested3.hdf5", "dmr,dap", true, - // { { {S4 } } } - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 4); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_sequence_1.syn", "dmr,dap", true, // 0 - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - int count = printer.printcount(); - for (int j = 0; j < count; j++) { - printer.printvalue('S', 4); - printer.printvalue('S', 2); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_sequence_2.syn", "dmr,dap", true, // 0 - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - int count = printer.printcount(); - for (int j = 0; j < count; j++) { - printer.printvalue('S', 4); - printer.printvalue('S', 2); - } - printer.newline(); - } - printer.verifychecksum(); - } - })); - /* - * Not currently working - * this.alltestcases.add( - * new TestCase("test_vlen1.nc", "dmr,dap", true, - * new Dump.Commands() - * { - * public void run(Dump printer) throws IOException - * { - * int count = printer.printcount(); - * for(int i = 0;i < count;i++) { - * printer.printvalue('S', 4, i); - * printer.format("\n"); - * } - * printer.printchecksum(); - * } - * })); - * this.alltestcases.add( - * new TestCase("test_vlen2.nc", "dmr,dap", true, - * new Dump.Commands() - * { - * public void run(Dump printer) throws IOException - * { - * //{1, 3, 5, 7}, {100,200}, {-1,-2},{1, 3, 5, 7}, {100,200}, {-1,-2}; - * for(int d3 = 0;d3 < 3;d3++) { - * for(int d2 = 0;d2 < 2;d2++) { - * int count = printer.printcount(); - * for(int i = 0;i < count;i++) { - * printer.printvalue('S', 4, d3, d2, i); - * printer.format("\n"); - * } - * } - * } - * printer.printchecksum(); - * } - * })); - * this.alltestcases.add( - * new TestCase("test_vlen3.hdf5", "dmr,dap", true, - * new Dump.Commands() - * { - * public void run(Dump printer) throws IOException - * { - * int count = printer.printcount(); - * for(int i = 0;i < count;i++) { - * printer.printvalue('S', 4, i); - * printer.format("\n"); - * } - * printer.printchecksum(); - * } - * })); - * //*hdf5 iosp is not doing this correctly - * this.alltestcases.add( - * new TestCase("test_vlen4.hdf5", "dmr,dap", true, - * new Dump.Commands() - * { - * public void run(Dump printer) throws IOException - * { - * for(int i=0;i<2;i++) { - * int count = printer.printcount(); - * for(int j = 0;j < count;j++) { - * printer.printvalue('S', 4, i, j); - * printer.format("\n"); - * } - * } - * printer.printchecksum(); - * } - * })); - * this.alltestcases.add( - * new TestCase("test_vlen5.hdf5", "dmr,dap", true, - * new Dump.Commands() - * { - * public void run(Dump printer) throws IOException - * { - * for(int i = 0;i < 2;i++) { - * int count = printer.printcount(); - * for(int j = 0;j < count;j++) { - * printer.printvalue('S', 4, i, j); - * printer.format("\n"); - * } - * } - * printer.printchecksum(); - * } - * })); - */ - this.alltestcases.add(new TestCase("test_anon_dim.syn", "dmr,dap", true, // 0 - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 6; i++) { - printer.printvalue('S', 4, i); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_atomic_types.syn", "dmr,dap", true, // 4 - // S1 U1 S2 U2 S4 U4 S8 U8 F4 F8 C1 T O S1 S1 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 1); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('U', 1); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('S', 2); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('U', 2); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('S', 4); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('U', 4); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('S', 8); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('U', 8); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('F', 4); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('F', 8); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('C', 1); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('T', 0); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('O', 0); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('S', 1); - printer.verifychecksum(); - printer.startchecksum(); - printer.printvalue('S', 1); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_atomic_array.syn", "dmr,dap", true, // 5 - // 6 U1 4 S2 6 U4 2 F8 2 C1 4 T 2 O 5 S1 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 6; i++) { - printer.printvalue('U', 1, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 4; i++) { - printer.printvalue('S', 2, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 6; i++) { - printer.printvalue('U', 4, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - printer.printvalue('F', 8, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - printer.printvalue('C', 1, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 4; i++) { - printer.printvalue('T', 0, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - printer.printvalue('O', 0, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 5; i++) { - printer.printvalue('S', 1, i); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase("test_struct_array.syn", "dmr,dap", true, // 8 - // 12 { S4 S4 } - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 4; i++) { - printer.printvalue('F', 4, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 3; i++) { - printer.printvalue('F', 4, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 3; j++) { - printer.printvalue('S', 4, i); - printer.format(" "); - printer.printvalue('S', 4); - printer.format("%n"); - } - } - printer.verifychecksum(); - } - })); - // XFAIL tests - this.alltestcases.add(new TestCase("test_struct_array.nc", "dmr", true)); - } - - ////////////////////////////////////////////////// - // Utility methods - - - // Locate the test cases with given prefix - List locate(String prefix) { - List results = new ArrayList(); - for (TestCase ct : this.alltestcases) { - if (ct.dataset.startsWith(prefix)) - results.add(ct); - } - return results; - } - - - ////////////////////////////////////////////////// - // Support classes - - static /* package */ class NullValidator implements Validator { - public boolean supports(Class clazz) { - return true; - } - - public void validate(Object target, Errors errors) { - return; - } - } - -} - diff --git a/dap4/d4tests/src/test/java/dap4/test/TestServletConstraints.java b/dap4/d4tests/src/test/java/dap4/test/TestServletConstraints.java deleted file mode 100644 index 1a20ea04bb..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestServletConstraints.java +++ /dev/null @@ -1,453 +0,0 @@ -package dap4.test; - -import dap4.core.ce.parser.CEParserImpl; -import dap4.core.data.DSPRegistry; -import dap4.core.util.DapDump; -import dap4.core.util.Escape; -import dap4.dap4lib.ChunkInputStream; -import dap4.dap4lib.FileDSP; -import dap4.dap4lib.RequestMode; -import dap4.servlet.DapCache; -import dap4.servlet.Generator; -import dap4.servlet.SynDSP; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.springframework.mock.web.MockHttpServletResponse; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder; -import thredds.server.dap4.Dap4Controller; -import ucar.unidata.util.test.category.NotPullRequest; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.lang.invoke.MethodHandles; -import java.math.BigInteger; -import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.List; - - -/** - * TestServletConstraints has multiple purposes. - * 1. It tests the d4tsservlet ability to serve up constrained data. - * 2. It (optionally) stores the serialized raw databuffer - * for datasets into files., These files are then used to - * test client side deserialization (see TestCDMClient). - */ -@Category(NotPullRequest.class) -public class TestServletConstraints extends DapTestCommon { - static public boolean DEBUG = false; - static public boolean DEBUGDATA = false; - static public boolean PARSEDEBUG = false; - static public boolean CEPARSEDEBUG = false; - - static public boolean USEBIG = false; - static public boolean NOCSUM = false; - - ////////////////////////////////////////////////// - // Constants - - static protected final String RESOURCEPATH = "/src/test/data/resources"; // wrt getTestInputFilesDir - static protected final String TESTINPUTDIR = "/testfiles"; - static protected final String BASELINEDIR = "/TestServletConstraints/baseline"; - static protected final String GENERATEDIR = "/TestCDMClient/testinput"; - - // constants for Fake Request - static protected final String FAKEURLPREFIX = "/dap4"; - - static protected final BigInteger MASK = new BigInteger("FFFFFFFFFFFFFFFF", 16); - - // Define the file extensions of interest for generation - static protected final String[] GENEXTENSIONS = new String[] {".raw.dap", ".raw.dmr"}; - - ////////////////////////////////////////////////// - // Type Declarations - - static protected class TestCase { - static String inputroot = null; - static String baselineroot = null; - static String generateroot = null; - - static public void setRoots(String input, String baseline, String generate) { - inputroot = input; - baselineroot = baseline; - generateroot = generate; - } - - protected String title; - protected String dataset; - protected String[] extensions; - protected boolean checksumming; - protected Dump.Commands template; - protected String testinputpath; - protected String baselinepath; - protected String generatepath; - - protected String constraint = null; - protected int id; - - protected TestCase(int id, String dataset, String extensions, String ce, Dump.Commands template) { - this(id, dataset, extensions, ce, true, template); - } - - protected TestCase(int id, String dataset, String extensions, String ce, boolean checksumming, - Dump.Commands template) { - this.id = id; - this.title = dataset + (ce == null ? "" : ("?" + ce)); - this.constraint = ce; - this.dataset = dataset; - this.extensions = extensions.split(","); - this.template = template; - this.checksumming = checksumming; - this.testinputpath = canonjoin(this.inputroot, dataset); - this.baselinepath = canonjoin(this.baselineroot, dataset) + "." + id; - this.generatepath = canonjoin(this.generateroot, dataset) + "." + id; - } - - String makeurl(RequestMode ext) { - String u = canonjoin(FAKEURLPREFIX, canonjoin(TESTINPUTDIR, dataset)) + "." + ext.toString(); - return u; - } - - String makequery() { - String query = ""; - if (this.constraint != null) { - String ce = this.constraint; - // Escape it - ce = Escape.urlEncodeQuery(ce); - query = ce; - } - return query; - } - - public String makeBasepath(RequestMode mode) { - String ext; - switch (mode) { - case DMR: - return this.baselinepath + ".dmr"; - case DAP: - return this.baselinepath + ".dap"; - default: - break; - } - throw new UnsupportedOperationException("illegal mode: " + mode); - } - - public String toString() { - return dataset + "." + id; - } - } - - ////////////////////////////////////////////////// - // Instance variables - - protected MockMvc mockMvc; - - // Test cases - - protected List alltestcases = new ArrayList(); - - protected List chosentests = new ArrayList(); - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - super.bindstd(); - StandaloneMockMvcBuilder mvcbuilder = MockMvcBuilders.standaloneSetup(new Dap4Controller()); - mvcbuilder.setValidator(new TestServlet.NullValidator()); - this.mockMvc = mvcbuilder.build(); - testSetup(); - if (prop_ascii) - Generator.setASCII(true); - TestCase.setRoots(canonjoin(getResourceRoot(), TESTINPUTDIR), canonjoin(getResourceRoot(), BASELINEDIR), - canonjoin(getResourceRoot(), GENERATEDIR)); - defineAllTestcases(); - chooseTestcases(); - } - - @After - public void cleanup() { - super.unbindstd(); - } - - - ////////////////////////////////////////////////// - // Define test cases - - protected void chooseTestcases() { - if (false) { - if (false) { - chosentests = locate(8); - } else { - List choose1 = locate(8); - chosentests = locate(5); - chosentests.addAll(choose1); - } - prop_visual = true; - prop_debug = false; - prop_generate = false; - prop_baseline = true; - } else { - prop_baseline = false; - prop_generate = false; - for (TestCase tc : alltestcases) { - chosentests.add(tc); - } - } - } - - ////////////////////////////////////////////////// - // Junit test methods - - @Test - public void testServletConstraints() throws Exception { - DapCache.flush(); - for (TestCase testcase : chosentests) { - doOneTest(testcase); - } - } - - ////////////////////////////////////////////////// - // Primary test method - - void doOneTest(TestCase testcase) throws Exception { - System.err.println("Testcase: " + testcase.toString()); - System.err.println("Baseline: " + testcase.baselinepath); - if (CEPARSEDEBUG) - CEParserImpl.setGlobalDebugLevel(1); - - for (String extension : testcase.extensions) { - RequestMode ext = RequestMode.modeFor(extension); - switch (ext) { - case DMR: - dodmr(testcase); - break; - case DAP: - dodata(testcase); - break; - default: - Assert.assertTrue("Unknown extension", false); - } - } - } - - void dodmr(TestCase testcase) throws Exception { - String url = testcase.makeurl(RequestMode.DMR); - String query = testcase.makequery(); - String basepath = testcase.makeBasepath(RequestMode.DMR); - - String little = (USEBIG ? "0" : "1"); - String nocsum = (NOCSUM ? "1" : "0"); - MvcResult result = perform(url, this.mockMvc, RESOURCEPATH, DapTestCommon.CONSTRAINTTAG, query, - DapTestCommon.ORDERTAG, little, DapTestCommon.NOCSUMTAG, nocsum, DapTestCommon.TESTTAG, "true"); - - // Collect the output - MockHttpServletResponse res = result.getResponse(); - byte[] byteresult = res.getContentAsByteArray(); - - // Test by converting the raw output to a string - String sdmr = new String(byteresult, UTF8); - - if (prop_visual) - visual(testcase.title + ".dmr", sdmr); - if (prop_baseline) { - writefile(basepath, sdmr); - } else if (prop_diff) { // compare with baseline - // Read the baseline file - String baselinecontent = readfile(basepath); - System.err.println("DMR Comparison"); - Assert.assertTrue("***Fail", same(getTitle(), baselinecontent, sdmr)); - } - } - - void dodata(TestCase testcase) throws Exception { - String url = testcase.makeurl(RequestMode.DAP); - String query = testcase.makequery(); - String basepath = testcase.makeBasepath(RequestMode.DAP); - String little = (USEBIG ? "0" : "1"); - String nocsum = (NOCSUM ? "1" : "0"); - MvcResult result = perform(url, this.mockMvc, RESOURCEPATH, DapTestCommon.CONSTRAINTTAG, query, - DapTestCommon.ORDERTAG, little, DapTestCommon.NOCSUMTAG, nocsum, DapTestCommon.TESTTAG, "true"); - - // Collect the output - MockHttpServletResponse res = result.getResponse(); - byte[] byteresult = res.getContentAsByteArray(); - - if (prop_debug || DEBUG) { - DapDump.dumpbytestream(byteresult, ByteOrder.nativeOrder(), "TestServletConstraint.dodata"); - } - - if (prop_generate) { - // Dump the serialization into a file; this also includes the dmr - String target = testcase.generatepath + ".raw"; - writefile(target, byteresult); - } - - // Setup a ChunkInputStream - ByteArrayInputStream bytestream = new ByteArrayInputStream(byteresult); - - ChunkInputStream reader = new ChunkInputStream(bytestream, RequestMode.DAP, ByteOrder.nativeOrder()); - - String sdmr = reader.readDMR(); // Read the DMR - if (prop_visual) - visual(testcase.title + ".dmr.dap", sdmr); - - Dump printer = new Dump(); - String sdata = printer.dumpdata(reader, testcase.checksumming, reader.getRemoteByteOrder(), testcase.template); - - if (prop_visual) - visual(testcase.title + ".dap", sdata); - - if (prop_baseline) - writefile(basepath, sdata); - - if (prop_diff) { - // compare with baseline - // Read the baseline file - System.err.println("Data Comparison:"); - String baselinecontent = readfile(testcase.baselinepath + ".dap"); - Assert.assertTrue("***Fail", same(getTitle(), baselinecontent, sdata)); - } - } - - ////////////////////////////////////////////////// - - protected void defineAllTestcases() { - this.alltestcases.add(new TestCase(1, "test_one_vararray.nc", "dmr,dap", "/t[1]", - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 4); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase(2, "test_anon_dim.syn", "dmr,dap", "/vu32[0:3]", // test for dimension inclusion - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('U', 4); - printer.printvalue('U', 4); - printer.printvalue('U', 4); - printer.printvalue('U', 4); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase(3, "test_one_vararray.nc", "dmr,dap", "/t", // test for dimension inclusion - // S4 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - printer.printvalue('S', 4); - printer.printvalue('S', 4); - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase(4, "test_enum_array.nc", "dmr,dap", "/primary_cloud[1:2:4]", - // 2 S1 - new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - printer.printvalue('U', 1, i); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase(5, "test_atomic_array.nc", "dmr,dap", - "/vu8[1][0:2:2];/vd[1];/vs[1][0];/vo[0][1]", new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - printer.printvalue('U', 1, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 1; i++) { - printer.printvalue('F', 8, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 1; i++) { - printer.printvalue('T', 0, i); - } - printer.verifychecksum(); - printer.startchecksum(); - for (int i = 0; i < 1; i++) { - printer.printvalue('O', 0, i); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase(6, "test_struct_array.nc", "dmr,dap", "/s[0:2:3][0:1]", new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 2; j++) { - printer.printvalue('S', 4); - } - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase(7, "test_opaque_array.nc", "dmr,dap", "/vo2[1][0:1]", new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 2; i++) { - printer.printvalue('O', 0, i); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase(8, "test_atomic_array.nc", "dmr,dap", "/v16[0:1,3]", new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 3; i++) { - printer.printvalue('S', 2, i); - } - printer.verifychecksum(); - } - })); - this.alltestcases.add(new TestCase(9, "test_atomic_array.nc", "dmr,dap", "/v16[3,0:1]", new Dump.Commands() { - public void run(Dump printer) throws IOException { - printer.startchecksum(); - for (int i = 0; i < 3; i++) { - printer.printvalue('S', 2, i); - } - printer.verifychecksum(); - } - })); - for (int i = 0; i < 3; i++) { - int numCases = this.alltestcases.size(); - for (int testCase = 0; testCase < numCases; testCase++) { - this.alltestcases.add(this.alltestcases.get(testCase)); - } - } - } - - ////////////////////////////////////////////////// - // Utility methods - - - // Locate the test cases with given prefix - List locate(Object tag) { - List results = new ArrayList(); - for (TestCase ct : this.alltestcases) { - if (tag instanceof Integer && ct.id == (Integer) tag) { - results.add(ct); - break; - } else if (tag instanceof String && ct.title.equals((String) tag)) { - results.add(ct); - break; - } - } - return results; - } -} diff --git a/dap4/d4tests/src/test/resources/logback-test.xml b/dap4/d4tests/src/test/resources/logback-test.xml deleted file mode 100644 index d24280d3c9..0000000000 --- a/dap4/d4tests/src/test/resources/logback-test.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - %highlight([%d{HH:mm:ss.SSS} %-5level %logger{36}]) %message%n - - - - - - - - - - - - - - - - diff --git a/dap4/d4ts/build.gradle b/dap4/d4ts/build.gradle index 5f1da93acd..23ca998d68 100644 --- a/dap4/d4ts/build.gradle +++ b/dap4/d4ts/build.gradle @@ -3,40 +3,39 @@ apply from: "$rootDir/gradle/any/war-published.gradle" apply from: "$rootDir/gradle/any/gretty.gradle" dependencies { - compile enforcedPlatform(project(':tds-platform')) + implementation enforcedPlatform(project(':tds-platform')) + + implementation 'edu.ucar:dap4' + implementation project(":dap4:d4servlet") - compile 'edu.ucar:dap4' - compile project(":dap4:dap4-servlet") providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.javaxServletApi}" - compile 'org.slf4j:slf4j-api' + compileOnly 'org.slf4j:slf4j-api' runtime 'org.apache.logging.log4j:log4j-slf4j-impl' runtime 'org.apache.logging.log4j:log4j-web' - testRuntime 'ch.qos.logback:logback-classic' + compileOnly 'org.slf4j:slf4j-api' } -// This specifies the resources from ":dap4:d4tests" that we need to include in the d4ts war and inplaceWebapp. +// This specifies the resources from ":dap4" that we need to include in the d4ts war and inplaceWebapp. def d4testsResourcesCopySpec = copySpec { - File d4testsResourcesDir = project(":dap4:d4tests").file('src/test/data/resources') + File d4tsResourcesDir = project(":dap4:d4ts").file('src/main/webapp/WEB-INF') + +/*These are already in place - from (new File(d4testsResourcesDir, 'favicon.ico')) { + from(d4tsResourcesDir) { into('WEB-INF/') + include('dsr.xml.template') + include('dsr.html.template') + include('frontpage.html.template') + include('favicon.ico') } - from (new File(d4testsResourcesDir, "testfiles/")) { - into('WEB-INF/resources/testfiles/') - include('*.syn') + from (new File(d4tsResourcesDir, "testfiles/")) { + into('WEB-INF/testfiles/') include('*.nc') - include('*.hdf5') - include('*.raw') - } - /* ignore for now - from(new File(d4testsResourcesDir, "testfiles/dmr/")) { - into('WEB-INF/resources/testfiles/dmr/') - include('*.dmr') } - */ +*/ } diff --git a/dap4/d4ts/src/main/java/dap4/d4ts/D4TSServlet.java b/dap4/d4ts/src/main/java/dap4/d4ts/D4TSServlet.java index bc832898c8..59ae59c7c1 100644 --- a/dap4/d4ts/src/main/java/dap4/d4ts/D4TSServlet.java +++ b/dap4/d4ts/src/main/java/dap4/d4ts/D4TSServlet.java @@ -5,16 +5,13 @@ package dap4.d4ts; -import dap4.core.data.DSPRegistry; import dap4.core.util.DapContext; import dap4.core.util.DapException; import dap4.core.util.DapUtil; import dap4.dap4lib.DapCodes; import dap4.dap4lib.DapLog; -import dap4.dap4lib.FileDSP; -import dap4.dap4lib.netcdf.Nc4DSP; import dap4.servlet.*; -import javax.servlet.ServletContext; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -36,31 +33,11 @@ public class D4TSServlet extends DapController { static final boolean PARSEDEBUG = false; - static protected final String RESOURCEPATH = "WEB-INF/resources"; + static final String RESOURCEPATH = "/testfiles"; ////////////////////////////////////////////////// // Type Decls - static class D4TSFactory extends DSPFactory { - - public D4TSFactory() { - // Register known DSP classes: order is important - // in event that two or more dsps can match a given file - // (e.q. FileDSP vs Nc4DSP). - // Only used in server - DapCache.dspregistry.register(Nc4DSP.class, DSPRegistry.LAST); - DapCache.dspregistry.register(SynDSP.class, DSPRegistry.LAST); - DapCache.dspregistry.register(FileDSP.class, DSPRegistry.LAST); - } - - } - - ////////////////////////////////////////////////// - - static { - DapCache.setFactory(new D4TSFactory()); - } - ////////////////////////////////////////////////// // Instance variables @@ -92,7 +69,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se @Override protected void doFavicon(String icopath, DapContext cxt) throws IOException { DapRequest drq = (DapRequest) cxt.get(DapRequest.class); - String favfile = getResourcePath(drq, icopath); + String favfile = drq.getResourcePath(icopath); if (favfile != null) { try (FileInputStream fav = new FileInputStream(favfile);) { byte[] content = DapUtil.readbinaryfile(fav); @@ -120,36 +97,11 @@ protected void doCapabilities(DapRequest drq, DapContext cxt) throws IOException } - @Override - public String getResourcePath(DapRequest drq, String location) throws DapException { - String prefix = drq.getResourceRoot(); - if (prefix == null) - throw new DapException("Cannot find location resource: " + location).setCode(DapCodes.SC_NOT_FOUND); - location = DapUtil.canonicalpath(location); - String datasetfilepath = DapUtil.canonjoin(prefix, location); - // See if it really exists and is readable and of proper type - File dataset = new File(datasetfilepath); - if (!dataset.exists()) { - String msg = String.format("Requested file does not exist: prefix=%s location=%s datasetfilepath=%s", prefix, - location, datasetfilepath); - throw new DapException(msg).setCode(HttpServletResponse.SC_NOT_FOUND); - } - if (!dataset.canRead()) - throw new DapException("Requested file not readable: " + datasetfilepath) - .setCode(HttpServletResponse.SC_FORBIDDEN); - return datasetfilepath; - } - @Override public long getBinaryWriteLimit() { return DEFAULTBINARYWRITELIMIT; } - @Override - public String getServletID() { - return "d4ts"; - } - /** * Isolate front page builder so we can override if desired for testing. * @@ -161,14 +113,59 @@ protected FrontPage getFrontPage(DapRequest drq, DapContext cxt) throws DapExcep if (this.defaultroots == null) { // Figure out the directory containing // the files to display. - String pageroot; - pageroot = getResourcePath(drq, ""); - if (pageroot == null) - throw new DapException("Cannot locate resources directory"); + String testroot = drq.getResourcePath("/"); + if (testroot == null) + throw new DapException("Cannot locate dataset directory"); this.defaultroots = new ArrayList<>(); - this.defaultroots.add(new Root("testfiles", pageroot)); + this.defaultroots.add(new Root(testroot, RESOURCEPATH)); } return new FrontPage(this.defaultroots, drq); } + @Override + public String getServletID() { + return "/d4ts"; + } + + @Override + public String getWebContentRoot(DapRequest drq) throws DapException { + try { + String servletpath = getServletContext().getResource("/").getPath(); + String path = servletpath + "WEB-INF"; + File f = new File(path); + if (!f.exists() || !f.canRead() || !f.isDirectory()) + throw new DapException("Cannot find WEB-INF").setCode(DapCodes.SC_NOT_FOUND); + return path; + } catch (IOException ioe) { + throw new DapException(ioe); + } + } + + /** + * Convert a URL path for a dataset into an absolute file path + * + * @param drq dap request + * @param location suffix of url path + * @return path in a string builder so caller can extend. + * @throws IOException + */ + public String getResourcePath(DapRequest drq, String location) throws DapException { + try { + String root = getWebContentRoot(drq); + if (root == null) + throw new DapException("Cannot find WEB-INF").setCode(DapCodes.SC_NOT_FOUND); + StringBuilder path = new StringBuilder(DapUtil.canonicalpath(root)); + if (location.charAt(0) != '/') + path.append('/'); + path.append(location); + String result = path.toString(); + File f = new File(result); + if (!f.exists() || !f.canRead()) + throw new DapException("Cannot find Resource path: " + result).setCode(DapCodes.SC_NOT_FOUND); + return result; + } catch (IOException ioe) { + throw new DapException(ioe).setCode(DapCodes.SC_NOT_FOUND); + } + } + } diff --git a/dap4/d4ts/src/main/java/dap4/d4ts/FrontPage.java b/dap4/d4ts/src/main/java/dap4/d4ts/FrontPage.java index 5273627d4d..322620282d 100644 --- a/dap4/d4ts/src/main/java/dap4/d4ts/FrontPage.java +++ b/dap4/d4ts/src/main/java/dap4/d4ts/FrontPage.java @@ -5,11 +5,17 @@ package dap4.d4ts; +import dap4.core.util.DapConstants; import dap4.core.util.DapException; import dap4.core.util.DapUtil; import dap4.dap4lib.DapLog; import dap4.servlet.DapRequest; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletResponse; import java.io.*; +import java.net.MalformedURLException; +import java.net.URL; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -25,6 +31,10 @@ public class FrontPage { static final boolean DUMPFILELIST = false; + static final String FPTEMPLATE = "/templates/dap4.frontpage.html.template"; + + static final String DFALTTESTSERVER = "remotetest.unidata.ucar.edu"; + ////////////////////////////////////////////////// // Constants @@ -33,36 +43,35 @@ public class FrontPage { static final protected String[] expatterns = new String[0]; // Define the file sources of interest - static final protected FileSource[] SOURCES = - new FileSource[] {new FileSource(".nc", "netCDF"), new FileSource(".hdf5", "HDF5"), - new FileSource(".dap", "Raw Protocol Output"), new FileSource(".syn", "Synthetic")}; + static final protected FileSource[] SOURCES = new FileSource[] {new FileSource(".nc", "netCDF")}; - static public class Root { + public static class Root { public String prefix; + public String dir; + public List files; public String toString() { return String.format("{'%s/%s'}", this.prefix, this.dir); } - public Root(String dir, String prefix) { - this.dir = dir; + public Root(String prefix, String dir) { this.prefix = DapUtil.canonicalpath(prefix); + this.dir = dir; } public String getFullPath() { - return DapUtil.canonjoin(this.prefix, this.dir); - } + return this.prefix + "/" + this.dir; + }; public void setFiles(List files) { this.files = files; } } - // Remote Test server: should match values in TestDir.java private static String dap4TestServerPropName = "d4ts"; - static public String dap4TestServer = "remotetest.unidata.ucar.edu"; // mutable + public static String dap4TestServer = null;; // mutable static { String d4ts = System.getProperty(dap4TestServerPropName); @@ -88,6 +97,7 @@ public FileSource(String ext, String tag) { protected DapRequest drq = null; protected List roots = null; // root paths to the displayed files + protected StringBuilder frontpage = null; ////////////////////////////////////////////////// // Constructor(s) @@ -103,7 +113,26 @@ public FrontPage(List rootinfo, DapRequest req) throws DapException { // Construct the list of usable files buildFileList(root); } + // Figure out the test server + if (this.dap4TestServer == null) { + try { + URL url = new URL(drq.getRequest().getRequestURL().toString()); + this.dap4TestServer = url.getHost(); + if (url.getPort() > 0) + this.dap4TestServer += ":" + url.getPort(); + } catch (MalformedURLException mue) { + this.dap4TestServer = null; + } + } + if (this.dap4TestServer == null) + this.dap4TestServer = DFALTTESTSERVER; + // Get the template and fill in selected macros + try { + this.frontpage = initialPage(this.dap4TestServer); + } catch (IOException ioe) { + throw new DapException(ioe).setCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } } ////////////////////////////////////////////////// @@ -148,7 +177,7 @@ public int compare(File f1, File f2) { }); if (DUMPFILELIST) { for (File x : matches) { - System.err.printf("file: %s/%s%n", rootinfo.prefix, x.getName()); + System.err.printf("file: %s/%s%n", rootinfo.dir, x.getName()); } } FileSource clone = new FileSource(src.ext, src.tag); @@ -160,46 +189,71 @@ public int compare(File f1, File f2) { } protected String buildPage() throws DapException { - StringBuilder html = new StringBuilder(); - html.append(HTML_PREFIX); - html.append(HTML_HEADER1); - StringBuilder rootnames = new StringBuilder(); for (Root root : this.roots) { if (rootnames.length() > 0) rootnames.append(","); rootnames.append(root.dir); } - html.append(String.format(HTML_HEADER2, rootnames)); - + StringBuilder sources = new StringBuilder(); for (Root root : this.roots) { try { for (FileSource src : root.files) { - html.append(String.format(HTML_HEADER3, src.tag)); - html.append(TABLE_HEADER); + StringBuilder allrows = new StringBuilder(); for (File file : src.files) { String name = file.getName(); - StringBuilder buf = new StringBuilder(); - buf.append(this.drq.getControllerPath()); - buf.append('/'); - buf.append(DapUtil.canonicalpath(root.dir)); - buf.append('/'); - buf.append(DapUtil.canonicalpath(name)); - String urlpath = buf.toString(); - String line = String.format(HTML_FORMAT, name, urlpath, urlpath, urlpath); - html.append(line); + String rootpath = root.dir; + if (rootpath.startsWith("/")) + rootpath = rootpath.substring(1); + String url = String.format(HTML_URL_FORMAT, this.dap4TestServer, rootpath, name); + StringBuilder row = new StringBuilder(HTML_ROW); + substitute(row, "dataset", name); + substitute(row, "url", url); + allrows.append(row); } - html.append(TABLE_FOOTER); + StringBuilder source = new StringBuilder(HTML_SOURCE); + substitute(source, "source", src.tag); + substitute(source, "rows", allrows.toString()); + sources.append(source); } } catch (Exception e) { sendtrace(drq, e); } } - html.append(HTML_FOOTER); - return html.toString(); + substitute(this.frontpage, "sources", sources.toString()); + return this.frontpage.toString(); + } + + protected StringBuilder initialPage(String testserver) throws IOException { + // Get the FrontPage template + StringBuilder page = new StringBuilder(); + String template = drq.getWebContentPath(FPTEMPLATE); + try (InputStream stream = new FileInputStream(template)) { + int ch; + while ((ch = stream.read()) >= 0) { + page.append((char) ch); + } + } + // Fill in initial parameters + substitute(page, "dap4TestServer", testserver); + return page; + } + + protected void substitute(StringBuilder buf, String macro, String value) { + int from = 0; + String tag = "${" + macro + "}"; + int taglen = tag.length(); + int valuelen = value.length(); + for (;;) { + int index = buf.indexOf(tag, from); + if (index < 0) + break; + buf.replace(index, index + taglen, value); + from = index + valuelen; + } } - static public void sendtrace(DapRequest drq, Exception e) { + public static void sendtrace(DapRequest drq, Exception e) { try { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); @@ -212,7 +266,7 @@ static public void sendtrace(DapRequest drq, Exception e) { } } - static public void sendtext(DapRequest drq, String s) { + public static void sendtext(DapRequest drq, String s) { try { // s = s.replace("<", "<"); // s = s.replace(">", ">"); @@ -258,24 +312,16 @@ static public void sendtext(DapRequest drq, String s) { */ ////////////////////////////////////////////////// - // HTML prefix and suffix + // HTML Text Pieces // (Remember that java does not allow Strings to cross lines) - static final String HTML_PREFIX = - "\n\nDAP4 Test Files\n\n\n\n"; - - static final String HTML_HEADER1 = "

DAP4 Test Files

\n"; - static final String HTML_HEADER2 = "

http://" + dap4TestServer + "/d4ts/{%s}

%n
%n"; - static final String HTML_HEADER3 = "

%s Based Test Files

%n"; - - static final String TABLE_HEADER = "\n"; - static final String TABLE_FOOTER = "
\n"; - static final String HTML_FOOTER = "
\n\n"; + static final String HTML_URL_FORMAT = DapConstants.HTTPSCHEME + "//%s/d4ts/%s/%s"; - static final String HTML_FORMAT = "%n" + "%s:%n" - + " DMR.XML %n" - + " DAP %n" - + " DSR.XML %n" + "%n"; -} + static final String HTML_SOURCE = "

${source} Based Test Files

\n\n${rows}\n
"; + static final String HTML_ROW = String.join("\n", "", "${dataset}:", + " DMR ", + " DAP ", + " DSR ", "", ""); +} // FrontPage diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/README.md b/dap4/d4ts/src/main/webapp/WEB-INF/README.md new file mode 100644 index 0000000000..ae8ea847ce --- /dev/null +++ b/dap4/d4ts/src/main/webapp/WEB-INF/README.md @@ -0,0 +1,14 @@ +## Notes on DAP4 Web Files + +The template files for the DAP4 DSR and Capabilities support +are located in this directory: +* dap4/d4ts/src/main/webapp/WEB-INF/templates/ + +The template files are: +* dap4.dsr.html.template +* dap4.dsr.xml.template +* dap4.frontpage.html.template + +The DSR templates are also used in the tds server. +They are installed in this directory. +* tds/src/main/webapp/WEB-INF/templates/ diff --git a/dap4/d4tests/src/test/data/resources/favicon.ico b/dap4/d4ts/src/main/webapp/WEB-INF/favicon.ico similarity index 100% rename from dap4/d4tests/src/test/data/resources/favicon.ico rename to dap4/d4ts/src/main/webapp/WEB-INF/favicon.ico diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/templates/dap4.dsr.html.template b/dap4/d4ts/src/main/webapp/WEB-INF/templates/dap4.dsr.html.template new file mode 100644 index 0000000000..422a1552d8 --- /dev/null +++ b/dap4/d4ts/src/main/webapp/WEB-INF/templates/dap4.dsr.html.template @@ -0,0 +1,61 @@ + + + + + + name="title" content="Dataset Services Response"> + + + + +
+

DAP4 Dataset Services

+
+
+ + + +
Dap Version:${DAP_VERSION}
Server Software Version:${DAP_SERVER}
+
+

Dataset: ${DATASET}

+ + + + + + +
Dataset Service + Class + Format + URL + Media Type +
Metadata + DMR + XML + ${URL}.dmr.xml + application/vnd.opendap.dap4.dataset-metadata+xml +
Data + DAP + Binary + ${URL}.dap + application/vnd.opendap.dap4.data +
Services + DSR + XML + ${URL}.dsr.xml + application/vnd.opendap.dap4.dataset-services+xml +
Services + DSR + HTML + ${URL}.dsr.html + application/vnd.opendap.dap4.dataset-services+html +
+ + diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/templates/dap4.dsr.xml.template b/dap4/d4ts/src/main/webapp/WEB-INF/templates/dap4.dsr.xml.template new file mode 100644 index 0000000000..d07474a1a1 --- /dev/null +++ b/dap4/d4ts/src/main/webapp/WEB-INF/templates/dap4.dsr.xml.template @@ -0,0 +1,28 @@ + + + +${DAP_VERSION} +${DAP_SERVER} + + + + + + + + + + + + diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/templates/dap4.frontpage.html.template b/dap4/d4ts/src/main/webapp/WEB-INF/templates/dap4.frontpage.html.template new file mode 100644 index 0000000000..7f2a9ee9a6 --- /dev/null +++ b/dap4/d4ts/src/main/webapp/WEB-INF/templates/dap4.frontpage.html.template @@ -0,0 +1,18 @@ + + + + + + + + +
+

DAP4 Test Files

+
+

http://${dap4TestServer}/d4ts/testfiles/*

+
+${sources} +
+ + diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_atomic_array.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_atomic_array.nc new file mode 100644 index 0000000000..9250eab38f Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_atomic_array.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_atomic_types.nc similarity index 57% rename from dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_atomic_types.nc index 066dd89354..99f89f071a 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_atomic_types.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_1.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_1.nc new file mode 100644 index 0000000000..e98f12301e Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_1.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_2.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_2.nc new file mode 100644 index 0000000000..c7091e08c4 Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_2.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_3.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_3.nc new file mode 100644 index 0000000000..efbb3e2395 Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_3.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_array.nc similarity index 74% rename from dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_array.nc index c6b4a2f388..b9afa6df63 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_enum_array.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_fill.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_fill.nc new file mode 100644 index 0000000000..9009412a7e Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_fill.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_fill_2.nc similarity index 53% rename from dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_fill_2.nc index 00be0b7551..95e7e806a2 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_fill_2.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_groups1.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_groups1.nc new file mode 100644 index 0000000000..80e3ad32b3 Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_groups1.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_misc1.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_misc1.nc new file mode 100644 index 0000000000..4129edc066 Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_misc1.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_one_var.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_one_var.nc new file mode 100644 index 0000000000..c90ed3dbe4 Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_one_var.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_one_vararray.nc similarity index 78% rename from dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_one_vararray.nc index e0cc0ce34a..c82678de63 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_one_vararray.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_opaque.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_opaque.nc new file mode 100644 index 0000000000..b2923df7c1 Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_opaque.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_opaque_array.nc similarity index 76% rename from dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_opaque_array.nc index 895a8bf065..e0cb43deb5 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_opaque_array.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct1.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct1.nc new file mode 100644 index 0000000000..67e8dc9d9e Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct1.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_array.nc similarity index 67% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_array.nc index 572ed1deaa..7628fd1ed9 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_array.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_nested.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_nested.nc new file mode 100644 index 0000000000..912601640a Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_nested.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_nested3.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_nested3.nc new file mode 100644 index 0000000000..df7825a6cd Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_nested3.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_type.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_type.nc new file mode 100644 index 0000000000..67e8dc9d9e Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_struct_type.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_test.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_test.nc new file mode 100644 index 0000000000..bcacdf7f59 Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_test.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_unlim.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_unlim.nc similarity index 58% rename from dap4/d4tests/src/test/data/resources/testfiles/test_unlim.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_unlim.nc index f362f967fb..012cc86932 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_unlim.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_unlim.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_unlim1.nc similarity index 66% rename from dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_unlim1.nc index 5b92931e63..6a46aede6f 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_unlim1.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_utf8.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_utf8.nc similarity index 76% rename from dap4/d4tests/src/test/data/resources/testfiles/test_utf8.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_utf8.nc index fd90a6f12e..449dad8d6f 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_utf8.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_utf8.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen1.nc similarity index 85% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen1.nc index 4c7f097564..e575c561a3 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen1.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen10.nc similarity index 78% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen10.nc index eeb02b6351..703a7d7fa7 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen10.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen11.nc similarity index 80% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen11.nc index 729e4b607b..a0ed0bb977 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen11.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.hdf5 b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen2.nc similarity index 65% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.hdf5 rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen2.nc index cf0654cd89..8ff67e7f35 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.hdf5 and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen2.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen3.nc similarity index 81% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen3.nc index e5564961e2..61377f53ed 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen3.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen4.nc similarity index 80% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen4.nc index f119d3d119..bc214f5f4f 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen4.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.hdf5 b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen5.nc similarity index 77% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.hdf5 rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen5.nc index cd54563424..706122dfc8 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.hdf5 and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen5.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen6.nc similarity index 75% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen6.nc index f294775e10..01c393c1ad 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen6.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen7.nc similarity index 75% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen7.nc index f1989bf335..5ccf64addd 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen7.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.hdf5 b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen8.nc similarity index 66% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.hdf5 rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen8.nc index 2d3be72508..6b87f7a37a 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.hdf5 and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen8.nc differ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen9.nc similarity index 71% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.nc rename to dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen9.nc index 95343fff4f..7c10820d97 100644 Binary files a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.nc and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_vlen9.nc differ diff --git a/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_zerodim.nc b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_zerodim.nc new file mode 100644 index 0000000000..fee2801c91 Binary files /dev/null and b/dap4/d4ts/src/main/webapp/WEB-INF/testfiles/test_zerodim.nc differ diff --git a/dap4/git.sh b/dap4/git.sh deleted file mode 100644 index 0ec56d5a1f..0000000000 --- a/dap4/git.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -set -x -GIT=github -DST=$GIT/dap4 - -FILES=`cat Inventory |tr -d '\r' |tr '\r\n' ' '` - -rm -fr ${GIT} -mkdir -p ${DST} - -for f in ${FILES} ; do -DIR=`dirname $f` -mkdir -p ${DST}/${DIR} -cp $f $DST/$f -done - diff --git a/gradle/any/coverage.gradle b/gradle/any/coverage.gradle index f6ba25970f..141cb5e034 100644 --- a/gradle/any/coverage.gradle +++ b/gradle/any/coverage.gradle @@ -21,7 +21,7 @@ tasksExtendedByJacoco.all { * in cdm/src/main only. * * That's fine for :cdm, but we have subprojects that contain no code in their 'main' source set, namely :it, - * :cdm-test, and :dap4:d4tests. They only have code in their 'test' SourceSets. As a result, the default + * and :cdm-test. They only have code in their 'test' SourceSets. As a result, the default * 'jacocoTestReport' task added to those tasks will generate an empty report, because there's nothing to report on. * * We could remedy this by adding main SourceSets from other projects to report on. This would be particularly diff --git a/gradle/root/testing.gradle b/gradle/root/testing.gradle index 2f6212b8bc..fe25d7b912 100644 --- a/gradle/root/testing.gradle +++ b/gradle/root/testing.gradle @@ -40,13 +40,14 @@ ext { isRdaDataAvailable = false // figure out how to set later - // for now, ignore dap4 tests when checking against netcdf-java pull requests + // for now, ignore dap4 when checking against netcdf-java pull requests skipDap4 = false ciWorkspace = System.getenv('GITHUB_WORKSPACE') if (ciWorkspace != null) { ciWorkspace = ciWorkspace.replace('/', '') - skipDap4 = ciWorkspace != null && ciWorkspace.endsWith('netcdf-java') +// skipDap4 = ciWorkspace != null && ciWorkspace.endsWith('netcdf-java') } + skipDap4 = false if (skipDap4) { logger.warn 'Skipping dap4 tests when running against netCDF-Java PRs.' } diff --git a/settings.gradle b/settings.gradle index 8e620f54e8..58101fe65c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,9 +2,8 @@ rootProject.name = 'thredds-data-server' // These all refer to subdirectory names. -//include 'dap4:d4servlet' -//include 'dap4:d4ts' -//include 'dap4:d4tests' +include 'dap4:d4servlet' +include 'dap4:d4ts' include 'docs' include 'opendap:dtswar' include 'opendap:server' @@ -21,4 +20,3 @@ include 'tds-ui' // Set name of the opendap servlet artifact project(':opendap:server').name = 'opendap-servlet' -//project(':dap4:d4servlet').name = 'dap4-servlet' diff --git a/tds-platform/build.gradle b/tds-platform/build.gradle index 40b400f431..8ce1d1de57 100644 --- a/tds-platform/build.gradle +++ b/tds-platform/build.gradle @@ -76,7 +76,8 @@ dependencies { runtime 'org.apache.taglibs:taglibs-standard-impl:1.2.5' // dap4 - api 'edu.ucar:dap4' + runtime 'edu.ucar:dap4' + // defined in tds-testing-platform as well, but using api config runtime 'org.apache.logging.log4j:log4j-web' diff --git a/tds-testing-platform/build.gradle b/tds-testing-platform/build.gradle index cf0f7c48c9..f4e705e120 100644 --- a/tds-testing-platform/build.gradle +++ b/tds-testing-platform/build.gradle @@ -20,10 +20,6 @@ dependencies { // spring-test 5.3.3. api 'org.springframework:spring-test:5.3.27' - // opendap - api 'org.apache.taglibs:taglibs-standard-spec' - api 'org.apache.taglibs:taglibs-standard-impl' - // dap4 // defined in tds-platform as well, but using runtime config api 'org.apache.logging.log4j:log4j-web' // api because of :dap4:d4tests) diff --git a/tds/build.gradle b/tds/build.gradle index 4cc3f73db7..daf3aba123 100644 --- a/tds/build.gradle +++ b/tds/build.gradle @@ -31,9 +31,8 @@ dependencies { implementation project(':tds-ugrid') // DAP4 Dependencies (technically forward) - compile 'edu.ucar:dap4' -// -// compile project(':dap4:dap4-servlet') + implementation 'edu.ucar:dap4' + implementation project(':dap4:d4servlet') // Server stuff providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.javaxServletApi}" @@ -101,6 +100,7 @@ dependencies { testCompile 'junit:junit' testCompile project(':tds-test-utils'); testCompile 'edu.ucar:cdm-test-utils' // Contains stuff like the JUnit @Category classes. + testCompile 'edu.ucar:httpservices' // Logging compile 'org.slf4j:slf4j-api' diff --git a/tds/src/integrationTests/java/ucar/nc2/util/net/TestFormBuilder.java b/tds/src/integrationTests/java/ucar/nc2/util/net/TestFormBuilder.java index ef54cfe686..7a71babe67 100644 --- a/tds/src/integrationTests/java/ucar/nc2/util/net/TestFormBuilder.java +++ b/tds/src/integrationTests/java/ucar/nc2/util/net/TestFormBuilder.java @@ -9,6 +9,9 @@ import org.apache.http.HttpEntity; import org.junit.Assert; import org.junit.Test; +import org.junit.Before; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import thredds.test.util.TdsUnitTestCommon; @@ -17,17 +20,16 @@ import java.io.*; import java.lang.invoke.MethodHandles; -import java.util.HashMap; -import java.util.Map; -import java.util.TreeMap; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Test HttpFormBuilder */ + +@RunWith(Parameterized.class) public class TestFormBuilder extends TdsUnitTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); ////////////////////////////////////////////////// // Constants @@ -59,125 +61,133 @@ public class TestFormBuilder extends TdsUnitTestCommon { static final String NULLURL = "http://" + TestDir.remoteTestServer; ////////////////////////////////////////////////// - // Instance Variables + // Static Fields - protected String boundary = null; + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - File attach3file = null; + ////////////////////////////////////////////////// + // Test Case Class + + // Encapulate the arguments for each test + static class TestCase { + public String name; + public boolean ismultipart; + public HttpEntity content; + + public TestCase(String name, HttpEntity content, boolean ismultipart) { + this.name = name; + this.ismultipart = ismultipart; + this.content = content; + } + + public String toString() { + return this.name; + } + } + + ////////////////////////////////////////////////// + // Test Generator + + @Parameterized.Parameters(name = "{index}: {0}") + static public List defineTestCases() throws IOException { + List testcases = new ArrayList<>(); + // Simple form test case + HTTPFormBuilder builder = buildForm(false, null); + HttpEntity content = builder.build(); + TestCase tc = new TestCase("simple-form", content, false); + testcases.add(tc); + + // Multi-part form test case + File attach3file = HTTPUtil.fillTempFile("attach3.txt", ATTACHTEXT); + attach3file.deleteOnExit(); + builder = buildForm(true, attach3file); + content = builder.build(); + tc = new TestCase("multi-part-form", content, true); + testcases.add(tc); + return testcases; + } + + ////////////////////////////////////////////////// + // Test Fields + + TestCase tc; + + ////////////////////////////////////////////////// + // Instance Variables ////////////////////////////////////////////////// // Constructor(s) - public TestFormBuilder() { + public TestFormBuilder(TestCase tc) { + this.tc = tc; setTitle("HTTPFormBuilder test(s)"); + HTTPIntercepts.setGlobalDebugInterceptors(false); + } + + ////////////////////////////////////////////////// + // Junit test method(s) + + @Before + public void setup() { setSystemProperties(); - // Turn on Session debugging - HTTPSession.TESTING = true; - HTTPIntercepts.setGlobalDebugInterceptors(true); } @Test - public void testSimple() throws Exception { - HTTPSession session = HTTPFactory.newSession(NULLURL); - session.resetInterceptors(); + public void test() throws Exception { try { - HTTPFormBuilder builder = buildForm(false); - HttpEntity content = builder.build(); - try (HTTPMethod postMethod = HTTPFactory.Post(session)) { - postMethod.setRequestContent(content); + HTTPIntercepts.DebugInterceptRequest dbgreq = null; + HttpEntity entity = null; + try (HTTPMethod postMethod = HTTPFactory.Post(NULLURL)) { + HTTPSession session = postMethod.getSession(); + session.resetInterceptors(); + postMethod.setRequestContent(tc.content); // Execute, but ignore any problems - try { - postMethod.execute(); - } catch (Exception e) { - // ignore - } + postMethod.execute(); + dbgreq = session.getDebugRequestInterceptor(); // Get the request that was used + Assert.assertTrue("Could not get debug request", dbgreq != null); + entity = dbgreq.getRequestEntity(); + Assert.assertTrue("Could not get debug entity", entity != null); } - // Get the request that was used - HTTPIntercepts.DebugInterceptRequest dbgreq = session.getDebugRequestInterceptor(); - Assert.assertTrue("Could not get debug request", dbgreq != null); - HttpEntity entity = dbgreq.getRequestEntity(); - Assert.assertTrue("Could not get debug entity", entity != null); // Extract the form info Header ct = entity.getContentType(); - String body = extract(entity, ct, false); + String body = extract(entity, ct, tc.ismultipart); Assert.assertTrue("Malformed debug request", body != null); - if (DEBUG || prop_visual) + if (prop_visual) visual("TestFormBuilder.testsimple.RAW", body); - body = genericize(body, OSTEXT, null, null); - if (DEBUG) - visual("TestFormBuilder.testsimple.LOCALIZED", body); - String diffs = TdsUnitTestCommon.compare("TestFormBuilder.testSimpl", simplebaseline, body); - if (diffs != null) { - System.err.println("TestFormBuilder.testsimple.diffs:\n" + diffs); - Assert.assertTrue("TestFormBuilder.testSimple: ***FAIL", false); - } - } catch (Exception e) { - Assert.assertTrue("***FAIL: " + e.getCause(), false); - if (DEBUG) - e.printStackTrace(); - } - } - - @Test - public void testMultiPart() throws Exception { - // Try to create a tmp file - attach3file = HTTPUtil.fillTempFile("attach3.txt", ATTACHTEXT); - attach3file.deleteOnExit(); - - HTTPSession session = HTTPFactory.newSession(NULLURL); - session.resetInterceptors(); - try { - HTTPFormBuilder builder = buildForm(true); - HttpEntity content = builder.build(); - try (HTTPMethod postMethod = HTTPFactory.Post(session)) { - postMethod.setRequestContent(content); - // Execute, but ignore any problems - try { - postMethod.execute(); - } catch (Exception e) { - // ignore + if (!tc.ismultipart) { // simple form + body = genericize(body, OSTEXT, null, null); + if (prop_visual) + visual("TestFormBuilder.testsimple.LOCALIZED", body); + String diffs = TdsUnitTestCommon.compare("TestFormBuilder.testSimple", simplebaseline, body); + if (diffs != null) { + System.err.println("TestFormBuilder.testsimple.diffs:\n" + diffs); + Assert.assertTrue("TestFormBuilder.testSimple: ***FAIL", false); } - } - // Get the request that was used - HTTPIntercepts.DebugInterceptRequest dbgreq = session.getDebugRequestInterceptor(); - Assert.assertTrue("Could not get debug request", dbgreq != null); - HttpEntity entity = dbgreq.getRequestEntity(); - Assert.assertTrue("Could not get debug entity", entity != null); - // Extract the form info - Header ct = entity.getContentType(); - String body = extract(entity, ct, true); - Assert.assertTrue("Malformed debug request", body != null); - if (DEBUG || prop_visual) - visual("TestFormBuilder.testmultipart.RAW", body); - // Get the contenttype boundary - String boundary = getboundary(ct); - Assert.assertTrue("Missing boundary info", boundary != null); - String attach3 = getattach(body, "attach3"); - Assert.assertTrue("Missing attach3 info", attach3 != null); - body = genericize(body, OSTEXT, boundary, attach3); - if (DEBUG) - visual("TestFormBuilder.testmultipart.LOCALIZED", body); - String diffs = TdsUnitTestCommon.compare("TestFormBuilder.testMultiPart", multipartbaseline, body); - if (diffs != null) { - System.err.println("TestFormBuilder.testmultipart.diffs:\n" + diffs); - Assert.assertTrue("TestFormBuilder.testmultipart: ***FAIL", false); + } else if (tc.ismultipart) { // multi-part form + // Get the contenttype boundary + String boundary = getboundary(ct); + Assert.assertTrue("Missing boundary info", boundary != null); + String attach3 = getattach(body, "attach3"); + Assert.assertTrue("Missing attach3 info", attach3 != null); + body = genericize(body, OSTEXT, boundary, attach3); + if (prop_visual) + visual("TestFormBuilder.testmultipart.LOCALIZED", body); + String diffs = TdsUnitTestCommon.compare("TestFormBuilder.testMultiPart", multipartbaseline, body); + if (diffs != null) { + System.err.println("TestFormBuilder.testmultipart.diffs:\n" + diffs); + Assert.assertTrue("TestFormBuilder.testmultipart: ***FAIL", false); + } + } else { + assert false; } } catch (Exception e) { - Assert.assertTrue("***FAIL: " + e.getCause(), false); - if (DEBUG) - e.printStackTrace(); + e.printStackTrace(); + Assert.assertTrue("***FAIL: " + e, false); } } - protected HTTPFormBuilder buildForm(boolean multipart) throws HTTPException { + static HTTPFormBuilder buildForm(boolean ismultipart, File attach3file) throws HTTPException { HTTPFormBuilder builder = new HTTPFormBuilder(); - - /* - * StringBuffer javaInfo = new StringBuffer(); - * javaInfo.append("Java: home: " + System.getProperty("java.home")); - * javaInfo.append(" version: " + System.getProperty("java.version")) - */ - builder.add("fullName", NAMEENTRY); builder.add("emailAddress", EMAILENTRY); builder.add("organization", ORGENTRY); @@ -188,7 +198,7 @@ protected HTTPFormBuilder buildForm(boolean multipart) throws HTTPException { builder.add("os", OSTEXT); builder.add("hardware", HARDWAREENTRY); - if (multipart) { + if (ismultipart) { // Use bytes builder.add("attachmentOne", EXTRATEXT.getBytes(HTTPUtil.ASCII), "extra.html"); // Use Inputstream diff --git a/tds/src/main/java/thredds/server/catalogservice/CatalogViewContextParser.java b/tds/src/main/java/thredds/server/catalogservice/CatalogViewContextParser.java index 9f555d9967..0ee70acd96 100644 --- a/tds/src/main/java/thredds/server/catalogservice/CatalogViewContextParser.java +++ b/tds/src/main/java/thredds/server/catalogservice/CatalogViewContextParser.java @@ -581,7 +581,7 @@ private void setAccess() { urlString = urlString + ".html"; break; case DAP4: - urlString = urlString + ".dmr.xml"; + urlString = urlString + ".dsr.html"; break; case WCS: queryString = "service=WCS&version=1.0.0&request=GetCapabilities"; diff --git a/tds/src/main/java/thredds/server/dap4/Dap4Controller.java b/tds/src/main/java/thredds/server/dap4/Dap4Controller.java index f601401c00..b1ac877e23 100644 --- a/tds/src/main/java/thredds/server/dap4/Dap4Controller.java +++ b/tds/src/main/java/thredds/server/dap4/Dap4Controller.java @@ -5,135 +5,126 @@ package thredds.server.dap4; -// import dap4.core.data.DSPRegistry; -// import dap4.core.util.DapContext; -// import dap4.core.util.DapException; -// import dap4.core.util.DapUtil; -// import dap4.dap4lib.DapCodes; -// import dap4.dap4lib.DapLog; -// import dap4.servlet.DSPFactory; -// import dap4.servlet.DapCache; -// import dap4.servlet.DapController; -// import dap4.servlet.DapRequest; +import dap4.core.util.DapContext; +import dap4.core.util.DapException; +import dap4.core.util.DapUtil; +import dap4.dap4lib.DapCodes; +import dap4.servlet.DapController; +import dap4.servlet.DapRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import thredds.core.TdsRequestedDataset; -import ucar.nc2.NetcdfFile; -import javax.servlet.ServletContext; +import thredds.server.config.TdsContext; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; @Controller @RequestMapping("/dap4") -public class Dap4Controller { - - // ////////////////////////////////////////////////// - // // Constants - // - // static final boolean DEBUG = false; - // - // static final boolean PARSEDEBUG = false; - // - // // NetcdfDataset enhancement to use: need only coord systems - // // static Set ENHANCEMENT = EnumSet.of(NetcdfDataset.Enhance.CoordSystems); - // - // ////////////////////////////////////////////////// - // // Type Decls - // - // static class Dap4Factory extends DSPFactory { - // - // public Dap4Factory() { - // // For TDS, we only need to register one DSP type: ThreddsDSP. - // // This is because we will always serve only NetcdfFile objects. - // // See D4TSServlet for a multiple registration case. - // DapCache.dspregistry.register(ThreddsDSP.class, DSPRegistry.LAST); - // } - // - // } - // - // static { - // DapCache.setFactory(new Dap4Factory()); - // } +public class Dap4Controller extends DapController { ////////////////////////////////////////////////// - // Spring Elements + // Constants + + static final boolean DEBUG = false; + + static final boolean PARSEDEBUG = false; + + static final String SERVICEID = "/dap4"; + + // NetcdfDataset enhancement to use: need only coord systems + // static Set ENHANCEMENT = EnumSet.of(NetcdfDataset.Enhance.CoordSystems); + + ////////////////////////////////////////////////// + // Instance variables @Autowired - private ServletContext servletContext; + private TdsContext tdscontext; + + ////////////////////////////////////////////////// + // Spring Elements @RequestMapping("**") public void handleRequest(HttpServletRequest req, HttpServletResponse res) throws IOException { - throw new UnsupportedOperationException("DAP4 is not currently functional, but we are working on it!"); - // super.handleRequest(req, res); + // throw new UnsupportedOperationException("DAP4 is not currently functional, but we are working on it!"); + super.handleRequest(req, res); } - // ////////////////////////////////////////////////// - // // Constructor(s) - // - // public Dap4Controller() { - // super(); - // } - // - // ////////////////////////////////////////////////////////// - // - // @Override - // protected void doFavicon(String icopath, DapContext cxt) throws IOException { - // throw new UnsupportedOperationException("Favicon"); - // } - // - // @Override - // protected void doCapabilities(DapRequest drq, DapContext cxt) throws IOException { - // addCommonHeaders(drq); - // OutputStream out = drq.getOutputStream(); - // PrintWriter pw = new PrintWriter(new OutputStreamWriter(out, DapUtil.UTF8)); - // pw.println("Capabilities page not supported"); - // pw.flush(); - // } - // - // @Override - // public long getBinaryWriteLimit() { - // return DEFAULTBINARYWRITELIMIT; - // } - // - // @Override - // public String getServletID() { - // return "dap4"; - // } - // - // // There is a problem Spring under intellij when using mocking. - // // See TestServlet for more info. In any case, if autowiring does - // // not work, then TdsRequestedDataset.getLocationFromRequestPath - // // will fail because it internal DatasetManager value will be null. - // // Autowiring would have set it to non-null. So, check to see if - // // the autowiring worked and if so use - // // TdsRequestedDataset.getLocationFromRequestPath. - // // Otherwise, compute the proper path from the drq.getResourceRoot. - // // This is completely a hack until such time as we can get things - // // to work under Intellij. - // @Override - // public String getResourcePath(DapRequest drq, String location) throws DapException { - // String realpath; - // if (TdsRequestedDataset.getDatasetManager() != null) { - // realpath = TdsRequestedDataset.getLocationFromRequestPath(location); - // } else { - // assert TdsRequestedDataset.getDatasetManager() == null; - // String prefix = drq.getResourceRoot(); - // assert (prefix != null); - // realpath = DapUtil.canonjoin(prefix, location); - // } - // - // if (!TESTING) { - // if (!TdsRequestedDataset.resourceControlOk(drq.getRequest(), drq.getResponse(), realpath)) - // throw new DapException("Not authorized: " + location).setCode(DapCodes.SC_FORBIDDEN); - // } - // File f = new File(realpath); - // if (!f.exists() || !f.canRead()) - // throw new DapException("Not found: " + location).setCode(DapCodes.SC_NOT_FOUND); - // // ncfile = TdsRequestedDataset.getNetcdfFile(this.request, this.response, path); - // return realpath; - // } + ////////////////////////////////////////////////// + // Constructor(s) + + public Dap4Controller() { + super(); + } + + ////////////////////////////////////////////////////////// + + @Override + protected void doFavicon(String icopath, DapContext cxt) throws IOException { + throw new UnsupportedOperationException("Favicon"); + } + + @Override + protected void doCapabilities(DapRequest drq, DapContext cxt) throws IOException { + addCommonHeaders(drq); + OutputStream out = drq.getOutputStream(); + PrintWriter pw = new PrintWriter(new OutputStreamWriter(out, DapUtil.UTF8)); + pw.println("Capabilities page not supported"); + pw.flush(); + } + + @Override + public long getBinaryWriteLimit() { + return DEFAULTBINARYWRITELIMIT; + } + + @Override + public String getServletID() { + String cp = tdscontext.getContextPath(); + if (cp == null || cp.length() == 0) + cp = "dap4"; + StringBuilder id = new StringBuilder(cp); + // Strip any trailing '/' + if (id.charAt(id.length() - 1) == '/') + id.deleteCharAt(id.length()); + // ensure it starts with '/' + if (id.charAt(0) != '/') + id.insert(0, '/'); + return id.toString(); + } + + @Override + public String getWebContentRoot(DapRequest drq) throws DapException { + File root = tdscontext.getServletRootDirectory(); + if (!root.exists() || !root.canRead() || !root.isDirectory()) + throw new DapException("Cannot locate WEB-INF root").setCode(DapCodes.SC_NOT_FOUND); + String rootpath = root.getAbsolutePath() + "/WEB-INF"; + return DapUtil.canonicalpath(rootpath); + } + + /** + * Convert a URL path for a dataset into an absolute file path + * + * @param location suffix of url path + * @return path in a string builder so caller can extend. + * @throws IOException + */ + public String getResourcePath(DapRequest drq, String location) throws DapException { + assert (location.charAt(0) == '/'); + // Remove the leading service name, if any + if (location.startsWith(SERVICEID)) + location = location.substring(SERVICEID.length()); + String path = TdsRequestedDataset.getLocationFromRequestPath(location); + if (path == null || path.length() == 0) + throw new DapException(String.format("getLocationFromRequestPath: location=|%s| path=null", location, path)) + .setCode(DapCodes.SC_NOT_FOUND); + File f = new File(path); + if (!f.exists() || !f.canRead() || !f.isFile()) + throw new DapException("Cannot locate resource: " + location).setCode(DapCodes.SC_NOT_FOUND); + return DapUtil.canonicalpath(path); + } } diff --git a/tds/src/main/java/thredds/server/dap4/ThreddsDSP.java b/tds/src/main/java/thredds/server/dap4/ThreddsDSP.java deleted file mode 100644 index 2fb74c0542..0000000000 --- a/tds/src/main/java/thredds/server/dap4/ThreddsDSP.java +++ /dev/null @@ -1,67 +0,0 @@ -/// * -// * Copyright 1998-2015 the University Corporation for Atmospheric Research/Unidata -// * -// * Portions of this software were developed by the Unidata Program at the -// * University Corporation for Atmospheric Research. -// * -// * Access and use of this software shall impose the following obligations -// * and understandings on the user. The user is granted the right, without -// * any fee or cost, to use, copy, modify, alter, enhance and distribute -// * this software, and any derivative works thereof, and its supporting -// * documentation for any purpose whatsoever, provided that this entire -// * notice appears in all copies of the software, derivative works and -// * supporting documentation. Further, UCAR requests that the user credit -// * UCAR/Unidata in any publications that result from the use of this -// * software or in any product that includes this software. The names UCAR -// * and/or Unidata, however, may not be used in any advertising or publicity -// * to endorse or promote any products or commercial entity unless specific -// * written permission is obtained from UCAR/Unidata. The user also -// * understands that UCAR/Unidata is not obligated to provide the user with -// * any support, consulting, training or assistance of any kind with regard -// * to the use, operation and performance of this software nor to provide -// * the user with any updates, revisions, new versions or "bug fixes." -// * -// * THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR -// * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// * DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL, -// * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING -// * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -// * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -// * WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. -// */ -// -// package thredds.server.dap4; -// -// import dap4.cdm.dsp.CDMDSP; -// import dap4.core.util.DapContext; -// import dap4.core.util.DapException; -// import dap4.core.util.DapUtil; -// import dap4.dap4lib.DapCodes; -// import thredds.core.TdsRequestedDataset; -// import ucar.nc2.NetcdfFile; -// import java.io.File; -// -/// ** -// * CDM->DAP DSP -// * Used (for now) only on server side. -// */ -// -// public class ThreddsDSP extends CDMDSP { -// -// -// ////////////////////////////////////////////////// -// // Instance variables -// -// ////////////////////////////////////////////////// -// // Constructor(s) -// -// public ThreddsDSP() {} -// -// public ThreddsDSP(String path) throws DapException { -// super(path); -// } -// -// ////////////////////////////////////////////////// -// -// } diff --git a/tds/src/main/java/thredds/server/opendap/NcDAS.java b/tds/src/main/java/thredds/server/opendap/NcDAS.java index 0fb32558b5..8383912250 100644 --- a/tds/src/main/java/thredds/server/opendap/NcDAS.java +++ b/tds/src/main/java/thredds/server/opendap/NcDAS.java @@ -146,7 +146,7 @@ private int addAttributes(opendap.dap.AttributeTable table, Variable v, Iterator // add attribute table for this variable while (iter.hasNext()) { Attribute att = (Attribute) iter.next(); - if ((isVbyte && att.getShortName().equalsIgnoreCase(CDM.UNSIGNED)) || Attribute.isspecial(att)) + if ((isVbyte && att.getShortName().equalsIgnoreCase(CDM.UNSIGNED)) || CDM.isspecial(att)) continue; // got this covered int dods_type = DODSNetcdfFile.convertToDODSType(att.getDataType()); diff --git a/tds/src/main/webapp/WEB-INF/altContent/startup/catalog.xml b/tds/src/main/webapp/WEB-INF/altContent/startup/catalog.xml index 80f3c081ff..7845434332 100644 --- a/tds/src/main/webapp/WEB-INF/altContent/startup/catalog.xml +++ b/tds/src/main/webapp/WEB-INF/altContent/startup/catalog.xml @@ -8,7 +8,7 @@ - + diff --git a/tds/src/main/webapp/WEB-INF/templates/dap4.dsr.html.template b/tds/src/main/webapp/WEB-INF/templates/dap4.dsr.html.template new file mode 100644 index 0000000000..422a1552d8 --- /dev/null +++ b/tds/src/main/webapp/WEB-INF/templates/dap4.dsr.html.template @@ -0,0 +1,61 @@ + + + + + + name="title" content="Dataset Services Response"> + + + + +
+

DAP4 Dataset Services

+
+
+ + + +
Dap Version:${DAP_VERSION}
Server Software Version:${DAP_SERVER}
+
+

Dataset: ${DATASET}

+ + + + + + +
Dataset Service + Class + Format + URL + Media Type +
Metadata + DMR + XML + ${URL}.dmr.xml + application/vnd.opendap.dap4.dataset-metadata+xml +
Data + DAP + Binary + ${URL}.dap + application/vnd.opendap.dap4.data +
Services + DSR + XML + ${URL}.dsr.xml + application/vnd.opendap.dap4.dataset-services+xml +
Services + DSR + HTML + ${URL}.dsr.html + application/vnd.opendap.dap4.dataset-services+html +
+ + diff --git a/tds/src/main/webapp/WEB-INF/templates/dap4.dsr.xml.template b/tds/src/main/webapp/WEB-INF/templates/dap4.dsr.xml.template new file mode 100644 index 0000000000..d07474a1a1 --- /dev/null +++ b/tds/src/main/webapp/WEB-INF/templates/dap4.dsr.xml.template @@ -0,0 +1,28 @@ + + + +${DAP_VERSION} +${DAP_SERVER} + + + + + + + + + + + + diff --git a/tds/src/test/content/thredds/catalog.xml b/tds/src/test/content/thredds/catalog.xml index 5c67dae062..bf6175869f 100644 --- a/tds/src/test/content/thredds/catalog.xml +++ b/tds/src/test/content/thredds/catalog.xml @@ -9,7 +9,7 @@ - +