Esempio n. 1
0
        public void UpdateProcessOfferings()
        {
            WpsProvider provider = CreateProvider("test-wps-1-sync", "test provider 1", "http://dem.terradue.int:8080/wps/WebProcessingService", false);

            provider.AddTag("mytag1");
            List <WpsProcessOffering> services = provider.GetWpsProcessOfferingsFromRemote();

            Assert.AreEqual(1, services.Count());
            var service = services[0];

            foreach (var s in services)
            {
                s.Store();
            }
            Assert.True(!string.IsNullOrEmpty(service.Tags) && service.Tags.Contains("mytag1"));
            provider.AddTag("mytag2");//mytag2 is added only for new services
            provider.UpdateProcessOfferings();
            Assert.True(!string.IsNullOrEmpty(service.Tags) && service.Tags.Contains("mytag1") && !service.Tags.Contains("mytag2"));
            service.Delete();
            provider.UpdateProcessOfferings();
            EntityList <WpsProcessOffering> dbProcesses = provider.GetWpsProcessOfferings(false);

            Assert.AreEqual(1, dbProcesses.Count());
            service = dbProcesses.Items.First();
            Assert.True(!string.IsNullOrEmpty(service.Tags) && service.Tags.Contains("mytag1") && service.Tags.Contains("mytag2"));
            provider.Delete();
        }
Esempio n. 2
0
        public void GetProcessOfferingEntityList()
        {
            WpsProvider        provider = CreateProvider("test-wps-1", "test provider 1", "http://dem.terradue.int:8080/wps/WebProcessingService", false);
            WpsProcessOffering process  = CreateProcess(provider, "com.test.provider.1", "test provider 1", false);

            process.Store();
            Assert.IsFalse(process.Available);
            WpsProvider        provider2 = CreateProvider("test-wps-2", "test provider 2", "http://dem.terradue.int:8080/wps/WebProcessingService", false);
            WpsProcessOffering process2  = CreateProcess(provider2, "com.test.provider.2", "test provider 2", false);

            process2.Store();
            Assert.IsFalse(process2.Available);
            EntityList <WpsProcessOffering> processes = provider.GetWpsProcessOfferings(false);

            Assert.That(processes.Count == 1);
            provider.Delete();
            provider2.Delete();
        }