Index: src/LevMartester.cpp
===================================================================
--- src/LevMartester.cpp	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/LevMartester.cpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -40,4 +40,5 @@
 
 #include <boost/assign.hpp>
+#include <boost/assign/list_of.hpp>
 #include <boost/bind.hpp>
 #include <boost/filesystem.hpp>
Index: src/Potentials/EmpiricalPotential.hpp
===================================================================
--- src/Potentials/EmpiricalPotential.hpp	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/Potentials/EmpiricalPotential.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -66,14 +66,5 @@
    */
   virtual derivative_components_t derivative(const arguments_t &arguments) const=0;
-
-  /** Return the name of this specific potential.
-   *
-   * This is required for storage in a Registry.
-   *
-   * \return name of the potential
-   */
-  virtual const std::string getName() const=0;
 };
 
-
 #endif /* EMPIRICALPOTENTIAL_HPP_ */
Index: src/Potentials/Exceptions.hpp
===================================================================
--- src/Potentials/Exceptions.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
+++ src/Potentials/Exceptions.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -0,0 +1,40 @@
+/*
+ * Exceptions.hpp
+ *
+ *  Created on: Nov 23, 2012
+ *      Author: heber
+ */
+
+#ifndef SERIALZABLEPOTENTIALEXCEPTIONS_HPP_
+#define SERIALZABLEPOTENTIALEXCEPTIONS_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <exception>
+#include <boost/exception/all.hpp>
+
+/** Base type for all exceptions regarding linear algebra.
+ *
+ */
+struct SerializablePotentialException : virtual std::exception, virtual boost::exception { };
+
+/** ========================== General error information ================== */
+
+/** Exception information for ParserException: non-present key of an internal map.
+ */
+typedef boost::error_info< struct tag_SerializablePotentialKey, const std::string > SerializablePotentialKey;
+
+/** ============================ Specific exceptions ====================== */
+
+/** Exception thrown when the given parameter name/key does not exist
+ */
+struct SerializablePotentialIllegalKeyException : virtual SerializablePotentialException { };
+
+/** Exception thrown when the value to parameter name/key is missing
+ */
+struct SerializablePotentialMissingValueException : virtual SerializablePotentialException { };
+
+#endif /* EXCEPTIONS_HPP_ */
Index: src/Potentials/Makefile.am
===================================================================
--- src/Potentials/Makefile.am	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/Potentials/Makefile.am	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -5,4 +5,5 @@
   Potentials/Specifics/ManyBodyPotential_Tersoff.cpp \
   Potentials/PotentialRegistry.cpp \
+  Potentials/SerializablePotential.cpp \
   Potentials/Specifics/PairPotential_Angle.cpp \
   Potentials/Specifics/PairPotential_Harmonic.cpp \
@@ -12,6 +13,8 @@
 POTENTIALSHEADER = \
   Potentials/EmpiricalPotential.hpp \
+  Potentials/Exceptions.hpp \
   Potentials/helpers.hpp \
   Potentials/PotentialRegistry.hpp \
+  Potentials/SerializablePotential.hpp \
   Potentials/Specifics/ManyBodyPotential_Tersoff.hpp \
   Potentials/Specifics/PairPotential_Angle.hpp \
Index: src/Potentials/PotentialRegistry.cpp
===================================================================
--- src/Potentials/PotentialRegistry.cpp	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/Potentials/PotentialRegistry.cpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -40,3 +40,3 @@
 
 CONSTRUCT_SINGLETON(PotentialRegistry)
-CONSTRUCT_REGISTRY(EmpiricalPotential)
+CONSTRUCT_REGISTRY(SerializablePotential)
Index: src/Potentials/PotentialRegistry.hpp
===================================================================
--- src/Potentials/PotentialRegistry.hpp	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/Potentials/PotentialRegistry.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -16,5 +16,5 @@
 #include "CodePatterns/Registry.hpp"
 #include "CodePatterns/Singleton.hpp"
-#include "Potentials/EmpiricalPotential.hpp"
+#include "Potentials/SerializablePotential.hpp"
 
 /** Potential Registry.
@@ -29,8 +29,8 @@
  * ones.
  */
