public void testGetUserTypeIdentifierWithUnknownTypeName() { var ctx = new SafeConfigurablePofContext(); Assert.IsTrue(ctx.GetUserTypeIdentifier(typeof(NestedType).AssemblyQualifiedName) == SafeConfigurablePofContext.TYPE_PORTABLE); }
public void testGetUserTypeIdentifierWithUnknownObject() { var ctx = new SafeConfigurablePofContext(); Assert.IsTrue(ctx.GetUserTypeIdentifier(new NestedType()) == SafeConfigurablePofContext.TYPE_PORTABLE); }
public void testSerialization() { var ctx = new SafeConfigurablePofContext(); var uuid = new UUID(); var buffer = new MemoryStream(1024); ctx.Serialize(new DataWriter(buffer), uuid); buffer.Position = 0; Object o = ctx.Deserialize(new DataReader(buffer)); Assert.AreEqual(o, uuid); var person = new PortablePerson("Aleksandar Seovic", new DateTime(74, 7, 24)); person.Address = new Address("208 Myrtle Ridge Rd", "Lutz", "FL", "33549"); person.Children = new Person[] { new PortablePerson("Aleksandar Seovic JR.", new DateTime(174, 1, 1)) }; buffer.Position = 0; ctx.Serialize(new DataWriter(buffer), person); buffer.Position = 0; o = ctx.Deserialize(new DataReader(buffer)); Assert.AreEqual(o, person); }
public void testGetUserTypeIdentifierWithUnknownType() { var ctx = new SafeConfigurablePofContext(); Assert.IsTrue(ctx.GetUserTypeIdentifier(typeof(NestedType)) == SafeConfigurablePofContext.TYPE_PORTABLE); // COH-5584: repeat the test to verify that NestedType is now // cached in ConfigurablePofContext. Assert.IsTrue(ctx.GetUserTypeIdentifier(typeof(NestedType)) == SafeConfigurablePofContext.TYPE_PORTABLE); }
public void testEvolvableSerialization() { var ctx = new SafeConfigurablePofContext(); var person = new EvolvablePortablePerson("Aleksandar Seovic", new DateTime(74, 7, 24)); person.Address = new Address("208 Myrtle Ridge Rd", "Lutz", "FL", "33549"); person.DataVersion = 2; var buffer = new MemoryStream(1024); ctx.Serialize(new DataWriter(buffer), person); buffer.Position = 0; Object o = ctx.Deserialize(new DataReader(buffer)); Assert.IsTrue((((EvolvablePortablePerson)o).DataVersion == 2)); Assert.AreEqual(o, person); }
public void testSetSerializer() { IPofContext ctx = new ConfigurablePofContext("assembly://Coherence.Tests/Tangosol.Resources/s4hc-test-config.xml"); var set = new HashSet(); Assert.IsTrue(ctx.IsUserType(set)); Assert.IsTrue(ctx.IsUserType(typeof(HashSet))); Assert.IsTrue(ctx.IsUserType(typeof(HashSet).AssemblyQualifiedName)); var buffer = new MemoryStream(1024); var writer = new DataWriter(buffer); ctx.Serialize(writer, new HashSet()); var reader = new DataReader(buffer); buffer.Position = 0; object o = ctx.Deserialize(reader); Assert.IsTrue(o is HashSet); buffer.Close(); ctx = new SafeConfigurablePofContext("assembly://Coherence.Tests/Tangosol.Resources/s4hc-test-config.xml"); Assert.IsTrue(ctx.IsUserType(set)); Assert.IsTrue(ctx.IsUserType(typeof(HashSet))); Assert.IsTrue(ctx.IsUserType(typeof(HashSet).AssemblyQualifiedName)); buffer = new MemoryStream(1024); writer = new DataWriter(buffer); ctx.Serialize(writer, new HashSet()); reader = new DataReader(buffer); buffer.Position = 0; o = ctx.Deserialize(reader); Assert.IsTrue(o is HashSet); buffer.Close(); }
public void testIsUserTypeWithKnownObject() { var ctx = new SafeConfigurablePofContext(); Assert.IsTrue(ctx.IsUserType(new Exception())); }
public void testGetPofSerializerWithKnownTypeId() { var ctx = new SafeConfigurablePofContext(); Assert.IsTrue(ctx.GetPofSerializer(1) is PortableObjectSerializer); }
public void testGetUserTypeIdentifierWithNullTypeName() { var ctx = new SafeConfigurablePofContext(); ctx.GetUserTypeIdentifier((String)null); }
public void testIsUserTypeWithKnownTypeName() { var ctx = new SafeConfigurablePofContext(); Assert.IsTrue(ctx.IsUserType(typeof(Exception).AssemblyQualifiedName)); }
public void testGetUserTypeIdentifierWithPofType() { var ctx = new SafeConfigurablePofContext(); ctx.GetUserTypeIdentifier(typeof(HashDictionary)); }
public void testGetUserTypeIdentifierWithPofTypeName() { var ctx = new SafeConfigurablePofContext(); ctx.GetUserTypeIdentifier(typeof(HashDictionary).AssemblyQualifiedName); }
public void testGetTypeWithUnknownTypeId() { var ctx = new SafeConfigurablePofContext(); ctx.GetType(12358); }
public void testGetTypeWithNegativeTypeId() { var ctx = new SafeConfigurablePofContext(); ctx.GetType(-1); }
public void testIsUserTypeWithPofObject() { var ctx = new SafeConfigurablePofContext(); Assert.IsFalse(ctx.IsUserType(new HashDictionary())); }
public void testIsUserTypeWithUnknownObject() { var ctx = new SafeConfigurablePofContext(); Assert.IsFalse(ctx.IsUserType(this)); }
public void testIsUserTypeWithNullObject() { var ctx = new SafeConfigurablePofContext(); ctx.IsUserType((Object)null); }
public void testGetUserTypeIdentifierWithKnownTypeName() { var ctx = new SafeConfigurablePofContext(); Assert.IsTrue(ctx.GetUserTypeIdentifier(typeof(Exception).AssemblyQualifiedName) == 0); }
public void testGetPofSerializerWithUnknownTypeId() { var ctx = new SafeConfigurablePofContext(); ctx.GetPofSerializer(12358); }
public void testGetPofSerializerWithNegativeTypeId() { var ctx = new SafeConfigurablePofContext(); ctx.GetPofSerializer(-1); }
public void testGetTypeWithKnownTypeId() { var ctx = new SafeConfigurablePofContext(); Assert.IsTrue(typeof(Exception).Equals(ctx.GetType(0))); }
public void testIsUserTypeWithNullTypeName() { var ctx = new SafeConfigurablePofContext(); ctx.IsUserType((String)null); }
public void testGetUserTypeIdentifierWithNullObject() { var ctx = new SafeConfigurablePofContext(); ctx.GetUserTypeIdentifier((object)null); }
public void testIsUserTypeWithUnknownTypeName() { var ctx = new SafeConfigurablePofContext(); Assert.IsFalse(ctx.IsUserType(typeof(SafeConfigurablePofContextTests).AssemblyQualifiedName)); }
public void testGetUserTypeIdentifierWithPofObject() { var ctx = new SafeConfigurablePofContext(); ctx.GetUserTypeIdentifier(new HashDictionary()); }
public void testIsUserTypeWithPofTypeName() { var ctx = new SafeConfigurablePofContext(); Assert.IsFalse(ctx.IsUserType(typeof(HashDictionary).AssemblyQualifiedName)); }