Projects >> thredds >>b6f007b9d88cc25eefd1d25c22383685f92101e9

Chunk
Conflicting content
package ucar.nc2.util.net;

import org.junit.Test;
<<<<<<< HEAD
import thredds.catalog.InvCatalogFactory;
import thredds.catalog.InvCatalogImpl;
=======
import thredds.client.catalog.Catalog;
import thredds.client.catalog.builder.CatalogBuilder;
import thredds.client.catalog.tools.CatalogXmlWriter;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
import ucar.httpservices.HTTPFactory;
import ucar.httpservices.HTTPMethod;
import ucar.httpservices.HTTPSession;
Solution content
package ucar.nc2.util.net;

import org.junit.Test;
import thredds.client.catalog.Catalog;
import thredds.client.catalog.builder.CatalogBuilder;
import thredds.client.catalog.tools.CatalogXmlWriter;
import ucar.httpservices.HTTPFactory;
import ucar.httpservices.HTTPMethod;
import ucar.httpservices.HTTPSession;
File
TestStream.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import ucar.httpservices.HTTPMethod;
import ucar.httpservices.HTTPSession;
import ucar.nc2.constants.CDM;
<<<<<<< HEAD
import ucar.unidata.test.util.ThreddsServer;
=======
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

import java.io.IOException;
import java.io.InputStream;
Solution content
import ucar.httpservices.HTTPMethod;
import ucar.httpservices.HTTPSession;
import ucar.nc2.constants.CDM;

import java.io.IOException;
import java.io.InputStream;
File
TestStream.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
    String catalogName = "http://thredds.ucar.edu/thredds/catalog.xml";
    URI catalogURI = new URI(catalogName);

<<<<<<< HEAD
    try {
      try (HTTPMethod m = HTTPFactory.Get(catalogName)) {
=======
    try (HTTPSession client = HTTPFactory.newSession(catalogName)) {
      HTTPMethod m = HTTPFactory.Get(client);
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

        int statusCode = m.execute();
        System.out.printf("status = %d%n", statusCode);
Solution content
    String catalogName = "http://thredds.ucar.edu/thredds/catalog.xml";
    URI catalogURI = new URI(catalogName);

    try (HTTPSession client = HTTPFactory.newSession(catalogName)) {
      HTTPMethod m = HTTPFactory.Get(client);

      int statusCode = m.execute();
      System.out.printf("status = %d%n", statusCode);

      InputStream stream = m.getResponseBodyAsStream();
      CatalogBuilder builder = new CatalogBuilder();
      Catalog cat = builder.buildFromStream(stream, catalogURI);
      CatalogXmlWriter writer = new CatalogXmlWriter();
      writer.writeXML(cat, System.out, false);

    } catch (IOException e) {
      e.printStackTrace();
    }
  }

  @Test
  public void testString() throws URISyntaxException {
    String catalogName = "http://thredds.ucar.edu/thredds/catalog.xml";
    URI catalogURI = new URI(catalogName);

    try (HTTPSession client = HTTPFactory.newSession(catalogName)) {
      HTTPMethod m = HTTPFactory.Get(client);

      int statusCode = m.execute();
      System.out.printf("status = %d%n", statusCode);

      String catAsString = m.getResponseAsString(CDM.UTF8);
      System.out.printf("cat = %s%n", catAsString);

      CatalogBuilder builder = new CatalogBuilder();
      Catalog cat = builder.buildFromString(catAsString, catalogURI);
      CatalogXmlWriter writer = new CatalogXmlWriter();
      writer.writeXML(cat, System.out, false);

    } catch (IOException e) {
      e.printStackTrace();

    }

  }



}
File
TestStream.java
Developer's decision
Manual
Kind of conflict
Other
Chunk
Conflicting content
        int statusCode = m.execute();
        System.out.printf("status = %d%n", statusCode);

<<<<<<< HEAD
        InputStream stream = m.getResponseBodyAsStream();
        InvCatalogFactory reader = InvCatalogFactory.getDefaultFactory(true);

        InvCatalogImpl catalog = reader.readXML(stream, catalogURI);
        catalog.writeXML(System.out);
      }
=======
      InputStream stream = m.getResponseBodyAsStream();
      CatalogBuilder builder = new CatalogBuilder();
      Catalog cat = builder.buildFromStream(stream, catalogURI);
      CatalogXmlWriter writer = new CatalogXmlWriter();
      writer.writeXML(cat, System.out, false);
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

    } catch (IOException e) {
      e.printStackTrace();
Solution content
      int statusCode = m.execute();
      System.out.printf("status = %d%n", statusCode);

      InputStream stream = m.getResponseBodyAsStream();
      CatalogBuilder builder = new CatalogBuilder();
      Catalog cat = builder.buildFromStream(stream, catalogURI);
      CatalogXmlWriter writer = new CatalogXmlWriter();
      writer.writeXML(cat, System.out, false);

    } catch (IOException e) {
      e.printStackTrace();
File
TestStream.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
    String catalogName = "http://thredds.ucar.edu/thredds/catalog.xml";
    URI catalogURI = new URI(catalogName);

<<<<<<< HEAD
    try {
      try (HTTPMethod m = HTTPFactory.Get(catalogName)) {
=======
    try (HTTPSession client = HTTPFactory.newSession(catalogName)) {
      HTTPMethod m = HTTPFactory.Get(client);
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

        int statusCode = m.execute();
        System.out.printf("status = %d%n", statusCode);
Solution content
    String catalogName = "http://thredds.ucar.edu/thredds/catalog.xml";
    URI catalogURI = new URI(catalogName);

    try (HTTPSession client = HTTPFactory.newSession(catalogName)) {
      HTTPMethod m = HTTPFactory.Get(client);

      int statusCode = m.execute();
      System.out.printf("status = %d%n", statusCode);

      String catAsString = m.getResponseAsString(CDM.UTF8);
      System.out.printf("cat = %s%n", catAsString);

      CatalogBuilder builder = new CatalogBuilder();
      Catalog cat = builder.buildFromString(catAsString, catalogURI);
      CatalogXmlWriter writer = new CatalogXmlWriter();
      writer.writeXML(cat, System.out, false);

    } catch (IOException e) {
      e.printStackTrace();

    }

  }



}
File
TestStream.java
Developer's decision
Manual
Kind of conflict
Other
Chunk
Conflicting content
        int statusCode = m.execute();
        System.out.printf("status = %d%n", statusCode);

<<<<<<< HEAD
        String stream = m.getResponseAsString(CDM.UTF8);
        System.out.printf("cat = %s%n", stream);

        InvCatalogFactory reader = InvCatalogFactory.getDefaultFactory(true);
=======
      String catAsString = m.getResponseAsString(CDM.UTF8);
      System.out.printf("cat = %s%n", catAsString);

      CatalogBuilder builder = new CatalogBuilder();
      Catalog cat = builder.buildFromString(catAsString, catalogURI);
      CatalogXmlWriter writer = new CatalogXmlWriter();
      writer.writeXML(cat, System.out, false);
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

        InvCatalogImpl catalog = reader.readXML(stream, catalogURI);
        catalog.writeXML(System.out);
Solution content
      int statusCode = m.execute();
      System.out.printf("status = %d%n", statusCode);

      String catAsString = m.getResponseAsString(CDM.UTF8);
      System.out.printf("cat = %s%n", catAsString);

      CatalogBuilder builder = new CatalogBuilder();
      Catalog cat = builder.buildFromString(catAsString, catalogURI);
      CatalogXmlWriter writer = new CatalogXmlWriter();
      writer.writeXML(cat, System.out, false);
File
TestStream.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
      }
    } catch (IOException e) {
      e.printStackTrace();
<<<<<<< HEAD
=======

>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
    }

  }
Solution content
    } catch (IOException e) {
      e.printStackTrace();

    }

  }
File
TestStream.java
Developer's decision
Version 1
Kind of conflict
Blank
Chunk
Conflicting content
      // special processing for collection: datasets
    } else if (location.startsWith(ucar.nc2.ft.point.collection.CompositeDatasetFactory.SCHEME)) {
      String spec = location.substring(CompositeDatasetFactory.SCHEME.length());
<<<<<<< HEAD
      MFileCollectionManager dcm = MFileCollectionManager.open(spec, spec, null, errlog); // look we dont have a name
=======
      CollectionManager dcm = MFileCollectionManager.open(spec, spec, null, errlog); // LOOK we dont have a name
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
      return CompositeDatasetFactory.factory(location, wantFeatureType, dcm, errlog);
    }
Solution content
      // special processing for collection: datasets
    } else if (location.startsWith(ucar.nc2.ft.point.collection.CompositeDatasetFactory.SCHEME)) {
      String spec = location.substring(CompositeDatasetFactory.SCHEME.length());
      CollectionManager dcm = MFileCollectionManager.open(spec, spec, null, errlog); // LOOK we dont have a name
      return CompositeDatasetFactory.factory(location, wantFeatureType, dcm, errlog);
    }
