Commit Graph
190 Commits
Author SHA1 Message Date
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 85650c7528 Test serialization wen class has method bool ShouldSerialize<T>().
.NET throws an exception but it should have no effect on the serialization.
2014-09-15 13:02:00 +01:00
Marcos Henrich 17ad50a165 Added test for optional {V}Specified and ShouldSerialize{V}.
{V}Specified is a property or field and ShouldSerialize{V} is a method that can be set to false if we do not want to serialize an attribute with name {V}.
2014-09-15 13:02:00 +01:00
Marcos Henrich f008d4afb6 Test XmlSerialization of element that requires implicit conversion.
Covers #20403.
2014-09-10 16:30:03 +01:00
Zoltan Varga 03aee949f1 Merge pull request #1200 from akoeplinger/remove-jvm
[Cleanup] Remove TARGET_JVM
2014-08-28 19:17:43 -04:00
Marcos Henrich 5df652e7d2 Test SerializationCodeGenerator.
XmlSerializerTests was mostly testing XmlSerializationReaderInterpreter and XmlSerializationWriterInterpreter.
XmlSerializerGeneratorTests forces the usage of SerializationCodeGenerator while running XmlSerializerTests.
2014-08-22 02:56:05 +08:00
Marcos Henrich dd6aca8621 Tests serialization of XmlNode field with attribute XmlAnyElement.
Covers #3211.
2014-08-22 02:42:19 +08:00
Marcos Henrich 2c5f30d7bd Added test BaseClassWithoutParameterlessConstructor.
Covers #6913
2014-08-18 14:08:02 +01:00
Marcos Henrich 6c5ea03852 Test XmlSerialization of class with XmlSchemaProvider with IsAny.
Covers #11916.
2014-08-18 11:40:58 +01:00
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Chris Webb 1a3ec8c3b3 Fixed issue related to fully qualified namespaces being used for XmlEnumAttribute values. 2014-08-07 06:15:55 +00:00
Alexis Christoforides 94b523275e [XML] Added unit test for multiple XMLElement attributes on arrays & ArrayLists 2014-04-08 18:05:46 -04: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
Eberhard Beilharz c0ef1fcb02 [Sys.Xml] Add unit test for Novell bug #594490
The unit test demonstrates the problem of serializing the
xml:lang attribute.
2014-02-27 15:57:57 +01:00
Marek Safar 31cab6a76d Fixes build 2013-11-29 13:51:02 +01:00
Sebastien Pouliot c3b782f4ec Do not assume the unit tests can write in the application directory (e.g. iOS devices). Use the temporary directory and open files in read-only 2013-03-18 17:38:28 -04:00
Rodrigo Kumpera abe9dc6206 Revert "Fix object::GetType when remoting is enabled."
This reverts commit 93e2d1dc48.
2013-03-01 10:54:09 -05:00
Rodrigo Kumpera 93e2d1dc48 Fix object::GetType when remoting is enabled. 2013-03-01 10:52:03 -05:00
Marek Safar dd4cc7ca66 Tests update for mobile profile 2013-03-01 15:31:25 +01: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
Andres G. Aragoneses 48c73cfb3c [System.XML]: Do not set XmlTypeMapElementInfo.IsNullable if it's already True
The IsNullable attribute in XmlElementAttribute is false by default,
so when not using it in a member which was already nullable
(i.e. Nullable<DateTime>), Mono was overriding the attribute causing
a FormatException later if an xsi:nil value was found when deserializing.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=7613
2012-10-03 12:08:16 +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
Marek Safar c81c35a8c6 Fix more xml serializer tests 2012-05-31 13:23:55 +01:00
Rolf Bjarne Kvinge b3014f2bcc Fix XmlAttributes to ignore all XmlAttributes if XmlIgnore is present 2012-04-19 23:04:16 +02:00
Rolf Bjarne Kvinge 5d7c168eba Ignore XmlIgnore attributes when importing members in XmlReflectionImporter. Fixes #4367. 2012-04-19 23:04:15 +02:00
Marek Safar 0dcb829e5e Convert old unit tests 2012-04-17 18:31:13 +01:00
Miguel de Icaza 07b6638343 Apply patch from Tom Hindle to fix ##2893 and add a test case.
The serializer interpreted was broken, but the compiled version was fine,
running MONO_XMLSERIALIZER_THS=0 allowed this to run
2012-01-14 15:35:45 -05: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 01308ef4ea Add test for XmlMembersMapping.TypeName and .Namespace (not very useful yet...) 2011-05-27 17:29:05 +09:00
Atsushi Eno e1f4f82a0a Do not import xs:any member as XmlElement[]. Create a wrapper class instead.
Part of bugfix #670945.
2011-05-16 18:45:08 +09:00
Atsushi Eno 2f86157982 XmlSerializer code generator was generating wrong char literal.
Fixed bug #673019.
2011-04-28 15:41:27 +09:00
Atsushi Eno 6e5c07fd59 2010-03-29 Atsushi Enomoto <[email protected]>
* XmlTypeMapping.cs, XmlReflectionImporter.cs: XmlRoot takes higher
	  priority to XmlSchemaProvider QName.
	  This fixes WCF EndpointAddress serialization.

	* XmlSerializerTests.cs : test for XmlRoot and XmlSchemaProvider
	  QName conflict case.


