Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision 25b05f0fee8b0762fb7f6e7391142f5789d68795)
+++ src/unittests/Makefile.am	(revision 404d2be35f6544290132fcbe8f79a4ff9c6584ad)
@@ -2,250 +2,137 @@
 # Also indentation by a single tab
 
+MOSTLYCLEANFILES =
+bin_PROGRAMS =
+TESTS =
 check_PROGRAMS =
 noinst_PROGRAMS =
-TESTS =
-XFAIL_TESTS =
-MOSTLYCLEANFILES =
 noinst_LTLIBRARIES =
+lib_LTLIBRARIES =
 
-#AUTOMAKE_OPTIONS = no-dependencies
+AM_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
+AM_CPPFLAGS = -I$(top_srcdir)/src $(CPPUNIT_CFLAGS) $(BOOST_CPPFLAGS) ${CodePatterns_CFLAGS}
 
-if CONDCPPUNIT
+FRAGMENTATIONAUTOMATIONTESTSSOURCES = \
+  FragmentJobUnitTest.cpp \
+  FragmentResultUnitTest.cpp \
+  FragmentQueueUnitTest.cpp \
+  OperationQueueUnitTest.cpp \
+  SystemCommandJobUnitTest.cpp \
+  WorkerAddressUnitTest.cpp \
+  WorkerPoolUnitTest.cpp
+  
+FRAGMENTATIONAUTOMATIONTESTSHEADERS = \
+  FragmentJobUnitTest.hpp \
+  FragmentResultUnitTest.hpp \
+  FragmentQueueUnitTest.hpp \
+  OperationQueueUnitTest.hpp \
+  SystemCommandJobUnitTest.hpp \
+  WorkerAddressUnitTest.hpp \
+  WorkerPoolUnitTest.hpp
 
