internal async Task Relational_ChangeStorageFormatFromBinaryToJsonInMemory_WriteRead(string grainType, GrainReference grainReference, GrainState <TestState1> grainState) { //Use the default binary serializer and deserializer. Now the data in the storage is in binary format. var initialVersion = grainState.ETag; await PersistenceStorageTests.Store_WriteRead(grainType, grainReference, grainState); var firstVersion = grainState.ETag; Assert.NotEqual(initialVersion, firstVersion); //Change the serializer and deserializer to a JSON one. The real world situation might be more complicated that the data //might not be in memory upon first read but the previous serializer format would need to used to retrieve data and the //new one to write and after that the new one used to both read and write data. //Change both the serializer and deserializer and do writing and reading once more just to be sure. ((AdoNetStorageProvider)PersistenceStorageTests.Storage).StorageSerializationPicker = JsonPicker; await PersistenceStorageTests.Store_WriteRead(grainType, grainReference, grainState); var secondVersion = grainState.ETag; Assert.NotEqual(firstVersion, secondVersion); }
internal async Task Relational_Xml_WriteReadStreaming(string grainType, GrainReference grainReference, GrainState <TestStateGeneric1 <string> > grainState) { ((AdoNetStorageProvider)PersistenceStorageTests.Storage).StorageSerializationPicker = XmlStreamingPicker; await PersistenceStorageTests.Store_WriteRead(grainType, grainReference, grainState); }
internal async Task Relational_Json_WriteRead(string grainType, GrainReference grainReference, GrainState <TestStateGeneric1 <string> > grainState) { ((AdoNetGrainStorage)PersistenceStorageTests.Storage).StorageSerializationPicker = JsonPicker; await PersistenceStorageTests.Store_WriteRead(grainType, grainReference, grainState); }