Index: configure.ac
===================================================================
--- configure.ac	(revision 85949a638ffde393b44b0671e40b3ccedb46ce2f)
+++ configure.ac	(revision c0bccbecd01c28def7f751995f67ff1a54f4c1c4)
@@ -153,4 +153,5 @@
 AC_CONFIG_FILES([
 	src/unittests/Makefile
+	src/Patterns/unittests/Makefile
 ])
 AC_OUTPUT
Index: src/Patterns/Singleton_impl.hpp
===================================================================
--- src/Patterns/Singleton_impl.hpp	(revision 85949a638ffde393b44b0671e40b3ccedb46ce2f)
+++ src/Patterns/Singleton_impl.hpp	(revision c0bccbecd01c28def7f751995f67ff1a54f4c1c4)
@@ -9,4 +9,5 @@
 #define SINGLETON_IMPL_HPP_
 
+#include "Helpers/Assert.hpp"
 #include "Patterns/Singleton.hpp"
 
Index: src/Patterns/unittests/Makefile.am
===================================================================
--- src/Patterns/unittests/Makefile.am	(revision c0bccbecd01c28def7f751995f67ff1a54f4c1c4)
+++ src/Patterns/unittests/Makefile.am	(revision c0bccbecd01c28def7f751995f67ff1a54f4c1c4)
@@ -0,0 +1,29 @@
+# PLEASE adhere to the alphabetical ordering in this Makefile!
+# Also indentation by a single tab
+
+INCLUDES = -I$(top_srcdir)/src
+
+AM_LDFLAGS = $(CPPUNIT_LIBS) -ldl
+AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
+AM_CPPFLAGS = ${BOOST_CPPFLAGS}
+
+TESTS = \
+  SingletonUnitTest
+
+
+check_PROGRAMS = $(TESTS) 
+noinst_PROGRAMS = $(TESTS)
+
+BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB) $(BOOST_THREAD_LIB)
+GSLLIBS = \
+	../../LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \
+	../../Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
+	../../Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
+	$(BOOST_LIB)
+
+SingletonUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	SingletonUnitTest.cpp \
+	SingletonUnitTest.hpp
+SingletonUnitTest_LDADD = ../../Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la $(BOOST_LIB)
+
+#AUTOMAKE_OPTIONS = parallel-tests
Index: src/Patterns/unittests/SingletonUnitTest.cpp
===================================================================
--- src/Patterns/unittests/SingletonUnitTest.cpp	(revision c0bccbecd01c28def7f751995f67ff1a54f4c1c4)
+++ src/Patterns/unittests/SingletonUnitTest.cpp	(revision c0bccbecd01c28def7f751995f67ff1a54f4c1c4)
@@ -0,0 +1,155 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * SingletonUnitTest.cpp
+ *
+ *  Created on: Mar 11, 2010
+ *      Author: crueger
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "SingletonUnitTest.hpp"
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+#include <iostream>
+
+#include "Patterns/Singleton.hpp"
+#include "Patterns/Singleton_impl.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+CPPUNIT_TEST_SUITE_REGISTRATION( SingletonTest );
+
+// some necessary stubs
+class SingletonStub1 : public Singleton <SingletonStub1>{
+  friend class Singleton<SingletonStub1>;
+private:
+  SingletonStub1(){
+    count1++;
+  }
+  // explicit copy constructor to catch if this is ever called
+  SingletonStub1(const SingletonStub1&){
+    CPPUNIT_FAIL    ( "Copy constructor of Singleton called" );
+  }
+  virtual ~SingletonStub1(){
+    count2++;
+  }
+public:
+  static int count1;
+  static int count2;
+};
+
+int SingletonStub1::count1 = 0;
+int SingletonStub1::count2 = 0;
+
+CONSTRUCT_SINGLETON(SingletonStub1);
+
+class SingletonStub2 : public Singleton<SingletonStub2>{
+  friend class Singleton<SingletonStub2>;
+private:
+  SingletonStub2(){
+    count1++;
+  }
+  // explicit copy constructor to catch if this is ever called
+  SingletonStub2(const SingletonStub2&){
+    CPPUNIT_FAIL    ( "Copy constructor of Singleton called" );
+  }
+  virtual ~SingletonStub2(){
+    count2++;
+  }
+public:
+  static int count1;
+  static int count2;
+};
+
+int SingletonStub2::count1 = 0;
+int SingletonStub2::count2 = 0;
+
+CONSTRUCT_SINGLETON(SingletonStub2);
+
+void SingletonTest::setUp(){}
+void SingletonTest::tearDown(){}
+
+void SingletonTest::ConstructionTest(){
+  void *ptr_1_1 = reinterpret_cast<void*>(SingletonStub1::getPointer());
+  void *ptr_1_2 = reinterpret_cast<void*>(SingletonStub1::getPointer());
+  void *ptr_1_3 = reinterpret_cast<void*>(&(SingletonStub1::getInstance()));
+
+  // test if we always get the same instance of our singleton
+  CPPUNIT_ASSERT_EQUAL(ptr_1_1,ptr_1_2);
+  CPPUNIT_ASSERT_EQUAL(ptr_1_1,ptr_1_3);
+
+  void *ptr_2_1 = reinterpret_cast<void*>(SingletonStub2::getPointer());
+  void *ptr_2_2 = reinterpret_cast<void*>(SingletonStub2::getPointer());
+  void *ptr_2_3 = reinterpret_cast<void*>(&(SingletonStub2::getInstance()));
+
+  // same as above but for a different singleton
+  CPPUNIT_ASSERT_EQUAL(ptr_2_1,ptr_2_2);
+  CPPUNIT_ASSERT_EQUAL(ptr_2_1,ptr_2_3);
+
+  // see if the two singletons actually differ
+  CPPUNIT_ASSERT(ptr_1_1!=ptr_2_1);
+
+  // see if each constructor was called exactly once
+  CPPUNIT_ASSERT_EQUAL(1,SingletonStub1::count1);
+  CPPUNIT_ASSERT_EQUAL(1,SingletonStub2::count1);
+  // no calls to the destructor should have occured so far
+  CPPUNIT_ASSERT_EQUAL(0,SingletonStub1::count2);
+  CPPUNIT_ASSERT_EQUAL(0,SingletonStub2::count2);
+
+  SingletonStub1::purgeInstance();
+
+  void *ptr_3_1 = reinterpret_cast<void*>(SingletonStub1::getPointer());
+  void *ptr_3_2 = reinterpret_cast<void*>(SingletonStub1::getPointer());
+
+  // now the constructor should have been called twice
+  CPPUNIT_ASSERT_EQUAL(2,SingletonStub1::count1);
+  // the destructor should have been called once
+  CPPUNIT_ASSERT_EQUAL(1,SingletonStub1::count2);
+  // see if the singleton Assumption holds
+  CPPUNIT_ASSERT_EQUAL(ptr_3_1,ptr_3_2);
+  // Some esoteric thing might cause our pointer to lay at the position of Singleton2 now
+  // See that those two objects still differ
+  CPPUNIT_ASSERT(ptr_3_1!=ptr_2_1);
+  // don't test for pointer difference between first and second singleton here,
+  // because they might be constructed in the same place
+
+
+  SingletonStub2::resetInstance();
+  // now the constructor should have been called twice
+  CPPUNIT_ASSERT_EQUAL(2,SingletonStub2::count1);
+  // the destructor should have been called once
+  CPPUNIT_ASSERT_EQUAL(1,SingletonStub2::count2);
+
+  void *ptr_4_1 = reinterpret_cast<void*>(SingletonStub2::getPointer());
+  void *ptr_4_2 = reinterpret_cast<void*>(SingletonStub2::getPointer());
+
+  // Still only two calls to the constructor, one call to destructor
+  CPPUNIT_ASSERT_EQUAL(2,SingletonStub2::count1);
+  CPPUNIT_ASSERT_EQUAL(1,SingletonStub2::count2);
+
+  // test if Singleton assumption can be broken by reset
+  CPPUNIT_ASSERT_EQUAL(ptr_4_1,ptr_4_2);
+
+  // and again test if we actually have a object seperate from anything else
+  CPPUNIT_ASSERT(ptr_4_1!=ptr_3_1);
+
+
+  // we don't purge our singletons here. Purging should be done automatically by the Singleton
+  // mechanism. Check with Valgrind to see if memory-leak occurs
+  std::cout << "Not purging Singleton!\n Check with Valgrind to see if automatic purgins is working!" << std::endl;
+
+}
Index: src/Patterns/unittests/SingletonUnitTest.hpp
===================================================================
--- src/Patterns/unittests/SingletonUnitTest.hpp	(revision c0bccbecd01c28def7f751995f67ff1a54f4c1c4)
+++ src/Patterns/unittests/SingletonUnitTest.hpp	(revision c0bccbecd01c28def7f751995f67ff1a54f4c1c4)
@@ -0,0 +1,26 @@
+/*
+ * SingletonUnitTest.hpp
+ *
+ *  Created on: Mar 11, 2010
+ *      Author: crueger
+ */
+
+#ifndef SINGLETONUNITTEST_HPP_
+#define SINGLETONUNITTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class SingletonTest : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( SingletonTest );
+  CPPUNIT_TEST ( ConstructionTest );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void ConstructionTest();
+};
+
+#endif /* SINGLETONUNITTEST_HPP_ */
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision 85949a638ffde393b44b0671e40b3ccedb46ce2f)
+++ src/unittests/Makefile.am	(revision c0bccbecd01c28def7f751995f67ff1a54f4c1c4)
@@ -1,4 +1,7 @@
 # PLEASE adhere to the alphabetical ordering in this Makefile!
 # Also indentation by a single tab