-include ../../src/Actions/unittests/Makefile.am
-include ../../src/Analysis/unittests/Makefile.am
-include ../../src/Atom/unittests/Makefile.am
-include ../../src/Descriptors/unittests/Makefile.am
-include ../../src/Element/unittests/Makefile.am
-include ../../src/Filling/unittests/Makefile.am
-include ../../src/FunctionApproximation/unittests/Makefile.am
-include ../../src/Fragmentation/unittests/Makefile.am
-include ../../src/Fragmentation/Exporters/unittests/Makefile.am
-include ../../src/Fragmentation/Homology/unittests/Makefile.am
-include ../../src/Fragmentation/Summation/unittests/Makefile.am
-include ../../src/Fragmentation/Summation/Containers/unittests/Makefile.am
-include ../../src/Fragmentation/Summation/SetValues/unittests/Makefile.am
-include ../../src/Graph/unittests/Makefile.am
-
-if CONDJOBMARKET
-include ../../src/Jobs/unittests/Makefile.am
-endif
-
-include ../../src/LinkedCell/unittests/Makefile.am
-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
-include ../../src/Shapes/unittests/Makefile.am
-include ../../src/Tesselation/unittests/Makefile.am
-include ../../src/UIElements/CommandLineUI/unittests/Makefile.am
-include ../../src/UIElements/Menu/unittests/Makefile.am
-
-AM_LDFLAGS = \
-	$(CodePatterns_LDFLAGS) ${CodePatterns_LIBS} \
-	$(CPPUNIT_LIBS) \
-	-ldl
-AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/ThirdParty/LinearAlgebra/src ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS) ${CodePatterns_CFLAGS}
-
-GENERALTESTS = \
-  AtomIdSetUnitTest \
-  BoxUnitTest \
-  Box_BoundaryConditionsTest \
-  FormulaUnittest \
-  ListOfBondsUnitTest \
-  MoleculeUnitTest \
-  WorldTimeUnitTest
-
-# these ones are checked
-TESTS += $(GENERALTESTS)
-# these ones are built for checking only
-check_PROGRAMS += $(GENERALTESTS) 
-# ... and not installed
-noinst_PROGRAMS += $(GENERALTESTS)
-
-if CONDECUT
-noinst_PROGRAMS += TestRunner
-endif
-
-noinst_LTLIBRARIES += libUnitTest.la
-libUnitTest_la_LDFLAGS = \
-        $(AM_LDFLAGS)
-libUnitTest_la_LIBADD =
-
-#nobase_libUnitTest_la_include_HEADERS =
-
-## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la"
-## target.  Note that @MOLECUILDER_API_VERSION@ is not interpreted by Automake and
-## will therefore be treated as if it were literally part of the target name,
-## and the variable name derived from that.
-## The file extension .cc is recognized by Automake, and makes it produce
-## rules which invoke the C++ compiler to produce a libtool object file (.lo)
-## from each source file.  Note that it is not necessary to list header files
-## which are already listed elsewhere in a _HEADERS variable assignment.
-libUnitTest_la_SOURCES = UnitTestMain.cpp
-
-## Instruct libtool to include ABI version information in the generated shared
-## library file (.so).  The library ABI version is defined in configure.ac, so
-## that all version information is kept in one place.
-#libUnitTest_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION)
-
-## The generated configuration header is installed in its own subdirectory of
-## $(libdir).  The reason for this is that the configuration information put
-## into this header file describes the target platform the installed library
-## has been built for.  Thus the file must not be installed into a location
-## intended for architecture-independent files, as defined by the Filesystem
-## Hierarchy Standard (FHS).
-## The nodist_ prefix instructs Automake to not generate rules for including
-## the listed files in the distribution on 'make dist'.  Files that are listed
-## in _HEADERS variables are normally included in the distribution, but the
-## configuration header file is generated at configure time and should not be
-## shipped with the source tarball.
-#libUnitTest_la_libincludedir = $(libdir)/MoleCuilder/include
-#nodist_libUnitTest_la_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
-
-## Install the generated pkg-config file (.pc) into the expected location for
-## architecture-dependent package configuration information.  Occasionally,
-## pkg-config files are also used for architecture-independent data packages,
-## in which case the correct install location would be $(datadir)/pkgconfig.
-#pkgconfigdir = $(libdir)/pkgconfig
-#pkgconfig_DATA = $(top_builddir)/MoleCuilder.pc
+FRAGMENTATIONAUTOMATIONTESTS = \
+  FragmentJobUnitTest \
+  FragmentResultUnitTest \
+  FragmentQueueUnitTest \
+  OperationQueueUnitTest \
+  SystemCommandJobUnitTest \
+  WorkerAddressUnitTest \
+  WorkerPoolUnitTest
 
 
-BOOST_LIB = \
-	$(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIBS) \
-	$(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_FILESYSTEM_LIBS) \
-	$(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
-	$(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
-	$(BOOST_THREAD_LDFLAGS) $(BOOST_THREAD_LIBS)
+TESTS += $(FRAGMENTATIONAUTOMATIONTESTS)
+check_PROGRAMS += $(FRAGMENTATIONAUTOMATIONTESTS) 
+noinst_PROGRAMS += $(FRAGMENTATIONAUTOMATIONTESTS)
 
-GENERALLIBS = \
-	../libMolecuilder.la \
-	$(top_builddir)/ThirdParty/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
-	${CodePatterns_LIBS} \
-	$(BOOST_LIB)
+FRAGMENTATIONAUTOMATIONLIBS = \
+  ../JobMarket/libJobMarketJobs.la \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+  $(BOOST_THREAD_LDFLAGS) $(BOOST_THREAD_LIBS) \
+  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
+  ${CodePatterns_LIBS}
 
-ALLLIBS = \
-        libUnitTest.la \
-	../libMolecuilder.la \
-	../libMolecuilderUI.la
-if CONDJOBMARKET
-ALLLIBS += \
-	../libMolecuilderJobs.la
-endif
-ALLLIBS += \
-	$(top_builddir)/ThirdParty/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
-	${CodePatterns_LIBS} \
-	$(BOOST_LIB)
+FragmentJobUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
+FragmentJobUnitTest_SOURCES = UnitTestMain.cpp \
+  FragmentJobUnitTest.cpp \
+  FragmentJobUnitTest.hpp \
+  stubs/FragmentResultStub.cpp \
+  stubs/FragmentJobStub.cpp \
+  stubs/FragmentJobStub.hpp
+FragmentJobUnitTest_LDADD = \
+  ../JobMarket/libJobMarketJobs.la \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
+  ${CodePatterns_LIBS}
 
-TESTSOURCES = \
-	${ACTIONTESTSSOURCES} \
-	${ANALYSISTESTSSOURCES} \
-	${DESCRIPTORTESTSSOURCES} \
-	${ELEMENTTESTSSOURCES} \
-	${FILLINGTESTSSOURCES} \
-	${FRAGMENTATIONTESTSSOURCES} \
-	${GRAPHTESTSSOURCES} \
-	${LINKEDCELLTESTSSOURCES} \
-	${LINEARALGEBRATESTSSOURCES} \
-	${PARAMETERTESTSSOURCES} \
-	${PARSERTESTSSOURCES} \
-	${RANDOMNUMBERTESTSSOURCES} \
-	${SHAPETESTSSOURCES} \
-	${TESSELATIONTESTSSOURCES} \
-	$(UIELEMENTSCOMMANDLINEPARSERTESTSSOURCES) \
-	${UIELEMENTSMENUTESTSSOURCES} \
-	stubs/ObserverStub.cpp \
-	AtomIdSetUnitTest.cpp \
-  BoxUnitTest.cpp \
-	Box_BoundaryConditionsUnitTest.cpp \
-  FormulaUnitTest.cpp \
-  ListOfBondsUnitTest.cpp \
-  MoleculeUnitTest.cpp \
-  WorldTimeUnitTest.cpp
+FragmentQueueUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
+FragmentQueueUnitTest_SOURCES = UnitTestMain.cpp \
+  FragmentQueueUnitTest.cpp \
+  FragmentQueueUnitTest.hpp \
+  stubs/FragmentJobStub.cpp \
+  stubs/FragmentJobStub.hpp \
+  stubs/ObserverStub.cpp \
+  stubs/ObserverStub.hpp
+FragmentQueueUnitTest_LDADD = \
+  ../JobMarket/libJobMarketJobs.la \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
+  ${CodePatterns_LIBS}
 
-TESTHEADERS = \
-	${ACTIONTESTSHEADERS} \
-	${ANALYSISTESTSHEADERS} \
-	${DESCRIPTORTESTSHEADERS} \
-	${ELEMENTTESTSHEADERS} \
-	${FILLINGTESTSHEADERS} \
-	${FRAGMENTATIONTESTSHEADERS} \
-	${GRAPHTESTSHEADERS} \
-	${LINKEDCELLTESTHEADERS} \
-	${LINEARALGEBRATESTSHEADERS} \
-	${PARAMETERTESTSHEADERS} \
-	${PARSERTESTSHEADERS} \
-	${RANDOMNUMBERTESTSHEADERS} \
-	${SHAPETESTSHEADERS} \
-	${TESSELATIONTESTSHEADERS} \
-	$(UIELEMENTSCOMMANDLINEPARSERTESTSHEADERS) \
-	${UIELEMENTSMENUTESTSHEADERS} \
-	stubs/ObserverStub.hpp \
-	AtomIdSetUnitTest.hpp \
-  BoxUnitTest.hpp \
-	Box_BoundaryConditionsUnitTest.hpp \
-  FormulaUnitTest.hpp \
-  ListOfBondsUnitTest.hpp \
-  MoleculeUnitTest.hpp \
-  WorldTimeUnitTest.hpp
-  
+FragmentResultUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
+FragmentResultUnitTest_SOURCES = UnitTestMain.cpp \
+  FragmentResultUnitTest.cpp \
+  FragmentResultUnitTest.hpp
+FragmentResultUnitTest_LDADD = \
+	../JobMarket/libJobMarketJobs.la \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
+  ${CodePatterns_LIBS}
 
-BoxUnitTest_SOURCES = \
-	BoxUnitTest.cpp \
-	BoxUnitTest.hpp \
-	stubs/ObserverStub.cpp \
-	stubs/ObserverStub.hpp \
-	../Shapes/unittests/stubs/ApproximateShapeAreaStub.cpp \
-	../Shapes/unittests/stubs/ApproximateShapeVolumeStub.cpp
-BoxUnitTest_LDADD = \
-	$(ALLLIBS) \
-	../libMolecuilderShapes.la \
-	../libMolecuilderHelpers.la
+OperationQueueUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
+OperationQueueUnitTest_SOURCES = UnitTestMain.cpp \
+  OperationQueueUnitTest.cpp \
+  OperationQueueUnitTest.hpp \
+  stubs/AsyncOperationStub.hpp
+OperationQueueUnitTest_LDADD = \
+	../JobMarket/libJobMarketOperations.la \
+	../JobMarket/libJobMarketJobs.la \
+	../JobMarket/libJobMarketHelper.la \
+  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
+  ${CodePatterns_LIBS}
 
-AtomIdSetUnitTest_SOURCES = \
-	AtomIdSetUnitTest.cpp \
-	AtomIdSetUnitTest.hpp
-AtomIdSetUnitTest_LDADD =  $(ALLLIBS)
+SystemCommandJobUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
+SystemCommandJobUnitTest_SOURCES = UnitTestMain.cpp \
+  SystemCommandJobUnitTest.cpp \
+  SystemCommandJobUnitTest.hpp
+SystemCommandJobUnitTest_LDADD = \
+	../JobMarket/libJobMarketJobs.la \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+  $(BOOST_IOSTREAMS_LDFLAGS) $(BOOST_IOSTREAMS_LIBS) \
+  $(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_FILESYSTEM_LIBS) \
+  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
+  ${CodePatterns_LIBS}
 
-Box_BoundaryConditionsTest_SOURCES = \
-	Box_BoundaryConditionsUnitTest.cpp \
-	Box_BoundaryConditionsUnitTest.hpp
-Box_BoundaryConditionsTest_LDADD = \
-	$(ALLLIBS) \
-	../libMolecuilderShapes.la \
-	../libMolecuilderHelpers.la
+WorkerAddressUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
+WorkerAddressUnitTest_SOURCES = UnitTestMain.cpp \
+  WorkerAddressUnitTest.cpp \
+  WorkerAddressUnitTest.hpp
+WorkerAddressUnitTest_LDADD = \
+	../JobMarket/libJobMarketHelper.la \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
+  ${CodePatterns_LIBS}
 
-FormulaUnittest_SOURCES = \
-	FormulaUnitTest.cpp \
-	FormulaUnitTest.hpp
-FormulaUnittest_LDADD = $(ALLLIBS)
-
-ListOfBondsUnitTest_SOURCES = \
-	ListOfBondsUnitTest.cpp \
-	ListOfBondsUnitTest.hpp 
-ListOfBondsUnitTest_LDADD = $(ALLLIBS)
-
-MoleculeUnitTest_SOURCES = \
-	MoleculeUnitTest.cpp \
-	MoleculeUnitTest.hpp
-MoleculeUnitTest_LDADD = \
-	$(ALLLIBS) \
-	../libMolecuilderShapes.la \
-	../libMolecuilderHelpers.la
-
-WorldTimeUnitTest_SOURCES = \
-	WorldTimeUnitTest.cpp \
-	WorldTimeUnitTest.hpp
-WorldTimeUnitTest_LDADD = \
-	$(ALLLIBS) \
-	../libMolecuilderShapes.la \
-	../libMolecuilderHelpers.la
-
-
-TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)
-TestRunner_LDADD = ${UILIBS} ${ALLLIBS}
+WorkerPoolUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
+WorkerPoolUnitTest_SOURCES = UnitTestMain.cpp \
+  WorkerPoolUnitTest.cpp \
+  WorkerPoolUnitTest.hpp \
+  stubs/ObserverStub.cpp \
+  stubs/ObserverStub.hpp
+WorkerPoolUnitTest_LDADD = \
+	../JobMarket/libJobMarketPool.la \
+	../JobMarket/libJobMarketHelper.la \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
+  ${CodePatterns_LIBS}
 
 #AUTOMAKE_OPTIONS = parallel-tests
-
-endif
