50 Commits
Author SHA1 Message Date
Maxim Lipnin 9988ebc7f2 [System.Xml] Fix deserialization issue (#16965)
[This ](https://github.com/mono/mono/pull/11194/files#diff-ae54d9565e735005686191de0f19ed50R431-R435)change in `XmlTypeMapElementInfo.GetElement`  introduced the logic for handling the case of derived types deserialization. 
For some cases (like https://github.com/mono/mono/issues/16918) it breaks existing functionality because it returns wrong element for given element name after searching withing derived types collection.

![image](https://user-images.githubusercontent.com/3258267/65416085-bedc0500-ddff-11e9-941c-f24045c64121.png)

Unfortunately, what I can do here is just reverting the related changes.

Fixes https://github.com/mono/mono/issues/16918
2019-09-24 11:35:15 +02:00
majellin24 92711632bf Modification to allow deserialization of derrived types (#11194)
* Modification to allow deserialization of derrived types

* white space correction

* second attempt

* third attempt

* fourth

* whitespace

* maybe fix null ref exception

* missed same condition in other method

* fixing condition

* hopefully correcting the test failure in AOT

* Modification to allow deserialization of derrived types

white space correction

second attempt

third attempt

fourth

whitespace

maybe fix null ref exception

missed same condition in other method

fixing condition

hopefully correcting the test failure in AOT

formatting

missed some formatting

* adding a test for PR #11194

* fixing a few exceptions

* adding ref
2018-10-31 10:43:46 +01:00
Marek Safar d19e5c42a5 [System.Xml] Update supported time formats for mobile version of XML deserializer. Fixes #42843 2016-10-14 09:10:17 +02:00
Marcos Henrich e58fe58ef1 [System.Xml] Test sub class serialization on lists
Covers #36829
2016-01-11 18:03:43 +00:00
Marek Safar 401a35cd69 [system.xml] Serialization from reference sources for desktop 2015-05-13 18:47:07 +02:00
Atsushi Eno ddca46d22b Revert "[system.xml] Serialization from reference sources for desktop"
This reverts commit 6ae517ea65.
2015-05-12 14:42:19 +08:00
Marek Safar 6ae517ea65 [system.xml] Serialization from reference sources for desktop 2015-05-11 15:37:01 +02:00
Alexander Köplinger 746650d1b9 [bcl] Remove more NET_2_0 checks from class libs 2015-01-17 05:45:39 +01:00
Marcos Henrich 007413298d Test Xml serialization of a property with attribute XmlText.
The tested property has a default value that is not null.
Covers 18908.
2014-09-26 10:31:51 +01:00
Marcos Henrich 8790297c85 Test xml serialization of nullable array items. Covers #19012. 2014-09-15 16:55:31 +01:00
Marcos Henrich f008d4afb6 Test XmlSerialization of element that requires implicit conversion.
Covers #20403.
2014-09-10 16:30:03 +01:00
Alistair Bush eaa5a184ca Add test to ensure using concrete List as readonly property still serializes
This change is released under the MIT license.
2014-03-09 01:12:06 +13:00
Alistair Bush f3296a1559 When a read only property and the type is an interface we can't serialize the type.
This change is released under the MIT license.
2014-03-09 01:05:24 +13:00
Lluis Sanchez 0c2e8c9455 Add some unit tests for bug 9193 2013-01-09 13:43:56 +01:00
Lluis Sanchez 3a6c0cf166 Add tests for bug #8468
Conflicts:

	mcs/class/System.XML/Test/System.Xml.Serialization/DeserializeTests.cs
2012-11-19 21:21:03 +01:00
Lluis Sanchez aabbc960b7 Improve date serialization compatibility with third party web services
Make XmlCustomFormatter.cs more liberal about the date formats it accepts.
Many third party web services do not format date exactly at 'yyyy-mm-dd'.
The Microsoft implementation is more liberal about accepting other formats
and so the current Mono implementation breaks projects that consume third
party web services when they are ported to Mono.
Based on a patch by Aaron Roydhouse.
2012-06-05 12:35:52 +02:00
Miguel de Icaza 62d7430864 XmlSerializer: Add support to serialize nullable types when the XmlElement has explicity set the DataType
The existing code had a special code path for handling nullables that
ignored the DataType component.

This patch splits the nullable test away, allows the specified XmlDataType
to be probed and then performs the standard type lookup mechanism.

This allows this:

        [XmlElement ("MyNullableTime", DataType="time", IsNullable=true)]
        DateTime? myTime;

To be serialized as a "time" instead of a "datetime".

Fixes bug #329
2012-01-03 19:38:13 -05:00
Atsushi Eno 0ac09f4e2b Merge pull request #146 from flutos/207ce0bccceec3ff7860ea986086fedb5a92d822
fix for bug 708178 that would fail if the type wasnt IEnumerable, should check if it implement IEnumerable rather than is IEnumerable
2011-08-03 17:05:06 -07:00
Atsushi Eno 693ed85130 Fix bug #707434, check order only when applicable.
Based on the input by Scott Fluto.
2011-08-03 05:35:26 +09:00
scott fluto 207ce0bccc [708178] - Type check invalid and breaks XmlSerialization if serializing ICollection<> types 2011-07-28 15:19:43 -06:00
Atsushi Eno 4fab2dc4c3 Fix bug #703910 - implement Order support in XmlSerializer. 2011-07-21 04:57:32 +09:00
Atsushi Eno 2cc686a3af Fix bug 704813: just ignore members of type IEnumerable`1 without Add(). 2011-07-16 06:48:41 -07:00
Atsushi Eno dfa3a04f22 2008-09-02 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs
	  XmlSerializationWriterInterpreter.cs : fixed bug #419973.
	  Sometimes implicit operators could involve and it affects on
	  typecasting. It's simple for code generator, but very bad for
	  reflection.

	* XmlSerializerTestClasses.cs, XmlSerializerTests.cs:
	  added test for bug #419973.


svn path=/trunk/mcs/; revision=112103
2008-09-02 16:56:08 +00:00
Atsushi Eno 8688f906c3 2008-06-05 Atsushi Enomoto <[email protected]>
* XmlSerializationReaderInterpreter.cs, MapCodeGenerator.cs,
	  SerializationCodeGenerator.cs : fixed bug #378696.
	  Default value should not be filled during deserialization, and
	  default values for DateTime/TimeSpan/DateTimeOffset should not be
	  output as raw string in generated code.

	* XmlSerializerTestClasses.cs, DeserializeTests.cs,
	  ComplexDataStructure.cs : added test for bug #378696.
	  Fixed couple of wrong tests that expects default values filled
	  during deserialization.


svn path=/trunk/mcs/; revision=104983
2008-06-05 11:28:51 +00:00
Atsushi Eno da257a4cbb 2008-04-11 Atsushi Enomoto <[email protected]>
* XmlTypeMapping.cs : .NET 2.0 has a weird behavior that swallows
	  exception from IXmlSerializable.GetSchema().

	* XmlSerializerTestClasses.cs, XmlSerializerTests.cs : added test
	for IXmlSerializable serialization whose GetSchema() borks.


svn path=/trunk/mcs/; revision=100415
2008-04-11 06:34:35 +00:00
Lluis Sanchez 9d4657431e * System.Xml.Serialization/XmlSerializerTestClasses.cs,
System.Xml.Serialization/XmlSerializerTests.cs: Test nullable
  enums.

svn path=/trunk/mcs/; revision=99517
2008-04-01 14:26:05 +00:00
Gert Driesen c590893933 * XmlSerializerTests.cs: Only compile generic tests on 2.0 profile.
Fixes build.
* DeserializeTests.cs: Same.
* XmlSerializerTestClasses.cs: Same.

svn path=/trunk/mcs/; revision=68888
2006-12-03 14:14:20 +00:00
Yoni Klain acef74c489 2006-12-03 Hagit Yidov <[email protected]>
* XmlSerializerTests.cs : added tests for serialization of generic types.
	* DeserializeTests.cs : added tests for deserialization of generic types.
	* XmlSerializerTestClasses.cs : added classes for tests which use generic types.

svn path=/trunk/mcs/; revision=68886
2006-12-03 12:28:23 +00:00
Tal Klahr 9867e1cc09 Reverting r68577
svn path=/trunk/mcs/; revision=68588
2006-11-28 14:50:54 +00:00
Hagit Yidov d27d092b14 ChangeLog, DeserializationTests, XmlSerializerTestClasses.cs, XmlSerializerTests.cs
Added serialization and deseralization tests for generic types.

svn path=/trunk/mcs/; revision=68577
2006-11-28 13:06:44 +00:00
Atsushi Eno 3b1767cacf eol-style:native.
svn path=/trunk/mcs/; revision=67663
2006-11-10 10:13:46 +00:00
Gert Driesen b5eb88c87f * DeserializeTest.cs: Added several tests.
* XmlSerializerTestClasses.cs: Added test classes for encoded SOAP.
* XmlSerializerTests.cs: Added new tests and fixed existing test.
* XmlReflectionImporterTests.cs: Added test for invalid default
values.
* SoapReflectionImporterTests.cs: Fixed numbering of tests.
* XmlSerializer.cs: Corrected exception message when deserialization
fails.
* SerializationCodeGenerator.cs: Added support for flag enums.
* XmlReflectionImporter.cs: Use InvalidOperationException wrapper for
all exceptions that occur while reflecting member. Validate default
values to match MS.
* SoapReflectionImporter.cs: Revert small part of previous patch as
XmlSerializer expects enum value.

svn path=/trunk/mcs/; revision=66524
2006-10-10 17:53:49 +00:00
Gert Driesen a99e0e1f9b * SoapAttributesTests.cs: Added tests for bug #78205.
* XmlSerializerTestClasses.cs: Added test classes and improved existing
classes for usage in upcoming bug reports.
* System.Xml_test.dll.sources: Added Test/System.Xml.Serialization/
SoapAttributesTests.cs.
* SoapAttributes.cs: The DefaultValueAttribute.Value should be returned
as SoapDefaultValue instead of the attribute itself. Fixes bug #78205.

svn path=/trunk/mcs/; revision=59917
2006-04-26 09:34:18 +00:00
Lluis Sanchez e087a00fc0 2006-03-07 Lluis Sanchez Gual <[email protected]>
* System.Xml.Serialization/XmlSerializerTestClasses.cs:
	* System.Xml.Serialization/XmlSerializerTests.cs: Added tests
	  for XmlSchemaForm.


svn path=/trunk/mcs/; revision=57662
2006-03-07 19:25:14 +00:00
Gert Driesen 8ecc0d6b83 * XmlSerializerTestClasses.cs: Fixed line endings (sigh).
svn path=/trunk/mcs/; revision=56799
2006-02-11 13:50:03 +00:00
Lluis Sanchez af09017623 2006-02-09 Lluis Sanchez Gual <[email protected]>
* XmlSerializerTests.cs, XmlSerializerTestClasses.cs: Added test
	for bug #77447.


svn path=/trunk/mcs/; revision=56717
2006-02-09 17:10:04 +00:00
Gert Driesen c64e0ec874 * XmlSerializerTestClasses.cs: Added test classes.
svn path=/trunk/mcs/; revision=56713
2006-02-09 16:54:13 +00:00
Gert Driesen 514da3a616 * XmlReflectionImporterTests.cs: Marked tests NotWorking until fixes have
landed in svn.
* SoapReflectionImporterTests.cs: Added numerous tests.
* XmlSchemaImporterTests.cs: Added numerous tests.
* XmlSchemaExporterTests.cs: Added numerous tests.
* SoapSchemaExporterTests.cs: Added numerous tests.
* XmlSerializerTestClasses.cs: Added test classes for
XmlSchemaExporter. Fixed line endings (to CRLF).

svn path=/trunk/mcs/; revision=55929
2006-01-23 07:17:04 +00:00
Lluis Sanchez 6074454762 2005-12-05 Lluis Sanchez Gual <[email protected]>
* XmlSerializerTestClasses.cs:
	* DeserializeTests.cs: Added tests for bug #76808 and related behavior.

2005-12-05  Lluis Sanchez Gual  <[email protected]>

	* XmlSerializationReaderInterpreter.cs:
	* SerializationCodeGenerator.cs: When deserializing a collection,
	don't create a new collection if the property already has a 
	collection instance. This does not apply to arrays. Changed how nullabe
	array properties are set. Setting IsNullable=false to the property means
	that it won't be set if the read array is null (so, if the property
	already has a value, it will be kept).
	Another change is that can't never be null (only arrays can).


svn path=/trunk/mcs/; revision=53949
2005-12-05 20:44:42 +00:00
Lluis Sanchez a238942f0e 2005-12-01 Lluis Sanchez Gual <[email protected]>
* XmlSerializerTestClasses.cs:
	* XmlSerializerTests.cs: Added tests for bug #76860.


svn path=/trunk/mcs/; revision=53761
2005-12-01 12:22:13 +00:00
Vladimir Krasnov cf50bd21d7 * XmlTypeMapping.cs: fixed GetXmlName method, added difference of value serialization of flags and non-flags enums
* XmlSerializerTestClasses.cs: added two enum types, without 0-value
* XmlSerializerTests.cs: added tests for serialization enum's default value


svn path=/trunk/mcs/; revision=53451
2005-11-24 13:42:27 +00:00
Lluis Sanchez b63a5f42e9 2005-09-26 Lluis Sanchez Gual <[email protected]>
* XmlSerializerTests.cs, DeserializeTests.cs, 
	XmlSerializerTestClasses.cs: Added tests for serialization of
	arrays of choice values.


svn path=/trunk/mcs/; revision=50785
2005-09-26 16:15:47 +00:00
Lluis Sanchez a4aafd6734 2005-09-21 Lluis Sanchez Gual <[email protected]>
* XmlSerializerTests.cs, XmlSerializerTestClasses.cs: Added test
	for bug #75986.


svn path=/trunk/mcs/; revision=50376
2005-09-21 14:09:25 +00:00
Lluis Sanchez 4f5a2dd8a8 2005-08-24 Lluis Sanchez Gual <[email protected]>
* XmlSerializerTests.cs: Added test for bug #75855.
	* DeserializeTests.cs: New test.
	* XmlSerializerTestClasses.cs: New test classes.


svn path=/trunk/mcs/; revision=48802
2005-08-24 18:09:51 +00:00
Lluis Sanchez 2bb89efdaf 2005-04-26 Lluis Sanchez Gual <[email protected]>
* XmlSerializerTests.cs:
	* DeserializeTests.cs:
	* XmlSerializerTestClasses.cs: Added tests for readonly properties and
	elements with spaces on them.


svn path=/trunk/mcs/; revision=43585
2005-04-26 09:20:55 +00:00
Lluis Sanchez 539cf95e9c 2005-03-30 Lluis Sanchez Gual <[email protected]>
* XmlSerializerTests.cs:
	* XmlReflectionImporterTests.cs:
	* DeserializeTests.cs:
	* XmlSerializerTestClasses.cs: Added tests for serialization of choices.


svn path=/trunk/mcs/; revision=42417
2005-03-31 08:40:30 +00:00
Lluis Sanchez 1466ec3475 2005-03-29 Lluis Sanchez Gual <[email protected]>
* XmlSerializerTests.cs:
	* DeserializeTests.cs: 
	* XmlSerializerTestClasses.cs: Added some tests for xml node serialization.


svn path=/trunk/mcs/; revision=42329
2005-03-29 11:42:18 +00:00
Lluis Sanchez 2d39f2bd3d * XmlSerializerTestClasses.cs: Added some test classes.
* DeserializeTests.cs: Added tests for bug #61464.

svn path=/trunk/mcs/; revision=33231
2004-09-02 16:12:57 +00:00
Lluis Sanchez 06cd746bed * DeserializeTests.cs: Added test for empty enum deserialization (bug #55509).
* XmlAttributesTests.cs, XmlReflectionImporterTests.cs,
	  XmlSerializationWriterTests.cs, XmlSerializerTests.cs:
	  Simplified namespace hierarchy.
	* XmlSerializerTestClasses.cs: Added more test classes.

svn path=/trunk/mcs/; revision=23956
2004-03-12 15:55:33 +00:00
Atsushi Eno 140a4ec73a 2003-04-12 Atsushi Enomoto <[email protected]>
* added this file as a new entry.
	  See ../ChangeLog to find former ChangeLog entries.
	* added XmlSerializerTests.cs and XmlSerializerTestClasses.cs
	  (by Erik Lebel)

svn path=/trunk/mcs/; revision=13550
2003-04-12 13:41:24 +00:00