svn path=/trunk/mcs/; revision=154368
2010-03-29 12:48:29 +00:00
Atsushi Eno 2866de3175 2010-01-26 Atsushi Enomoto <[email protected]>
* XmlReflectionImporter.cs, SerializationCodeGenerator.cs,
	  XmlSerializationWriterInterpreter.cs: XmlAnyElementAttribute can be
	  still used for non-XmlNode (object) array. It only fails when it
	  tries to serialize non-XmlNode object at run-time.
	  Fixed bug #553032.

	* XmlSerializerTests.cs : added test for bug #553032.


svn path=/trunk/mcs/; revision=150197
2010-01-26 07:06:51 +00:00
Atsushi Eno 6811013bfb 2010-01-06 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs : enum value identifiers should be
	  escaped with '@'. Fixed bug #566370.

	* XmlSerializerTests.cs : added test for #566370.


svn path=/trunk/mcs/; revision=149104
2010-01-06 04:02:02 +00:00
Atsushi Eno ae6c7511d1 Fix for bug #430759.
svn path=/trunk/mcs/; revision=117965
2008-11-05 11:54:29 +00: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 dcf0d7cc29 * XmlCodeExporterTests.cs: Remove CWL.
svn path=/trunk/mcs/; revision=99459
2008-03-31 19:05:33 +00:00
Gert Driesen b10e9acc58 * 82078.xsd: Added new complex type as test for duplicate field
name.
* MapCodeGenerator.cs: Ensure fields that back properties are unique.
* XmlSerializationReaderTests.cs: Marked HandleOutAttributeParameters 
test as NotDotNet on 1.0 profile.
* XmlCodeExporterTests.cs: Improved test for duplicate identifiers.
Fixed ExportTypeMapping_Root and ExportTypeMapping_Field tests to
pass on .NET 2.0.

svn path=/trunk/mcs/; revision=99345
2008-03-30 15:25:11 +00:00
Atsushi Eno d89e9691ac 2008-02-19 Atsushi Enomoto <[email protected]>
* XsdWildcard.cs : block extra compilation and made compilation reset.
	  This somehow fixed bug #360541.

	* XmlSchemaAny.cs : block extra compilation in anyTypeContent.

	* XmlSchemasTests.cs : new test file (for bug #360541).

	* System.Xml_test.dll.sources: added XmlSchemasTests.cs.


svn path=/trunk/mcs/; revision=96115
2008-02-19 04:02:53 +00:00