-class PotentialRegistry : public Singleton<PotentialRegistry>, public Registry<EmpiricalPotential>
+class PotentialRegistry : public Singleton<PotentialRegistry>, public Registry<SerializablePotential>
 {
   friend class Singleton<PotentialRegistry>;
-  //friend class Registry<EmpiricalPotential>;
+  //friend class Registry<SerializablePotential>;
 
 public:
Index: src/Potentials/SerializablePotential.cpp
===================================================================
--- src/Potentials/SerializablePotential.cpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
+++ src/Potentials/SerializablePotential.cpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -0,0 +1,170 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the COPYING file or "Copyright notice" in builder.cpp for details.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>. 
+ */
+
+/*
+ * SerializablePotential.cpp
+ *
+ *  Created on: 23.11.2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "SerializablePotential.hpp"
+
+#include <algorithm>
+#include <boost/foreach.hpp>
+#include <boost/tokenizer.hpp>
+#include <iostream>
+#include <string>
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/toString.hpp"
+
+#include "Potentials/Exceptions.hpp"
+
+std::ostream& operator<<(std::ostream &ost, const SerializablePotential &potential)
+{
+  // check stream
+  if (ost.bad())
+    throw SerializablePotentialException();
+
+  /// print parameter key
+  ost << potential.getToken() << ":";
+  /// print associated particles
+  const SerializablePotential::ParticleTypes_t &types = potential.getParticleTypes();
+  for (size_t index=0; index < types.size(); ++index) {
+    ost << "\tparticle_type" << index+1 << "=" << types[index];
+    ost << (index != (types.size()-1) ? std::string(",") : std::string(""));
+  }
+  /// print coefficients
+  const SerializablePotential::ParameterNames_t &paramNames = potential.getParameterNames();
+  const SerializablePotential::parameters_t &params = potential.getParameters();
+  SerializablePotential::ParameterNames_t::const_iterator nameiter = paramNames.begin();
+  SerializablePotential::parameters_t::const_iterator valueiter = params.begin();
+  for (; valueiter != params.end(); ++valueiter, ++nameiter) {
+    ASSERT( nameiter != paramNames.end(),
+        "ManyBodyPotential_Tersoff::operator<<() - there are less names than parameters.");
+    if (*nameiter != std::string(""))
+      ost << ",\t" << *nameiter << "=" << *valueiter;
+  }
+  /// print terminating semi-colon
+  ost << ";";
+  return ost;
+}
+
+std::istream& operator>>(std::istream &ist, SerializablePotential &potential)
+{
+  // check stream
+  if (ist.bad())
+    throw SerializablePotentialException();
+
+  // create copy of current parameters, hence line may contain not all required
+  SerializablePotential::parameters_t params(potential.getParameters());
+
+  // read in full line
+  std::string linestring;
+  getline(ist, linestring);
+  const std::string whitespace(" \t");
+  const size_t strBegin = linestring.find_first_not_of(whitespace);
+  const size_t colonpos = linestring.find(":");
+  if ((strBegin == std::string::npos) || (colonpos == std::string::npos) ||
+      (linestring.substr(strBegin, colonpos-1) != potential.getToken()))
+    throw SerializablePotentialMissingValueException()
+        << SerializablePotentialKey(potential.getName());
+
+  // tokenize by ","
+  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
+  boost::char_separator<char> pairsep(",\t ;");
+  boost::char_separator<char> keyvaluesep("=");
+  std::string remainderstring(linestring.substr(colonpos+1));
+//  {
+//    std::stringstream remainderstream
+//    remainderstream >> std::ws >> remainderstring;
+//  }
+  tokenizer tokens(remainderstring, pairsep); //skip colon
+
+  // step through each token
+  ConvertTo<size_t> ConvertToIndex;
+  ConvertTo<SerializablePotential::parameter_t> ConvertToValue;
+  ConvertTo<SerializablePotential::ParticleType_t> ConvertToParticleType;
+  for (tokenizer::iterator tok_iter = tokens.begin();
+    tok_iter != tokens.end(); ++tok_iter) {
+    const std::string &keyvalue = *tok_iter;
+    tokenizer keyvaluetoken(keyvalue, keyvaluesep);
+    tokenizer::iterator keyvalue_iter = keyvaluetoken.begin();
+    const std::string &key = *keyvalue_iter;
+
+    /// parse the particle_types
+    const size_t pos = key.find("particle_type");
+    if (pos != std::string::npos) {
+      // split of type and convert rest to index
+      const size_t index = ConvertToIndex(key.substr(pos, std::string::npos));
+      // and set the type
+      if (++keyvalue_iter == keyvaluetoken.end())
+        throw SerializablePotentialMissingValueException() << SerializablePotentialKey(key);
+      const std::string &value = *keyvalue_iter;
+      potential.setParticleType(index, ConvertToParticleType(value));
+    } else {
+      const size_t index = potential.getParameterIndex(key);
+      // parse the coefficients
+      if (index != (size_t)-1) {
+        if (++keyvalue_iter == keyvaluetoken.end())
+          throw SerializablePotentialMissingValueException() << SerializablePotentialKey(key);
+        const std::string &value = *keyvalue_iter;
+        params[index] = ConvertToValue(value);
+      } else {
+        throw SerializablePotentialIllegalKeyException() << SerializablePotentialKey(key);
+      }
+    }
+  }
+
+  /// set the new paremeters
+  potential.setParameters(params);
+  return ist;
+}
+
+const size_t SerializablePotential::getParameterIndex(const std::string &_name) const
+{
+  const ParameterNames_t& ParameterNames = getParameterNames();
+  ParameterNames_t::const_iterator iter =
+      std::find(ParameterNames.begin(), ParameterNames.end(), _name);
+  if (iter == ParameterNames.end())
+    return (size_t)-1;
+  else
+    return std::distance(ParameterNames.begin(), iter);
+}
+
+const std::string SerializablePotential::getName() const
+{
+  std::string returnstring = getToken() + std::string("_");
+  BOOST_FOREACH(const ParticleType_t &type, getParticleTypes()) {
+    returnstring += toString(type);
+  }
+  return returnstring;
+}
Index: src/Potentials/SerializablePotential.hpp
===================================================================
--- src/Potentials/SerializablePotential.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
+++ src/Potentials/SerializablePotential.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -0,0 +1,159 @@
+/*
+ * SerializablePotential.hpp
+ *
+ *  Created on: 23.11.2012
+ *      Author: heber
+ */
+
+#ifndef SERIALIZABLEPOTENTIAL_HPP_
+#define SERIALIZABLEPOTENTIAL_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <iosfwd>
+#include <vector>
+
+/** SerializablePotential is a potential that can be parsed from and stored to
+ * a .potentials file.
+ *
+ * All required functionality for printing and parsing the set of parameters
+ * is set as virtual functions and have to be implemented specifically, e.g.
+ * -# ParameterNames: Should be static instance as are the same over each
+ *    potential type despite although there may be more than one instance.
+ *    \note If the parameter name is left empty, the value is neither printed
+ *    nor parsed. This may be issued to skip internal parameters (e.g. offset).
+ * -# ParticleTypes: has been implemented here, as is different per instance.
+ *
+ * Specifically, what you need to do when inheriting is:
+ * -# implement getParameters() and setParameters()
+ * -# have some static const ParameterNames_t in your class and implement
+ *    getParameterNames() as a getter for it (or any other way you prefer).
+ *    The static instance can be easily initialized via boost::assign::list_of.
+ *
+ */
+class SerializablePotential
+{
+  //!> grant operator access to private functions
+  friend std::ostream& operator<<(std::ostream &ost, const SerializablePotential &potential);
+  //!> grant operator access to private functions
+  friend std::istream& operator>>(std::istream &ost, SerializablePotential &potential);
+
+public:
+  //!> typedef for particle designation
+  typedef int ParticleType_t;
+  //!> typedef for a vector of particle designations
+  typedef std::vector<ParticleType_t> ParticleTypes_t;
+  //!> typedef for a vector of parameter names
+  typedef std::vector<std::string> ParameterNames_t;
+  //!> typedef for a single parameter degree of freedom of the function
+  typedef double parameter_t;
+  //!> typedef for the whole set of parameters of the function
+  typedef std::vector<parameter_t> parameters_t;
+
+public:
+  SerializablePotential(const ParticleTypes_t &_ParticleTypes) :
+    ParticleTypes(_ParticleTypes)
+  {}
+  ~SerializablePotential() {}
+
+  /** Return the token name of this specific potential.
+   *
+   * \return token name of the potential
+   */
+  virtual const std::string& getToken() const=0;
+
+  /** Return the name of this specific potential.
+   *
+   * This is required for storage in a Registry. The name is the token name
+   * followed by "_" and the particle types to make it unique.
+   *
+   * \return name of the potential
+   */
+  const std::string getName() const;
+
+
+  /** Getter for the parameters of this model function.
+   *
+   * \return current set of parameters of the model function
+   */
+  virtual parameters_t getParameters() const=0;
+
+  /** Getter for the number of parameters of this model function.
+   *
+   * \return number of parameters
+   */
+  virtual size_t getParameterDimension() const=0;
+
+  /** Returns a vector of particle designations.
+   *
+   * These designations denote the particle types for which this potential
+   * has been parametrized.
+   *
+   * \return vector of particle type
+   */
+  const ParticleTypes_t& getParticleTypes() const
+  { return ParticleTypes; }
+
+  /** Returns a vector of parameter names.
+   *
+   * This is required from the specific implementation
+   *
+   * \return vector of strings containing parameter names
+   */
+  virtual const ParameterNames_t& getParameterNames() const=0;
+
+  /** Returns the index associated to a specific parameter \a _name.
+   *
+   * \param _name parameter name to look up index for
+   * \return index to the given \a _name or (size_t)-1 if none found
+   */
+  const size_t getParameterIndex(const std::string &_name) const;
+
+protected:
+
+  /** Setter for the parameters of the model function.
+   *
+   * \param params set of parameters to set
+   */
+  virtual void setParameters(const parameters_t &params)=0;
+
+  /** Setter for a given particle type.
+   *
+   * \param index index of type to set
+   * \param _designation type to set to
+   */
+  void setParticleType(const size_t index, const ParticleType_t& _designation)
+  {
+    const_cast<ParticleTypes_t &>(ParticleTypes).resize(index);
+    const_cast<ParticleTypes_t &>(ParticleTypes)[index] = _designation;
+  }
+
+private:
+
+  //!> static definition of the particle types for this potential
+  const ParticleTypes_t ParticleTypes;
+};
+
+/** Output operations stores .potentials line containing these parameters
+ * coefficients and designations.
+ *
+ * \param ost output stream to print to
+ * \param potential potential whose coefficients to print
+ * \return output stream for concatenation
+ */
+std::ostream& operator<<(std::ostream &ost, const SerializablePotential &potential);
+
+/** Input operation parses coefficients from a given line of a .potentials
+ * file.
+ *
+ * \param ist input stream to parse from
+ * \param potential potential to set
+ * \return input stream for concatenation
+ */
+std::istream& operator>>(std::istream &ist, SerializablePotential &potential);
+
+
+#endif /* SERIALIZABLEPOTENTIAL_HPP_ */
Index: src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp
===================================================================
--- src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -120,11 +120,9 @@
   results_t parameter_derivative(const arguments_t &arguments, const size_t index) const;
 
-  /** Return the name of this specific potential.
-   *
-   * This is required for storage in a Registry.
-   *
-   * \return name of the potential
-   */
-  const std::string getName() const {
+  /** Return the token name of this specific potential.
+   *
+   * \return token name of the potential
+   */
+  const std::string getToken() const {
     return std::string("tersoff");
   }
Index: src/Potentials/Specifics/PairPotential_Angle.hpp
===================================================================
--- src/Potentials/Specifics/PairPotential_Angle.hpp	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/Potentials/Specifics/PairPotential_Angle.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -93,11 +93,9 @@
   results_t parameter_derivative(const arguments_t &arguments, const size_t index) const;
 
-  /** Return the name of this specific potential.
+  /** Return the token name of this specific potential.
    *
-   * This is required for storage in a Registry.
-   *
-   * \return name of the potential
+   * \return token name of the potential
    */
-  const std::string getName() const {
+  const std::string getToken() const {
     return std::string("harmonic_angle");
   }
Index: src/Potentials/Specifics/PairPotential_Harmonic.hpp
===================================================================
--- src/Potentials/Specifics/PairPotential_Harmonic.hpp	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/Potentials/Specifics/PairPotential_Harmonic.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -93,14 +93,4 @@
   results_t parameter_derivative(const arguments_t &arguments, const size_t index) const;
 
-  /** Return the name of this specific potential.
-   *
-   * This is required for storage in a Registry.
-   *
-   * \return name of the potential
-   */
-  const std::string getName() const {
-    return std::string("harmonic_bond");
-  }
-
   /** States whether lower and upper boundaries should be used to constraint
    * the parameter search for this function model.
@@ -132,4 +122,12 @@
   }
 
+  /** Return the token name of this specific potential.
+   *
+   * \return token name of the potential
+   */
+  const std::string getToken() const {
+    return std::string("harmonic_bond");
+  }
+
   enum parameter_enum_t {
     spring_constant=0,
Index: src/Potentials/Specifics/PairPotential_Morse.hpp
===================================================================
--- src/Potentials/Specifics/PairPotential_Morse.hpp	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/Potentials/Specifics/PairPotential_Morse.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -94,11 +94,9 @@
   results_t parameter_derivative(const arguments_t &arguments, const size_t index) const;
 
-  /** Return the name of this specific potential.
+  /** Return the token name of this specific potential.
    *
-   * This is required for storage in a Registry.
-   *
-   * \return name of the potential
+   * \return token name of the potential
    */
-  const std::string getName() const {
+  const std::string getToken() const {
     return std::string("morse");
   }
Index: src/Potentials/Specifics/SaturationPotential.hpp
===================================================================
--- src/Potentials/Specifics/SaturationPotential.hpp	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/Potentials/Specifics/SaturationPotential.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -96,11 +96,9 @@
   results_t parameter_derivative(const arguments_t &arguments, const size_t index) const;
 
-  /** Return the name of this specific potential.
+  /** Return the token name of this specific potential.
    *
-   * This is required for storage in a Registry.
-   *
-   * \return name of the potential
+   * \return token name of the potential
    */
-  const std::string getName() const {
+  const std::string getToken() const {
     return std::string("saturation");
   }
Index: src/Potentials/unittests/Makefile.am
===================================================================
--- src/Potentials/unittests/Makefile.am	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
+++ src/Potentials/unittests/Makefile.am	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -0,0 +1,32 @@
+# PLEASE adhere to the alphabetical ordering in this Makefile!
+# Also indentation by a single tab
+
+POTENTIALSTESTSSOURCES = \
+	../Potentials/unittests/SerializablePotentialUnitTest.cpp
+
+POTENTIALSTESTSHEADERS = \
+	../Potentials/unittests/SerializablePotentialUnitTest.hpp
+
+POTENTIALSTESTS = \
+	SerializablePotentialUnitTest
+
+TESTS += $(POTENTIALSTESTS)
+check_PROGRAMS += $(POTENTIALSTESTS) 
+noinst_PROGRAMS += $(POTENTIALSTESTS)
+
+POTENTIALSLIBS = \
+	../libMolecuilderPotentials.la \
+	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
+	${CodePatterns_LIBS} \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+	$(BOOST_LIB)
+
+SerializablePotentialUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Potentials/unittests/SerializablePotentialUnitTest.cpp \
+	../Potentials/unittests/SerializablePotentialUnitTest.hpp \
+	../Potentials/unittests/stubs/SerializablePotentialMock.cpp \
+	../Potentials/unittests/stubs/SerializablePotentialMock.hpp
+SerializablePotentialUnitTest_LDADD = ${POTENTIALSLIBS}
+
+
+#AUTOMAKE_OPTIONS = parallel-tests
Index: src/Potentials/unittests/SerializablePotentialUnitTest.cpp
===================================================================
--- src/Potentials/unittests/SerializablePotentialUnitTest.cpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
+++ src/Potentials/unittests/SerializablePotentialUnitTest.cpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -0,0 +1,123 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * SerializablePotentialUnitTest.cpp
+ *
+ *  Created on: Nov 23, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "SerializablePotentialUnitTest.hpp"
+
+#include <boost/assign.hpp>
+#include <sstream>
+
+#include "CodePatterns/Assert.hpp"
+
+#include "Potentials/Exceptions.hpp"
+#include "Potentials/SerializablePotential.hpp"
+
+using namespace boost::assign;
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( SerializablePotentialTest );
+
+
+void SerializablePotentialTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+}
+
+
+void SerializablePotentialTest::tearDown()
+{
+}
+
+/** UnitTest for operator<<()
+ */
+void SerializablePotentialTest::outputTest()
+{
+  {
+  std::stringstream outstream;
+  CPPUNIT_ASSERT_NO_THROW(outstream << mockpotential);
+  CPPUNIT_ASSERT_EQUAL(
+      std::string("serializablepotentialmock:\tparticle_type1=1,\tdummy_constant=0;"),
+      outstream.str()
+      );
+  }
+}
+
+/** UnitTest for derivative>>()
+ */
+void SerializablePotentialTest::inputTest()
+{
+  {
+    std::stringstream instream(
+        std::string("\tserializablepotentialmock:\tparticle_type1=1,\tdummy_constant=1;")
+    );
+    CPPUNIT_ASSERT_NO_THROW(instream >> mockpotential);
+    CPPUNIT_ASSERT_EQUAL(
+        SerializablePotential::parameter_t(1),
+        mockpotential.getParameters()[0]);
+  }
+  {
+    std::stringstream illegalkeystream(
+        std::string("\tserializablepotentialmock:\tparticle_type1=1,\tdummy_wrong=0;")
+    );
+    CPPUNIT_ASSERT_THROW(
+        illegalkeystream >> mockpotential,
+        SerializablePotentialIllegalKeyException);
+    CPPUNIT_ASSERT_EQUAL(
+        SerializablePotential::parameter_t(1),
+        mockpotential.getParameters()[0]);
+  }
+  {
+    std::stringstream missingvaluestream(
+        std::string("\tserializablepotentialmock:\tparticle_type1=1,\tdummy_constant;")
+    );
+    CPPUNIT_ASSERT_THROW(
+        missingvaluestream >> mockpotential,
+        SerializablePotentialMissingValueException);
+    CPPUNIT_ASSERT_EQUAL(
+        SerializablePotential::parameter_t(1),
+        mockpotential.getParameters()[0]);
+  }
+}
Index: src/Potentials/unittests/SerializablePotentialUnitTest.hpp
===================================================================
--- src/Potentials/unittests/SerializablePotentialUnitTest.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
+++ src/Potentials/unittests/SerializablePotentialUnitTest.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -0,0 +1,40 @@
+/*
+ * SerializablePotentialUnitTest.hpp
+ *
+ *  Created on: Nov 23, 2012
+ *      Author: heber
+ */
+
+#ifndef SERIALIZABLEPOTENTIALUNITTEST_HPP_
+#define SERIALIZABLEPOTENTIALUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "stubs/SerializablePotentialMock.hpp"
+
+/********************************************** Test classes **************************************/
+
+class SerializablePotentialTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( SerializablePotentialTest) ;
+    CPPUNIT_TEST ( inputTest );
+    CPPUNIT_TEST ( outputTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void inputTest();
+      void outputTest();
+
+private:
+      SerializablePotentialMock mockpotential;
+};
+
+#endif /* SERIALIZABLEPOTENTIALUNITTEST_HPP_ */
Index: src/Potentials/unittests/stubs/SerializablePotentialMock.cpp
===================================================================
--- src/Potentials/unittests/stubs/SerializablePotentialMock.cpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
+++ src/Potentials/unittests/stubs/SerializablePotentialMock.cpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -0,0 +1,58 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the COPYING file or "Copyright notice" in builder.cpp for details.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>. 
+ */
+
+/*
+ * SerializablePotentialMock.cpp
+ *
+ *  Created on: 23.11.2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "SerializablePotentialMock.hpp"
+
+#include "CodePatterns/Assert.hpp"
+
+#include <boost/assign.hpp>
+
+using namespace boost::assign;
+
+// static definitions
+const SerializablePotential::ParameterNames_t SerializablePotentialMock::paramNames(1, std::string("dummy_constant"));
+
+const std::string SerializablePotentialMock::potential_token("serializablepotentialmock");
+
+
+void SerializablePotentialMock::setParameters(const parameters_t &_params)
+{
+  ASSERT( _params.size() == (size_t)1,
+      "SerializablePotentialMock::setParameters() - not the right number of parameters.");
+  params = _params;
+}
+
Index: src/Potentials/unittests/stubs/SerializablePotentialMock.hpp
===================================================================
--- src/Potentials/unittests/stubs/SerializablePotentialMock.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
+++ src/Potentials/unittests/stubs/SerializablePotentialMock.hpp	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -0,0 +1,89 @@
+/*
+ * SerializablePotentialMock.hpp
+ *
+ *  Created on: 23.11.2012
+ *      Author: heber
+ */
+
+#ifndef SERIALIZABLEPOTENTIALMOCK_HPP_
+#define SERIALIZABLEPOTENTIALMOCK_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string>
+
+#include "Potentials/SerializablePotential.hpp"
+
+/** This is a test implementation of a SerializablePotential for the unit test.
+ *
+ */
+class SerializablePotentialMock : public SerializablePotential
+{
+public :
+  SerializablePotentialMock() :
+    SerializablePotential(ParticleTypes_t(1, ParticleType_t(1))),
+    params(1, 0)
+  {}
+  ~SerializablePotentialMock() {}
+
+  /* ==== Implementing virtual functions from SerializablePotental ==== */
+
+  /** Return the token name of this specific potential.
+   *
+   * \return token name of the potential
+   */
+  const std::string& getToken() const
+  { return potential_token; }
+
+  /** Returns a vector of parameter names.
+   *
+   * This is required from the specific implementation
+   *
+   * \return vector of strings containing parameter names
+   */
+  const ParameterNames_t& getParameterNames() const
+  { return paramNames; }
+
+  /* ==== Implementing virtual functions from FunctionModel ==== */
+
+  /** Setter for the parameters of the model function.
+   *
+   * \param _params set of parameters to set
+   */
+  void setParameters(const parameters_t &_params);
+
+  /** Getter for the parameters of this model function.
+   *
+   * \return current set of parameters of the model function
+   */
+  parameters_t getParameters() const
+  { return params; }
+
+  /** Getter for the number of parameters of this model function.
+   *
+   * \return number of parameters
+   */
+  size_t getParameterDimension() const
+  { return 1; }
+
+
+  enum parameter_enum_t {
+    dummy_constant=0,
+    MAXPARAMS
+  };
+private:
+  //!> parameter vector with parameters as in enum parameter_enum_t
+  parameters_t params;
+
+private:
+  //!> names of each parameter
+  static const ParameterNames_t paramNames;
+
+  //!> static token of this potential type
+  static const std::string potential_token;
+};
+
+#endif /* SERIALIZABLEPOTENTIALMOCK_HPP_ */
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision 67cd3abba5d9690e39969a20e1e96f938cfc6574)
+++ src/unittests/Makefile.am	(revision 6efcaec4b6119396e4609fd8ec76dda69a50c32f)
@@ -30,4 +30,5 @@
 include ../../src/Parameters/unittests/Makefile.am
 include ../../src/Parser/unittests/Makefile.am
+include ../../src/Potentials/unittests/Makefile.am
 include ../../src/Potentials/Specifics/unittests/Makefile.am
 include ../../src/RandomNumbers/unittests/Makefile.am
