コード例 #1
0
  @Test
  public void checkDatasetWithServiceNameInMetadataElement()
      throws URISyntaxException, ThreddsXmlParserException {
    String docBaseUriString =
        "http://test/thredds/catalog2/xml/parser/ServiceNameInheritanceTest/metadataElement.xml";
    URI docBaseUri = new URI(docBaseUriString);
    String catalogAsString = setupDatasetWithServiceNameInMetadataElement();

    CatalogBuilder catBuilder =
        CatalogXmlUtils.parseCatalogIntoBuilder(docBaseUri, catalogAsString);

    CatalogXmlUtils.assertCatalogWithCompoundServiceAsExpected(catBuilder, docBaseUri, null);
    assertDatasetOneHasOdapAccess(catBuilder);
  }
コード例 #2
0
  @Test
  public void checkDatasetNotInheritingServiceNameFromParentAuthorityAttribute()
      throws URISyntaxException, ThreddsXmlParserException {
    String docBaseUriString =
        "http://test/thredds/catalog2/xml/parser/ServiceNameInheritanceTest/notInheritAttribute.xml";
    URI docBaseUri = new URI(docBaseUriString);
    String catalogAsString = setupDatasetNotInheritingServiceNameFromParentAuthorityAttribute();

    CatalogBuilder catBuilder =
        CatalogXmlUtils.parseCatalogIntoBuilder(docBaseUri, catalogAsString);

    CatalogXmlUtils.assertCatalogWithCompoundServiceAsExpected(catBuilder, docBaseUri, null);
    assertDatasetOneHasOdapAccess(catBuilder);
    assertDatasetTwoHasNoAccess(catBuilder);
  }
コード例 #3
0
 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);
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
 }
コード例 #7
0
 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);
 }
コード例 #8
0
 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);
 }