Index: src/Atom/AtomObserver.cpp
===================================================================
--- src/Atom/AtomObserver.cpp	(revision 5dfabdae3cbf78f772003f96b321468cd321f7eb)
+++ src/Atom/AtomObserver.cpp	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
@@ -25,4 +25,5 @@
 
 #include "Atom/atom.hpp"
+#include "Atom/atom_observable.hpp"
 
 
@@ -32,5 +33,10 @@
 AtomObserver::AtomObserver() :
   Relay(std::string("AtomObserver"))
-{}
+{
+  Channels *OurChannel = new Channels();
+  NotificationChannels.insert( std::make_pair(this, OurChannel) );
+  OurChannel->addChannel(AtomObservable::PositionChanged);
+  OurChannel->addChannel(AtomObservable::ElementChanged);
+}
 
 /** Private Destructor of class AtomObserver.
@@ -50,26 +56,3 @@
 }
 
-/** Callback function for Observer mechanism.
- *
- * @param publisher reference to the Observable that calls
- */
-void AtomObserver::update(Observable *publisher)
-{}
-
-/** Callback function for the Notifications mechanism.
- *
- * @param publisher reference to the Observable that calls
- * @param notification specific notification as cause of the call
- */
-void AtomObserver::recieveNotification(Observable *publisher, Notification_ptr notification)
-{}
-
-/** Callback function when an Observer dies.
- *
- * @param publisher reference to the Observable that calls
- */
-void AtomObserver::subjectKilled(Observable *publisher)
-{}
-
-
 CONSTRUCT_SINGLETON(AtomObserver)
Index: src/Atom/AtomObserver.hpp
===================================================================
--- src/Atom/AtomObserver.hpp	(revision 5dfabdae3cbf78f772003f96b321468cd321f7eb)
+++ src/Atom/AtomObserver.hpp	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
@@ -36,9 +36,4 @@
 public:
 
-protected:
-  void update(Observable *publisher);
-  void recieveNotification(Observable *publisher, Notification_ptr notification);
-  void subjectKilled(Observable *publisher);
-
 private:
   void AtomInserted(atom *res);
