Index: trunk/sources/HeuristicLab.Persistence/Test/HeuristicLab.Persistence.Test.csproj
===================================================================
--- trunk/sources/HeuristicLab.Persistence/Test/HeuristicLab.Persistence.Test.csproj	(revision 1568)
+++ trunk/sources/HeuristicLab.Persistence/Test/HeuristicLab.Persistence.Test.csproj	(revision 1568)
@@ -0,0 +1,103 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{E2245078-6F40-449E-A370-01A97A7C5E6A}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Persistence.Test</RootNamespace>
+    <AssemblyName>HeuristicLab.Persistence.Test</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <StartupObject>HeuristicLab.Persistence.Test.NewSerializationTest</StartupObject>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <ItemGroup>
+    <Compile Include="NewSerializationTest.cs" />
+    <Compile Include="SerializationTest.cs" />
+    <Compile Include="StorableAttributeTests.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\HeuristicLab.Tracing\3.2\libs\debug\log4net.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.XML" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
+      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
+      <Name>HeuristicLab.Persistence-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Tracing\3.2\HeuristicLab.Tracing-3.2.csproj">
+      <Project>{EE2034D9-6E27-48A1-B855-42D45F69A4FC}</Project>
+      <Name>HeuristicLab.Tracing-3.2</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Properties\" />
+  </ItemGroup>
+</Project>
Index: trunk/sources/HeuristicLab.Persistence/Test/NewSerializationTest.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/Test/NewSerializationTest.cs	(revision 1568)
+++ trunk/sources/HeuristicLab.Persistence/Test/NewSerializationTest.cs	(revision 1568)
@@ -0,0 +1,312 @@
+﻿using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using HeuristicLab.Persistence.Core;
+using HeuristicLab.Persistence.Default.Xml;
+using HeuristicLab.Persistence.Interfaces;
+using HeuristicLab.Tracing;
+using log4net;
+using log4net.Config;
+using HeuristicLab.Persistence.Default.ViewOnly;
+
+namespace HeuristicLab.Persistence.Test {
+
+  public class StringDecomposerTest {
+    [Storable] private bool _bool = true;
+    [Storable] private byte _byte = 0xFF;
+    [Storable] private sbyte _sbyte = 0xF;
+    [Storable] private short _short = -123;
+    [Storable] private ushort _ushort = 123;
+    [Storable] private int _int = -123;
+    [Storable] private uint _uint = 123;
+    [Storable] private long _long = 123456;
+    [Storable] private ulong _ulong = 123456;
+    [Storable] private long[,] _long_array =
+      new long[,] { { 123, 456, }, { 789, 123 } };
+    [Storable] public List<int> list = new List<int>{ 1, 2, 3, 4, 5};
+  }
+
+  public enum TestEnum { va1, va2, va3, va8 } ;
+
+  public class RootBase {
+    [Storable]
+    private string baseString = "   Serial  ";
+    [Storable]
+    public TestEnum myEnum = TestEnum.va3;
+  }
+
+  public class Root : RootBase {
+    [Storable]
+    public int[] i = new[] { 3, 4, 5, 6 };
+    [Storable]
+    public string s;
+    [Storable]
+    public ArrayList intArray = new ArrayList(new[] { 1, 2, 3 });
+    [Storable]
+    public List<int> intList = new List<int>(new[] { 321, 312, 321 });
+    [Storable]
+    public Custom c;
+    [Storable]
+    public List<Root> selfReferences;
+    [Storable]
+    public double[,] multiDimArray = new double[,] { { 1, 2, 3 }, { 3, 4, 5 } };
+    [Storable]
+    public bool boolean = true;
+    [Storable]
+    public DateTime dateTime;
+    [Storable]
+    public KeyValuePair<string, int> kvp = new KeyValuePair<string, int>("Serial", 123);
+    [Storable]
+    public Dictionary<string, int> dict = new Dictionary<string, int>();
+    [Storable(DefaultValue = "default")]
+    public string uninitialized;
+  }
+
+  public class Custom {
+    [Storable]
+    public int i;
+    [Storable]
+    public Root r;
+    [Storable]
+    public string name = "Serial";
+  }
+
+  public class CloneableRoot {
+    public int[] i = new[] { 3, 4, 5, 6 };
+    public string s;
+    public ArrayList intArray = new ArrayList(new[] { 1, 2, 3 });
+    public List<int> intList = new List<int>(new[] { 321, 312, 321 });
+    public CloneableCustom c;
+    public List<CloneableRoot> selfReferences;
+    public double[,] multiDimArray = new double[,] { { 1, 2, 3 }, { 3, 4, 5 } };
+    public bool boolean = true;
+    public DateTime dateTime;
+    public KeyValuePair<string, int> kvp = new KeyValuePair<string, int>("test key", 123);
+    public Dictionary<string, int> dict = new Dictionary<string, int>();
+    public object Clone(Dictionary<object, object> twins) {
+      if (twins.ContainsKey(this))
+        return twins[this];
+      CloneableRoot cr = new CloneableRoot();
+      twins.Add(this, cr);
+      cr.i = i;
+      cr.s = s;
+      cr.intArray = new ArrayList(intArray);
+      cr.intList = new List<int>(intList);
+      cr.c = (CloneableCustom)c.Clone(twins);
+      cr.selfReferences = new List<CloneableRoot>();
+      for (int j = 0; j < selfReferences.Count; j++) {
+        cr.selfReferences.Add(this);
+      }
+      cr.multiDimArray = (double[,])multiDimArray.Clone();
+      cr.dateTime = new DateTime(dateTime.Ticks);
+      cr.kvp = new KeyValuePair<string, int>(kvp.Key, kvp.Value);
+      cr.dict = new Dictionary<string, int>(dict);
+      return cr;
+    }
+  }
+
+  public class CloneableCustom {
+    public int i;
+    public CloneableRoot r;
+    public string name = "Serial";
+    public object Clone(Dictionary<object, object> twins) {
+      if (twins.ContainsKey(this))
+        return twins[this];
+      CloneableCustom cc = new CloneableCustom();
+      twins.Add(this, cc);
+      cc.i = i;
+      cc.r = (CloneableRoot)r.Clone(twins);
+      cc.name = name;
+      return cc;
+    }
+  }
+
+  public class Manager {
+
+    private DateTime lastLoadTime;
+    [Storable]
+    private DateTime lastLoadTimePersistence {
+      get { return lastLoadTime; }
+      // ReSharper disable ValueParameterNotUsed
+      set { lastLoadTime = DateTime.Now; }
+      // ReSharper restore ValueParameterNotUsed
+    }
+    [Storable]
+    private double? dbl;
+  }
+
+  public class StorableObject {
+
+    [Storable]
+    Dictionary<int, string> dict;
+
+    public void Init() {
+      dict = new Dictionary<int, string>();
+      for (int i = 0; i < 1000000; i++) {
+        dict.Add(i, i.ToString());
+      }
+    }
+  }
+
+  public class CloneableObject : ICloneable {
+
+    Dictionary<int, string> dict;
+
+    public void Init() {
+      dict = new Dictionary<int, string>();
+      for (int i = 0; i < 1000000; i++) {
+        dict.Add(i, i.ToString());
+      }
+    }
+    public object Clone() {
+      CloneableObject clone = new CloneableObject {
+        dict = new Dictionary<int, string>(dict)
+      };
+      return clone;
+    }
+  }
+
+  public class C {
+    [Storable]
+    public C[][] allCs;
+    public KeyValuePair<List<C>, C> kvpList;
+  }
+
+  public class NewSerializationTest {
+
+    public static void Test1() {
+      Root r = new Root();
+      r.selfReferences = new List<Root> { r, r };
+      r.c = new Custom { r = r };
+      r.dict.Add("one", 1);
+      r.dict.Add("two", 2);
+      r.dict.Add("three", 3);
+      r.myEnum = TestEnum.va1;
+      XmlGenerator.Serialize(r, "test.zip");
+      object o = XmlParser.DeSerialize("test.zip");
+      Console.WriteLine(ViewOnlyGenerator.Serialize(r));
+      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
+    }
+
+    public static void Test3() {
+      C c = new C();
+      C[][] cs = new C[2][];
+      cs[0] = new C[] { c };
+      cs[1] = new C[] { c };
+      c.allCs = cs;
+      c.kvpList = new KeyValuePair<List<C>, C>(new List<C> { c }, c);
+      XmlGenerator.Serialize(cs, "test3.zip");
+      object o = XmlParser.DeSerialize("test3.zip");
+      Console.WriteLine(ViewOnlyGenerator.Serialize(cs));
+      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
+    }
+
+    public static void Test4() {
+      ArrayList[] arrayListArray = new ArrayList[4];
+      arrayListArray[0] = new ArrayList();
+      arrayListArray[0].Add(arrayListArray);
+      arrayListArray[0].Add(arrayListArray);
+      arrayListArray[1] = new ArrayList();
+      arrayListArray[1].Add(arrayListArray);
+      arrayListArray[2] = new ArrayList();
+      arrayListArray[2].Add(arrayListArray);
+      arrayListArray[2].Add(arrayListArray);
+      Array a = Array.CreateInstance(
+                              typeof(object),
+                              new[] { 1, 2 }, new[] { 3, 4 });
+      arrayListArray[2].Add(a);
+      XmlGenerator.Serialize(arrayListArray, "test4.zip");
+      object o = XmlParser.DeSerialize("test4.zip");
+      Console.WriteLine(ViewOnlyGenerator.Serialize(arrayListArray));
+      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
+    }
+
+    public static void Test2() {
+      Manager m = new Manager();
+      XmlGenerator.Serialize(m, "test2.zip");
+      object o = XmlParser.DeSerialize("test2.zip");
+      Console.WriteLine(ViewOnlyGenerator.Serialize(m));
+      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
+    }
+
+
+
+    public static void Test5() {
+      StringDecomposerTest sdt = new StringDecomposerTest();
+      XmlGenerator.Serialize(sdt, "test5.zip");
+      object o = XmlParser.DeSerialize("test5.zip");
+      //Console.WriteLine(ViewOnlyGenerator.Serialize(sdt));
+      //Console.WriteLine(ViewOnlyGenerator.Serialize(o));
+    }
+
+    public static void Test6() {
+      string[,] mDimString = new string[,] {
+        {"ora", "et", "labora"},
+        {"Beten", "und", "Arbeiten"}
+      };
+      XmlGenerator.Serialize(mDimString, "test6.zip");
+      object o = XmlParser.DeSerialize("test6.zip");
+      Console.WriteLine(ViewOnlyGenerator.Serialize(mDimString));
+      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
+    }
+
+    public class NestedType {
+      [Storable]
+      private string value = "value";
+    }
+
+    public static void Test7() {
+      NestedType t = new NestedType();
+      XmlGenerator.Serialize(t, "test7.zip");
+      object o = XmlParser.DeSerialize("test7.zip");
+      Console.WriteLine(ViewOnlyGenerator.Serialize(t));
+      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
+    }
+
+
+    public static void Test8() {
+      string[] strings = { "ora", "et", "labora" };
+      XmlGenerator.Serialize(strings, "test8.zip");
+      object o = XmlParser.DeSerialize("test8.zip");
+      Console.WriteLine(ViewOnlyGenerator.Serialize(strings));
+      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
+    }
+
+    public static void Test9() {
+      Root r = new Root();
+      //BinaryGenerator.Serialize(r, "test.bin");
+    }
+
+    class Float {
+      [Storable]
+      float f = 12.3f;
+    }
+
+    public static void Test10() {
+      XmlGenerator.Serialize(12.3f, "test9.zip");
+      object o = XmlParser.DeSerialize("test9.zip");
+      Console.WriteLine(ViewOnlyGenerator.Serialize(12.3f));
+      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
+    }
+
+
+    public static void Main() {
+      BasicConfigurator.Configure();
+      ConfigurationService.Instance.Reset();
+      Test1();
+      Test2();
+      Test3();
+      Test4();
+      Test5();
+      Test6();
+      Test7();
+      Test8();
+      Test9();
+      Test10();
+      //SpeedTest();
+      //SpeedTest2();
+      Console.In.ReadLine();
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Persistence/Test/SerializationTest.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/Test/SerializationTest.cs	(revision 1568)
+++ trunk/sources/HeuristicLab.Persistence/Test/SerializationTest.cs	(revision 1568)
@@ -0,0 +1,52 @@
+﻿using System;
+using System.Xml.Serialization;
+using System.Collections;
+
+namespace Persistence.Test {
+
+  [Serializable]
+  public class Employer {
+
+    public string name;
+    public ArrayList employees;
+
+    public Employer() { }
+
+    public Employer(string name) {
+      this.name = name;
+      employees = new ArrayList();
+    }
+
+  }
+
+  [Serializable]
+  public class Employee {
+
+    public string firstName;
+    public string lastName;
+    public Employer employer;
+
+    public Employee() { }
+
+    public Employee(string firstName, string lastName, Employer employer) {
+      this.firstName = firstName;
+      this.lastName = lastName;
+      this.employer = employer;
+    }
+
+  }
+
+  class SerializationTest {
+    public static void Main() {
+
+      Employer company = new Employer("FH OOE F&E GmbH.");
+      company.employees.Add(new Employee("John", "Smith", company));
+      company.employees.Add(new Employee("Max", "Mustermann", company));
+      company.employees.Add(new Employee("Erik", "Pitzer", company));
+
+      XmlSerializer s = new XmlSerializer(typeof(Employer));
+      s.Serialize(Console.Out, company);
+      Console.ReadLine();
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Persistence/Test/StorableAttributeTests.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/Test/StorableAttributeTests.cs	(revision 1568)
+++ trunk/sources/HeuristicLab.Persistence/Test/StorableAttributeTests.cs	(revision 1568)
@@ -0,0 +1,41 @@
+﻿using System;
+using System.Collections.Generic;
+using HeuristicLab.Persistence.Core;
+
+namespace HeuristicLab.Persistence.Test {
+
+  class TestClass {
+
+    [Storable(Name = "TestProperty", DefaultValue = 12)]
+    public object o;
+
+    [Storable]
+    public int x = 2;
+
+    public int y;
+
+  }
+
+  class AttributeTest {
+
+    static void Main() {
+      TestClass t = new TestClass();
+      Dictionary<string, DataMemberAccessor> accessors = StorableAttribute.GetStorableAccessors(t);
+      foreach (KeyValuePair<string, DataMemberAccessor> pair in accessors) {
+        Console.WriteLine(pair.Key + ": " + pair.Value);
+      }
+      t.o = new Object();
+      t.x = 12;
+      t.y = 312890;
+      accessors["o"].Set(null);
+      accessors["x"].Set(123);
+      try {
+        accessors["y"].Set(0);
+        throw new InvalidOperationException();
+      } catch (KeyNotFoundException) { }
+      Console.ReadLine();
+    }
+
+  }
+
+}