+
+SUBDIRS = \
+	../Patterns/unittests
 
 INCLUDES = -I$(top_srcdir)/src
@@ -41,5 +44,4 @@
   Registry \
   ShapeUnittest \
-  SingletonTest \
   SubspaceFactorizerUnitTest \
   TesselationUnitTest \
@@ -102,5 +104,5 @@
   RegistryUnitTest.cpp \
   ShapeUnittest.cpp \
-  SingletonTest.cpp \
+  ../Patterns/unittests/SingletonUnitTest.cpp \
   tesselationunittest.cpp \
   tesselation_boundarytriangleunittest.cpp \
@@ -141,5 +143,7 @@
   PlaneUnittest.hpp \
   RegistryUnitTest.hpp \
-  SingletonTest.hpp \
+  ShapeUnittest.hpp \
+  ../Patterns/unittests/SingletonUnitTest.hpp \
+  stackclassunittest.hpp \
   tesselationunittest.hpp \
   tesselation_boundarytriangleunittest.hpp \
@@ -245,7 +249,4 @@
 ShapeUnittest_LDADD = ${ALLLIBS}
 
-SingletonTest_SOURCES = UnitTestMain.cpp SingletonTest.cpp SingletonTest.hpp
-SingletonTest_LDADD = ${ALLLIBS} $(BOOST_LIB) ${BOOST_THREAD_LIB}
-
 SubspaceFactorizerUnitTest_SOURCES = UnitTestMain.cpp SubspaceFactorizerUnittest.cpp SubspaceFactorizerUnittest.hpp
 SubspaceFactorizerUnitTest_LDADD = ${GSLLIBS}
