Index: trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs	(revision 5290)
+++ trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs	(revision 5324)
@@ -31,4 +31,5 @@
 using HeuristicLab.Persistence.Auxiliary;
 using HeuristicLab.Persistence.Core;
+using HeuristicLab.Persistence.Core.Tokens;
 using HeuristicLab.Persistence.Default.CompositeSerializers;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
@@ -606,6 +607,5 @@
         XmlGenerator.Serialize(c, tempFile);
         Assert.Fail("Exception not thrown");
-      }
-      catch (PersistenceException) {
+      } catch (PersistenceException) {
       }
     }
@@ -619,6 +619,5 @@
         XmlGenerator.Serialize(s, tempFile);
         Assert.Fail("Exception expected");
-      }
-      catch (PersistenceException) { }
+      } catch (PersistenceException) { }
       List<int> newList = (List<int>)XmlParser.Deserialize(tempFile);
       Assert.AreEqual(list[0], newList[0]);
@@ -659,6 +658,5 @@
         }
         Assert.Fail("Exception expected");
-      }
-      catch (PersistenceException px) {
+      } catch (PersistenceException px) {
         Assert.AreEqual(3, px.Data.Count);
       }
@@ -688,6 +686,5 @@
         d = new Deserializer(XmlParser.ParseTypeCache(new StringReader(newTypeString)));
         Assert.Fail("Exception expected");
-      }
-      catch (PersistenceException x) {
+      } catch (PersistenceException x) {
         Assert.IsTrue(x.Message.Contains("incompatible"));
       }
@@ -698,6 +695,5 @@
         d = new Deserializer(XmlParser.ParseTypeCache(new StringReader(newTypeString)));
         Assert.Fail("Exception expected");
-      }
-      catch (PersistenceException x) {
+      } catch (PersistenceException x) {
         Assert.IsTrue(x.Message.Contains("newer"));
       }
@@ -866,6 +862,5 @@
         ExplodingDefaultConstructor newX = (ExplodingDefaultConstructor)XmlParser.Deserialize(tempFile);
         Assert.Fail("Exception expected");
-      }
-      catch (PersistenceException pe) {
+      } catch (PersistenceException pe) {
         Assert.AreEqual(pe.InnerException.Message, "this constructor will always fail");
       }
@@ -878,6 +873,5 @@
         XmlGenerator.Serialize(ns, tempFile);
         Assert.Fail("PersistenceException expected");
-      }
-      catch (PersistenceException x) {
+      } catch (PersistenceException x) {
         Assert.IsTrue(x.Message.Contains(new StorableSerializer().JustifyRejection(typeof(NonSerializable))));
       }
@@ -1161,4 +1155,79 @@
     }
 
+    [StorableClass]
+    public class ReadOnlyFail {
+      [Storable]
+      public string ReadOnly {
+        get { return "fail"; }
+      }
+    }
+
+    [TestMethod]
+    public void TestReadOnlyFail() {
+      try {
+        XmlGenerator.Serialize(new ReadOnlyFail(), tempFile);
+        Assert.Fail("Exception expected");
+      } catch (PersistenceException) {
+      } catch {
+        Assert.Fail("PersistenceException expected");
+      }
+    }
+
+
+    [StorableClass]
+    public class WriteOnlyFail {
+      [Storable]
+      public string WriteOnly {
+        set { throw new InvalidOperationException("this property should never be set."); }
+      }
+    }
+
+    [TestMethod]
+    public void TestWriteOnlyFail() {
+      try {
+        XmlGenerator.Serialize(new WriteOnlyFail(), tempFile);
+        Assert.Fail("Exception expected");
+      } catch (PersistenceException) {
+      } catch {
+        Assert.Fail("PersistenceException expected.");
+      }
+    }
+
+    [StorableClass]
+    public class OneWayTest {
+      public OneWayTest() { this.value = "default"; }
+      public string value;
+      [Storable(AllowOneWay=true)]
+      public string ReadOnly {
+        get { return "ReadOnly"; }
+      }
+      [Storable(AllowOneWay=true)]
+      public string WriteOnly {
+        set { this.value = value; }
+      }
+    }
+
+    [TestMethod]
+    public void TestOneWaySerialization() {
+      var test = new OneWayTest();
+      var serializer = new Serializer(test, ConfigurationService.Instance.GetDefaultConfig(new XmlFormat()));
+      var it = serializer.GetEnumerator();
+      it.MoveNext();
+      Assert.AreEqual("ROOT", ((BeginToken)it.Current).Name); it.MoveNext();
+      Assert.AreEqual("ReadOnly", ((PrimitiveToken)it.Current).Name); it.MoveNext();
+      Assert.AreEqual("ROOT", ((EndToken)it.Current).Name); it.MoveNext();
+      var deserializer = new Deserializer(new[] { 
+        new TypeMapping(0, typeof(OneWayTest).AssemblyQualifiedName, typeof(StorableSerializer).AssemblyQualifiedName),
+        new TypeMapping(1, typeof(string).AssemblyQualifiedName, typeof(String2XmlSerializer).AssemblyQualifiedName) });
+      var newTest = (OneWayTest)deserializer.Deserialize(new ISerializationToken[] {
+        new BeginToken("ROOT", 0, 0),
+        new PrimitiveToken("WriteOnly", 1, 1, new XmlString("<![CDATA[serial data]]>")),
+        new EndToken("ROOT", 0, 0)
+      });
+      Assert.AreEqual("serial data", newTest.value);
+    }
+
+
+
     [ClassInitialize]
     public static void Initialize(TestContext testContext) {
