Index: src/Fragmentation/Automation/unittests/MPQCCommandJobUnitTest.cpp
===================================================================
--- src/Fragmentation/Automation/unittests/MPQCCommandJobUnitTest.cpp	(revision cc276ec507f3ccef1a447ef1f76b1f35e8bcd527)
+++ src/Fragmentation/Automation/unittests/MPQCCommandJobUnitTest.cpp	(revision cc276ec507f3ccef1a447ef1f76b1f35e8bcd527)
@@ -0,0 +1,102 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MPQCCommandJobUnitTest.cpp
+ *
+ *  Created on: Feb 08, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+// include headers that implement a archive in simple text format
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+
+#include <vector>
+
+#include "MPQCCommandJobUnitTest.hpp"
+
+#include "Jobs/MPQCCommandJob.hpp"
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+const std::string resultstring="\
+\n\
+   total scf energy = -37.3479855\n\
+\n\
+   Total Gradient:\n\
+  1  H  -2.35  -0.54  0.345\n\
+  2  H  0.35  -0.54  0.345\n\
+\n\
+";
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( MPQCCommandJobTest );
+
+
+void MPQCCommandJobTest::setUp()
+{
+  // Throw assertions
+  ASSERT_DO(Assert::Throw);
+
+  setVerbosity(3);
+
+  job = new MPQCCommandJob(std::string("empty"), 1);
+}
+
+
+void MPQCCommandJobTest::tearDown()
+{
+  delete job;
+}
+
+/** UnitTest for extractString()
+ */
+void MPQCCommandJobTest::extractStringTest()
+{
+  // prepare result container
+  MPQCData data;
+  data.energy = -37.3479855;
+  std::vector<double> force;
+  std::vector< std::vector<double> > forces;
+  force.push_back(-2.35);
+  force.push_back(-0.54);
+  force.push_back(0.345);
+  data.forces.push_back( force );
+  force.clear();
+  force.push_back(0.35);
+  force.push_back(-0.54);
+  force.push_back(0.345);
+  data.forces.push_back( force );
+
+  // extract and check
+  FragmentResult::ptr result = job->extractResult(resultstring);
+  std::stringstream returnstream(result->result);
+
+  // deserialize
+  MPQCData extractedData;
+  boost::archive::text_iarchive ia(returnstream);
+  ia >> extractedData;
+
+  CPPUNIT_ASSERT( data == extractedData );
+}
Index: src/Fragmentation/Automation/unittests/MPQCCommandJobUnitTest.hpp
===================================================================
--- src/Fragmentation/Automation/unittests/MPQCCommandJobUnitTest.hpp	(revision cc276ec507f3ccef1a447ef1f76b1f35e8bcd527)
+++ src/Fragmentation/Automation/unittests/MPQCCommandJobUnitTest.hpp	(revision cc276ec507f3ccef1a447ef1f76b1f35e8bcd527)
@@ -0,0 +1,40 @@
+/*
+ * MPQCCommandJobUnitTest.hpp
+ *
+ *  Created on: Oct 23, 2011
+ *      Author: heber
+ */
+
+#ifndef MPQCCOMMANDJOBUNITTEST_HPP_
+#define MPQCCOMMANDJOBUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class MPQCCommandJob;
+
+
+/********************************************** Test classes **************************************/
+
+class MPQCCommandJobTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( MPQCCommandJobTest) ;
+    CPPUNIT_TEST ( extractStringTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void extractStringTest();
+
+private:
+      MPQCCommandJob *job;
+};
+
+#endif /* MPQCCOMMANDJOBUNITTEST_HPP_ */
Index: src/Fragmentation/Automation/unittests/MPQCDataUnitTest.cpp
===================================================================
--- src/Fragmentation/Automation/unittests/MPQCDataUnitTest.cpp	(revision cc276ec507f3ccef1a447ef1f76b1f35e8bcd527)
+++ src/Fragmentation/Automation/unittests/MPQCDataUnitTest.cpp	(revision cc276ec507f3ccef1a447ef1f76b1f35e8bcd527)
@@ -0,0 +1,140 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MPQCDataUnitTest.cpp
+ *
+ *  Created on: Feb 09, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+// include headers that implement a archive in simple text format
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+
+#include <limits>
+#include <vector>
+
+#include "MPQCDataUnitTest.hpp"
+
+#include "Jobs/MPQCCommandJob_MPQCData.hpp"
+
+#include "CodePatterns/Assert.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( MPQCDataTest );
+
+
+void MPQCDataTest::setUp()
+{
+  // Throw assertions
+  ASSERT_DO(Assert::Throw);
+
+  data = new MPQCData;
+
+  data->energy = -37.3479855;
+  std::vector<double> force;
+  std::vector< std::vector<double> > forces;
+  force.push_back(-2.35);
+  force.push_back(-0.54);
+  force.push_back(0.345);
+  data->forces.push_back(force);
+  force.clear();
+  force.push_back(-2.35);
+  force.push_back(-0.54);
+  force.push_back(0.345);
+  data->forces.push_back( force );
+
+  CPPUNIT_ASSERT_EQUAL( (size_t)2, data->forces.size() );
+}
+
+
+void MPQCDataTest::tearDown()
+{
+  delete data;
+}
+
+/** UnitTest for operator==()
+ */
+void MPQCDataTest::operatorTest()
+{
+  MPQCData otherData;
+
+  // ascertain unequality
+  CPPUNIT_ASSERT( !(*data == otherData) );
+  CPPUNIT_ASSERT( *data != otherData );
+
+  // construct closer and closer pendant
+  otherData.energy = -37.3479855;
+  CPPUNIT_ASSERT( *data != otherData );
+  std::vector<double> force;
+  std::vector< std::vector<double> > forces;
+  force.push_back(-2.35);
+  force.push_back(-0.54);
+  force.push_back(0.345);
+  otherData.forces.push_back(force);
+  CPPUNIT_ASSERT( *data != otherData );
+  force.clear();
+  force.push_back(-2.35);
+  force.push_back(-0.54);
+  force.push_back(0.345);
+  otherData.forces.push_back( force );
+  CPPUNIT_ASSERT( *data == otherData );
+
+  // change energy
+  otherData.energy = -4;
+  CPPUNIT_ASSERT( *data != otherData );
+  otherData.energy = -37.3479855;
+  CPPUNIT_ASSERT( *data == otherData );
+
+  // change force component
+  otherData.forces[0][2] = -4;
+  CPPUNIT_ASSERT( *data != otherData );
+  otherData.forces[0][2] = 0.345;
+  CPPUNIT_ASSERT( *data == otherData );
+
+  // check sensibility
+  otherData.energy -= 1e-1*std::numeric_limits<double>::epsilon();
+  CPPUNIT_ASSERT( *data == otherData );
+  otherData.forces[1][0] -= 1e-1*std::numeric_limits<double>::epsilon();
+  CPPUNIT_ASSERT( *data == otherData );
+}
+
+/** UnitTest for serialization
+ */
+void MPQCDataTest::serializationTest()
+{
+  // serialize
+  std::stringstream outputstream;
+  boost::archive::text_oarchive oa(outputstream);
+  oa << data;
+
+  // deserialize
+  MPQCData *extractedData;
+  std::stringstream returnstream(outputstream.str());
+  boost::archive::text_iarchive ia(returnstream);
+  ia >> extractedData;
+
+  CPPUNIT_ASSERT( *data == *extractedData );
+
+  delete extractedData;
+}
Index: src/Fragmentation/Automation/unittests/MPQCDataUnitTest.hpp
===================================================================
--- src/Fragmentation/Automation/unittests/MPQCDataUnitTest.hpp	(revision cc276ec507f3ccef1a447ef1f76b1f35e8bcd527)
+++ src/Fragmentation/Automation/unittests/MPQCDataUnitTest.hpp	(revision cc276ec507f3ccef1a447ef1f76b1f35e8bcd527)
@@ -0,0 +1,42 @@
+/*
+ * MPQCDataUnitTest.hpp
+ *
+ *  Created on: Feb 9, 2012
+ *      Author: heber
+ */
+
+#ifndef MPQCDATAUNITTEST_HPP_
+#define MPQCDATAUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class MPQCData;
+
+
+/********************************************** Test classes **************************************/
+
+class MPQCDataTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( MPQCDataTest) ;
+    CPPUNIT_TEST ( operatorTest );
+    CPPUNIT_TEST ( serializationTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void operatorTest();
+      void serializationTest();
+
+private:
+      MPQCData *data;
+};
+
+#endif /* MPQCDATAUNITTEST_HPP_ */
Index: src/Fragmentation/Automation/unittests/Makefile.am
===================================================================
--- src/Fragmentation/Automation/unittests/Makefile.am	(revision d920b9e35d1332c01a14e561aa60b85bbe881b3b)
+++ src/Fragmentation/Automation/unittests/Makefile.am	(revision cc276ec507f3ccef1a447ef1f76b1f35e8bcd527)
@@ -6,4 +6,6 @@
   unittests/FragmentResultUnitTest.cpp \
   unittests/FragmentQueueUnitTest.cpp \
