assert newVar.getShortName().equals("titleAsVariable");
assert newVar.getRank() == 0;
assert newVar.getSize() == 1;
assert newVar.getDataType() == DataType.STRING;
Array data = newVar.read();
assert data.getElementType() == String.class;
Object val = data.getObject(0);
assert val instanceof String;
assert val.equals("COADS 1-degree Equatorial Enhanced");
////////////////
newVar = ncfile.findVariable("titleAsVariable2");
assert null != newVar;
assert newVar.getShortName().equals("titleAsVariable2");
assert newVar.getRank() == 0;
assert newVar.getSize() == 1;
assert newVar.getDataType() == DataType.STRING;
data = newVar.read();
assert data.getElementType() == String.class;
val = data.getObject(0);
assert val instanceof String;
assert val.equals("COADS 1-degree Equatorial Enhanced");
///////////////
newVar = ncfile.findVariable("VariableAttribute");
assert null != newVar;
assert newVar.getShortName().equals("VariableAttribute");
assert newVar.getRank() == 1;
assert newVar.getSize() == 2;
assert newVar.getDataType() == DataType.DOUBLE;
data = newVar.read();
assert data.getRank() == 1;
assert data.getSize() == 2;
assert data.getElementType() == double.class;
double[] result = new double[] { 715511.0, 729360.0};
for (int i=0; i<result.length; i++) {
assert result[i] == data.getDouble(i);
}
ncfile.close();
}