private static String setupDatasetWithServiceNameAttribute() {
   StringBuilder sb =
       new StringBuilder()
           .append("<dataset name='ds1' ID='DS1' urlPath='dir/file1.nc' serviceName='odap' />");
   return CatalogXmlUtils.wrapThreddsXmlInCatalogWithCompoundService(
       sb.toString(), null, null, null);
 }
 private static String setupDatasetWithServiceNameInChildElement() {
   StringBuilder sb =
       new StringBuilder()
           .append("<dataset name='ds1' ID='DS1' urlPath='dir/file1.nc'>")
           .append("    <serviceName>odap</serviceName>")
           .append("</dataset>");
   return CatalogXmlUtils.wrapThreddsXmlInCatalogWithCompoundService(
       sb.toString(), null, null, null);
 }
 private static String setupDatasetNotInheritingServiceNameFromParentAuthorityAttribute() {
   StringBuilder sb =
       new StringBuilder()
           .append("<dataset name='ds1' ID='DS1' urlPath='dir/file1.nc' serviceName='odap'>")
           .append("  <dataset name='dataset 2' ID='DS2' />")
           .append("</dataset>");
   return CatalogXmlUtils.wrapThreddsXmlInCatalogWithCompoundService(
       sb.toString(), null, null, null);
 }
 private static String setupDatasetAccessWithInheritedMetadataServiceNameElement() {
   StringBuilder sb =
       new StringBuilder()
           .append("<dataset name='ds1' ID='DS1'>")
           .append("  <metadata inherited='true'>")
           .append("    <serviceName>odap</serviceName>")
           .append("  </metadata>")
           .append("  <access urlPath='dir/file1.nc' />")
           .append("</dataset>");
   return CatalogXmlUtils.wrapThreddsXmlInCatalogWithCompoundService(
       sb.toString(), null, null, null);
 }
 private static String setupDatasetOverridingInheritedServiceNameWithAttribute() {
   StringBuilder sb =
       new StringBuilder()
           .append("<dataset name='ds1' ID='DS1' urlPath='dir/file1.nc'>")
           .append("  <metadata inherited='true'>")
           .append("    <serviceName>odap</serviceName>")
           .append("  </metadata>")
           .append("  <dataset name='ds2' ID='DS2' urlPath='dir/file2.nc' serviceName='wcs' />")
           .append("</dataset>");
   return CatalogXmlUtils.wrapThreddsXmlInCatalogWithCompoundService(
       sb.toString(), null, null, null);
 }
 private static String setupDatasetNotInheritingServiceNameFromParentMetadataElement() {
   StringBuilder sb =
       new StringBuilder()
           .append("<dataset name='ds1' ID='DS1' urlPath='dir/file1.nc'>")
           .append("  <metadata>")
           .append("    <serviceName>odap</serviceName>")
           .append("  </metadata>")
           .append("  <dataset name='dataset 2' ID='DS2' />")
           .append("</dataset>");
   return CatalogXmlUtils.wrapThreddsXmlInCatalogWithCompoundService(
       sb.toString(), null, null, null);
 }