+  unittests/MPQCCommandJobUnitTest.cpp \
+  unittests/MPQCDataUnitTest.cpp \
   unittests/SystemCommandJobUnitTest.cpp
 
@@ -12,4 +14,6 @@
   unittests/FragmentResultUnitTest.hpp \
   unittests/FragmentQueueUnitTest.hpp \
+  unittests/MPQCCommandJobUnitTest.hpp \
+  unittests/MPQCDataUnitTest.hpp \
   unittests/SystemCommandJobUnitTest.hpp
 
@@ -18,4 +22,6 @@
   FragmentResultUnitTest \
   FragmentQueueUnitTest \
+  MPQCCommandJobUnitTest \
+  MPQCDataUnitTest \
   SystemCommandJobUnitTest
 
@@ -74,4 +80,26 @@
   ${CodePatterns_LIBS}
 
+MPQCCommandJobUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
+MPQCCommandJobUnitTest_CPPFLAGS = ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS) ${CodePatterns_CFLAGS}
+MPQCCommandJobUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+  unittests/MPQCCommandJobUnitTest.cpp \
+  unittests/MPQCCommandJobUnitTest.hpp
+MPQCCommandJobUnitTest_LDADD = \
+  libMolecuilderFragmentJobs.la \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
+  ${CodePatterns_LIBS}
+
+MPQCDataUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
+MPQCDataUnitTest_CPPFLAGS = ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS) ${CodePatterns_CFLAGS}
+MPQCDataUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+  unittests/MPQCDataUnitTest.cpp \
+  unittests/MPQCDataUnitTest.hpp
+MPQCDataUnitTest_LDADD = \
+  libMolecuilderFragmentJobs.la \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
+  ${CodePatterns_LIBS}
+
 SystemCommandJobUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
 SystemCommandJobUnitTest_CPPFLAGS = ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS) ${CodePatterns_CFLAGS}
