Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 6b4c34a2

Přidáno uživatelem Eliška Mourycová před více než 3 roky(ů)

Re #8836. Added XML protocol building / parsing.

Zobrazit rozdíly:

Server/ServerApp/Program.cs
1 1
using ServerApp.Connection;
2
using ServerApp.Connection.XMLProtocolHandler;
2 3
using ServerApp.DataDownload;
3 4
using ServerApp.Parser.Parsers;
4 5
using ServerApp.Predictor;
......
46 47
			//DataParser p = new DataParser("data/");
47 48
			//p.Parse();
48 49

  
49

  
50
			#region UNCOMMENT
50 51
			//test scenario -data download:
51 52
			DataDownloader dd = new DataDownloader(config.DataRootDir, config.DataWebsite, config.DownloadedFilesNaming);
52 53
			dd.OverwriteExisting = false;
53 54
			List<string> savedFiles = new List<string>();
54
			savedFiles.AddRange(dd.DownloadData(DataType.JIS, DataFormat.CSV, new Date(1, 2019), new Date(12, 2020)));
55
			savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, new Date(1, 2017), new Date(12, 2020)));
56
			savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, new Date(1, 2017), new Date(12, 2020)));
55
			savedFiles.AddRange(dd.DownloadData(DataType.JIS, DataFormat.CSV, new DataDownload.Date(1, 2019), new DataDownload.Date(12, 2020)));
56
			savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, new DataDownload.Date(1, 2017), new DataDownload.Date(12, 2020)));
57
			savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, new DataDownload.Date(1, 2017), new DataDownload.Date(12, 2020)));
57 58

  
58 59

  
59 60

  
......
69 70
				Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value);
70 71
			}
71 72

  
72
			List<string> retrievedData = dd.GetData(dd.DataSubDirectories[DataType.JIS], new Date(10, 2019), new Date(12, 2020));
73
			List<string> retrievedData = dd.GetData(dd.DataSubDirectories[DataType.JIS], new DataDownload.Date(10, 2019), new DataDownload.Date(12, 2020));
73 74
			Console.WriteLine("Retrieved data: ");
74 75
			foreach (string s in retrievedData)
75 76
			{
......
79 80
			// test - connection:
80 81
			ConnectionListener cl = new ConnectionListener(int.Parse(config.Port));
81 82
			cl.StartListening();
83
			#endregion
84

  
85
			#region XML_TEST
86
			//Response response = Response.Randomize();
87
			//var xml = XmlCommunication.Serialize(response);
88
			//Console.WriteLine(xml);
89
			//Response responseDeserialized = XmlCommunication.Deserialize(response, xml);
90

  
91
			//Console.WriteLine("------");
92

  
93

  
94
			//Request request = Request.Randomize();
95
			//xml = XmlCommunication.Serialize(request);
96
			//Console.WriteLine(xml);
97
			//Request requestDeserialized = XmlCommunication.Deserialize(request, xml);
98
			#endregion
99

  
100

  
101

  
82 102

  
83 103
			Console.ReadLine();
84 104
        }

Také k dispozici: Unified diff