Ejemplo n.º 1
0
        public async Task GetLocalPathsForMissingDS()
        {
            var repro = BuildRepro("ExistingFileInExistingDataset");

            BuildDatset(repro, "ds1", "f1.root", "f2.root");
            var place = new PlaceLocalWindowsDisk("test", repro);
            var files = (await place.GetLocalFileLocationsAsync(new Uri[] { new Uri("gridds://ds3/f2.root") })).ToArray();
        }
Ejemplo n.º 2
0
        public async Task GetLocalPathsForDSFiles()
        {
            var repro = BuildRepro("ExistingFileInExistingDataset");

            BuildDatset(repro, "ds1", "f1.root", "f2.root");
            var place = new PlaceLocalWindowsDisk("test", repro);
            var files = await place.GetLocalFileLocationsAsync(new Uri[] { new Uri("gridds://ds1/f1.root"), new Uri("gridds://ds1/f2.root") });

            Assert.AreEqual(2, files.Count());
            foreach (var f in files)
            {
                Assert.IsTrue(new FileInfo(f.LocalPath).Exists);
            }
        }
Ejemplo n.º 3
0
        public async Task TestUNCLocation()
        {
            // Create a UNC repro
            string uncRoot = File.ReadLines("location_test_unc.txt").First();
            var    repro1  = new DirectoryInfo(uncRoot);

            if (repro1.Exists)
            {
                repro1.Delete(true);
            }
            repro1.Create();
            repro1.Refresh();

            // Now build a dataset there.
            BuildDatset(repro1, "ds1", "f1.root", "f2.root");
            var place1 = new PlaceLocalWindowsDisk("test1", repro1);
            var files  = (await place1.GetLocalFileLocationsAsync(new[] { new Uri("gridds://ds1/f1.root") })).ToArray();

            Assert.AreEqual(1, files.Length);
            Assert.AreEqual($"{uncRoot}\\ds1\\files\\f1.root", files[0].LocalPath);
        }