Index: src/Atom/unittests/AtomObserverUnitTest.cpp
===================================================================
--- src/Atom/unittests/AtomObserverUnitTest.cpp	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
+++ src/Atom/unittests/AtomObserverUnitTest.cpp	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
@@ -0,0 +1,122 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2011 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomObserverUnitTest.cpp
+ *
+ *  Created on: Dec 19, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "AtomObserverUnitTest.hpp"
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+#include <iostream>
+
+#include "CodePatterns/Log.hpp"
+
+#include "World.hpp"
+#include "Atom/atom.hpp"
+#include "Atom/AtomObserver.hpp"
+#include "Element/element.hpp"
+#include "Element/periodentafel.hpp"
+
+#include "stubs/ObserverStub.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( AtomObserverTest );
+
+// set up and tear down
+void AtomObserverTest::setUp(){
+  World::getInstance();
+  AtomObserver::getInstance();
+
+  setVerbosity(3);
+
+  // observer checks that we don't receive general updates ...
+  observer = new UpdateCountObserver;
+  // but only specific notifications in observer1 and observer2
+  observer1 = new NotificationObserver(
+      AtomObserver::getInstance().getChannel(AtomObservable::PositionChanged)
+      );
+  observer2 = new NotificationObserver(
+      AtomObserver::getInstance().getChannel(AtomObservable::ElementChanged)
+      );
+
+  AtomObserver::getInstance().signOn(observer);
+  AtomObserver::getInstance().signOn(observer1, AtomObservable::PositionChanged);
+  AtomObserver::getInstance().signOn(observer2, AtomObservable::ElementChanged);
+
+  for(int i=0;i<ATOM_COUNT;++i){
+    atoms[i]= World::getInstance().createAtom();
+    atomIds[i]= atoms[i]->getId();
+  }
+}
+
+void AtomObserverTest::tearDown()
+{
+  AtomObserver::getInstance().signOff(observer);
+  AtomObserver::getInstance().signOff(observer1, AtomObservable::PositionChanged);
+  AtomObserver::getInstance().signOff(observer2, AtomObservable::ElementChanged);
+
+  delete observer;
+  delete observer1;
+  delete observer2;
+
+  AtomObserver::purgeInstance();
+  World::purgeInstance();
+}
+
+/** Unit test on whether adding/removing atoms informs relay and onward.
+ *
+ */
+void AtomObserverTest::AtomAddTest()
+{
+  // check for zero update
+  CPPUNIT_ASSERT_EQUAL( (int)0, observer->updates );
+  CPPUNIT_ASSERT_EQUAL( false, observer1->wasNotified );
+  CPPUNIT_ASSERT_EQUAL( false, observer2->wasNotified );
+}
+
+/** Unit test on whether moving atoms informs relay and onward.
+ *
+ */
+void AtomObserverTest::AtomMoveTest()
+{
+  // move an atom
+  atoms[0]->setPosition(Vector(1.,0.,0.));
+
+  // check for update
+  CPPUNIT_ASSERT_EQUAL( true, observer1->wasNotified );
+  CPPUNIT_ASSERT_EQUAL( false, observer2->wasNotified );
+  CPPUNIT_ASSERT_EQUAL( (int)0, observer->updates );
+}
+
+/** Unit test on whether changing atom's element informs relay and onward.
+ *
+ */
+void AtomObserverTest::AtomElementTest()
+{
+  atoms[0]->setType(1);
+
+  // check for update
+  CPPUNIT_ASSERT_EQUAL( false, observer1->wasNotified );
+  CPPUNIT_ASSERT_EQUAL( true, observer2->wasNotified );
+  CPPUNIT_ASSERT_EQUAL( (int)0, observer->updates );
+}
Index: src/Atom/unittests/AtomObserverUnitTest.hpp
===================================================================
--- src/Atom/unittests/AtomObserverUnitTest.hpp	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
+++ src/Atom/unittests/AtomObserverUnitTest.hpp	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
@@ -0,0 +1,54 @@
+/*
+ * AtomObserverUnitTest.hpp
+ *
+ *  Created on: Dec 19, 2011
+ *      Author: heber
+ */
+
+#ifndef ATOMOBSERVERUNITTEST_HPP_
+#define ATOMOBSERVERUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "types.hpp"
+
+class UpdateCountObserver;
+class NotificationObserver;
+
+// we prefer enum over define
+enum { ATOM_COUNT = 2 };
+
+class atom;
+
+class AtomObserverTest : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( AtomObserverTest );
+  CPPUNIT_TEST ( AtomAddTest );
+  CPPUNIT_TEST ( AtomElementTest );
+  CPPUNIT_TEST ( AtomMoveTest );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void AtomAddTest();
+  void AtomElementTest();
+  void AtomMoveTest();
+
+private:
+  atom *atoms [ATOM_COUNT];
+  atomId_t atomIds [ATOM_COUNT];
+
+  UpdateCountObserver *observer;
+  NotificationObserver *observer1;
+  NotificationObserver *observer2;
+};
+
+#endif /* ATOMOBSERVERUNITTEST_HPP_ */
Index: src/Atom/unittests/Makefile.am
===================================================================
--- src/Atom/unittests/Makefile.am	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
+++ src/Atom/unittests/Makefile.am	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
@@ -0,0 +1,37 @@
+# PLEASE adhere to the alphabetical ordering in this Makefile!
+# Also indentation by a single tab
+
+ATOMTESTSSOURCES = \
+	../Atom/unittests/AtomObserverUnitTest.cpp
+
+ATOMTESTSHEADERS = \
+	../Atom/unittests/AtomObserverUnitTest.hpp
+
+ATOMTESTS = \
+  AtomObserverUnitTest
+
+TESTS += $(ATOMTESTS)
+check_PROGRAMS += $(ATOMTESTS) 
+noinst_PROGRAMS += $(ATOMTESTS)
+
+ATOMTESTLIBS = \
+	../libMolecuilderUI.la \
+	../libMolecuilderActions.la \
+	../libMolecuilderParser.la \
+	../libMolecuilder.la \
+	../libMolecuilderShapes.la \
+	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
+	../libMolecuilderRandomNumbers.la \
+	${CodePatterns_LIBS}
+
+
+AtomObserverUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Atom/unittests/AtomObserverUnitTest.cpp \
+	../Atom/unittests/AtomObserverUnitTest.hpp \
+	../Atom/unittests/stubs/ObserverStub.cpp \
+	../Atom/unittests/stubs/ObserverStub.hpp
+AtomObserverUnitTest_LDADD = ${ATOMTESTLIBS}
+
+
+
+#AUTOMAKE_OPTIONS = parallel-tests
Index: src/Atom/unittests/stubs/ObserverStub.cpp
===================================================================
--- src/Atom/unittests/stubs/ObserverStub.cpp	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
+++ src/Atom/unittests/stubs/ObserverStub.cpp	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
@@ -0,0 +1,61 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2011 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ObserverStub.cpp
+ *
+ *  Created on: Dec 19, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Observer/Observer.hpp"
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "ObserverStub.hpp"
+
+/************ UpdateCountObserver **************/
+
+UpdateCountObserver::UpdateCountObserver() :
+  Observer("UpdateCountObserver"),
+  updates(0)
+{};
+
+UpdateCountObserver::~UpdateCountObserver()
+{}
+
+void UpdateCountObserver::update(Observable *publisher){
+  updates++;
+}
+
+void UpdateCountObserver::subjectKilled(Observable *publisher) {
+}
+
+NotificationObserver::NotificationObserver(Notification_ptr notification) :
+  Observer("NotificationObserver"),
+  requestedNotification(notification),
+  wasNotified(false)
+{}
+
+/*********** NotificationObserver **************/
+
+NotificationObserver::~NotificationObserver()
+{}
+
+void NotificationObserver::update(Observable*){}
+void NotificationObserver::subjectKilled(Observable*){}
+void NotificationObserver::recieveNotification(Observable *publisher, Notification_ptr notification){
+  CPPUNIT_ASSERT(requestedNotification==notification);
+  wasNotified = true;
+}
Index: src/Atom/unittests/stubs/ObserverStub.hpp
===================================================================
--- src/Atom/unittests/stubs/ObserverStub.hpp	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
+++ src/Atom/unittests/stubs/ObserverStub.hpp	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
@@ -0,0 +1,44 @@
+/*
+ * ObserverStub.hpp
+ *
+ *  Created on: Dec 19, 2011
+ *      Author: heber
+ */
+
+#ifndef OBSERVERSTUB_HPP_
+#define OBSERVERSTUB_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "CodePatterns/Observer/Observer.hpp"
+
+class UpdateCountObserver : public Observer {
+public:
+  UpdateCountObserver();
+  virtual ~UpdateCountObserver();
+
+  void update(Observable *publisher);
+  void subjectKilled(Observable *publisher);
+
+  int updates;
+};
+
+class NotificationObserver : public Observer {
+public:
+  NotificationObserver(Notification_ptr notification);
+  virtual ~NotificationObserver();
+
+  void update(Observable*);
+  void subjectKilled(Observable*);
+  void recieveNotification(Observable *publisher, Notification_ptr notification);
+
+  Notification_ptr requestedNotification;
+
+  bool wasNotified;
+};
+
+#endif /* OBSERVERSTUB_HPP_ */
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision 5dfabdae3cbf78f772003f96b321468cd321f7eb)
+++ src/unittests/Makefile.am	(revision 97c25501cdca20b601f0fa7b5f1e7524cf194d1e)
@@ -8,4 +8,5 @@
 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