Index: c/unittests/SingletonTest.cpp
===================================================================
--- src/unittests/SingletonTest.cpp	(revision 85949a638ffde393b44b0671e40b3ccedb46ce2f)
+++ 	(revision )
@@ -1,155 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * SingletonTest.cpp
- *
- *  Created on: Mar 11, 2010
- *      Author: crueger
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "SingletonTest.hpp"
-
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/ui/text/TestRunner.h>
-#include <iostream>
-
-#include "Patterns/Singleton.hpp"
-#include "Patterns/Singleton_impl.hpp"
-
-#ifdef HAVE_TESTRUNNER
-#include "UnitTestMain.hpp"
-#endif /*HAVE_TESTRUNNER*/
-
-CPPUNIT_TEST_SUITE_REGISTRATION( SingletonTest );
-
-// some necessary stubs
-class SingletonStub1 : public Singleton <SingletonStub1>{
-  friend class Singleton<SingletonStub1>;
-private:
-  SingletonStub1(){
-    count1++;
-  }
-  // explicit copy constructor to catch if this is ever called
-  SingletonStub1(const SingletonStub1&){
-    CPPUNIT_FAIL    ( "Copy constructor of Singleton called" );
-  }
-  virtual ~SingletonStub1(){
-    count2++;
-  }
-public:
-  static int count1;
-  static int count2;
-};
-
-int SingletonStub1::count1 = 0;
-int SingletonStub1::count2 = 0;
-
-CONSTRUCT_SINGLETON(SingletonStub1);
-
-class SingletonStub2 : public Singleton<SingletonStub2>{
-  friend class Singleton<SingletonStub2>;
-private:
-  SingletonStub2(){
-    count1++;
-  }
-  // explicit copy constructor to catch if this is ever called
-  SingletonStub2(const SingletonStub2&){
-    CPPUNIT_FAIL    ( "Copy constructor of Singleton called" );
-  }
-  virtual ~SingletonStub2(){
-    count2++;
-  }
-public:
-  static int count1;
-  static int count2;
-};
-
-int SingletonStub2::count1 = 0;
-int SingletonStub2::count2 = 0;
-
-CONSTRUCT_SINGLETON(SingletonStub2);
-
-void SingletonTest::setUp(){}
-void SingletonTest::tearDown(){}
-
-void SingletonTest::ConstructionTest(){
-  void *ptr_1_1 = reinterpret_cast<void*>(SingletonStub1::getPointer());
-  void *ptr_1_2 = reinterpret_cast<void*>(SingletonStub1::getPointer());
-  void *ptr_1_3 = reinterpret_cast<void*>(&(SingletonStub1::getInstance()));
-
-  // test if we always get the same instance of our singleton
-  CPPUNIT_ASSERT_EQUAL(ptr_1_1,ptr_1_2);
-  CPPUNIT_ASSERT_EQUAL(ptr_1_1,ptr_1_3);
-
-  void *ptr_2_1 = reinterpret_cast<void*>(SingletonStub2::getPointer());
-  void *ptr_2_2 = reinterpret_cast<void*>(SingletonStub2::getPointer());
-  void *ptr_2_3 = reinterpret_cast<void*>(&(SingletonStub2::getInstance()));
-
-  // same as above but for a different singleton
-  CPPUNIT_ASSERT_EQUAL(ptr_2_1,ptr_2_2);
-  CPPUNIT_ASSERT_EQUAL(ptr_2_1,ptr_2_3);
-
-  // see if the two singletons actually differ
-  CPPUNIT_ASSERT(ptr_1_1!=ptr_2_1);
-
-  // see if each constructor was called exactly once
-  CPPUNIT_ASSERT_EQUAL(1,SingletonStub1::count1);
-  CPPUNIT_ASSERT_EQUAL(1,SingletonStub2::count1);
-  // no calls to the destructor should have occured so far
-  CPPUNIT_ASSERT_EQUAL(0,SingletonStub1::count2);
-  CPPUNIT_ASSERT_EQUAL(0,SingletonStub2::count2);
-
-  SingletonStub1::purgeInstance();
-
-  void *ptr_3_1 = reinterpret_cast<void*>(SingletonStub1::getPointer());
-  void *ptr_3_2 = reinterpret_cast<void*>(SingletonStub1::getPointer());
-
-  // now the constructor should have been called twice
-  CPPUNIT_ASSERT_EQUAL(2,SingletonStub1::count1);
-  // the destructor should have been called once
-  CPPUNIT_ASSERT_EQUAL(1,SingletonStub1::count2);
-  // see if the singleton Assumption holds
-  CPPUNIT_ASSERT_EQUAL(ptr_3_1,ptr_3_2);
-  // Some esoteric thing might cause our pointer to lay at the position of Singleton2 now
-  // See that those two objects still differ
-  CPPUNIT_ASSERT(ptr_3_1!=ptr_2_1);
-  // don't test for pointer difference between first and second singleton here,
-  // because they might be constructed in the same place
-
-
-  SingletonStub2::resetInstance();
-  // now the constructor should have been called twice
-  CPPUNIT_ASSERT_EQUAL(2,SingletonStub2::count1);
-  // the destructor should have been called once
-  CPPUNIT_ASSERT_EQUAL(1,SingletonStub2::count2);
-
-  void *ptr_4_1 = reinterpret_cast<void*>(SingletonStub2::getPointer());
-  void *ptr_4_2 = reinterpret_cast<void*>(SingletonStub2::getPointer());
-
-  // Still only two calls to the constructor, one call to destructor
-  CPPUNIT_ASSERT_EQUAL(2,SingletonStub2::count1);
-  CPPUNIT_ASSERT_EQUAL(1,SingletonStub2::count2);
-
-  // test if Singleton assumption can be broken by reset
-  CPPUNIT_ASSERT_EQUAL(ptr_4_1,ptr_4_2);
-
-  // and again test if we actually have a object seperate from anything else
-  CPPUNIT_ASSERT(ptr_4_1!=ptr_3_1);
-
-
-  // we don't purge our singletons here. Purging should be done automatically by the Singleton
-  // mechanism. Check with Valgrind to see if memory-leak occurs
-  std::cout << "Not purging Singleton!\n Check with Valgrind to see if automatic purgins is working!" << std::endl;
-
-}
Index: c/unittests/SingletonTest.hpp
===================================================================
--- src/unittests/SingletonTest.hpp	(revision 85949a638ffde393b44b0671e40b3ccedb46ce2f)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/*
- * SingletonTest.hpp
- *
- *  Created on: Mar 11, 2010
- *      Author: crueger
- */
-
-#ifndef SINGLETONTEST_HPP_
-#define SINGLETONTEST_HPP_
-
-#include <cppunit/extensions/HelperMacros.h>
-
-class SingletonTest : public CppUnit::TestFixture
-{
-  CPPUNIT_TEST_SUITE( SingletonTest );
-  CPPUNIT_TEST ( ConstructionTest );
-  CPPUNIT_TEST_SUITE_END();
-
-public:
-  void setUp();
-  void tearDown();
-
-  void ConstructionTest();
-};
-
-#endif /* SINGLETONTEST_HPP_ */
