Exemple #1
0
        //Test that if the data is modified then it is corretly saved and read from disk
        //tests read and write
        public void TestSerializeDeserialize()
        {
            string testDataPath = _testDataDirectory + Path.DirectorySeparatorChar + @"prevwsdl-serialize-deserialize.txt";

            Assert.IsTrue(File.Exists(testDataPath));

            //first read in and check data
            var storage = new pickle.Pickler(testDataPath);
            var config  = new model.Config.PrevWsdls(5);

            storage.Load(config);

            Assert.AreEqual(config.WsdlList[0], @"http://*****:*****@"file://C:\service2.wsdl");
            Assert.AreEqual(config.WsdlList[2], @"http://*****:*****@"file://C:\service4.wsdl");
            Assert.AreEqual(config.WsdlList[4], @"http://*****:*****@"http://localhost:5555/service5.svc?wsdl");
            config.Add(@"file://*****:*****@"http://localhost:3333/service3.svc?wsdl");
            config.Add(@"file://*****:*****@"http://localhost:1111/service1.svc?wsdl");
            storage.Save(config);
        }
Exemple #2
0
        public void Save()
        {
            var storageProxy        = new pickle.Pickler(GetExePath() + _configProxyPath);
            var storageTimeout      = new pickle.Pickler(GetExePath() + _configTimeoutPath);
            var storagePrevWsdl     = new pickle.Pickler(GetExePath() + _configPrevWsdlPath);
            var storagePrevUrl      = new pickle.Pickler(GetExePath() + _configPrevUrlPath);
            var storageUpdate       = new pickle.Pickler(GetExePath() + _configUpdatePath);
            var storageStartupWsdls = new pickle.Pickler(GetExePath() + _configStartupWsdlsPath);

            storageTimeout.Save(ConfigTimeout);
            storageProxy.Save(ConfigProxy);
            if (Mode == ProjectMode.MultipleWsdl)
            {
                storagePrevWsdl.Save(ConfigPrevWsdls);
                storagePrevUrl.Save(ConfigPrevUrls);
                storageUpdate.Save(ConfigUpdate);
                storageStartupWsdls.Save(ConfigStartupWsdls);
            }
        }
Exemple #3
0
        //Test that if the data is modified then it is corretly saved and read from disk
        //tests read and write
        public void TestSerializeDeserialize()
        {
            string testDataPath = _testDataDirectory + Path.DirectorySeparatorChar + @"proxy-serialize-deserialize.txt";

            Assert.IsTrue(File.Exists(testDataPath));

            //first test that data is correcly read in from disk
            var storageProxy = new pickle.Pickler(testDataPath);
            var configProxy  = new model.Config.Proxy();

            storageProxy.Load(configProxy);

            Assert.AreEqual(configProxy.Port, 1234);
            Assert.AreEqual(configProxy.Host, "123.4.5.6");
            Assert.AreEqual(configProxy.ProxyType, Drexyia.WebSvc.Model.Proxy.EProxyType.Disabled);
            Assert.AreEqual(configProxy.Modified, false);

            //modify data and serialize back to file
            configProxy.Port      = 5678;
            configProxy.Host      = "111.2.3.4";
            configProxy.ProxyType = Drexyia.WebSvc.Model.Proxy.EProxyType.Enabled;
            storageProxy.Save(configProxy);

            //read in the data again and check the values
            storageProxy = new pickle.Pickler(testDataPath);
            configProxy  = new model.Config.Proxy();
            storageProxy.Load(configProxy);

            Assert.AreEqual(configProxy.Port, 5678);
            Assert.AreEqual(configProxy.Host, "111.2.3.4");
            Assert.AreEqual(configProxy.ProxyType, Drexyia.WebSvc.Model.Proxy.EProxyType.Enabled);
            Assert.AreEqual(configProxy.Modified, false);

            //set the settings back to initial so that tests can run again
            configProxy.Port      = 1234;
            configProxy.Host      = "123.4.5.6";
            configProxy.ProxyType = Drexyia.WebSvc.Model.Proxy.EProxyType.Disabled;
            storageProxy.Save(configProxy);
        }
Exemple #4
0
        public void TestSerializeDeserialize()
        {
            string testDataPath = _testDataDirectory + Path.DirectorySeparatorChar + @"prevwsdl-serialize-deserialize.txt";

            Assert.IsTrue(File.Exists(testDataPath));

            //first read in and check data
            var storage = new pickle.Pickler(testDataPath);
            var config = new model.Config.PrevWsdls(5);
            storage.Load(config);

            Assert.AreEqual(config.WsdlList[0], @"http://*****:*****@"file://C:\service2.wsdl");
            Assert.AreEqual(config.WsdlList[2], @"http://*****:*****@"file://C:\service4.wsdl");
            Assert.AreEqual(config.WsdlList[4], @"http://*****:*****@"http://localhost:5555/service5.svc?wsdl");
            config.Add(@"file://*****:*****@"http://localhost:3333/service3.svc?wsdl");
            config.Add(@"file://*****:*****@"http://localhost:1111/service1.svc?wsdl");
            storage.Save(config);
        }
Exemple #5
0
        public void Save()
        {
            var storageProxy = new pickle.Pickler(GetExePath() + _configProxyPath);
            var storageTimeout = new pickle.Pickler(GetExePath() + _configTimeoutPath);
            var storagePrevWsdl = new pickle.Pickler(GetExePath() + _configPrevWsdlPath);
            var storagePrevUrl = new pickle.Pickler(GetExePath() + _configPrevUrlPath);
            var storageUpdate = new pickle.Pickler(GetExePath() + _configUpdatePath);
            var storageStartupWsdls = new pickle.Pickler(GetExePath() + _configStartupWsdlsPath);

            storageTimeout.Save(ConfigTimeout);
            storageProxy.Save(ConfigProxy);
            if (Mode == ProjectMode.MultipleWsdl) {
                storagePrevWsdl.Save(ConfigPrevWsdls);
                storagePrevUrl.Save(ConfigPrevUrls);
                storageUpdate.Save(ConfigUpdate);
                storageStartupWsdls.Save(ConfigStartupWsdls);
            }
        }