1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064
|
//
// FileWebRequestTest.cs - NUnit Test Cases for System.Net.FileWebRequest
//
// Authors:
// Lawrence Pit (loz@cable.a2000.nl)
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Gert Driesen (drieseng@users.sourceforge.net)
//
// (C) 2003 Martin Willemoes Hansen
//
using System;
using System.Collections;
using System.IO;
using System.Net;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters;
using System.Runtime.Serialization.Formatters.Binary;
using System.Security;
using System.Security.Permissions;
using NUnit.Framework;
#if TARGET_JVM
using System.Globalization;
using System.Reflection;
#endif
namespace MonoTests.System.Net
{
[TestFixture]
public class FileWebRequestTest
{
private string _tempDirectory;
private string _tempFile;
private Uri _tempFileUri;
[SetUp]
public void SetUp ()
{
_tempDirectory = Path.Combine (Path.GetTempPath (), "MonoTests.System.Net.FileWebRequestTest");
_tempFile = Path.Combine (_tempDirectory, "FileWebRequestTest.tmp");
if (!Directory.Exists (_tempDirectory)) {
Directory.CreateDirectory (_tempDirectory);
} else {
// ensure no files are left over from previous runs
string [] files = Directory.GetFiles (_tempDirectory, "*");
foreach (string file in files)
File.Delete (file);
}
_tempFileUri = GetTempFileUri ();
}
[TearDown]
public void TearDown ()
{
if (Directory.Exists (_tempDirectory))
Directory.Delete (_tempDirectory, true);
}
[Test]
public void Async ()
{
WebResponse res = null;
try {
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
req.Method = "PUT";
req.ContentLength = 1;
req.ContentType = "image/png";
req.Timeout = 2 * 1000;
IAsyncResult async = req.BeginGetRequestStream (null, null);
try {
req.BeginGetRequestStream (null, null);
Assert.Fail ("#1 should've failed");
} catch (InvalidOperationException) {
// Cannot re-call BeginGetRequestStream/BeginGetResponse while
// a previous call is still in progress
}
try {
req.GetRequestStream ();
Assert.Fail ("#3 should've failed");
} catch (InvalidOperationException) {
// Cannot re-call BeginGetRequestStream/BeginGetResponse while
// a previous call is still in progress
}
using (Stream wstream = req.EndGetRequestStream (async)) {
Assert.IsFalse (wstream.CanRead, "#1r");
Assert.IsTrue (wstream.CanWrite, "#1w");
Assert.IsTrue (wstream.CanSeek, "#1s");
wstream.WriteByte (72);
wstream.WriteByte (101);
wstream.WriteByte (108);
wstream.WriteByte (108);
wstream.WriteByte (111);
wstream.Close ();
}
Assert.AreEqual (1, req.ContentLength, "#1cl");
Assert.AreEqual ("image/png", req.ContentType, "#1ct");
// stream written
req = (FileWebRequest) WebRequest.Create (_tempFileUri);
res = req.GetResponse ();
try {
req.BeginGetRequestStream (null, null);
Assert.Fail ("#20: should've failed");
} catch (InvalidOperationException) {
// Cannot send a content-body with this verb-type
}
try {
req.Method = "PUT";
req.BeginGetRequestStream (null, null);
Assert.Fail ("#21: should've failed");
} catch (InvalidOperationException) {
// This operation cannot be perfomed after the request has been submitted.
}
req.GetResponse ();
IAsyncResult async2 = req.BeginGetResponse (null, null);
// this succeeds !!
WebResponse res2 = req.EndGetResponse (async2);
Assert.AreSame (res, res2, "#23");
Assert.AreEqual (5, res.ContentLength, "#2 len");
Assert.AreEqual ("application/octet-stream", res.ContentType, "#2 type");
Assert.AreEqual ("file", res.ResponseUri.Scheme, "#2 scheme");
Stream rstream = res.GetResponseStream ();
Assert.IsTrue (rstream.CanRead, "#3r");
Assert.IsFalse (rstream.CanWrite, "#3w");
Assert.IsTrue (rstream.CanSeek, "#3s");
Assert.AreEqual (72, rstream.ReadByte (), "#4a");
Assert.AreEqual (101, rstream.ReadByte (), "#4b");
Assert.AreEqual (108, rstream.ReadByte (), "#4c");
Assert.AreEqual (108, rstream.ReadByte (), "#4d");
Assert.AreEqual (111, rstream.ReadByte (), "#4e");
rstream.Close ();
try {
long len = res.ContentLength;
Assert.AreEqual ((long) 5, len, "#5");
} catch (ObjectDisposedException) {
Assert.Fail ("#disposed contentlength");
}
try {
WebHeaderCollection w = res.Headers;
} catch (ObjectDisposedException) {
Assert.Fail ("#disposed headers");
}
try {
res.Close ();
} catch (ObjectDisposedException) {
Assert.Fail ("#disposed close");
}
} finally {
if (res != null)
res.Close ();
}
}
[Test]
[Category ("NotWorking")] // bug #323388
public void Async_GetResponse_Failure ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
req.Method = "PUT";
req.ContentLength = 1;
req.ContentType = "image/png";
req.Timeout = 500;
IAsyncResult async = req.BeginGetRequestStream (null, null);
try {
req.GetResponse ();
Assert.Fail ("#1");
} catch (WebException) {
// The operation has timed out
}
try {
req.BeginGetResponse (null, null);
Assert.Fail ("#2");
} catch (InvalidOperationException) {
// Cannot re-call BeginGetRequestStream/BeginGetResponse while
// a previous call is still in progress
}
using (Stream wstream = req.EndGetRequestStream (async)) {
wstream.WriteByte (72);
}
// the temp file should not be in use
Directory.Delete (_tempDirectory, true);
}
[Test]
public void Sync ()
{
WebResponse res = null;
try {
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
req.ContentLength = 1;
req.ContentType = "image/png";
try {
Stream stream = req.GetRequestStream ();
Assert.Fail ("should throw exception");
} catch (ProtocolViolationException) {
}
req.Method = "PUT";
Stream wstream = req.GetRequestStream ();
Assert.IsFalse (wstream.CanRead, "#1r");
Assert.IsTrue (wstream.CanWrite, "#1w");
Assert.IsTrue (wstream.CanSeek, "#1s");
wstream.WriteByte (72);
wstream.WriteByte (101);
wstream.WriteByte (108);
wstream.WriteByte (108);
wstream.WriteByte (111);
wstream.Close ();
Assert.AreEqual (1, req.ContentLength, "#1cl");
Assert.AreEqual ("image/png", req.ContentType, "#1ct");
// stream written
req = (FileWebRequest) WebRequest.Create (_tempFileUri);
res = req.GetResponse ();
Assert.AreEqual ((long) 5, res.ContentLength, "#2 len");
Assert.AreEqual ("application/octet-stream", res.ContentType, "#2 type");
Assert.AreEqual ("file", res.ResponseUri.Scheme, "#2 scheme");
Stream rstream = res.GetResponseStream ();
Assert.IsTrue (rstream.CanRead, "#3r");
Assert.IsFalse (rstream.CanWrite, "#3w");
Assert.IsTrue (rstream.CanSeek, "#3s");
Assert.AreEqual (72, rstream.ReadByte (), "#4a");
Assert.AreEqual (101, rstream.ReadByte (), "#4b");
Assert.AreEqual (108, rstream.ReadByte (), "#4c");
Assert.AreEqual (108, rstream.ReadByte (), "#4d");
Assert.AreEqual (111, rstream.ReadByte (), "#4e");
rstream.Close ();
try {
long len = res.ContentLength;
Assert.AreEqual ((long) 5, len, "#5");
} catch (ObjectDisposedException) {
Assert.Fail ("#disposed contentlength");
}
try {
WebHeaderCollection w = res.Headers;
} catch (ObjectDisposedException) {
Assert.Fail ("#disposed headers");
}
try {
res.Close ();
} catch (ObjectDisposedException) {
Assert.Fail ("#disposed close");
}
} finally {
if (res != null)
res.Close ();
}
}
[Test]
[Category ("NotWorking")] // bug #323388
public void Sync_GetResponse_Failure ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
req.Method = "PUT";
req.ContentLength = 1;
req.ContentType = "image/png";
req.Timeout = 500;
using (Stream rs = req.GetRequestStream ()) {
try {
req.GetResponse ();
Assert.Fail ("#1");
} catch (WebException) {
// The operation has timed out
}
try {
req.BeginGetResponse (null, null);
Assert.Fail ("#2");
} catch (InvalidOperationException) {
// Cannot re-call BeginGetRequestStream/BeginGetResponse while
// a previous call is still in progress
}
}
// the temp file should not be in use
Directory.Delete (_tempDirectory, true);
}
[Test]
public void ConnectionGroupName ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
Assert.IsNull (req.ConnectionGroupName, "#A");
req.ConnectionGroupName = "whatever";
Assert.IsNotNull (req.ConnectionGroupName, "#B1");
Assert.AreEqual ("whatever", req.ConnectionGroupName, "#B2");
req.ConnectionGroupName = string.Empty;
Assert.IsNotNull (req.ConnectionGroupName, "#C1");
Assert.AreEqual (string.Empty, req.ConnectionGroupName, "#C2");
req.ConnectionGroupName = null;
Assert.IsNull (req.ConnectionGroupName, "#D");
}
[Test]
public void ContentLength ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
Assert.AreEqual (0, req.Headers.Count, "#A1");
Assert.AreEqual (0, req.ContentLength, "#A2");
req.ContentLength = 5;
Assert.AreEqual (5, req.ContentLength, "#A3");
Assert.AreEqual (0, req.Headers.Count, "#A4");
req.Method = "PUT";
using (Stream s = req.GetRequestStream ()) {
s.WriteByte (5);
Assert.AreEqual (5, req.ContentLength, "#B1");
s.WriteByte (4);
Assert.AreEqual (5, req.ContentLength, "#B2");
s.Flush ();
Assert.AreEqual (5, req.ContentLength, "#B3");
}
Assert.AreEqual (5, req.ContentLength, "#B4");
}
[Test]
public void ContentLength_Negative ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
try {
req.ContentLength = -1;
Assert.Fail ("#1");
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.Message, "#3");
#if NET_2_0
Assert.IsFalse (ex.Message == "value", "#4");
#else
Assert.AreEqual ("value", ex.Message, "#4");
#endif
#if !TARGET_JVM
#if NET_2_0
Assert.IsNotNull (ex.ParamName, "#5");
Assert.AreEqual ("value", ex.ParamName, "#6");
#else
Assert.IsNull (ex.ParamName, "#5");
#endif
#endif
Assert.IsNull (ex.InnerException, "#7");
}
}
[Test]
public void ContentType ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
Assert.AreEqual (0, req.Headers.Count, "#A1");
Assert.IsNull (req.ContentType, "#A2");
req.ContentType = "application/x-gzip";
Assert.AreEqual (1, req.Headers.Count, "#B1");
Assert.AreEqual ("Content-Type", req.Headers.GetKey (0), "#B2");
Assert.AreEqual ("application/x-gzip", req.Headers.Get (0), "#B3");
Assert.AreEqual ("application/x-gzip", req.ContentType, "#B4");
req.Headers.Set ("Content-Type", "image/png");
Assert.AreEqual ("image/png", req.ContentType, "#C1");
req.ContentType = null;
Assert.AreEqual (1, req.Headers.Count, "#D1");
Assert.AreEqual ("Content-Type", req.Headers.GetKey (0), "#D2");
Assert.AreEqual (string.Empty, req.Headers.Get (0), "#D3");
Assert.AreEqual (string.Empty, req.ContentType, "#D4");
req.Headers.Remove ("Content-Type");
Assert.AreEqual (0, req.Headers.Count, "#E1");
Assert.IsNull (req.ContentType, "#E2");
}
[Test]
public void Credentials ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
Assert.IsNull (req.Credentials, "#1");
req.Credentials = new NetworkCredential ();
Assert.IsNotNull (req.Credentials, "#2");
req.Credentials = null;
Assert.IsNull (req.Credentials, "#3");
}
[Test]
[Category ("NotWorking")]
public void GetRequestStream ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (
_tempFileUri);
req.Timeout = 1000;
req.Method = "POST";
FileStream fsA = null;
FileStream fsB = null;
try {
fsA = req.GetRequestStream () as FileStream;
Assert.IsNotNull (fsA, "#A1");
#if NET_2_0
try {
req.GetRequestStream ();
Assert.Fail ("#A2");
} catch (WebException) {
// The operation has timed out
}
fsA.Close ();
try {
req.GetRequestStream ();
Assert.Fail ("#A3");
} catch (InvalidOperationException) {
// Cannot re-call BeginGetRequestStream/BeginGetResponse
// while a previous call is still in progress.
}
#else
fsB = req.GetRequestStream () as FileStream;
Assert.IsNotNull (fsB, "#A2");
Assert.AreSame (fsA, fsB, "#A3");
#endif
} finally {
if (fsA != null)
fsA.Close ();
if (fsB != null)
fsB.Close ();
}
req = (FileWebRequest) WebRequest.Create (_tempFileUri);
req.Timeout = 1000;
req.Method = "POST";
try {
fsA = req.GetRequestStream () as FileStream;
Assert.IsNotNull (fsA, "#B1");
fsA.Close ();
#if NET_2_0
try {
req.GetRequestStream ();
Assert.Fail ("#B2");
} catch (WebException) {
// The operation has timed out
}
fsA.Close ();
try {
req.GetRequestStream ();
Assert.Fail ("#B3");
} catch (InvalidOperationException) {
// Cannot re-call BeginGetRequestStream/BeginGetResponse
// while a previous call is still in progress.
}
#else
fsB = req.GetRequestStream () as FileStream;
Assert.IsNotNull (fsB, "#B2");
Assert.AreSame (fsA, fsB, "#B3");
#endif
} finally {
if (fsA != null)
fsA.Close ();
if (fsB != null)
fsB.Close ();
}
}
[Test]
public void GetRequestStream_File_Exists ()
{
Stream s = File.Create (_tempFile);
s.Close ();
FileWebRequest req = (FileWebRequest) WebRequest.Create (
_tempFileUri);
req.Method = "POST";
s = req.GetRequestStream ();
s.Close ();
}
[Test]
public void GetRequestStream_Method_Valid ()
{
string [] methods = new string [] { "PUT", "POST", "CHECKOUT",
"DELETE", "OPTIONS", "TRACE", "GET ", "DUNNO" };
foreach (string method in methods) {
FileWebRequest req = (FileWebRequest) WebRequest.Create (
_tempFileUri);
req.Method = method;
using (Stream s = req.GetRequestStream ()) {
Assert.IsNotNull (s, "#1:" + method);
Assert.IsFalse (s.CanRead, "#2:" + method);
Assert.IsTrue (s.CanSeek, "#3:" + method);
#if NET_2_0
Assert.IsFalse (s.CanTimeout, "#4:" + method);
#endif
Assert.IsTrue (s.CanWrite, "#5:" + method);
Assert.AreEqual (0, s.Length, "#6:" + method);
Assert.AreEqual (0, s.Position, "#7:" + method);
#if NET_2_0
try {
int i = s.ReadTimeout;
Assert.Fail ("#8:" + method + "=>" + i);
} catch (InvalidOperationException) {
}
try {
int i = s.WriteTimeout;
Assert.Fail ("#9:" + method + "=>" + i);
} catch (InvalidOperationException) {
}
#endif
}
}
}
[Test]
public void GetRequestStream_Method_Invalid ()
{
string [] methods = new string [] { "GET", "get", "HEAD", "head",
"CONNECT", "connect"};
foreach (string method in methods) {
FileWebRequest req = (FileWebRequest) WebRequest.Create (
_tempFileUri);
req.Method = method;
try {
req.GetRequestStream ();
Assert.Fail ("#1:" + method);
} catch (ProtocolViolationException ex) {
Assert.AreEqual (typeof (ProtocolViolationException), ex.GetType (), "#2:" + method);
Assert.IsNotNull (ex.Message, "#3:" + method);
Assert.IsNull (ex.InnerException, "#4:" + method);
}
}
}
[Test]
public void GetResponse_File_Exists ()
{
Stream s = File.Create (_tempFile);
s.Close ();
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
FileWebResponse respA = null;
FileWebResponse respB = null;
try {
respA = req.GetResponse () as FileWebResponse;
Assert.IsNotNull (respA, "#1");
respB = req.GetResponse () as FileWebResponse;
Assert.IsNotNull (respB, "#2");
Assert.AreSame (respA, respB, "#3");
} finally {
if (respA != null)
respA.Close ();
if (respB != null)
respB.Close ();
}
}
[Test]
public void GetResponse_File_DoesNotExist ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
try {
req.GetResponse ();
Assert.Fail ("#1");
} catch (WebException ex) {
Assert.AreEqual (typeof (WebException), ex.GetType (), "#1");
Assert.IsNotNull (ex.Message, "#2");
#if !TARGET_JVM
Assert.IsTrue (ex.Message.IndexOf ("FileWebRequestTest.tmp") != -1, "#3");
Assert.IsNull (ex.Response, "#4");
Assert.IsNotNull (ex.InnerException, "#5");
#endif
#if ONLY_1_1
FileNotFoundException fnf = ex.InnerException as FileNotFoundException;
Assert.IsNotNull (fnf, "#6");
Assert.AreEqual (typeof (FileNotFoundException), fnf.GetType (), "#7");
Assert.IsNotNull (fnf.FileName, "#8");
Assert.IsTrue (fnf.FileName.IndexOf ("FileWebRequestTest.tmp") != -1, "#9");
Assert.IsNotNull (fnf.Message, "#10");
Assert.IsTrue (fnf.Message.IndexOf ("FileWebRequestTest.tmp") != -1, "#11");
Assert.IsNull (fnf.InnerException, "#12");
#endif
}
}
[Test]
public void Method ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
Assert.IsNotNull (req.Method, "#A1");
Assert.AreEqual ("GET", req.Method, "#A2");
req.Method = "whatever";
Assert.IsNotNull (req.Method, "#B1");
Assert.AreEqual ("whatever", req.Method, "#B2");
req.Method = "get ";
Assert.IsNotNull (req.Method, "#C1");
Assert.AreEqual ("get ", req.Method, "#C2");
}
[Test]
public void Method_Empty ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
try {
req.Method = string.Empty;
Assert.Fail ("#1");
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.Message, "#3");
#if !TARGET_JVM
#if NET_2_0
Assert.AreEqual ("value", ex.ParamName, "#4");
#else
Assert.IsNull (ex.ParamName, "#4");
#endif
#endif
Assert.IsNull (ex.InnerException, "#5");
}
}
[Test]
public void Method_Null ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
try {
req.Method = null;
Assert.Fail ("#1");
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.Message, "#3");
#if !TARGET_JVM
#if NET_2_0
Assert.AreEqual ("value", ex.ParamName, "#4");
#else
Assert.IsNull (ex.ParamName, "#4");
#endif
#endif
Assert.IsNull (ex.InnerException, "#5");
}
}
[Test]
public void PreAuthenticate ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
Assert.IsFalse (req.PreAuthenticate, "#1");
req.PreAuthenticate = true;
Assert.IsTrue (req.PreAuthenticate, "#2");
}
[Test]
public void Proxy ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
Assert.IsNull (req.Proxy, "#1");
req.Proxy = new WebProxy ();
Assert.IsNotNull (req.Proxy, "#2");
req.Proxy = null;
Assert.IsNull (req.Proxy, "#3");
}
[Test]
public void RequestUri ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
Assert.AreSame (_tempFileUri, req.RequestUri);
}
[Test]
public void Timeout ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
Assert.AreEqual (100000, req.Timeout, "#1");
req.Timeout = int.MaxValue;
Assert.AreEqual (int.MaxValue, req.Timeout, "#2");
req.Timeout = 0;
Assert.AreEqual (0, req.Timeout, "#3");
}
[Test]
public void Timeout_Negative ()
{
FileWebRequest req = (FileWebRequest) WebRequest.Create (_tempFileUri);
req.Timeout = -1;
Assert.AreEqual (-1, req.Timeout, "#1");
try {
req.Timeout = -2;
Assert.Fail ("#2");
} catch (ArgumentOutOfRangeException ex) {
Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#3");
Assert.IsNotNull (ex.Message, "#4");
#if !TARGET_JVM
Assert.IsNotNull (ex.ParamName, "#5");
#if NET_2_0
Assert.IsFalse (ex.ParamName == "value", "#6");
#else
Assert.AreEqual ("value", ex.ParamName, "#6");
#endif
#endif
Assert.IsNull (ex.InnerException, "#7");
}
}
[Test]
#if TARGET_JVM
//FIXME: include Java serialization compliant tests
[Ignore ("The MS compliant binary serialization is not supported")]
#endif
public void GetObjectData ()
{
FileWebRequest fwr = (FileWebRequest) WebRequest.Create ("file:///test.txt");
fwr.ConnectionGroupName = "CGN";
fwr.ContentLength = 10;
fwr.ContentType = "image/png";
fwr.Credentials = new NetworkCredential ("Miguel", "de Icaza", "Novell");
fwr.Headers.Add ("Disposition", "attach");
fwr.Method = "PUT";
fwr.PreAuthenticate = true;
fwr.Proxy = new WebProxy ("proxy.ximian.com");
fwr.Timeout = 20;
SerializationInfo si = new SerializationInfo (typeof (FileWebRequest),
new FormatterConverter ());
((ISerializable) fwr).GetObjectData (si, new StreamingContext ());
Assert.AreEqual (9, si.MemberCount, "#A1");
int i = 0;
foreach (SerializationEntry entry in si) {
Assert.IsNotNull (entry.Name, "#B1:" + i);
Assert.IsNotNull (entry.ObjectType, "#B2:" + i);
Assert.IsNotNull (entry.Value, "#B3:" + i);
switch (i) {
case 0:
Assert.AreEqual ("headers", entry.Name, "#B4:" + i);
Assert.AreEqual (typeof (WebHeaderCollection), entry.ObjectType, "#B5:" + i);
break;
case 1:
Assert.AreEqual ("proxy", entry.Name, "#B4:" + i);
Assert.AreEqual (typeof (IWebProxy), entry.ObjectType, "#B5:" + i);
break;
case 2:
Assert.AreEqual ("uri", entry.Name, "#B4:" + i);
Assert.AreEqual (typeof (Uri), entry.ObjectType, "#B5:" + i);
break;
case 3:
Assert.AreEqual ("connectionGroupName", entry.Name, "#B4:" + i);
Assert.AreEqual (typeof (string), entry.ObjectType, "#B5:" + i);
Assert.AreEqual ("CGN", entry.Value, "#B6:" + i);
break;
case 4:
Assert.AreEqual ("method", entry.Name, "#B4:" + i);
Assert.AreEqual (typeof (string), entry.ObjectType, "#B5:" + i);
Assert.AreEqual ("PUT", entry.Value, "#B6:" + i);
break;
case 5:
Assert.AreEqual ("contentLength", entry.Name, "#B4:" + i);
Assert.AreEqual (typeof (long), entry.ObjectType, "#B5:" + i);
Assert.AreEqual (10, entry.Value, "#B6:" + i);
break;
case 6:
Assert.AreEqual ("timeout", entry.Name, "#B4:" + i);
Assert.AreEqual (typeof (int), entry.ObjectType, "#B5:" + i);
Assert.AreEqual (20, entry.Value, "#B6:" + i);
break;
case 7:
Assert.AreEqual ("fileAccess", entry.Name, "#B4:" + i);
Assert.AreEqual (typeof (FileAccess), entry.ObjectType, "#B5:" + i);
Assert.AreEqual (FileAccess.Read, entry.Value, "#B6:" + i);
break;
case 8:
Assert.AreEqual ("preauthenticate", entry.Name, "#B4:" + i);
Assert.AreEqual (typeof (bool), entry.ObjectType, "#B5:" + i);
#if NET_2_0
Assert.AreEqual (false, entry.Value, "#B6:" + i);
#else
Assert.AreEqual (true, entry.Value, "#B6:" + i);
#endif
break;
}
i++;
}
}
[Test]
[Category ("NotWorking")] // Difference at index 272: 20 instead of 19
public void Serialize ()
{
FileWebRequest fwr = (FileWebRequest) WebRequest.Create ("file://test.txt/");
fwr.ConnectionGroupName = "CGN";
fwr.ContentLength = 10;
fwr.ContentType = "image/png";
fwr.Credentials = new NetworkCredential ("Miguel", "de Icaza", "Novell");
fwr.Headers.Add ("Disposition", "attach");
fwr.Method = "PUT";
fwr.PreAuthenticate = true;
fwr.Proxy = new WebProxy ("proxy.ximian.com");
fwr.Timeout = 20;
BinaryFormatter bf = new BinaryFormatter ();
bf.AssemblyFormat = FormatterAssemblyStyle.Full;
MemoryStream ms = new MemoryStream ();
bf.Serialize (ms, fwr);
ms.Position = 0;
byte [] buffer = new byte [ms.Length];
ms.Read (buffer, 0, buffer.Length);
Assert.AreEqual (_serialized, buffer);
}
[Test]
#if TARGET_JVM
[Ignore ("The MS compliant binary serialization is not supported")]
#endif
public void Deserialize ()
{
MemoryStream ms = new MemoryStream ();
ms.Write (_serialized, 0, _serialized.Length);
ms.Position = 0;
BinaryFormatter bf = new BinaryFormatter ();
FileWebRequest req = (FileWebRequest) bf.Deserialize (ms);
Assert.AreEqual ("CGN", req.ConnectionGroupName, "#A1");
Assert.AreEqual (10, req.ContentLength, "#A2");
Assert.AreEqual ("image/png", req.ContentType, "#A3");
Assert.IsNull (req.Credentials, "#A4");
Assert.AreEqual ("PUT", req.Method, "#A5");
#if NET_2_0
Assert.IsFalse (req.PreAuthenticate, "#A6");
#else
Assert.IsTrue (req.PreAuthenticate, "#A6");
#endif
Assert.AreEqual ("file://test.txt/", req.RequestUri.AbsoluteUri, "#A7");
Assert.AreEqual (20, req.Timeout, "#A8");
WebHeaderCollection headers = req.Headers;
Assert.IsNotNull (headers, "#C1");
Assert.AreEqual (2, headers.Count, "#C2");
Assert.AreEqual ("Content-Type", req.Headers.GetKey (0), "#C3");
Assert.AreEqual ("image/png", req.Headers.Get (0), "#C4");
Assert.AreEqual ("Disposition", req.Headers.GetKey (1), "#C5");
Assert.AreEqual ("attach", req.Headers.Get (1), "#C6");
WebProxy proxy = req.Proxy as WebProxy;
Assert.IsNotNull (proxy, "#D1");
Assert.AreEqual ("http://proxy.ximian.com/", proxy.Address.AbsoluteUri, "#D2");
Assert.IsNotNull (proxy.BypassArrayList, "#D3");
Assert.AreEqual (0, proxy.BypassArrayList.Count, "#D4");
Assert.IsNotNull (proxy.BypassList, "#D5");
Assert.AreEqual (0, proxy.BypassList.Length, "#D6");
Assert.IsFalse (proxy.BypassProxyOnLocal, "#D7");
Assert.IsNull (proxy.Credentials, "#D8");
}
private Uri GetTempFileUri ()
{
string tempFile = _tempFile;
if (RunningOnUnix) {
// remove leading slash for absolute paths
tempFile = tempFile.TrimStart ('/');
} else {
tempFile = tempFile.Replace ('\\', '/');
}
return new Uri ("file:///" + tempFile);
}
#if TARGET_JVM
private bool RunningOnUnix {
get {
Type t = Type.GetType("java.lang.System");
MethodInfo mi = t.GetMethod("getProperty", new Type[] { typeof(string) });
string osName = (string) mi.Invoke(null, new object[] { "os.name" });
if(osName == null) {
return false;
}
return !osName.StartsWith("win", true, CultureInfo.InvariantCulture);
}
}
#else
private bool RunningOnUnix {
get {
// check for Unix platforms - see FAQ for more details
// http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F
int platform = (int) Environment.OSVersion.Platform;
return ((platform == 4) || (platform == 128) || (platform == 6));
}
}
#endif
private static readonly byte [] _serialized = new byte [] {
#if NET_2_0
0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
0x49, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2c, 0x20, 0x56, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e, 0x30, 0x2e, 0x30,
0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65,
0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50,
0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b,
0x65, 0x6e, 0x3d, 0x62, 0x37, 0x37, 0x61, 0x35, 0x63, 0x35, 0x36,
0x31, 0x39, 0x33, 0x34, 0x65, 0x30, 0x38, 0x39, 0x05, 0x01, 0x00,
0x00, 0x00, 0x19, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4e,
0x65, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x57, 0x65, 0x62, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x09, 0x00, 0x00, 0x00, 0x07,
0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x05, 0x70, 0x72, 0x6f,
0x78, 0x79, 0x03, 0x75, 0x72, 0x69, 0x13, 0x63, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x4e, 0x61, 0x6d, 0x65, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64,
0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e,
0x67, 0x74, 0x68, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
0x0a, 0x66, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,
0x0f, 0x70, 0x72, 0x65, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74,
0x69, 0x63, 0x61, 0x74, 0x65, 0x04, 0x04, 0x04, 0x01, 0x01, 0x00,
0x00, 0x03, 0x00, 0x1e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e,
0x4e, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x48, 0x65, 0x61, 0x64,
0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x02, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x2e, 0x4e, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x50, 0x72,
0x6f, 0x78, 0x79, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x53, 0x79, 0x73,
0x74, 0x65, 0x6d, 0x2e, 0x55, 0x72, 0x69, 0x02, 0x00, 0x00, 0x00,
0x09, 0x08, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x49,
0x4f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73,
0x73, 0x01, 0x02, 0x00, 0x00, 0x00, 0x09, 0x03, 0x00, 0x00, 0x00,
0x09, 0x04, 0x00, 0x00, 0x00, 0x09, 0x05, 0x00, 0x00, 0x00, 0x06,
0x06, 0x00, 0x00, 0x00, 0x03, 0x43, 0x47, 0x4e, 0x06, 0x07, 0x00,
0x00, 0x00, 0x03, 0x50, 0x55, 0x54, 0x0a, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0xf8, 0xff, 0xff,
0xff, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x49, 0x4f,
0x2e, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,
0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f,
0x5f, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x03, 0x00,
0x00, 0x00, 0x1e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4e,
0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x05, 0x00, 0x00, 0x00, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x01,
0x30, 0x01, 0x32, 0x01, 0x31, 0x01, 0x33, 0x00, 0x01, 0x01, 0x01,
0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06,
0x09, 0x00, 0x00, 0x00, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x06, 0x0a, 0x00, 0x00, 0x00,
0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0x06,
0x0b, 0x00, 0x00, 0x00, 0x0b, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73,
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x06,
0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x05, 0x04, 0x00, 0x00, 0x00,
0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4e, 0x65, 0x74,
0x2e, 0x57, 0x65, 0x62, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x04, 0x00,
0x00, 0x00, 0x0e, 0x5f, 0x42, 0x79, 0x70, 0x61, 0x73, 0x73, 0x4f,
0x6e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x0d, 0x5f, 0x50, 0x72, 0x6f,
0x78, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x0b, 0x5f,
0x42, 0x79, 0x70, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x16,
0x5f, 0x55, 0x73, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73,
0x00, 0x04, 0x02, 0x00, 0x01, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x2e, 0x55, 0x72, 0x69, 0x02, 0x00, 0x00, 0x00, 0x01, 0x02,
0x00, 0x00, 0x00, 0x00, 0x09, 0x0d, 0x00, 0x00, 0x00, 0x0a, 0x00,
0x05, 0x05, 0x00, 0x00, 0x00, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x2e, 0x55, 0x72, 0x69, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x41,
0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x55, 0x72, 0x69, 0x01,
0x02, 0x00, 0x00, 0x00, 0x06, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x66,
0x69, 0x6c, 0x65, 0x3a, 0x2f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e,
0x74, 0x78, 0x74, 0x2f, 0x01, 0x0d, 0x00, 0x00, 0x00, 0x05, 0x00,
0x00, 0x00, 0x06, 0x0f, 0x00, 0x00, 0x00, 0x18, 0x68, 0x74, 0x74,
0x70, 0x3a, 0x2f, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x78,
0x69, 0x6d, 0x69, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x0b
#else
0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
0x4c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2c, 0x20, 0x56, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x31, 0x2e, 0x30, 0x2e, 0x35,
0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37, 0x37, 0x61, 0x35,
0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65, 0x30, 0x38, 0x39,
0x05, 0x01, 0x00, 0x00, 0x00, 0x19, 0x53, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x2e, 0x4e, 0x65, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x57,
0x65, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x09, 0x00,
0x00, 0x00, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x05,
0x70, 0x72, 0x6f, 0x78, 0x79, 0x03, 0x75, 0x72, 0x69, 0x13, 0x63,
0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72,
0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x06, 0x6d, 0x65, 0x74,
0x68, 0x6f, 0x64, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x07, 0x74, 0x69, 0x6d, 0x65,
0x6f, 0x75, 0x74, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x63,
0x65, 0x73, 0x73, 0x0f, 0x70, 0x72, 0x65, 0x61, 0x75, 0x74, 0x68,
0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x04, 0x04, 0x04,
0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x1e, 0x53, 0x79, 0x73, 0x74,
0x65, 0x6d, 0x2e, 0x4e, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x48,
0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x02, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79,
0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4e, 0x65, 0x74, 0x2e, 0x57, 0x65,
0x62, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x02, 0x00, 0x00, 0x00, 0x0a,
0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x55, 0x72, 0x69, 0x02,
0x00, 0x00, 0x00, 0x09, 0x08, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x2e, 0x49, 0x4f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63,
0x63, 0x65, 0x73, 0x73, 0x01, 0x02, 0x00, 0x00, 0x00, 0x09, 0x03,
0x00, 0x00, 0x00, 0x09, 0x04, 0x00, 0x00, 0x00, 0x09, 0x05, 0x00,
0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x03, 0x43, 0x47, 0x4e,
0x06, 0x07, 0x00, 0x00, 0x00, 0x03, 0x50, 0x55, 0x54, 0x0a, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04,
0xf8, 0xff, 0xff, 0xff, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
0x2e, 0x49, 0x4f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x63,
0x65, 0x73, 0x73, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x01,
0x05, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x53, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x2e, 0x4e, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x05, 0x00, 0x00, 0x00, 0x05, 0x43, 0x6f, 0x75,
0x6e, 0x74, 0x01, 0x30, 0x01, 0x32, 0x01, 0x31, 0x01, 0x33, 0x00,
0x01, 0x01, 0x01, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x06, 0x09, 0x00, 0x00, 0x00, 0x0c, 0x43, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x06, 0x0a,
0x00, 0x00, 0x00, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x70,
0x6e, 0x67, 0x06, 0x0b, 0x00, 0x00, 0x00, 0x0b, 0x44, 0x69, 0x73,
0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x06, 0x0c, 0x00,
0x00, 0x00, 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x05, 0x04,
0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e,
0x4e, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x50, 0x72, 0x6f, 0x78,
0x79, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x5f, 0x42, 0x79, 0x70, 0x61,
0x73, 0x73, 0x4f, 0x6e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x0d, 0x5f,
0x50, 0x72, 0x6f, 0x78, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x0b, 0x5f, 0x42, 0x79, 0x70, 0x61, 0x73, 0x73, 0x4c, 0x69,
0x73, 0x74, 0x00, 0x04, 0x02, 0x01, 0x0a, 0x53, 0x79, 0x73, 0x74,
0x65, 0x6d, 0x2e, 0x55, 0x72, 0x69, 0x02, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x09, 0x0d, 0x00, 0x00, 0x00, 0x0a, 0x05,
0x05, 0x00, 0x00, 0x00, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
0x2e, 0x55, 0x72, 0x69, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x41, 0x62,
0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x55, 0x72, 0x69, 0x01, 0x02,
0x00, 0x00, 0x00, 0x06, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x66, 0x69,
0x6c, 0x65, 0x3a, 0x2f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74,
0x78, 0x74, 0x2f, 0x01, 0x0d, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x06, 0x0f, 0x00, 0x00, 0x00, 0x18, 0x68, 0x74, 0x74, 0x70,
0x3a, 0x2f, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x78, 0x69,
0x6d, 0x69, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x0b
#endif
};
}
}
|