File
FeatureDatasetFactoryManager.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Variable
Chunk
Conflicting content
    Attribute fillAttribute = null;
    if(HDF5FILL) {
<<<<<<< HEAD
      for (HeaderMessage mess : facade.dobj.messages) {
          if (mess.mtype == MessageType.FillValue) {
              MessageFillValue fvm = (MessageFillValue) mess.messData;
              if (fvm.hasFillValue)
                  vinfo.fillValue = fvm.value;
          } else if (mess.mtype == MessageType.FillValueOld) {
              MessageFillValueOld fvm = (MessageFillValueOld) mess.messData;
              if (fvm.size > 0)
                  vinfo.fillValue = fvm.value;
          }

          Object fillValue = vinfo.getFillValueNonDefault();
          if (fillValue != null) {
              Object defFillValue = vinfo.getFillValueDefault(vinfo.typeInfo.dataType);
              if (!fillValue.equals(defFillValue))
                  fillAttribute = new Attribute(CDM.FILL_VALUE, (Number) fillValue, vinfo.typeInfo.unsigned);
          }
=======
      for(HeaderMessage mess : facade.dobj.messages) {
        if(mess.mtype == MessageType.FillValue) {
          MessageFillValue fvm = (MessageFillValue) mess.messData;
          if(fvm.hasFillValue)
            vinfo.fillValue = fvm.value;

        } else if(mess.mtype == MessageType.FillValueOld) {
          MessageFillValueOld fvm = (MessageFillValueOld) mess.messData;
          if(fvm.size > 0)
            vinfo.fillValue = fvm.value;
        }

        Object fillValue = vinfo.getFillValueNonDefault();
        if(fillValue != null) {
          Object defFillValue = vinfo.getFillValueDefault(vinfo.typeInfo.dataType);
          if(!fillValue.equals(defFillValue))
            fillAttribute = new Attribute(CDM.FILL_VALUE, (Number) fillValue, vinfo.typeInfo.unsigned);
        }
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
      }
    }
Solution content
    Attribute fillAttribute = null;
    if(HDF5FILL) {
      for(HeaderMessage mess : facade.dobj.messages) {
        if(mess.mtype == MessageType.FillValue) {
          MessageFillValue fvm = (MessageFillValue) mess.messData;
          if(fvm.hasFillValue)
            vinfo.fillValue = fvm.value;

        } else if(mess.mtype == MessageType.FillValueOld) {
          MessageFillValueOld fvm = (MessageFillValueOld) mess.messData;
          if(fvm.size > 0)
            vinfo.fillValue = fvm.value;
        }

        Object fillValue = vinfo.getFillValueNonDefault();
        if(fillValue != null) {
          Object defFillValue = vinfo.getFillValueDefault(vinfo.typeInfo.dataType);
          if(!fillValue.equals(defFillValue))
            fillAttribute = new Attribute(CDM.FILL_VALUE, (Number) fillValue, vinfo.typeInfo.unsigned);
        }
      }
    }
File
H5header.java
Developer's decision
Version 1
Kind of conflict
Other
Chunk
Conflicting content
    }
    processSystemAttributes(facade.dobj.messages, v);
    if(HDF5FILL) {
<<<<<<< HEAD
        if (fillAttribute != null && v.findAttribute(CDM.FILL_VALUE) == null)
            v.addAttribute(fillAttribute);
=======
      if(fillAttribute != null && v.findAttribute(CDM.FILL_VALUE) == null)
        v.addAttribute(fillAttribute);
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
    }
    if (vinfo.typeInfo.unsigned)
      v.addAttribute(new Attribute(CDM.UNSIGNED, "true"));
Solution content
    }
    processSystemAttributes(facade.dobj.messages, v);
    if(HDF5FILL) {
      if(fillAttribute != null && v.findAttribute(CDM.FILL_VALUE) == null)
        v.addAttribute(fillAttribute);
    }
    if (vinfo.typeInfo.unsigned)
      v.addAttribute(new Attribute(CDM.UNSIGNED, "true"));
File
H5header.java
Developer's decision
Version 1
Kind of conflict
Other
Chunk
Conflicting content
    return tc.compare(org, copy);
  }

<<<<<<< HEAD

=======
  public interface ObjFilter {
    // if true, compare attribute, else skip comparision
    boolean attCheckOk(Variable v, Attribute att);
    // if true, compare variable, else skip comparision
    boolean varDataTypeCheckOk(Variable v);
  }
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

  static public boolean compareLists(List org, List copy, Formatter f) {
    boolean ok1 = checkContains("first", org, copy, f);
Solution content
    return tc.compare(org, copy);
  }

  public interface ObjFilter {
    // if true, compare attribute, else skip comparision
    boolean attCheckOk(Variable v, Attribute att);
    // if true, compare variable, else skip comparision
    boolean varDataTypeCheckOk(Variable v);
  }

  static public boolean compareLists(List org, List copy, Formatter f) {
File
CompareNetcdf2.java
Developer's decision
Version 2
Kind of conflict
Interface declaration
Chunk
Conflicting content
import org.junit.Test;
import thredds.client.catalog.Dataset;
import thredds.client.catalog.ServiceType;
<<<<<<< HEAD
import thredds.client.catalog.writer.DataFactory;
import ucar.ma2.Array;
import ucar.ma2.Index;
=======
import thredds.client.catalog.tools.DataFactory;
import ucar.ma2.*;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
import ucar.nc2.constants.DataFormatType;
import ucar.nc2.dataset.NetcdfDataset;
import ucar.nc2.util.Misc;
Solution content
import org.junit.Test;
import thredds.client.catalog.Dataset;
import thredds.client.catalog.ServiceType;
import thredds.client.catalog.tools.DataFactory;
import ucar.ma2.*;
import ucar.nc2.constants.DataFormatType;
import ucar.nc2.dataset.NetcdfDataset;
import ucar.nc2.util.Misc;
File
TestHTTP.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
    synchronized public Credentials
    getCredentials(AuthScope scope)
    {
<<<<<<< HEAD
=======
        // Is this still true in httpclient 4.2.x?
        // There appears to be a bug in HttpMethodDirector such that
        // as long as bad credentials are provided, it will keep on
        // calling the credentials provider.  We fix by checking for
        // retry in same way as HttpMethodDirector.processWWWAuthChallenge.
        // After MAX_RETRIES, we force retries to stop.
        // do: AuthState authstate = method.getMethod().getHostAuthState();
        //if(retryCount == 0 && authstate.isAuthAttempted() && authscheme.isComplete()) {
        //    return null; // Stop the retry.
        //}
        //retryCount--;

>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
        if(TESTING) {
            System.err.println("HTTPCachingProvider.getCredentials,arg " + scope.toString());
            System.err.flush();
Solution content
    synchronized public Credentials
    getCredentials(AuthScope scope)
    {
        // Is this still true in httpclient 4.2.x?
        // There appears to be a bug in HttpMethodDirector such that
        // as long as bad credentials are provided, it will keep on
        // calling the credentials provider.  We fix by checking for
        // retry in same way as HttpMethodDirector.processWWWAuthChallenge.
        // After MAX_RETRIES, we force retries to stop.
        // do: AuthState authstate = method.getMethod().getHostAuthState();
        //if(retryCount == 0 && authstate.isAuthAttempted() && authscheme.isComplete()) {
        //    return null; // Stop the retry.
        //}
        //retryCount--;

        if(TESTING) {
            System.err.println("HTTPCachingProvider.getCredentials,arg " + scope.toString());
            System.err.println("HTTPCachingProvider.getCredentials,intern " + this.authscope.toString());
            System.err.flush();
File
HTTPCachingProvider.java
Developer's decision
Concatenation
Kind of conflict
Comment
Chunk
Conflicting content
            System.err.flush();
        }

<<<<<<< HEAD
=======
/* Remove because of redirects
        // Verify that the scope argument "subsumes"
        // this.authscope
        if(!HTTPAuthScope.subsumes(scope, this.authscope))
            throw new InvalidCredentialsException("HTTPCachingProvider: scope :: authscope mismatch");
*/
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
        // See if the credentials have been cached.
        Credentials credentials = checkCache(scope);
        if(credentials != null) {
Solution content
            System.err.flush();
        }

/* Remove because of redirects
        // Verify that the scope argument "subsumes"
        // this.authscope
        if(!HTTPAuthScope.subsumes(scope, this.authscope))
            throw new InvalidCredentialsException("HTTPCachingProvider: scope :: authscope mismatch");
*/
        // See if the credentials have been cached.
        Credentials credentials = checkCache(principal, authscope);
        if(credentials != null) {
File
HTTPCachingProvider.java
Developer's decision
Version 2
Kind of conflict
Comment
Chunk
Conflicting content
            credentials = cp.getCredentials(scope);
            if(credentials == null)
        String scheme = scope.getScheme();
        try {
            if(scheme == null)
<<<<<<< HEAD
                throw new InvalidCredentialsException("HTTPCachingProvider: null scope scheme: " + scope);

            // search for matching authstore entries
            CredentialsProvider cp = this.store.lookup(scope);
            if(cp == null)
                throw new InvalidCredentialsException("HTTPCachingProvider: no credentialsprovider that match Authorization scope:" + scope);

            // Invoke the (real) credentials provider
            // using the incoming parameters
                throw new InvalidCredentialsException("HTTPCachingProvider: cannot obtain credentials");

            // Insert into the credentials cache
            cacheCredentials(scope, credentials);

=======
                throw new InvalidCredentialsException("HTTPCachingProvider: unsupported scheme: " + scope.getScheme());

            // search for matching authstore entries
            List matches = this.store.search(this.principal, this.authscope);
            if(matches.size() == 0)
                throw new InvalidCredentialsException("HTTPCachingProvider: no match for:" + this.authscope);

            // Choose the most restrictive
            HTTPAuthStore.Entry entry = matches.get(0);
            CredentialsProvider provider = entry.provider;

            if(provider == null)
                throw new InvalidCredentialsException("HTTPCachingProvider: no credentials provider provided");

            // Invoke the (real) credentials provider
            // using the incoming parameters
            credentials = provider.getCredentials(scope);
            if(credentials == null)
                throw new InvalidCredentialsException("HTTPCachingProvider: cannot obtain credentials");

            // Insert into the credentials cache
            cacheCredentials(entry.principal, this.authscope, credentials);

>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
            if(TESTING)
                System.err.println("Caching credentials: " + credentials);
Solution content
        String scheme = scope.getScheme();
        try {
            if(scheme == null)
                throw new InvalidCredentialsException("HTTPCachingProvider: unsupported scheme: " + scope.getScheme());

            // search for matching authstore entries
            List matches = this.store.search(this.principal, this.authscope);
            if(matches.size() == 0)
                throw new InvalidCredentialsException("HTTPCachingProvider: no match for:" + this.authscope);

            // Choose the most restrictive
            HTTPAuthStore.Entry entry = matches.get(0);
            CredentialsProvider provider = entry.provider;

            if(provider == null)
                throw new InvalidCredentialsException("HTTPCachingProvider: no credentials provider provided");

            // Invoke the (real) credentials provider
            // using the incoming parameters
            credentials = provider.getCredentials(scope);
            if(credentials == null)
                throw new InvalidCredentialsException("HTTPCachingProvider: cannot obtain credentials");

            // Insert into the credentials cache
            cacheCredentials(entry.principal, this.authscope, credentials);

            if(TESTING)
                System.err.println("Caching credentials: " + credentials);
File
HTTPCachingProvider.java
Developer's decision
Version 2
Kind of conflict
Comment
If statement
Method invocation
Throw statement
Variable
Chunk
Conflicting content
            return credentials;
        } catch (InvalidCredentialsException ice) {
<<<<<<< HEAD
            HTTPSession.log.debug(ice.getMessage());
=======
            HTTPSession.log.error(ice.getMessage());
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
            return null;
        }
    }
Solution content
            return credentials;
        } catch (InvalidCredentialsException ice) {
            HTTPSession.log.error(ice.getMessage());
            return null;
        }
    }
File
HTTPCachingProvider.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
        Auth p = null;
        Credentials old = null;

<<<<<<< HEAD
        for(Auth t : HTTPCachingProvider.cache) {
=======
        for(Triple t : HTTPCachingProvider.cache) {
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
            if(t.scope.equals(scope)) {
                p = t;
                break;
Solution content
                p = t;
        Credentials old = null;

        for(Triple t : HTTPCachingProvider.cache) {
            if(t.scope.equals(scope)) {
                break;
File
HTTPCachingProvider.java
Developer's decision
Version 2
Kind of conflict
For statement
Chunk
Conflicting content
        }
        // walk backward because we are removing entries
        for(int i = HTTPCachingProvider.cache.size() - 1; i >= 0; i--) {
<<<<<<< HEAD
            Auth p = HTTPCachingProvider.cache.get(i);
            if(HTTPAuthUtil.equals(scope, p.scope)) {
=======
            Triple p = HTTPCachingProvider.cache.get(i);
            if(HTTPAuthScope.equivalent(scope, p.scope)) {
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
                if(TESTING) {
                    System.err.println("invalidating: " + p);
                    if(testlist == null)
Solution content
        }
        // walk backward because we are removing entries
        for(int i = HTTPCachingProvider.cache.size() - 1; i >= 0; i--) {
            Triple p = HTTPCachingProvider.cache.get(i);
            if(HTTPAuthScope.equivalent(scope, p.scope)) {
                if(TESTING) {
                    System.err.println("invalidating: " + p);
                    if(testlist == null)
File
HTTPCachingProvider.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Variable
Chunk
Conflicting content
<<<<<<< HEAD
    assert children.size() == 2 : children.size();
    Dataset top = topList.get(0);
    assert top != null;
    List children = top.getDatasets();
=======
    Assert.assertEquals(3, children.size()); // latest + 2

>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
  }

  /*
Solution content
    Dataset top = topList.get(0);
    assert top != null;
    List children = top.getDatasets();
    Assert.assertEquals(3, children.size()); // latest + 2

  }
File
TestTdsDatasetScan.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Chunk
Conflicting content
    }
    assertEquals(7, elements.size());

<<<<<<< HEAD
    XPathExpression xpath2 =
        XPathFactory.instance().compile("//wcs:CoverageOfferingBrief/wcs:name", Filters.element(), null, NS_WCS);
    Element emt = xpath2.evaluateFirst(doc);
    assertEquals("Relative_humidity_height_above_ground", emt.getTextTrim());  // lame
=======
    XPathExpression xpath2 = XPathFactory.instance().compile("//wcs:CoverageOfferingBrief/wcs:name", Filters.element(), null, NS_WCS);
    List names = new ArrayList<>();
    for (Element elem : xpath2.evaluate(doc)) {
      System.out.printf(" %s==%s%n", elem.getName(), elem.getValue());
      names.add(elem.getValue());
    }
    Assert.assertEquals(7, names.size());
    assert names.contains("Relative_humidity_height_above_ground");
    assert names.contains("Pressure_reduced_to_MSL");
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
  }

  @HttpTest(method = Method.GET, path = "/wcs/cdmUnitTest/conventions/coards/sst.mnmean.nc?request=DescribeCoverage&version=1.0.0&service=WCS&coverage=sst")
Solution content
    }
    assertEquals(7, elements.size());

    XPathExpression xpath2 = XPathFactory.instance().compile("//wcs:CoverageOfferingBrief/wcs:name", Filters.element(), null, NS_WCS);
    List names = new ArrayList<>();
    for (Element elem : xpath2.evaluate(doc)) {
      System.out.printf(" %s==%s%n", elem.getName(), elem.getValue());
      names.add(elem.getValue());
    }
    Assert.assertEquals(7, names.size());
    assert names.contains("Relative_humidity_height_above_ground");
    assert names.contains("Pressure_reduced_to_MSL");
  }

  @HttpTest(method = Method.GET, path = "/wcs/cdmUnitTest/conventions/coards/sst.mnmean.nc?request=DescribeCoverage&version=1.0.0&service=WCS&coverage=sst")
File
TestWcsServer.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
    try (NetcdfFile ncfile = TdsRequestedDataset.getNetcdfFile(request, response, datasetPath)) {
      if (ncfile == null) return;

<<<<<<< HEAD
          ncfile.setLocation(datasetPath); // hide where the file is stored
          String cdl = ncfile.toString();
          res.setContentLength(cdl.length());
          pw.write(cdl);
          size = cdl.length();
          break;
        }

        case ncml: {
          res.setContentType(ContentType.xml.getContentHeader());
          PrintWriter pw = res.getWriter();
          ncfile.writeNcML(pw, absPath);
          break;
        }

        case header: {
          res.setContentType(ContentType.binary.getContentHeader());
          res.setHeader("Content-Description", "ncstream");

          OutputStream out = new BufferedOutputStream(res.getOutputStream(), 10 * 1000);
          //WritableByteChannel wbc = Channels.newChannel(out);
          NcStreamWriter ncWriter = new NcStreamWriter(ncfile, ServletUtil.getRequestBase(req));
          size = ncWriter.sendHeader(out);
          out.flush();
          break;
        }

        default: {
          res.setContentType(ContentType.binary.getContentHeader());
          res.setHeader("Content-Description", "ncstream");

          size = 0;
          //WritableByteChannel wbc = Channels.newChannel(out);
          NcStreamWriter ncWriter = new NcStreamWriter(ncfile, ServletUtil.getRequestBase(req));
          String query;
          if(qb.getVar() != null)
              query = qb.getVar();
          else
              query = req.getQueryString();

          if ((query == null) || (query.length() == 0)) {
            res.sendError(HttpServletResponse.SC_BAD_REQUEST, "must have query string");
            return;
          }

          OutputStream out = new BufferedOutputStream(res.getOutputStream(), 10 * 1000);
          query = EscapeStrings.unescapeURLQuery(query);
          StringTokenizer stoke = new StringTokenizer(query, ";"); // need UTF/%decode
          while (stoke.hasMoreTokens()) {
            ParsedSectionSpec cer = ParsedSectionSpec.parseVariableSection(ncfile, stoke.nextToken());
            size += ncWriter.sendData(cer.v, cer.section, out, qb.getCompression());
          }
          out.flush();
        }
      } // end switch on req type

      res.flushBuffer();
      if (showReq)
        System.out.printf("CdmRemoteController ok, size=%s%n", size);
=======
      response.setContentType(ContentType.binary.getContentHeader());
      response.setHeader("Content-Description", "ncstream");
      NcStreamWriter ncWriter = new NcStreamWriter(ncfile, ServletUtil.getRequestBase(request));
      long size = ncWriter.sendHeader(out);
      out.flush();
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

      if (showReq)
        System.out.printf("CdmRemoteController header ok, size=%s%n", size);
Solution content
    try (NetcdfFile ncfile = TdsRequestedDataset.getNetcdfFile(request, response, datasetPath)) {
      if (ncfile == null) return;

      response.setContentType(ContentType.binary.getContentHeader());
      response.setHeader("Content-Description", "ncstream");
      NcStreamWriter ncWriter = new NcStreamWriter(ncfile, ServletUtil.getRequestBase(request));
      long size = ncWriter.sendHeader(out);
      out.flush();

      if (showReq)
        System.out.printf("CdmRemoteController header ok, size=%s%n", size);
File
CdmRemoteController.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
import com.google.common.base.MoreObjects;

<<<<<<< HEAD
import ucar.nc2.stream.NcStreamCompression;
import ucar.nc2.units.DateRange;
import ucar.nc2.units.DateType;
import ucar.nc2.units.TimeDuration;
import ucar.unidata.geoloc.LatLonPoint;
import ucar.unidata.geoloc.LatLonPointImpl;
import ucar.unidata.geoloc.LatLonRect;
=======
import java.util.ArrayList;
import java.util.List;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

/**
 * Parses the query parameters for cdmRemote datasets.
Solution content
import com.google.common.base.MoreObjects;

import java.util.ArrayList;
import java.util.List;

/**
 * Parses the query parameters for cdmRemote datasets.
File
CdmRemoteQueryBean.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
    capabilities, cdl, data, header, ncml
  }

<<<<<<< HEAD
  public enum ResponseType {
    csv, netcdf, ncstream, html, xml
  }

  public enum SpatialSelection {
    all, bb, point, stns
  }

  public enum TemporalSelection {
    all, range, point
  }

  // type of request
  private String req = "";

  // type of response
  private String accept = "";

  // type of compression
  private NcStreamCompression compress = NcStreamCompression.none();

  // comma delimited list of variable names
  private String variables; // (forms) all some
=======
  // raw query parameters
  private String req;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
  private String var;

  // parsed
Solution content
    capabilities, cdl, data, header, ncml
  }

  // raw query parameters
  private String req;
  private String var;

  // parsed
File
CdmRemoteQueryBean.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
    }
    return Double.NaN;
  // parsed
  private RequestType reqType = null;

<<<<<<< HEAD
  boolean hasFatalError() {
    return fatal;
  }

  String getErrorMessage() {
    return errs.toString();
  }

  public LatLonRect getLatLonRect() {
    return (spatialSelection == SpatialSelection.bb) ? llbb : null;
  }

  DateRange getDateRange() {
    return dateRange;
  }

  public LatLonPoint getLatlonPoint() {
    return latlonPoint;
  }

  public DateType getTimePoint() {
    return timePoint;
  }

  public RequestType getRequestType() {
    if (reqType == null) {
      if (req.equalsIgnoreCase("capabilities")) reqType = RequestType.capabilities;
      else if (req.equalsIgnoreCase("cdl")) reqType = RequestType.cdl;
      else if (req.equalsIgnoreCase("data")) reqType = RequestType.data;
      else if (req.equalsIgnoreCase("dataForm")) reqType = RequestType.dataForm;
      else if (req.equalsIgnoreCase("form")) reqType = RequestType.form;
      else if (req.equalsIgnoreCase("header")) reqType = RequestType.header;
      else if (req.equalsIgnoreCase("ncml")) reqType = RequestType.ncml;
      else if (req.equalsIgnoreCase("stations")) reqType = RequestType.stations;
      else reqType = RequestType.data; // default
    }
    return reqType;
  }

  ResponseType getResponseType() {
    if (resType == null) {
      RequestType req = getRequestType();
      if (req == RequestType.capabilities) resType = ResponseType.xml;
      else if (req == RequestType.form) resType = ResponseType.html;
    }

    if (resType == null) {
      if (accept.equalsIgnoreCase("csv")) resType = ResponseType.csv;
      else if (accept.equalsIgnoreCase("ncstream")) resType = ResponseType.ncstream;
      else if (accept.equalsIgnoreCase("netcdf")) resType = ResponseType.netcdf;
      else if (accept.equalsIgnoreCase("xml")) resType = ResponseType.xml;
      else resType = ResponseType.ncstream; // default
    }

    return resType;
  }

  NcStreamCompression getCompression() {
    return compress;
  }

  public void setDeflate(String level) {
    compress = NcStreamCompression.deflate(Integer.parseInt(level));
  }

  SpatialSelection getSpatialSelection() {
    return spatialSelection;
  }


  TemporalSelection getTemporalSelection() {
    return temporalSelection;
  }

   boolean validate() {
    RequestType reqType = getRequestType();
    if (reqType == RequestType.dataForm) {
      fatal = true;
      parseVariablesForm();
      parseSpatialExtentForm();
      parseTemporalExtentForm();

    } else {
      parseSpatialExtent();
      parseTimeExtent();

      if ((spatialSelection == null) && (stn != null))
        spatialSelection = SpatialSelection.stns;
    }
    return !fatal;
  }

  private void parseVariablesForm() {  // from the form
    if (variables == null) {
      errs.format("form must have variables=(all|some)%n");
      fatal = true;
      return;
    }

    if (variables.equalsIgnoreCase("all")) {
      setVar(null);
    }
  }

  private void parseSpatialExtentForm() { // from the form
    if (spatial == null) {
      errs.format("form must have spatial=(all|bb|point|stns)%n");
      fatal = true;
      return;
    }

    if (spatial.equalsIgnoreCase("all")) spatialSelection = SpatialSelection.all;
    else if (spatial.equalsIgnoreCase("bb")) spatialSelection = SpatialSelection.bb;
    else if (spatial.equalsIgnoreCase("point")) spatialSelection = SpatialSelection.point;
    else if (spatial.equalsIgnoreCase("stns")) spatialSelection = SpatialSelection.stns;

    if (spatialSelection == SpatialSelection.bb) {
      parseSpatialExtent();

    } else if (spatialSelection == SpatialSelection.point) {
      double lat = parseLat("latitude", latitude);
      double lon = parseLon("longitude", longitude);
      latlonPoint = new LatLonPointImpl(lat, lon);
    }

  }

  private void parseSpatialExtent() {
    if (bbox != null) {
      String[] s = bbox.split(",");
      if (s.length != 4) {
        errs.format("bbox must have form 'bbox=west,east,south,north'; found 'bbox=%s'%n", bbox);
        fatal = true;
        return;
      }
      west = s[0];
      east = s[1];
      south = s[2];
      north = s[3];
    }

    if ((west != null) || (east != null) || (south != null) || (north != null)) {
      if ((west == null) || (east == null) || (south == null) || (north == null)) {
        errs.format("All edges (west,east,south,north) must be specified; found west=%s east=%s south=%s north=%s %n", west, east, south, north);
        fatal = true;
        return;
      }
      double westd = parseLon("west", west);
      double eastd = parseLon("east", east);
      double southd = parseLat("south", south);
      double northd = parseLat("north", north);

      if (!fatal) {
        llbb = new LatLonRect(new LatLonPointImpl(southd, westd), new LatLonPointImpl(northd, eastd));
        spatialSelection = SpatialSelection.bb;
      }
    }
  }

  private double parseLat(String key, String value) {
    double lat = parseDouble(key, value);
    if (!Double.isNaN(lat)) {
      if ((lat > 90.0) || (lat < -90.0)) {
        errs.format("Illegal param= param='%s=%s' must be between +/- 90.0 %n", key, value);
        lat = Double.NaN;
        fatal = true;
      }
    }
    return lat;
  }

  private double parseLon(String key, String value) {
    return parseDouble(key, value);
  }

  private double parseDouble(String key, String value) {
    value = value.trim();
    try {
      return Double.parseDouble(value);
    } catch (NumberFormatException e) {
      errs.format("Illegal param='%s=%s' must be valid floating point number%n", key, value);
  }

  ////////////////////////////////////////

  private void parseTemporalExtentForm() { // from the form
    if (temporal == null) {
      errs.format("form must have temporal=(all|range|point)%n");
      fatal = true;
      return;
    }

    if (temporal.equalsIgnoreCase("all")) temporalSelection = TemporalSelection.all;
    else if (temporal.equalsIgnoreCase("range")) temporalSelection = TemporalSelection.range;
    else if (temporal.equalsIgnoreCase("point")) temporalSelection = TemporalSelection.point;

    if (temporal.equalsIgnoreCase("range")) {
      try {
        parseTimeExtent();
      } catch (Throwable t) {
        errs.format("badly specified time range");
        fatal = true;
      }
    } else if (temporal.equalsIgnoreCase("point")) {
      timePoint = parseDate("time", time);
    }
  }

  private void parseTimeExtent() {
    DateType startDate = parseDate("time_start", time_start);
    DateType endDate = parseDate("time_end", time_end);
    TimeDuration duration = parseW3CDuration("time_duration", time_duration);

    // no range
    if ((startDate != null) && (endDate != null))
      dateRange = new DateRange(startDate, endDate, null, null);
    else if ((startDate != null) && (duration != null))
      dateRange = new DateRange(startDate, null, duration, null);
    else if ((endDate != null) && (duration != null))
      dateRange = new DateRange(null, endDate, duration, null);

    if (dateRange != null)
      temporalSelection = TemporalSelection.range;
  }


  public DateType parseDate(String key, String value) {
    if (value != null) {
      try {
        return new DateType(value, null, null);
      } catch (java.text.ParseException e) {
        errs.format("Illegal param='%s=%s'  must be valid ISO Date%n", key, value);
        fatal = true;
      }
    }
    return null;
  }

  public TimeDuration parseW3CDuration(String key, String value) {
    if (value != null) {
      try {
        return new TimeDuration(value);
      } catch (java.text.ParseException e) {
        errs.format("Illegal param='%s=%s'  must be valid ISO Duration%n", key, value);
        fatal = true;
      }
    }
    return null;
  }

  /////////////////////////////////////

  public void setAccept(String accept) {
    this.accept = accept;
=======
  public String getReq() {
    return req;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
  }

  public void setReq(String req) {
Solution content
  // parsed
  private RequestType reqType = null;

  public String getReq() {
    return req;
  }

  public void setReq(String req) {
File
CdmRemoteQueryBean.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method signature
Return statement
Chunk
Conflicting content
  /////////////////
  // Properties from tds.properties

<<<<<<< HEAD
  // The values for these properties all come from tds/src/main/template/thredds/server/tds.properties except for
  // "tds.content.root.path", which must be defined on the command line.

=======
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
  @Value("${tds.version}")
  private String webappVersion;
Solution content
  /////////////////
  // Properties from tds.properties

  @Value("${tds.version}")
  private String webappVersion;
File
TdsContext.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
  @Value("${tds.content.startup.path}")
  private String startupContentPath;
<<<<<<< HEAD

  ////////////////////////////////////

  private String webinfPath;

  private File rootDirectory;
  private File contentDirectory;
  private File publicContentDirectory;
  private File tomcatLogDir;

  private File startupContentDirectory;
  //private File iddContentDirectory;
  //private File motherlodeContentDirectory;

  private DescendantFileSource rootDirSource;
  private DescendantFileSource contentDirSource;
  private DescendantFileSource publicContentDirSource;
  private DescendantFileSource startupContentDirSource;
  //private DescendantFileSource iddContentPublicDirSource;
  //private DescendantFileSource motherlodeContentPublicDirSource;

  private FileSource configSource;
  private FileSource publicDocSource;
=======
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

  ////////////////////////////////////
  // set by spring
Solution content
  @Value("${tds.content.startup.path}")
  private String startupContentPath;

  ////////////////////////////////////
  // set by spring
File
TdsContext.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
  @Autowired
  private TdsUpdateConfig tdsUpdateConfig;

<<<<<<< HEAD
  private TdsContext() {
  }

  public void setWebappVersion(String verFull) {
    this.webappVersion = verFull;
  }

  public void setWebappVersionBuildDate(String buildDateString) {
    this.webappVersionBuildDate = buildDateString;
  }

  public void setContentRootPath(String contentRootPath) {
    this.contentRootPath = contentRootPath;
  }

  public String getContentRootPath() {
    return this.contentRootPath;
  }

  public String getContentRootPathAbsolute() {
    File abs = new File(this.contentRootPath);
    return abs.getAbsolutePath();
  }

  public void setContentPath(String contentPath) {
    this.contentPath = contentPath;
  }

  public void setStartupContentPath(String startupContentPath) {
    this.startupContentPath = startupContentPath;
  }

  public void setTdsConfigFileName(String filename) {
    this.tdsConfigFileName = filename;
  }
=======
  private ServletContext servletContext;

  ///////////////////////////////////////////

  private String contextPath;
  private String webappName;
  private String webinfPath;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

  private File rootDirectory;
  private File contentDirectory;
Solution content
  ///////////////////////////////////////////

  @Autowired
  private TdsUpdateConfig tdsUpdateConfig;

  private ServletContext servletContext;
  private String contextPath;
  private String webappName;
  private String webinfPath;

  private File rootDirectory;
  private File contentDirectory;
File
TdsContext.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
    return this.htmlConfig;
  }

<<<<<<< HEAD
  @Override
  public String toString() {
    final StringBuilder sb = new StringBuilder("TdsContext{");
    sb.append("webappName='").append(webappName).append('\'');
    sb.append("\n  contextPath='").append(contextPath).append('\'');
    sb.append("\n  webappVersion='").append(webappVersion).append('\'');
    sb.append("\n  webappVersionBuildDate='").append(webappVersionBuildDate).append('\'');
    sb.append("\n  contentRootPath='").append(contentRootPath).append('\'');
    sb.append("\n  contentPath='").append(contentPath).append('\'');
    sb.append("\n  tdsConfigFileName='").append(tdsConfigFileName).append('\'');
    sb.append("\n  startupContentPath='").append(startupContentPath).append('\'');
    sb.append("\n  webinfPath='").append(webinfPath).append('\'');
    sb.append("\n  rootDirectory=").append(rootDirectory);
    sb.append("\n  contentDirectory=").append(contentDirectory);
    sb.append("\n  publicContentDirectory=").append(publicContentDirectory);
    sb.append("\n  tomcatLogDir=").append(tomcatLogDir);
    sb.append("\n  startupContentDirectory=").append(startupContentDirectory);
    sb.append("\n  rootDirSource=").append(rootDirSource);
    sb.append("\n  contentDirSource=").append(contentDirSource);
    sb.append("\n  publicContentDirSource=").append(publicContentDirSource);
    sb.append("\n  startupContentDirSource=").append(startupContentDirSource);
    sb.append("\n  configSource=").append(configSource);
    sb.append("\n  publicDocSource=").append(publicDocSource);
    sb.append('}');
    return sb.toString();
=======
  public WmsConfig getWmsConfig() {
    return wmsConfig;
  }

  public void setWmsConfig(WmsConfig wmsConfig) {
    this.wmsConfig = wmsConfig;
  }

  public CorsConfig getCorsConfig() { return corsConfig; }


  public TdsUpdateConfig getTdsUpdateConfig() { return tdsUpdateConfig; }

  /////////////////////////////////////////////////////

  // used by MockTdsContextLoader
  public void setContentRootPath(String contentRootPath) {
    this.contentRootPath = contentRootPath;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
  }

}
Solution content
    return this.htmlConfig;
  }

  public WmsConfig getWmsConfig() {
    return wmsConfig;
  }

  public void setWmsConfig(WmsConfig wmsConfig) {
    this.wmsConfig = wmsConfig;
  }

  public CorsConfig getCorsConfig() { return corsConfig; }


  public TdsUpdateConfig getTdsUpdateConfig() { return tdsUpdateConfig; }

  /////////////////////////////////////////////////////

  // used by MockTdsContextLoader
  public void setContentRootPath(String contentRootPath) {
    this.contentRootPath = contentRootPath;
  }

}
File
TdsContext.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method declaration
Method signature
Chunk
Conflicting content
import dap4.servlet.CDMDSP;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
<<<<<<< HEAD
import thredds.server.dataset.TdsRequestedDataset;
import thredds.servlet.DatasetHandler;
=======
import thredds.core.TdsRequestedDataset;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
import ucar.ma2.*;
import ucar.nc2.*;
import ucar.nc2.dataset.*;
Solution content
import dap4.servlet.CDMDSP;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import thredds.core.TdsRequestedDataset;
import ucar.ma2.*;
import ucar.nc2.*;
import ucar.nc2.dataset.*;
File
ThreddsDSP.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
    {
        try {
            path = DapUtil.canonicalpath(location);
<<<<<<< HEAD
            NetcdfFile ncfile = DatasetHandler.getNetcdfFile( request, response, path );
=======
            NetcdfFile ncfile = TdsRequestedDataset.getNetcdfFile(this.request, this.response, null);
//            NetcdfFile ncfile = DatasetHandler.getNetcdfFile(this.request, this.response,location);
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
            return ncfile;
        } catch (Exception e) {
            return null;
Solution content
    {
        try {
            path = DapUtil.canonicalpath(location);
            NetcdfFile ncfile = TdsRequestedDataset.getNetcdfFile(this.request, this.response, null);
//            NetcdfFile ncfile = DatasetHandler.getNetcdfFile(this.request, this.response,location);
            return ncfile;
        } catch (Exception e) {
            return null;
File
ThreddsDSP.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Variable
Chunk
Conflicting content
import thredds.client.catalog.builder.CatalogBuilder;
import thredds.client.catalog.builder.CatalogRefBuilder;
import thredds.client.catalog.builder.DatasetBuilder;
<<<<<<< HEAD
import thredds.client.catalog.writer.CatalogXmlWriter;
import thredds.server.admin.DebugController;
import thredds.server.config.TdsContext;
import thredds.servlet.ThreddsConfig;
import ucar.nc2.constants.CDM;
=======
import thredds.client.catalog.tools.CatalogXmlWriter;
import thredds.server.config.TdsContext;
import thredds.server.config.ThreddsConfig;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
import ucar.nc2.time.CalendarDate;
import ucar.nc2.time.CalendarDateRange;
import ucar.nc2.time.CalendarPeriod;
Solution content
import thredds.client.catalog.builder.CatalogBuilder;
import thredds.client.catalog.builder.CatalogRefBuilder;
import thredds.client.catalog.builder.DatasetBuilder;
import thredds.client.catalog.tools.CatalogXmlWriter;
import thredds.server.admin.DebugCommands;
import thredds.server.config.TdsContext;
import thredds.server.config.ThreddsConfig;
import ucar.nc2.time.CalendarDate;
import ucar.nc2.time.CalendarDateRange;
import ucar.nc2.time.CalendarPeriod;
File
RadarServerController.java
Developer's decision
Manual
Kind of conflict
Import
Chunk
Conflicting content
      // Return the file
      ServletOutputStream out = res.getOutputStream();
<<<<<<< HEAD
      IO.copyFileB(file, out, 60 * 1000);
      /* try (WritableByteChannel cOut = Channels.newChannel(out)) {
        IO.copyFileWithChannels(file, cOut);
        res.flushBuffer();
      } */
      if (debugRequest) log.debug("returnFile(): returnFile ok = " + filename);
=======
      // IO.copyFileB(file, out, 60 * 1000);
      try (WritableByteChannel cOut = Channels.newChannel(out)) {
        IO.copyFileWithChannels(file, cOut);
        res.flushBuffer();
      }
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
    }

    // @todo Split up this exception handling: those from file access vs those from dealing with response
Solution content
      // Return the file
      ServletOutputStream out = res.getOutputStream();
      IO.copyFileB(file, out, 60 * 1000);
      /* try (WritableByteChannel cOut = Channels.newChannel(out)) {
        IO.copyFileWithChannels(file, cOut);
        res.flushBuffer();
      } */
    }

    // @todo Split up this exception handling: those from file access vs those from dealing with response
File
ServletUtil.java
Developer's decision
Combination
Kind of conflict
Comment
Chunk
Conflicting content
import thredds.client.catalog.CatalogRef;
import thredds.client.catalog.Dataset;
import thredds.client.catalog.ThreddsMetadata;
<<<<<<< HEAD
import thredds.client.catalog.writer.CatalogCrawler;
import thredds.client.catalog.writer.DataFactory;
import ucar.httpservices.HTTPSession;
=======
import thredds.client.catalog.tools.CatalogCrawler;
import thredds.client.catalog.tools.DataFactory;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
import ucar.nc2.Group;
import ucar.nc2.NetcdfFile;
import ucar.nc2.constants.FeatureType;
Solution content
import thredds.client.catalog.CatalogRef;
import thredds.client.catalog.Dataset;
import thredds.client.catalog.ThreddsMetadata;
import thredds.client.catalog.tools.CatalogCrawler;
import thredds.client.catalog.tools.DataFactory;
import ucar.nc2.Group;
import ucar.nc2.NetcdfFile;
import ucar.nc2.constants.FeatureType;
File
TestMotherlodeDatasets.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.web.WebAppConfiguration;
<<<<<<< HEAD
import org.springframework.web.servlet.ModelAndView;
=======
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.RequestBuilder;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
import thredds.mock.web.MockTdsContextLoader;
import ucar.unidata.test.util.NeedsContentRoot;
import ucar.unidata.test.util.ThreddsServer;
Solution content
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
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.RequestBuilder;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import thredds.mock.web.MockTdsContextLoader;
File
RemoteCatalogControllerTest.java
Developer's decision
Manual
Kind of conflict
Import
Chunk
Conflicting content
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
<<<<<<< HEAD
@ContextConfiguration(locations = { "/WEB-INF/applicationContext-tdsConfig.xml" }, loader = MockTdsContextLoader.class)
@Category(NeedsContentRoot.class)
public class RemoteCatalogControllerTest extends AbstractCatalogServiceTest{

	//RemoteCatalogRequest parameters:
	private static final String parameterNameCatalog = "catalog";
	private static final String parameterNameCommand = "command";
	private static final String parameterNameDatasetId = "dataset";
	private static final String parameterNameVerbose = "verbose";
	private static final String parameterNameHtmlView = "htmlView";

	//RemoteCatalogRequest commands:
	private static final String cmdShow = "show";
	private static final String cmdSubset = "subset";
	private static final String cmdValidate = "validate";
=======
@ContextConfiguration(locations = {"/WEB-INF/applicationContext.xml", "/WEB-INF/spring-servlet.xml"}, loader = MockTdsContextLoader.class)
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

public class RemoteCatalogControllerTest {
Solution content
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = {"/WEB-INF/applicationContext.xml", "/WEB-INF/spring-servlet.xml"}, loader = MockTdsContextLoader.class)

public class RemoteCatalogControllerTest {
File
RemoteCatalogControllerTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Chunk
Conflicting content
	String htmlContent = "text/html;charset=UTF-8";

	@Test
<<<<<<< HEAD
	public void showCommandTest() throws Exception{
		ThreddsServer.LIVE.assumeIsAvailable();
		// Testing against some reliable remote TDS
		catUriString = "http://thredds.ucar.edu/thredds/catalog.xml";
		request.setRequestURI(catUriString);

		// REQUEST WITH DEFAULT VALUES
		// setting up the request with default values:
		// command =null
		// datasetId=null
		// htmlView= null
		// verbose = null
		request.setParameter(parameterNameCatalog, catUriString);
		request.setParameter(parameterNameCommand, command);
		request.setParameter(parameterNameDatasetId, datasetId);
		request.setParameter(parameterNameHtmlView, htmlView);
		request.setParameter(parameterNameVerbose, verbose);
		
		MockHttpServletResponse response = new MockHttpServletResponse();
		ModelAndView mv = remoteCatalogController.handleAll(request, response);
		// Must be null
		assertNull(mv);
		//and we should have a nice response
		assertTrue(response.getStatus() == 200 );
		
=======
	@Category(NotTravis.class)     // LOOK WTF ???
	public void showCommandTest() throws Exception{

		RequestBuilder rb = MockMvcRequestBuilders.get(path).servletPath(path)
						.param("command", "SHOW")
						.param("catalog", catalog);

		MvcResult result = this.mockMvc.perform( rb )
            .andExpect(MockMvcResultMatchers.status().is(200))
            .andExpect(MockMvcResultMatchers.content().contentType(htmlContent))
            .andReturn();
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

		System.out.printf("showCommandTest status=%d%n", result.getResponse().getStatus());
		System.out.printf("%s%n", result.getResponse().getContentAsString());
Solution content
	String htmlContent = "text/html;charset=UTF-8";

	@Test
	@Category(NotTravis.class)     // LOOK WTF ???
	public void showCommandTest() throws Exception{

		RequestBuilder rb = MockMvcRequestBuilders.get(path).servletPath(path)
						.param("command", "SHOW")
						.param("catalog", catalog);

		MvcResult result = this.mockMvc.perform( rb )
            .andExpect(MockMvcResultMatchers.status().is(200))
            .andExpect(MockMvcResultMatchers.content().contentType(htmlContent))
            .andReturn();

		System.out.printf("showCommandTest status=%d%n", result.getResponse().getStatus());
		System.out.printf("%s%n", result.getResponse().getContentAsString());
File
RemoteCatalogControllerTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Comment
Method invocation
Method signature
Variable
Chunk
Conflicting content
	}

	@Test
<<<<<<< HEAD
	public void subsetCommandTest() throws Exception{
		ThreddsServer.LIVE.assumeIsAvailable();
		// SUBSET REQUEST PROVIDING A datasetId
		// setting up the request with default values:
		// command =null
		// datasetId=FMRC/NCEP/SREF (in motherlode)
		// htmlView= null
		// verbose = null
		// command null and a providing a datasetId becomes in a subset command  
		catUriString = "http://thredds.ucar.edu/thredds/catalog/grib/NCEP/NAM/CONUS_80km/catalog.xml";
		request.setParameter(parameterNameCatalog, catUriString);
		request.setParameter(parameterNameCommand, command);
		request.setParameter(parameterNameDatasetId, "grib/NCEP/NAM/CONUS_80km/Best");
		request.setParameter(parameterNameHtmlView, htmlView);
		request.setParameter(parameterNameVerbose, verbose);
		
		MockHttpServletResponse response = new MockHttpServletResponse();

		ModelAndView mv  = remoteCatalogController.handleAll(request, response);
		// Must be null
		assertNull(mv);
		// and we should have a nice response		
		assertTrue( response.getStatus() == 200 );
=======
	@Category(NotTravis.class)     // LOOK WTF ???
	public void subsetCommandTest() throws Exception{

		RequestBuilder rb = MockMvcRequestBuilders.get(path).servletPath(path)
						.param("command", "SUBSET")
						.param("catalog", catalog)
						.param("dataset", dataset);

		MvcResult result = this.mockMvc.perform( rb )
            .andExpect(MockMvcResultMatchers.status().is(200))
            .andExpect(MockMvcResultMatchers.content().contentType(htmlContent))
            .andReturn();

		System.out.printf("subsetCommandTest status=%d%n", result.getResponse().getStatus());
		System.out.printf("%s%n", result.getResponse().getContentAsString());
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
	}

	@Test
Solution content
	@Test
	}

	@Category(NotTravis.class)     // LOOK WTF ???
	public void subsetCommandTest() throws Exception{

		RequestBuilder rb = MockMvcRequestBuilders.get(path).servletPath(path)
						.param("command", "SUBSET")
						.param("catalog", catalog)
						.param("dataset", dataset);

		MvcResult result = this.mockMvc.perform( rb )
            .andExpect(MockMvcResultMatchers.status().is(200))
            .andExpect(MockMvcResultMatchers.content().contentType(htmlContent))
            .andReturn();

		System.out.printf("subsetCommandTest status=%d%n", result.getResponse().getStatus());
		System.out.printf("%s%n", result.getResponse().getContentAsString());
	}

	@Test
File
RemoteCatalogControllerTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Comment
Method invocation
Method signature
Variable
Chunk
Conflicting content
	}

	@Test
<<<<<<< HEAD
	public void validateCommandTest() throws Exception {
		ThreddsServer.LIVE.assumeIsAvailable();
		// VALIDATE REQUEST 
		// command =validate
		// datasetId= null
		// htmlView= null
		// verbose = null 
    catUriString = "http://thredds.ucar.edu/thredds/catalog/grib/NCEP/NAM/CONUS_80km/catalog.xml";
		request.setParameter(parameterNameCatalog, catUriString);
		request.setParameter(parameterNameCommand, cmdValidate);
		request.setParameter(parameterNameDatasetId, datasetId);
		request.setParameter(parameterNameHtmlView, htmlView);
		request.setParameter(parameterNameVerbose, verbose);		
		MockHttpServletResponse response = new MockHttpServletResponse();

		ModelAndView mv = remoteCatalogController.handleAll(request,response);
		
		assertViewName(mv, "/thredds/server/catalogservice/validationMessage");		
		assertModelAttributeAvailable(mv, "catalogUrl");
		assertModelAttributeAvailable(mv, "message");
=======
	@Category(NotTravis.class)     // LOOK WTF ???
	public void validateCommandTest() throws Exception{

		RequestBuilder rb = MockMvcRequestBuilders.get(path).servletPath(path)
						.param("command", "VALIDATE")
						.param("catalog", catalog)
						.param("dataset", dataset);

		MvcResult result = this.mockMvc.perform( rb )
            .andExpect(MockMvcResultMatchers.status().is(200))
            .andExpect(MockMvcResultMatchers.content().contentType(htmlContent))
            .andReturn();

		System.out.printf("validateCommandTest status=%d%n", result.getResponse().getStatus());
		System.out.printf("%s%n", result.getResponse().getContentAsString());
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
	}

}
Solution content
	}

	@Test
	@Category(NotTravis.class)     // LOOK WTF ???
	public void validateCommandTest() throws Exception{

		RequestBuilder rb = MockMvcRequestBuilders.get(path).servletPath(path)
						.param("command", "VALIDATE")
						.param("catalog", catalog)
						.param("dataset", dataset);

		MvcResult result = this.mockMvc.perform( rb )
            .andExpect(MockMvcResultMatchers.status().is(200))
            .andExpect(MockMvcResultMatchers.content().contentType(htmlContent))
            .andReturn();

		System.out.printf("validateCommandTest status=%d%n", result.getResponse().getStatus());
		System.out.printf("%s%n", result.getResponse().getContentAsString());
	}

}
File
RemoteCatalogControllerTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Comment
Method invocation
Method signature
Variable
Chunk
Conflicting content
/**
 * _defunct for now
 */
<<<<<<< HEAD
public class TestRemoteCatalogRequest extends TestCase
=======
@Category(NotTravis.class)
public class TestRemoteCatalogRequest
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
{
  private String parameterNameCatalog = "catalog";
  private String parameterNameCommand = "command";
Solution content
 */
/**
 * _defunct for now
@Category(NotTravis.class)
public class TestRemoteCatalogRequest
{
  private String parameterNameCatalog = "catalog";
  private String parameterNameCommand = "command";
File
TestRemoteCatalogRequest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Class signature
Chunk
Conflicting content
  private String cmdValidate = "validate";
  private String datasetId = "my/cool/dataset";

<<<<<<< HEAD
  public TestRemoteCatalogRequest( String name )
  {
    super( name );
  }

  @Override
  public void setUp() {
    ThreddsServer.LIVE.assumeIsAvailable();
  }

  public void testCommandDefaultValues()
=======
 /*  public void testCommandDefaultValues()
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
  {
    // Command defaults to SHOW when dataset ID not given:
    //     check that [url=http://** /*.xml, command=null, dataset=null] is
Solution content
  private String cmdValidate = "validate";
  private String datasetId = "my/cool/dataset";

 /*  public void testCommandDefaultValues()
  {
    // Command defaults to SHOW when dataset ID not given:
    //     check that [url=http://** /*.xml, command=null, dataset=null] is
File
TestRemoteCatalogRequest.java
Developer's decision
Version 2
Kind of conflict
Comment
Chunk
Conflicting content
<<<<<<< HEAD
import static org.junit.Assert.assertNotNull;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/WEB-INF/applicationContext-tdsConfig.xml"},loader=MockTdsContextLoader.class)
@Category(NeedsContentRoot.class)
=======
@ContextConfiguration(locations={"/WEB-INF/applicationContext.xml"},loader=MockTdsContextLoader.class)
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
public class TdsContextTest {

	@Autowired
Solution content
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/WEB-INF/applicationContext.xml"},loader=MockTdsContextLoader.class)
public class TdsContextTest {

	@Autowired
File
TdsContextTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Chunk
Conflicting content
package thredds.server.config;

<<<<<<< HEAD
=======
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Solution content
package thredds.server.config;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

import org.junit.Before;
import org.junit.Test;
File
ThreddsConfigTest.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import thredds.mock.web.MockTdsContextLoader;
<<<<<<< HEAD
import thredds.servlet.ThreddsConfig;
import ucar.unidata.test.util.NeedsContentRoot;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/WEB-INF/applicationContext-tdsConfig.xml"},loader=MockTdsContextLoader.class)
@Category(NeedsContentRoot.class)
=======

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/WEB-INF/applicationContext.xml"},loader=MockTdsContextLoader.class)
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
public class ThreddsConfigTest {

  @Autowired
Solution content
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import thredds.mock.web.MockTdsContextLoader;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/WEB-INF/applicationContext.xml"},loader=MockTdsContextLoader.class)
public class ThreddsConfigTest {

  @Autowired
File
ThreddsConfigTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Chunk
Conflicting content
 *
 */
@RunWith(SpringJUnit4ParameterizedClassRunner.class)
<<<<<<< HEAD
@ContextConfiguration(locations = { "/WEB-INF/applicationContext-tdsConfig.xml" }, loader = MockTdsContextLoader.class)
@Category(NeedsContentRoot.class)
=======
@ContextConfiguration(locations = { "/WEB-INF/applicationContext.xml" }, loader = MockTdsContextLoader.class)
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
public class DefaultDateRangeTest {

	private NcssParamsBean requestParams;
Solution content
 *
 */
@RunWith(SpringJUnit4ParameterizedClassRunner.class)
@ContextConfiguration(locations = { "/WEB-INF/applicationContext.xml" }, loader = MockTdsContextLoader.class)
public class DefaultDateRangeTest {

	private NcssParamsBean requestParams;
File
DefaultDateRangeTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Chunk
Conflicting content
package thredds.server.root;

<<<<<<< HEAD
=======
import static org.junit.Assert.assertEquals;

import org.junit.Assert;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
Solution content
package thredds.server.root;

import static org.junit.Assert.assertEquals;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
File
RootControllerTest.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
<<<<<<< HEAD
import thredds.mock.web.MockTdsContextLoader;
import ucar.unidata.test.util.NeedsContentRoot;

import static org.junit.Assert.assertEquals;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/WEB-INF/applicationContext-tdsConfig.xml"},loader=MockTdsContextLoader.class)
@Category(NeedsContentRoot.class)
=======

import thredds.mock.web.MockTdsContextLoader;

import javax.annotation.PostConstruct;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/WEB-INF/applicationContext.xml"},loader=MockTdsContextLoader.class)
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
public class RootControllerTest {

	@Autowired
Solution content
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;

import thredds.mock.web.MockTdsContextLoader;

import javax.annotation.PostConstruct;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/WEB-INF/applicationContext.xml"},loader=MockTdsContextLoader.class)
public class RootControllerTest {

	@Autowired
File
RootControllerTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Import
Chunk
Conflicting content
@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
<<<<<<< HEAD
@ContextConfiguration(locations={"/WEB-INF/applicationContext-tdsConfig.xml"},loader=MockTdsContextLoader.class)
@Category(NeedsContentRoot.class)
public class ServerInfoControllerTest{
=======
@ContextConfiguration(locations = {"/WEB-INF/applicationContext.xml"}, loader = MockTdsContextLoader.class)
public class ServerInfoControllerTest {

  @Autowired
  private WebApplicationContext wac;

  private MockMvc mockMvc;
  private RequestBuilder requestBuilder;


  @Before
  public void setUpTdsContext() {
    mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
  }

  @Test
  public void serverInfoHTMLRequestTest() throws Exception {
    requestBuilder = MockMvcRequestBuilders.get("/info/serverInfo.html");
    MvcResult mvc = this.mockMvc.perform(requestBuilder).andReturn();
    assertEquals(200, mvc.getResponse().getStatus());
    checkModelAndView(mvc.getModelAndView(), "thredds/server/serverinfo/serverInfo_html");
  }

  @Test
  public void serverInfoXMLRequestTest() throws Exception {
    requestBuilder = MockMvcRequestBuilders.get("/info/serverInfo.xml");
    MvcResult mvc = this.mockMvc.perform(requestBuilder).andReturn();
    assertEquals(200, mvc.getResponse().getStatus());
    checkModelAndView(mvc.getModelAndView(), "thredds/server/serverinfo/serverInfo_xml");
  }

  @Test
  public void serverVersionRequestTest() throws Exception {
    requestBuilder = MockMvcRequestBuilders.get("/info/serverVersion.txt");
    MvcResult mvc = this.mockMvc.perform(requestBuilder).andReturn();
    assertEquals(200, mvc.getResponse().getStatus());
    checkModelAndView(mvc.getModelAndView(), "thredds/server/serverinfo/serverVersion_txt");
  }

  private void checkModelAndView(ModelAndView mv, String view) {
    assertViewName(mv, view);
    assertAndReturnModelAttributeOfType(mv, "serverInfo", TdsServerInfo.class);
    assertAndReturnModelAttributeOfType(mv, "webappVersion", String.class);
    assertAndReturnModelAttributeOfType(mv, "webappName", String.class);
    assertAndReturnModelAttributeOfType(mv, "webappVersionBuildDate", String.class);
  }
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b


}
Solution content
@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/WEB-INF/applicationContext.xml"}, loader = MockTdsContextLoader.class)
public class ServerInfoControllerTest {

  @Autowired
  private WebApplicationContext wac;

  private MockMvc mockMvc;
  private RequestBuilder requestBuilder;


  @Before
  public void setUpTdsContext() {
    mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
  }

  @Test
  public void serverInfoHTMLRequestTest() throws Exception {
    requestBuilder = MockMvcRequestBuilders.get("/info/serverInfo.html");
    MvcResult mvc = this.mockMvc.perform(requestBuilder).andReturn();
    assertEquals(200, mvc.getResponse().getStatus());
    checkModelAndView(mvc.getModelAndView(), "thredds/server/serverinfo/serverInfo_html");
  }

  @Test
  public void serverInfoXMLRequestTest() throws Exception {
    requestBuilder = MockMvcRequestBuilders.get("/info/serverInfo.xml");
    MvcResult mvc = this.mockMvc.perform(requestBuilder).andReturn();
    assertEquals(200, mvc.getResponse().getStatus());
    checkModelAndView(mvc.getModelAndView(), "thredds/server/serverinfo/serverInfo_xml");
  }

  @Test
  public void serverVersionRequestTest() throws Exception {
    requestBuilder = MockMvcRequestBuilders.get("/info/serverVersion.txt");
    MvcResult mvc = this.mockMvc.perform(requestBuilder).andReturn();
    assertEquals(200, mvc.getResponse().getStatus());
    checkModelAndView(mvc.getModelAndView(), "thredds/server/serverinfo/serverVersion_txt");
  }

  private void checkModelAndView(ModelAndView mv, String view) {
    assertViewName(mv, view);
    assertAndReturnModelAttributeOfType(mv, "serverInfo", TdsServerInfo.class);
    assertAndReturnModelAttributeOfType(mv, "webappVersion", String.class);
    assertAndReturnModelAttributeOfType(mv, "webappName", String.class);
    assertAndReturnModelAttributeOfType(mv, "webappVersionBuildDate", String.class);
  }


}
File
ServerInfoControllerTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Attribute
Class signature
Method declaration
Chunk
Conflicting content

@RunWith(SpringJUnit4ClassRunner.class)
<<<<<<< HEAD
@ContextConfiguration(locations="/WEB-INF/applicationContext-tdsConfig.xml",  loader = MockTdsContextLoader.class)
@Category(NeedsContentRoot.class)
=======
@ContextConfiguration(locations="/WEB-INF/applicationContext.xml",  loader = MockTdsContextLoader.class)
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
public class ViewControllerTest{
	
	@Autowired
Solution content

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="/WEB-INF/applicationContext.xml",  loader = MockTdsContextLoader.class)
public class ViewControllerTest{
	
	@Autowired
File
ViewControllerTest.java
Developer's decision
Version 2
Kind of conflict
Annotation
Chunk
Conflicting content
 */
package thredds.tds.ethan;

<<<<<<< HEAD
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
=======
import junit.framework.*;

import java.io.*;
import java.util.*;
import java.net.URI;
import java.net.URISyntaxException;

>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
import thredds.client.catalog.*;
import thredds.client.catalog.builder.CatalogBuilder;
import thredds.client.catalog.tools.CatalogCrawler;
Solution content
 */
package thredds.tds.ethan;

import junit.framework.*;

import java.io.*;
import java.util.*;
import java.net.URI;
import java.net.URISyntaxException;

import thredds.client.catalog.*;
import thredds.client.catalog.builder.CatalogBuilder;
import thredds.client.catalog.tools.CatalogCrawler;
File
TestAll.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import ucar.unidata.geoloc.vertical.VerticalTransform;
import ucar.unidata.geoloc.ProjectionImpl;
import ucar.unidata.geoloc.ogc.EPSG_OGC_CF_Helper;
<<<<<<< HEAD
import ucar.unidata.geoloc.vertical.VerticalTransform;
import ucar.unidata.test.util.ThreddsServer;

import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
=======
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

/**
 * _more_
Solution content
import ucar.unidata.geoloc.vertical.VerticalTransform;
import ucar.unidata.geoloc.ProjectionImpl;
import ucar.unidata.geoloc.ogc.EPSG_OGC_CF_Helper;

/**
 * _more_
File
TestAll.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
 * @author edavis
 * @since Feb 15, 2007 10:10:08 PM
 */
<<<<<<< HEAD
public class TestAll extends TestCase
{
  public static Test suite()
  {
=======
public class TestAll extends TestCase {
  public static Test suite() {
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
    TestSuite suite = new TestSuite();

    String tdsTestLevel = System.getProperty("thredds.tds.test.level", "ping-catalogs");
Solution content
 * @author edavis
 * @since Feb 15, 2007 10:10:08 PM
 */
public class TestAll extends TestCase {
  public static Test suite() {
    TestSuite suite = new TestSuite();

    String tdsTestLevel = System.getProperty("thredds.tds.test.level", "ping-catalogs");
File
TestAll.java
Developer's decision
Version 1
Kind of conflict
Class signature
Method signature
Chunk
Conflicting content
    super(name);
  }

<<<<<<< HEAD
  @Override
  protected void setUp()
  {
    ThreddsServer.LIVE.assumeIsAvailable();
    if ( null == System.getProperty( "thredds.tds.test.id"))
      System.setProperty( "thredds.tds.test.id", "crawl-newmlode-8080" );
    if ( null == System.getProperty( "thredds.tds.test.server" ) )
      System.setProperty( "thredds.tds.test.server", "thredds.ucar.edu" );
    if ( null == System.getProperty( "thredds.tds.test.level" ) )
      System.setProperty( "thredds.tds.test.level", "crawl-catalogs" );
    if ( null == System.getProperty( "thredds.tds.test.catalogs" ) )
    {
=======
  protected void setUp() {
    if (null == System.getProperty("thredds.tds.test.id"))
      System.setProperty("thredds.tds.test.id", "crawl-newmlode-8080");
    if (null == System.getProperty("thredds.tds.test.server"))
      System.setProperty("thredds.tds.test.server", "thredds.ucar.edu");
    if (null == System.getProperty("thredds.tds.test.level"))
      System.setProperty("thredds.tds.test.level", "crawl-catalogs");
    if (null == System.getProperty("thredds.tds.test.catalogs")) {
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
      StringBuilder sb = new StringBuilder()
//              .append( "catalog.xml").append( ",")
//              .append( "topcatalog.xml").append( "," )
Solution content
    super(name);
  }

  protected void setUp() {
    if (null == System.getProperty("thredds.tds.test.id"))
      System.setProperty("thredds.tds.test.id", "crawl-newmlode-8080");
    if (null == System.getProperty("thredds.tds.test.server"))
      System.setProperty("thredds.tds.test.server", "thredds.ucar.edu");
    if (null == System.getProperty("thredds.tds.test.level"))
      System.setProperty("thredds.tds.test.level", "crawl-catalogs");
    if (null == System.getProperty("thredds.tds.test.catalogs")) {
      StringBuilder sb = new StringBuilder()
//              .append( "catalog.xml").append( ",")
//              .append( "topcatalog.xml").append( "," )
File
TestAll.java
Developer's decision
Version 2
Kind of conflict
If statement
Method signature
Chunk
Conflicting content
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
<<<<<<< HEAD
import thredds.catalog.InvCatalogFactory;
import thredds.catalog.InvCatalogImpl;
import ucar.unidata.test.util.ThreddsServer;
=======
import thredds.client.catalog.Catalog;
import thredds.client.catalog.builder.CatalogBuilder;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLPeerUnverifiedException;
Solution content
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import thredds.client.catalog.Catalog;
import thredds.client.catalog.builder.CatalogBuilder;

import javax.servlet.http.HttpServletResponse;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLPeerUnverifiedException;
File
TestServerSite.java
Developer's decision
Manual
Kind of conflict
Import
Chunk
Conflicting content
 * @author edavis
 * @since 15 July 2005 15:50:59 -0600
 */
<<<<<<< HEAD
public class TestServerSite extends TestCase
{
  static private org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger( TestServerSite.class );
=======
public class TestServerSite extends TestCase {
  static private org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TestServerSite.class);
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b


  private WebConversation wc;
Solution content
 * @author edavis
 * @since 15 July 2005 15:50:59 -0600
 */
public class TestServerSite extends TestCase {
  static private org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TestServerSite.class);


  private WebConversation wc;
File
TestServerSite.java
Developer's decision
Version 1
Kind of conflict
Attribute
Class signature
Method invocation
Chunk
Conflicting content
    super(name);
  }

<<<<<<< HEAD
  @Override
  protected void setUp()
  {
    ThreddsServer.LIVE.assumeIsAvailable();
=======
  protected void setUp() {
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
    wc = new WebConversation();

    Properties env = System.getProperties();
Solution content
    super(name);
  }

  protected void setUp() {
    wc = new WebConversation();

    Properties env = System.getProperties();
File
TestServerSite.java
Developer's decision
Version 2
Kind of conflict
Method signature
Chunk
Conflicting content
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
<<<<<<< HEAD
import ucar.unidata.test.util.ThreddsServer;

import java.util.Arrays;
import java.util.Collection;
=======

import java.io.IOException;
import java.util.*;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

/**
 * Compare variable names in  "FMRC Run" and "FMRC Raw File" datasets with matching timestamps.
Solution content
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.io.IOException;
import java.util.*;

/**
 * Compare variable names in  "FMRC Run" and "FMRC Raw File" datasets with matching timestamps.
File
CompareGribVarNamesOnMotherlodeTds.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
package thredds.tds.idd;

<<<<<<< HEAD
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import ucar.unidata.test.util.ThreddsServer;
=======
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.Test;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

import java.io.IOException;
import java.util.ArrayList;
Solution content
package thredds.tds.idd;

import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.Test;

import java.io.IOException;
File
CrawlRandomDatasetsOnMotherlodeTds.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import java.util.Collection;
import java.util.List;

<<<<<<< HEAD
/**
 * _more_
 *
 * @author edavis
 * @since 4.0
 */
=======
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
@RunWith(Parameterized.class)
public class CrawlRandomDatasetsOnMotherlodeTds
{
Solution content
import java.util.Collection;
import java.util.List;
import java.util.ArrayList;

@RunWith(Parameterized.class)
public class CrawlRandomDatasetsOnMotherlodeTds
{
File
CrawlRandomDatasetsOnMotherlodeTds.java
Developer's decision
Manual
Kind of conflict
Other
Chunk
Conflicting content
package thredds.tds.idd;

<<<<<<< HEAD
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import ucar.unidata.test.util.ThreddsServer;
=======
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.Test;
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b

import java.io.IOException;
import java.util.Collection;
Solution content
package thredds.tds.idd;

import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.Test;

import java.io.IOException;
import java.util.Collection;
File
PingTdsOnMotherlode8080.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import java.io.IOException;
import java.util.Collection;

<<<<<<< HEAD
/**
 * _more_
 *
 * @author edavis
 * @since 4.0
 */
=======
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
@RunWith(Parameterized.class)
public class PingTdsOnMotherlode8080
{
Solution content
import java.io.IOException;
import java.util.Collection;

@RunWith(Parameterized.class)
public class PingTdsOnMotherlode8080
{
File
PingTdsOnMotherlode8080.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
    }

    @Test
<<<<<<< HEAD
    public void ping()
    {
        ThreddsServer.LIVE.assumeIsAvailable();
=======
    public void ping() throws IOException {
>>>>>>> 360439825c2e82eaeffe8ee05d3f7cb619f5ee3b
        String tdsUrl = "http://thredds.ucar.edu/thredds/";

        CatalogValidityTestUtils.assertCatalogIsAccessibleValidAndNotExpired( tdsUrl + catalogUrl );
Solution content
    }

    @Test
    public void ping() throws IOException {
        String tdsUrl = "http://thredds.ucar.edu/thredds/";

        CatalogValidityTestUtils.assertCatalogIsAccessibleValidAndNotExpired( tdsUrl + catalogUrl );
File
PingTdsOnMotherlode8080.java
Developer's decision
Version 2
Kind of conflict
Method signature