changeset 935:186115da601f

Make common-core not depend on storage-core. Reviewed-by: vanaltj, omajid, ebaron Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-January/005042.html
author Severin Gehwolf <sgehwolf@redhat.com>
date Wed, 16 Jan 2013 18:58:59 +0100
parents 4290490a2e05
children 1936ad067842
files agent/cli/pom.xml agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/AgentApplication.java agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/ServiceCommand.java agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/db/StorageCommand.java agent/cli/src/test/java/com/redhat/thermostat/agent/cli/impl/ActivatorTest.java agent/cli/src/test/java/com/redhat/thermostat/agent/cli/impl/AgentApplicationTest.java agent/command/pom.xml agent/core/pom.xml agent/core/src/main/java/com/redhat/thermostat/agent/Agent.java agent/core/src/main/java/com/redhat/thermostat/backend/Backend.java agent/core/src/main/java/com/redhat/thermostat/utils/management/MXBeanConnector.java agent/core/src/test/java/com/redhat/thermostat/agent/AgentTest.java agent/core/src/test/java/com/redhat/thermostat/agent/VmStatusListenerRegistrarTest.java client/cli/pom.xml client/cli/src/main/java/com/redhat/thermostat/client/cli/HostVMArguments.java client/cli/src/main/java/com/redhat/thermostat/client/cli/VMStatPrintDelegate.java client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/ConnectCommand.java client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/DisconnectCommand.java client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/ListVMsCommand.java client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/ShellCommand.java client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMInfoCommand.java client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMListFormatter.java client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMStatCommand.java client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMStatPrinter.java client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ActivatorTest.java client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ConnectCommandTest.java client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/DisconnectCommandTest.java client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ListVMsCommandTest.java client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/LocaleResourcesTest.java client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ShellCommandTest.java client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/VMInfoCommandTest.java client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/VmStatCommandTest.java client/command/pom.xml client/command/src/main/java/com/redhat/thermostat/client/command/cli/PingCommand.java client/command/src/test/java/com/redhat/thermostat/client/command/cli/PingCommandTest.java client/core/pom.xml client/core/src/main/java/com/redhat/thermostat/client/core/InformationService.java client/core/src/main/java/com/redhat/thermostat/client/core/NameMatchingRefFilter.java client/core/src/main/java/com/redhat/thermostat/client/core/controllers/InformationServiceController.java client/core/src/main/java/com/redhat/thermostat/client/osgi/service/DecoratorProvider.java client/core/src/main/java/com/redhat/thermostat/client/osgi/service/HostContextAction.java client/core/src/main/java/com/redhat/thermostat/client/osgi/service/VMContextAction.java client/core/src/main/java/com/redhat/thermostat/client/ui/AgentInformationDisplayModel.java client/core/src/main/java/com/redhat/thermostat/client/ui/HostInformationController.java client/core/src/main/java/com/redhat/thermostat/client/ui/SummaryController.java client/core/src/main/java/com/redhat/thermostat/client/ui/UiFacadeFactory.java client/core/src/main/java/com/redhat/thermostat/client/ui/VmInformationController.java client/core/src/test/java/com/redhat/thermostat/client/locale/LocaleResourcesTest.java client/core/src/test/java/com/redhat/thermostat/client/ui/AgentInformationDisplayModelTest.java client/core/src/test/java/com/redhat/thermostat/client/ui/HostInformationControllerTest.java client/core/src/test/java/com/redhat/thermostat/client/ui/SummaryControllerTest.java client/core/src/test/java/com/redhat/thermostat/client/ui/VmInformationControllerTest.java client/living-vm-filter/core/pom.xml client/living-vm-filter/core/src/main/java/com/redhat/thermostat/client/filter/vm/core/LivingVMFilter.java client/living-vm-filter/core/src/main/java/com/redhat/thermostat/client/filter/vm/core/VMFilterActivator.java client/living-vm-filter/core/src/test/java/com/redhat/thermostat/client/filter/vm/core/LivingVMFilterTest.java client/living-vm-filter/core/src/test/java/com/redhat/thermostat/client/filter/vm/core/VMFilterActivatorTest.java client/living-vm-filter/swing/pom.xml client/living-vm-filter/swing/src/main/java/com/redhat/thermostat/client/filter/vm/swing/DeadVMDecoratorProvider.java client/living-vm-filter/swing/src/main/java/com/redhat/thermostat/client/filter/vm/swing/LivingVMDecoratorProvider.java client/living-vm-filter/swing/src/main/java/com/redhat/thermostat/client/filter/vm/swing/VMFilterActivator.java client/living-vm-filter/swing/src/test/java/com/redhat/thermostat/client/filter/vm/swing/VMFilterActivatorTest.java client/swing/pom.xml client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/HostFilterRegistry.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/HostIconDecoratorProvider.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/HostTreeDecoratorRegistry.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/Main.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/MainView.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/MainWindow.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/MainWindowControllerImpl.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/UiFacadeFactoryImpl.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/VMInformationRegistry.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/VMTreeDecoratorRegistry.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/VmFilterRegistry.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/components/DecoratedDefaultMutableTreeNode.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/osgi/InformationServiceTracker.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/osgi/ThermostatActivator.java client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/HostIconDecoratorProviderTest.java client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/MainTest.java client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/MainWindowControllerImplTest.java client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/MainWindowTest.java client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/osgi/HostContextActionServiceTrackerTest.java client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/osgi/ThermostatActivatorTest.java common/core/pom.xml common/core/src/main/java/com/redhat/thermostat/common/DbService.java common/core/src/main/java/com/redhat/thermostat/common/DbServiceFactory.java common/core/src/main/java/com/redhat/thermostat/common/DefaultHostsVMsLoader.java common/core/src/main/java/com/redhat/thermostat/common/HostsVMsLoader.java common/core/src/main/java/com/redhat/thermostat/common/Launcher.java common/core/src/main/java/com/redhat/thermostat/common/cli/BasicCommand.java common/core/src/main/java/com/redhat/thermostat/common/cli/HostVMArguments.java common/core/src/main/java/com/redhat/thermostat/common/dao/AgentInfoDAO.java common/core/src/main/java/com/redhat/thermostat/common/dao/AgentInfoDAOImpl.java common/core/src/main/java/com/redhat/thermostat/common/dao/BackendInfoDAO.java common/core/src/main/java/com/redhat/thermostat/common/dao/BackendInfoDAOImpl.java common/core/src/main/java/com/redhat/thermostat/common/dao/Countable.java common/core/src/main/java/com/redhat/thermostat/common/dao/DAOException.java common/core/src/main/java/com/redhat/thermostat/common/dao/DAOFactory.java common/core/src/main/java/com/redhat/thermostat/common/dao/DAOFactoryImpl.java common/core/src/main/java/com/redhat/thermostat/common/dao/HostInfoDAO.java common/core/src/main/java/com/redhat/thermostat/common/dao/HostInfoDAOImpl.java common/core/src/main/java/com/redhat/thermostat/common/dao/HostLatestPojoListGetter.java common/core/src/main/java/com/redhat/thermostat/common/dao/HostRef.java common/core/src/main/java/com/redhat/thermostat/common/dao/NetworkInterfaceInfoDAO.java common/core/src/main/java/com/redhat/thermostat/common/dao/NetworkInterfaceInfoDAOImpl.java common/core/src/main/java/com/redhat/thermostat/common/dao/Ref.java common/core/src/main/java/com/redhat/thermostat/common/dao/VmInfoDAO.java common/core/src/main/java/com/redhat/thermostat/common/dao/VmInfoDAOImpl.java common/core/src/main/java/com/redhat/thermostat/common/dao/VmLatestPojoListGetter.java common/core/src/main/java/com/redhat/thermostat/common/dao/VmRef.java common/core/src/main/java/com/redhat/thermostat/common/internal/DbServiceImpl.java common/core/src/main/java/com/redhat/thermostat/common/tools/BasicCommand.java common/core/src/main/java/com/redhat/thermostat/test/StubBundleContext.java common/core/src/main/java/com/redhat/thermostat/test/StubServiceReference.java common/core/src/main/java/com/redhat/thermostat/test/StubServiceRegistration.java common/core/src/test/java/com/redhat/thermostat/common/DefaultHostsVMsLoaderTest.java common/core/src/test/java/com/redhat/thermostat/common/cli/BasicCommandTest.java common/core/src/test/java/com/redhat/thermostat/common/dao/AgentInfoDAOTest.java common/core/src/test/java/com/redhat/thermostat/common/dao/BackendInfoDAOTest.java common/core/src/test/java/com/redhat/thermostat/common/dao/HostInfoDAOTest.java common/core/src/test/java/com/redhat/thermostat/common/dao/HostLatestPojoListGetterTest.java common/core/src/test/java/com/redhat/thermostat/common/dao/MongoDAOFactoryTest.java common/core/src/test/java/com/redhat/thermostat/common/dao/NetworkInterfaceInfoDAOTest.java common/core/src/test/java/com/redhat/thermostat/common/dao/QueryTestHelper.java common/core/src/test/java/com/redhat/thermostat/common/dao/VmInfoDAOTest.java common/core/src/test/java/com/redhat/thermostat/common/dao/VmLatestPojoListGetterTest.java common/core/src/test/java/com/redhat/thermostat/common/internal/DbServiceTest.java common/core/src/test/java/com/redhat/thermostat/common/tools/BasicCommandTest.java common/core/src/test/java/com/redhat/thermostat/test/StubBundleContextTest.java common/test/pom.xml common/test/src/main/java/com/redhat/thermostat/test/cli/TestCommand.java common/test/src/main/java/com/redhat/thermostat/test/locale/AbstractLocaleResourcesTest.java common/test/src/main/java/com/redhat/thermostat/testutils/AbstractLocaleResourcesTest.java common/test/src/main/java/com/redhat/thermostat/testutils/NotImplementedException.java common/test/src/main/java/com/redhat/thermostat/testutils/StubBundleContext.java common/test/src/main/java/com/redhat/thermostat/testutils/StubServiceReference.java common/test/src/main/java/com/redhat/thermostat/testutils/StubServiceRegistration.java common/test/src/test/java/com/redhat/thermostat/testutils/StubBundleContextTest.java distribution/config/commands/dump-heap.properties distribution/config/commands/find-objects.properties distribution/config/commands/find-root.properties distribution/config/commands/gui.properties distribution/config/commands/list-heap-dumps.properties distribution/config/commands/object-info.properties distribution/config/commands/save-heap-dump-to-file.properties distribution/config/commands/show-heap-histogram.properties eclipse/com.redhat.thermostat.eclipse.chart.common/META-INF/MANIFEST.MF eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostCpuViewPart.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostMemoryViewPart.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmCpuViewPart.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmGcViewPart.java eclipse/com.redhat.thermostat.eclipse.chart.vmclassstat/META-INF/MANIFEST.MF eclipse/com.redhat.thermostat.eclipse.chart.vmclassstat/src/com/redhat/thermostat/eclipse/chart/vmclassstat/VmClassStatViewPart.java eclipse/com.redhat.thermostat.eclipse.test/META-INF/MANIFEST.MF eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostVmsTreeContentProviderTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostsVmsLabelProviderTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/AbstractRefViewPartTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/HostCpuViewPartTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/HostMemoryViewPartTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/HostOverviewViewPartTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/VmClassStatViewPartTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/VmCpuViewPartTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/VmGcViewPartTest.java eclipse/com.redhat.thermostat.eclipse/META-INF/MANIFEST.MF eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/Activator.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/jobs/ConnectDbJob.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsLabelProvider.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsTreeContentProvider.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/HostOverviewViewPart.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/HostsVmsTreeViewPart.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/RefViewPart.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/HostRefViewPart.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/VmRefViewPart.java host-cpu/agent/pom.xml host-cpu/agent/src/test/java/com/redhat/thermostat/host/cpu/agent/internal/ActivatorTest.java host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/HostCpuService.java host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/internal/Activator.java host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/internal/HostCpuController.java host-cpu/client-core/src/test/java/com/redhat/thermostat/host/cpu/client/core/internal/ActivatorTest.java host-cpu/client-core/src/test/java/com/redhat/thermostat/host/cpu/client/core/internal/HostCpuControllerTest.java host-cpu/client-core/src/test/java/com/redhat/thermostat/host/cpu/client/locale/LocaleResourcesTest.java host-cpu/client-swing/pom.xml host-cpu/client-swing/src/test/java/com/redhat/thermostat/host/cpu/client/swing/internal/ActivatorTest.java host-cpu/common/pom.xml host-cpu/common/src/main/java/com/redhat/thermostat/host/cpu/common/CpuStatDAO.java host-cpu/common/src/main/java/com/redhat/thermostat/host/cpu/common/internal/CpuStatDAOImpl.java host-cpu/common/src/test/java/com/redhat/thermostat/host/cpu/common/internal/ActivatorTest.java host-cpu/common/src/test/java/com/redhat/thermostat/host/cpu/common/internal/CpuStatDAOTest.java host-memory/agent/pom.xml host-memory/agent/src/test/java/com/redhat/thermostat/host/memory/agent/internal/ActivatorTest.java host-memory/client-core/pom.xml host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/HostMemoryService.java host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/internal/Activator.java host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/internal/HostMemoryController.java host-memory/client-core/src/test/java/com/redhat/thermostat/host/memory/client/core/internal/ActivatorTest.java host-memory/client-core/src/test/java/com/redhat/thermostat/host/memory/client/core/internal/HostMemoryControllerTest.java host-memory/client-core/src/test/java/com/redhat/thermostat/host/memory/client/locale/LocaleResourcesTest.java host-memory/client-swing/pom.xml host-memory/client-swing/src/test/java/com/redhat/thermostat/host/memory/client/swing/internal/ActivatorTest.java host-memory/common/pom.xml host-memory/common/src/main/java/com/redhat/thermostat/host/memory/common/MemoryStatDAO.java host-memory/common/src/main/java/com/redhat/thermostat/host/memory/common/internal/MemoryStatDAOImpl.java host-memory/common/src/test/java/com/redhat/thermostat/host/memory/common/internal/ActivatorTest.java host-memory/common/src/test/java/com/redhat/thermostat/host/memory/common/internal/MemoryStatDAOTest.java host-overview/client-core/pom.xml host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/HostOverviewService.java host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/internal/Activator.java host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/internal/HostOverviewController.java host-overview/client-core/src/test/java/com/redhat/thermostat/host/overview/client/core/internal/ActivatorTest.java host-overview/client-core/src/test/java/com/redhat/thermostat/host/overview/client/core/internal/HostOverviewControllerTest.java host-overview/client-core/src/test/java/com/redhat/thermostat/host/overview/client/locale/LocaleResourcesTest.java host-overview/client-swing/pom.xml host-overview/client-swing/src/test/java/com/redhat/thermostat/host/overview/client/swing/internal/ActivatorTest.java killvm/client-swing/pom.xml killvm/client-swing/src/main/java/com/redhat/thermostat/killvm/client/internal/Activator.java killvm/client-swing/src/main/java/com/redhat/thermostat/killvm/client/internal/KillVMAction.java killvm/client-swing/src/test/java/com/redhat/thermostat/killvm/client/internal/KillVMActionTest.java launcher/pom.xml launcher/src/main/java/com/redhat/thermostat/launcher/Launcher.java launcher/src/main/java/com/redhat/thermostat/launcher/internal/Activator.java launcher/src/main/java/com/redhat/thermostat/launcher/internal/LauncherImpl.java launcher/src/test/java/com/redhat/thermostat/launcher/TestCommand.java launcher/src/test/java/com/redhat/thermostat/launcher/internal/ActivatorTest.java launcher/src/test/java/com/redhat/thermostat/launcher/internal/HelpCommandTest.java launcher/src/test/java/com/redhat/thermostat/launcher/internal/LauncherTest.java main/src/main/java/com/redhat/thermostat/main/Thermostat.java main/src/main/java/com/redhat/thermostat/main/impl/FrameworkProvider.java main/src/test/java/com/redhat/thermostat/main/ThermostatTest.java numa/agent/pom.xml numa/agent/src/test/java/com/redhat/thermostat/numa/agent/internal/ActivatorTest.java numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/NumaInformationService.java numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/internal/Activator.java numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/internal/NumaController.java numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/NumaInformationServiceTest.java numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/internal/ActivatorTest.java numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/internal/NumaControllerTest.java numa/client-core/src/test/java/com/redhat/thermostat/numa/client/locale/LocaleResourcesTest.java numa/client-swing/pom.xml numa/client-swing/src/test/java/com/redhat/thermostat/numa/client/swing/internal/ActivatorTest.java numa/common/pom.xml numa/common/src/main/java/com/redhat/thermostat/numa/common/NumaDAO.java numa/common/src/main/java/com/redhat/thermostat/numa/common/internal/NumaDAOImpl.java numa/common/src/test/java/com/redhat/thermostat/numa/common/internal/ActivatorTest.java storage/core/pom.xml storage/core/src/main/java/com/redhat/thermostat/storage/config/ConnectionConfiguration.java storage/core/src/main/java/com/redhat/thermostat/storage/core/Countable.java storage/core/src/main/java/com/redhat/thermostat/storage/core/DbService.java storage/core/src/main/java/com/redhat/thermostat/storage/core/DbServiceFactory.java storage/core/src/main/java/com/redhat/thermostat/storage/core/DefaultHostsVMsLoader.java storage/core/src/main/java/com/redhat/thermostat/storage/core/HostLatestPojoListGetter.java storage/core/src/main/java/com/redhat/thermostat/storage/core/HostRef.java storage/core/src/main/java/com/redhat/thermostat/storage/core/HostsVMsLoader.java storage/core/src/main/java/com/redhat/thermostat/storage/core/Ref.java storage/core/src/main/java/com/redhat/thermostat/storage/core/VmLatestPojoListGetter.java storage/core/src/main/java/com/redhat/thermostat/storage/core/VmRef.java storage/core/src/main/java/com/redhat/thermostat/storage/dao/AgentInfoDAO.java storage/core/src/main/java/com/redhat/thermostat/storage/dao/BackendInfoDAO.java storage/core/src/main/java/com/redhat/thermostat/storage/dao/DAOException.java storage/core/src/main/java/com/redhat/thermostat/storage/dao/DAOFactory.java storage/core/src/main/java/com/redhat/thermostat/storage/dao/DAOFactoryImpl.java storage/core/src/main/java/com/redhat/thermostat/storage/dao/HostInfoDAO.java storage/core/src/main/java/com/redhat/thermostat/storage/dao/NetworkInterfaceInfoDAO.java storage/core/src/main/java/com/redhat/thermostat/storage/dao/VmInfoDAO.java storage/core/src/main/java/com/redhat/thermostat/storage/internal/DbServiceImpl.java storage/core/src/main/java/com/redhat/thermostat/storage/internal/dao/AgentInfoDAOImpl.java storage/core/src/main/java/com/redhat/thermostat/storage/internal/dao/BackendInfoDAOImpl.java storage/core/src/main/java/com/redhat/thermostat/storage/internal/dao/HostInfoDAOImpl.java storage/core/src/main/java/com/redhat/thermostat/storage/internal/dao/NetworkInterfaceInfoDAOImpl.java storage/core/src/main/java/com/redhat/thermostat/storage/internal/dao/VmInfoDAOImpl.java storage/core/src/test/java/com/redhat/thermostat/storage/core/DefaultHostsVMsLoaderTest.java storage/core/src/test/java/com/redhat/thermostat/storage/core/HostLatestPojoListGetterTest.java storage/core/src/test/java/com/redhat/thermostat/storage/core/VmLatestPojoListGetterTest.java storage/core/src/test/java/com/redhat/thermostat/storage/dao/DAOFactoryTest.java storage/core/src/test/java/com/redhat/thermostat/storage/internal/DbServiceTest.java storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/AgentInfoDAOTest.java storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/BackendInfoDAOTest.java storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/HostInfoDAOTest.java storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/NetworkInterfaceInfoDAOTest.java storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/QueryTestHelper.java storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/VmInfoDAOTest.java storage/mongo/src/main/java/com/redhat/thermostat/storage/mongodb/internal/MongoConnection.java system-backend/pom.xml system-backend/src/main/java/com/redhat/thermostat/backend/system/JvmStatHostListener.java system-backend/src/main/java/com/redhat/thermostat/backend/system/SystemBackend.java system-backend/src/test/java/com/redhat/thermostat/backend/system/JvmStatHostListenerTest.java system-backend/src/test/java/com/redhat/thermostat/backend/system/SystemBackendTest.java system-backend/src/test/java/com/redhat/thermostat/backend/system/VmStatusChangeNotifierTest.java thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/ThreadCollector.java thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/ThreadCollectorFactory.java thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/impl/ThreadCollectorFactoryImpl.java thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/impl/ThreadMXBeanCollector.java thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/osgi/Activator.java thread/client-common/src/test/java/com/redhat/thermostat/thread/client/common/collector/ThreadCollectorFactoryTest.java thread/client-common/src/test/java/com/redhat/thermostat/thread/client/common/collector/impl/ThreadCollectorTest.java thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/impl/ThreadInformationController.java thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/impl/ThreadInformationService.java thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/osgi/Activator.java thread/client-controllers/src/test/java/com/redhat/thermostat/thread/client/controller/impl/ThreadInformationControllerTest.java thread/collector/src/main/java/com/redhat/thermostat/thread/dao/ThreadDao.java thread/collector/src/main/java/com/redhat/thermostat/thread/dao/impl/ThreadDaoImpl.java thread/collector/src/test/java/com/redhat/thermostat/thread/dao/impl/ThreadDaoImplTest.java vm-classstat/agent/pom.xml vm-classstat/agent/src/test/java/com/redhat/thermostat/vm/classstat/agent/internal/ActivatorTest.java vm-classstat/client-core/pom.xml vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/VmClassStatService.java vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/internal/Activator.java vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/internal/VmClassStatController.java vm-classstat/client-core/src/test/java/com/redhat/thermostat/vm/classstat/client/core/internal/ActivatorTest.java vm-classstat/client-core/src/test/java/com/redhat/thermostat/vm/classstat/client/core/internal/VmClassStatControllerTest.java vm-classstat/client-core/src/test/java/com/redhat/thermostat/vm/classstat/client/locale/LocaleResourcesTest.java vm-classstat/client-swing/pom.xml vm-classstat/client-swing/src/test/java/com/redhat/thermostat/vm/classstat/client/swing/ActivatorTest.java vm-classstat/common/pom.xml vm-classstat/common/src/main/java/com/redhat/thermostat/vm/classstat/common/VmClassStatDAO.java vm-classstat/common/src/main/java/com/redhat/thermostat/vm/classstat/common/internal/VmClassStatDAOImpl.java vm-classstat/common/src/test/java/com/redhat/thermostat/vm/classstat/common/internal/ActivatorTest.java vm-classstat/common/src/test/java/com/redhat/thermostat/vm/classstat/common/internal/VmClassStatDAOTest.java vm-cpu/agent/pom.xml vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/ActivatorTest.java vm-cpu/client-cli/src/main/java/com/redhat/thermostat/vm/cpu/client/cli/internal/VmCpuStatPrintDelegate.java vm-cpu/client-cli/src/test/java/com/redhat/thermostat/vm/cpu/client/cli/internal/ActivatorTest.java vm-cpu/client-cli/src/test/java/com/redhat/thermostat/vm/cpu/client/cli/internal/LocaleResourcesTest.java vm-cpu/client-cli/src/test/java/com/redhat/thermostat/vm/cpu/client/cli/internal/VmCpuStatPrintDelegateTest.java vm-cpu/client-core/pom.xml vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/VmCpuService.java vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/internal/Activator.java vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/internal/VmCpuController.java vm-cpu/client-core/src/test/java/com/redhat/thermostat/vm/cpu/client/core/internal/ActivatorTest.java vm-cpu/client-core/src/test/java/com/redhat/thermostat/vm/cpu/client/core/internal/VmCpuControllerTest.java vm-cpu/client-core/src/test/java/com/redhat/thermostat/vm/cpu/client/locale/LocaleResourcesTest.java vm-cpu/client-swing/pom.xml vm-cpu/client-swing/src/test/java/com/redhat/thermostat/vm/cpu/client/swing/internal/ActivatorTest.java vm-cpu/common/pom.xml vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/VmCpuStatDAO.java vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/internal/VmCpuStatDAOImpl.java vm-cpu/common/src/test/java/com/redhat/thermostat/vm/cpu/common/internal/ActivatorTest.java vm-cpu/common/src/test/java/com/redhat/thermostat/vm/cpu/common/internal/VmCpuStatDAOTest.java vm-gc/agent/pom.xml vm-gc/agent/src/test/java/com/redhat/thermostat/vm/gc/agent/internal/ActivatorTest.java vm-gc/client-core/pom.xml vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/VmGcService.java vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/internal/Activator.java vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/internal/VmGcController.java vm-gc/client-core/src/test/java/com/redhat/thermostat/vm/gc/client/core/internal/ActivatorTest.java vm-gc/client-core/src/test/java/com/redhat/thermostat/vm/gc/client/core/internal/VmGcControllerTest.java vm-gc/client-core/src/test/java/com/redhat/thermostat/vm/gc/client/locale/LocaleResourcesTest.java vm-gc/client-swing/pom.xml vm-gc/client-swing/src/test/java/com/redhat/thermostat/vm/gc/client/swing/internal/ActivatorTest.java vm-gc/common/pom.xml vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/VmGcStatDAO.java vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/internal/VmGcStatDAOImpl.java vm-gc/common/src/test/java/com/redhat/thermostat/vm/gc/common/internal/ActivatorTest.java vm-gc/common/src/test/java/com/redhat/thermostat/vm/gc/common/internal/VmGcStatDAOTest.java vm-gc/remote-collector-client-common/src/main/java/com/redhat/thermostat/gc/remote/common/GCRequest.java vm-gc/remote-collector-client-common/src/test/java/com/redhat/thermostat/gc/remote/common/GCRequestTest.java vm-heap-analysis/agent/pom.xml vm-heap-analysis/agent/src/test/java/com/redhat/thermostat/vm/heap/analysis/agent/internal/ActivatorTest.java vm-heap-analysis/client-core/pom.xml vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapDumperService.java vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/Activator.java vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumpController.java vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumper.java vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/ActivatorTest.java vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumpControllerTest.java vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumperTest.java vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/locale/LocaleResourcesTest.java vm-heap-analysis/client-swing/pom.xml vm-heap-analysis/client-swing/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/swing/internal/ActivatorTest.java vm-heap-analysis/command/pom.xml vm-heap-analysis/command/src/main/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapCommand.java vm-heap-analysis/command/src/main/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapHelper.java vm-heap-analysis/command/src/main/java/com/redhat/thermostat/vm/heap/analysis/command/internal/ListHeapDumpsCommand.java vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/ActivatorTest.java vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapCommandTest.java vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapHelperTest.java vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/ListHeapDumpsCommandTest.java vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/locale/LocaleResourcesTest.java vm-heap-analysis/common/pom.xml vm-heap-analysis/common/src/main/java/com/redhat/thermostat/vm/heap/analysis/common/HeapDAO.java vm-heap-analysis/common/src/main/java/com/redhat/thermostat/vm/heap/analysis/common/internal/HeapDAOImpl.java vm-heap-analysis/common/src/test/java/com/redhat/thermostat/vm/heap/analysis/common/internal/HeapDAOTest.java vm-memory/agent/pom.xml vm-memory/agent/src/test/java/com/redhat/thermostat/vm/memory/agent/internal/ActivatorTest.java vm-memory/client-cli/src/main/java/com/redhat/thermostat/vm/memory/client/cli/internal/VmMemoryStatPrintDelegate.java vm-memory/client-cli/src/test/java/com/redhat/thermostat/vm/memory/client/cli/internal/ActivatorTest.java vm-memory/client-cli/src/test/java/com/redhat/thermostat/vm/memory/client/cli/internal/LocaleResourcesTest.java vm-memory/client-cli/src/test/java/com/redhat/thermostat/vm/memory/client/cli/internal/VmMemoryStatPrintDelegateTest.java vm-memory/client-core/pom.xml vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/MemoryStatsService.java vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/internal/Activator.java vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/internal/MemoryStatsController.java vm-memory/client-core/src/test/java/com/redhat/thermostat/vm/memory/client/core/internal/ActivatorTest.java vm-memory/client-core/src/test/java/com/redhat/thermostat/vm/memory/client/core/internal/MemoryStatsControllerTest.java vm-memory/client-core/src/test/java/com/redhat/thermostat/vm/memory/client/locale/LocaleResourcesTest.java vm-memory/client-swing/pom.xml vm-memory/client-swing/src/test/java/com/redhat/thermostat/vm/memory/client/swing/internal/ActivatorTest.java vm-memory/common/pom.xml vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/VmMemoryStatDAO.java vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/internal/VmMemoryStatDAOImpl.java vm-memory/common/src/test/java/com/redhat/thermostat/vm/memory/common/internal/ActivatorTest.java vm-memory/common/src/test/java/com/redhat/thermostat/vm/memory/common/internal/VmMemoryStatDAOTest.java vm-overview/client-core/pom.xml vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/VmOverviewService.java vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/internal/Activator.java vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/internal/VmOverviewController.java vm-overview/client-core/src/test/java/com/redhat/thermostat/vm/overview/client/core/internal/ActivatorTest.java vm-overview/client-core/src/test/java/com/redhat/thermostat/vm/overview/client/core/internal/VmOverviewControllerTest.java vm-overview/client-core/src/test/java/com/redhat/thermostat/vm/overview/client/locale/LocaleResourcesTest.java vm-overview/client-swing/pom.xml vm-overview/client-swing/src/test/java/com/redhat/thermostat/vm/overview/client/swing/internal/ActivatorTest.java
diffstat 410 files changed, 6673 insertions(+), 6226 deletions(-) [+]
line wrap: on
line diff
--- a/agent/cli/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/cli/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -90,6 +90,17 @@
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-storage-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
 
   <build>
--- a/agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/AgentApplication.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/AgentApplication.java	Wed Jan 16 18:58:59 2013 +0100
@@ -53,21 +53,21 @@
 import com.redhat.thermostat.agent.config.AgentStartupConfiguration;
 import com.redhat.thermostat.backend.BackendRegistry;
 import com.redhat.thermostat.backend.BackendService;
+import com.redhat.thermostat.common.cli.BasicCommand;
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.LaunchException;
 import com.redhat.thermostat.common.cli.Arguments;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.config.InvalidConfigurationException;
-import com.redhat.thermostat.common.dao.DAOFactory;
-import com.redhat.thermostat.common.dao.DAOFactoryImpl;
-import com.redhat.thermostat.common.tools.BasicCommand;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.storage.core.Connection;
 import com.redhat.thermostat.storage.core.StorageProvider;
 import com.redhat.thermostat.storage.core.StorageProviderUtil;
 import com.redhat.thermostat.storage.core.Connection.ConnectionListener;
 import com.redhat.thermostat.storage.core.Connection.ConnectionStatus;
+import com.redhat.thermostat.storage.dao.DAOFactory;
+import com.redhat.thermostat.storage.dao.DAOFactoryImpl;
 
 @SuppressWarnings("restriction")
 public final class AgentApplication extends BasicCommand {
@@ -95,11 +95,6 @@
         parser = new AgentOptionParser(configuration, args);
         parser.parse();
     }
-
-    @Override
-    public AgentStartupConfiguration getConfiguration() {
-        return configuration;
-    }
     
     private void runAgent(CommandContext ctx) {
         long startTime = System.currentTimeMillis();
--- a/agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/ServiceCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/ServiceCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,13 +45,13 @@
 import com.redhat.thermostat.agent.cli.impl.locale.LocaleResources;
 import com.redhat.thermostat.common.ActionEvent;
 import com.redhat.thermostat.common.ActionListener;
+import com.redhat.thermostat.common.Launcher;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleCommand;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.tools.ApplicationState;
 import com.redhat.thermostat.common.utils.OSGIUtils;
-import com.redhat.thermostat.launcher.Launcher;
 
 /**
  * Simple service that allows starting Agent and DB Backend
--- a/agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/db/StorageCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/db/StorageCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,6 +39,7 @@
 import java.io.File;
 import java.io.IOException;
 
+import com.redhat.thermostat.common.cli.BasicCommand;
 import com.redhat.thermostat.common.cli.Arguments;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
@@ -46,7 +47,6 @@
 import com.redhat.thermostat.common.config.InvalidConfigurationException;
 import com.redhat.thermostat.common.tools.ApplicationException;
 import com.redhat.thermostat.common.tools.ApplicationState;
-import com.redhat.thermostat.common.tools.BasicCommand;
 
 public class StorageCommand extends BasicCommand {
 
@@ -137,7 +137,6 @@
         }
     }
 
-    @Override
     public DBStartupConfiguration getConfiguration() {
         return configuration;
     }
--- a/agent/cli/src/test/java/com/redhat/thermostat/agent/cli/impl/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/cli/src/test/java/com/redhat/thermostat/agent/cli/impl/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -43,7 +43,7 @@
 
 import com.redhat.thermostat.agent.cli.impl.db.StorageCommand;
 import com.redhat.thermostat.common.cli.Command;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
 
--- a/agent/cli/src/test/java/com/redhat/thermostat/agent/cli/impl/AgentApplicationTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/cli/src/test/java/com/redhat/thermostat/agent/cli/impl/AgentApplicationTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -58,11 +58,11 @@
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.config.InvalidConfigurationException;
-import com.redhat.thermostat.common.dao.DAOFactory;
 import com.redhat.thermostat.storage.core.Connection;
 import com.redhat.thermostat.storage.core.Connection.ConnectionListener;
 import com.redhat.thermostat.storage.core.Connection.ConnectionStatus;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.storage.dao.DAOFactory;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class AgentApplicationTest {
 
--- a/agent/command/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/command/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -92,6 +92,12 @@
       <version>${project.version}</version>
     </dependency>
     
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-storage-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    
   </dependencies>
 
   <build>
--- a/agent/core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -72,6 +72,17 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-storage-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
     </dependency>
--- a/agent/core/src/main/java/com/redhat/thermostat/agent/Agent.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/core/src/main/java/com/redhat/thermostat/agent/Agent.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,11 +49,11 @@
 import com.redhat.thermostat.common.ActionListener;
 import com.redhat.thermostat.common.LaunchException;
 import com.redhat.thermostat.common.ThermostatExtensionRegistry;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.BackendInfoDAO;
-import com.redhat.thermostat.common.dao.DAOFactory;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.BackendInfoDAO;
+import com.redhat.thermostat.storage.dao.DAOFactory;
 import com.redhat.thermostat.storage.model.AgentInformation;
 import com.redhat.thermostat.storage.model.BackendInformation;
 
--- a/agent/core/src/main/java/com/redhat/thermostat/backend/Backend.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/core/src/main/java/com/redhat/thermostat/backend/Backend.java	Wed Jan 16 18:58:59 2013 +0100
@@ -43,8 +43,8 @@
 import com.redhat.thermostat.annotations.ExtensionPoint;
 import com.redhat.thermostat.common.LaunchException;
 import com.redhat.thermostat.common.Ordered;
-import com.redhat.thermostat.common.dao.DAOFactory;
 import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.dao.DAOFactory;
 
 /**
  * Represents a plugin that runs on the agent and performs monitoring of host
--- a/agent/core/src/main/java/com/redhat/thermostat/utils/management/MXBeanConnector.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/core/src/main/java/com/redhat/thermostat/utils/management/MXBeanConnector.java	Wed Jan 16 18:58:59 2013 +0100
@@ -46,7 +46,7 @@
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
 
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.sun.tools.attach.VirtualMachine;
 
 public class MXBeanConnector implements Closeable {
--- a/agent/core/src/test/java/com/redhat/thermostat/agent/AgentTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/core/src/test/java/com/redhat/thermostat/agent/AgentTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -63,10 +63,10 @@
 import com.redhat.thermostat.common.ActionEvent;
 import com.redhat.thermostat.common.ActionListener;
 import com.redhat.thermostat.common.ThermostatExtensionRegistry;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.BackendInfoDAO;
-import com.redhat.thermostat.common.dao.DAOFactory;
 import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.BackendInfoDAO;
+import com.redhat.thermostat.storage.dao.DAOFactory;
 import com.redhat.thermostat.storage.model.AgentInformation;
 import com.redhat.thermostat.storage.model.BackendInformation;
 
--- a/agent/core/src/test/java/com/redhat/thermostat/agent/VmStatusListenerRegistrarTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/agent/core/src/test/java/com/redhat/thermostat/agent/VmStatusListenerRegistrarTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,7 +45,7 @@
 
 import com.redhat.thermostat.agent.VmStatusListener;
 import com.redhat.thermostat.agent.VmStatusListenerRegistrar;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class VmStatusListenerRegistrarTest {
 
--- a/client/cli/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -82,7 +82,7 @@
     </dependency>
     <dependency>
       <groupId>com.redhat.thermostat</groupId>
-      <artifactId>thermostat-launcher</artifactId>
+      <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
@@ -91,12 +91,6 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>com.redhat.thermostat</groupId>
-      <artifactId>thermostat-common-test</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
       <scope>provided</scope>
@@ -106,6 +100,12 @@
       <artifactId>org.osgi.compendium</artifactId>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/cli/src/main/java/com/redhat/thermostat/client/cli/HostVMArguments.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.client.cli;
+
+import com.redhat.thermostat.common.cli.Arguments;
+import com.redhat.thermostat.common.cli.CommandException;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+
+public class HostVMArguments {
+
+    static final String HOST_ID_ARGUMENT = "hostId";
+    static final String VM_ID_ARGUMENT = "vmId";
+
+    private HostRef host;
+    private VmRef vm;
+
+    public HostVMArguments(Arguments args) throws CommandException {
+        this(args, true, true);
+    }
+
+    public HostVMArguments(Arguments args, boolean hostRequired, boolean vmRequired) throws CommandException {
+        String hostId = args.getArgument(HOST_ID_ARGUMENT);
+        String vmId = args.getArgument(VM_ID_ARGUMENT);
+        if (hostRequired && hostId == null) {
+            throw new CommandException("a " + HOST_ID_ARGUMENT + " is required");
+        } else if (hostId == null) {
+            host = null;
+        } else {
+            host = new HostRef(hostId, "dummy");
+        }
+        try {
+            int parsedVmId = parseVmId(vmId);
+            vm = new VmRef(host, parsedVmId, "dummy");
+        } catch (CommandException ce) {
+            if (vmRequired) {
+                throw ce;
+            }
+            vm = null;
+        }
+    }
+
+    private int parseVmId(String vmId) throws CommandException {
+        try {
+            return Integer.parseInt(vmId);
+        } catch (NumberFormatException ex) {
+            throw new CommandException("Invalid VM ID: " + vmId, ex);
+        }
+    }
+
+    public HostRef getHost() {
+        return host;
+    }
+
+    public VmRef getVM() {
+        return vm;
+    }
+}
+
--- a/client/cli/src/main/java/com/redhat/thermostat/client/cli/VMStatPrintDelegate.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/main/java/com/redhat/thermostat/client/cli/VMStatPrintDelegate.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,7 +39,7 @@
 import java.util.List;
 
 import com.redhat.thermostat.common.Ordered;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.TimeStampedPojo;
 
 /**
--- a/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/ConnectCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/ConnectCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,8 +36,6 @@
 
 package com.redhat.thermostat.client.cli.internal;
 
-import com.redhat.thermostat.common.DbService;
-import com.redhat.thermostat.common.DbServiceFactory;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleCommand;
@@ -45,6 +43,8 @@
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.storage.core.ConnectionException;
+import com.redhat.thermostat.storage.core.DbService;
+import com.redhat.thermostat.storage.core.DbServiceFactory;
 import com.redhat.thermostat.storage.core.StorageException;
 import com.redhat.thermostat.utils.keyring.Keyring;
 
--- a/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/DisconnectCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/DisconnectCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,13 +38,13 @@
 
 import org.apache.commons.cli.Options;
 
-import com.redhat.thermostat.common.DbService;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleCommand;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.storage.core.ConnectionException;
+import com.redhat.thermostat.storage.core.DbService;
 
 public class DisconnectCommand extends SimpleCommand {
 
--- a/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/ListVMsCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/ListVMsCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,12 +41,12 @@
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleCommand;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 
 public class ListVMsCommand extends SimpleCommand {
--- a/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/ShellCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/ShellCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -52,6 +52,7 @@
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.ServiceReference;
 
+import com.redhat.thermostat.common.Launcher;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.Console;
@@ -59,7 +60,6 @@
 import com.redhat.thermostat.common.config.Configuration;
 import com.redhat.thermostat.common.config.InvalidConfigurationException;
 import com.redhat.thermostat.common.utils.LoggingUtils;
-import com.redhat.thermostat.launcher.Launcher;
 
 public class ShellCommand extends SimpleCommand {
 
--- a/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMInfoCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMInfoCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -40,17 +40,17 @@
 import java.util.Collection;
 import java.util.Date;
 
+import com.redhat.thermostat.client.cli.HostVMArguments;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
-import com.redhat.thermostat.common.cli.HostVMArguments;
 import com.redhat.thermostat.common.cli.SimpleCommand;
 import com.redhat.thermostat.common.cli.TableRenderer;
-import com.redhat.thermostat.common.dao.DAOException;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.DAOException;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 
 public class VMInfoCommand extends SimpleCommand {
--- a/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMListFormatter.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMListFormatter.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,8 +39,8 @@
 import java.io.PrintStream;
 
 import com.redhat.thermostat.common.cli.TableRenderer;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.VmInfo;
 
 class VMListFormatter {
--- a/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMStatCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMStatCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,7 +38,6 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.CountDownLatch;
@@ -51,16 +50,15 @@
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
 
+import com.redhat.thermostat.client.cli.HostVMArguments;
 import com.redhat.thermostat.client.cli.VMStatPrintDelegate;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.OrderedComparator;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
-import com.redhat.thermostat.common.cli.HostVMArguments;
 import com.redhat.thermostat.common.cli.SimpleCommand;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.LoggingUtils;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class VMStatCommand extends SimpleCommand {
 
--- a/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMStatPrinter.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/main/java/com/redhat/thermostat/client/cli/internal/VMStatPrinter.java	Wed Jan 16 18:58:59 2013 +0100
@@ -51,8 +51,8 @@
 import com.redhat.thermostat.client.cli.VMStatPrintDelegate;
 import com.redhat.thermostat.common.OrderedComparator;
 import com.redhat.thermostat.common.cli.TableRenderer;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.TimeStampedPojo;
 import com.redhat.thermostat.storage.model.TimeStampedPojoComparator;
 import com.redhat.thermostat.storage.model.TimeStampedPojoCorrelator;
--- a/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -51,7 +51,7 @@
 import org.powermock.modules.junit4.PowerMockRunner;
 
 import com.redhat.thermostat.common.cli.Command;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 @RunWith(PowerMockRunner.class)
 @PrepareForTest(FrameworkUtil.class)
--- a/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ConnectCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ConnectCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -55,13 +55,13 @@
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.redhat.thermostat.common.DbService;
-import com.redhat.thermostat.common.DbServiceFactory;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleArguments;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.DbService;
+import com.redhat.thermostat.storage.core.DbServiceFactory;
 import com.redhat.thermostat.test.TestCommandContextFactory;
 
 @RunWith(PowerMockRunner.class)
--- a/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/DisconnectCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/DisconnectCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -57,12 +57,12 @@
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.redhat.thermostat.common.DbService;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleArguments;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.DbService;
 import com.redhat.thermostat.test.TestCommandContextFactory;
 
 @RunWith(PowerMockRunner.class)
--- a/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ListVMsCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ListVMsCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -53,11 +53,11 @@
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleArguments;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 import com.redhat.thermostat.test.TestCommandContextFactory;
 
--- a/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.client.cli.internal;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ShellCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/ShellCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -59,11 +59,11 @@
 import org.osgi.framework.ServiceReference;
 
 import com.redhat.thermostat.client.cli.internal.ShellCommand.HistoryProvider;
+import com.redhat.thermostat.common.Launcher;
 import com.redhat.thermostat.common.cli.Arguments;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleArguments;
-import com.redhat.thermostat.launcher.Launcher;
 import com.redhat.thermostat.test.TestCommandContextFactory;
 
 public class ShellCommandTest {
--- a/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/VMInfoCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/VMInfoCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -58,11 +58,11 @@
 
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleArguments;
-import com.redhat.thermostat.common.dao.DAOException;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.DAOException;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 import com.redhat.thermostat.test.Bug;
 import com.redhat.thermostat.test.TestCommandContextFactory;
--- a/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/VmStatCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/cli/src/test/java/com/redhat/thermostat/client/cli/internal/VmStatCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -68,9 +68,15 @@
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleArguments;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.model.TimeStampedPojo;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
+import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.model.VmCpuStat;
+import com.redhat.thermostat.storage.model.VmMemoryStat;
+import com.redhat.thermostat.storage.model.VmMemoryStat.Generation;
+import com.redhat.thermostat.storage.model.VmMemoryStat.Space;
 import com.redhat.thermostat.test.TestCommandContextFactory;
 import com.redhat.thermostat.test.TestTimerFactory;
 
--- a/client/command/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/command/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -93,6 +93,11 @@
     </dependency>
     <dependency>
       <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-storage-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
       <artifactId>thermostat-common-command</artifactId>
       <version>${project.version}</version>
     </dependency>
--- a/client/command/src/main/java/com/redhat/thermostat/client/command/cli/PingCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/command/src/main/java/com/redhat/thermostat/client/command/cli/PingCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -51,11 +51,11 @@
 import com.redhat.thermostat.common.command.Request.RequestType;
 import com.redhat.thermostat.common.command.RequestResponseListener;
 import com.redhat.thermostat.common.command.Response;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
 
 public class PingCommand extends SimpleCommand {
 
--- a/client/command/src/test/java/com/redhat/thermostat/client/command/cli/PingCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/command/src/test/java/com/redhat/thermostat/client/command/cli/PingCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -47,9 +47,9 @@
 
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleArguments;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
 import com.redhat.thermostat.test.TestCommandContextFactory;
 
 public class PingCommandTest {
--- a/client/core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -85,6 +85,12 @@
     </dependency>
     
     <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-storage-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    
+    <dependency>
       <groupId>org.jfree</groupId>
       <artifactId>jfreechart</artifactId>
     </dependency>
--- a/client/core/src/main/java/com/redhat/thermostat/client/core/InformationService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/core/InformationService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,7 +39,7 @@
 import com.redhat.thermostat.annotations.ExtensionPoint;
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.common.Ordered;
-import com.redhat.thermostat.common.dao.Ref;
+import com.redhat.thermostat.storage.core.Ref;
 
 
 /**
--- a/client/core/src/main/java/com/redhat/thermostat/client/core/NameMatchingRefFilter.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/core/NameMatchingRefFilter.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,7 +38,7 @@
 
 import java.util.Objects;
 
-import com.redhat.thermostat.common.dao.Ref;
+import com.redhat.thermostat.storage.core.Ref;
 
 /**
  * A {@link Filter} that checks if the name of a {@link Ref} contains
--- a/client/core/src/main/java/com/redhat/thermostat/client/core/controllers/InformationServiceController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/core/controllers/InformationServiceController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -37,7 +37,7 @@
 package com.redhat.thermostat.client.core.controllers;
 
 import com.redhat.thermostat.client.core.views.UIComponent;
-import com.redhat.thermostat.common.dao.Ref;
+import com.redhat.thermostat.storage.core.Ref;
 
 /**
  * The UI controller for a view that provides some information about a Host or a VM.
--- a/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/DecoratorProvider.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/DecoratorProvider.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,7 +38,7 @@
 
 import com.redhat.thermostat.client.core.Filter;
 import com.redhat.thermostat.client.ui.Decorator;
-import com.redhat.thermostat.common.dao.Ref;
+import com.redhat.thermostat.storage.core.Ref;
 
 /**
  * This interface allows plugins to install a custom {@link Decorator} into
--- a/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/HostContextAction.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/HostContextAction.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,7 +38,7 @@
 
 import com.redhat.thermostat.annotations.ExtensionPoint;
 import com.redhat.thermostat.client.core.Filter;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostRef;
 
 /**
  * {@code HostContextAction}s provide actions that are associated with hosts and
--- a/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/VMContextAction.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/VMContextAction.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,7 +38,7 @@
 
 import com.redhat.thermostat.annotations.ExtensionPoint;
 import com.redhat.thermostat.client.core.Filter;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 /**
  * {@code VMContextAction}s provide actions that are associated with Java
--- a/client/core/src/main/java/com/redhat/thermostat/client/ui/AgentInformationDisplayModel.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/ui/AgentInformationDisplayModel.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,10 +42,10 @@
 import java.util.List;
 import java.util.Map;
 
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.BackendInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.BackendInfoDAO;
 import com.redhat.thermostat.storage.model.AgentInformation;
 import com.redhat.thermostat.storage.model.BackendInformation;
 
--- a/client/core/src/main/java/com/redhat/thermostat/client/ui/HostInformationController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/ui/HostInformationController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,7 +45,7 @@
 import com.redhat.thermostat.client.core.views.HostInformationView;
 import com.redhat.thermostat.client.core.views.HostInformationViewProvider;
 import com.redhat.thermostat.common.OrderedComparator;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class HostInformationController {
 
--- a/client/core/src/main/java/com/redhat/thermostat/client/ui/SummaryController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/ui/SummaryController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -47,8 +47,8 @@
 import com.redhat.thermostat.common.ApplicationService;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 
 public class SummaryController {
 
--- a/client/core/src/main/java/com/redhat/thermostat/client/ui/UiFacadeFactory.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/ui/UiFacadeFactory.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,10 +42,10 @@
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.client.osgi.service.HostContextAction;
 import com.redhat.thermostat.client.osgi.service.VMContextAction;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 
 public interface UiFacadeFactory {
 
--- a/client/core/src/main/java/com/redhat/thermostat/client/ui/VmInformationController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/ui/VmInformationController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,8 +45,8 @@
 import com.redhat.thermostat.client.core.views.VmInformationView;
 import com.redhat.thermostat.client.core.views.VmInformationViewProvider;
 import com.redhat.thermostat.common.OrderedComparator;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class VmInformationController {
 
--- a/client/core/src/test/java/com/redhat/thermostat/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/test/java/com/redhat/thermostat/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.client.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/client/core/src/test/java/com/redhat/thermostat/client/ui/AgentInformationDisplayModelTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/test/java/com/redhat/thermostat/client/ui/AgentInformationDisplayModelTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,8 +45,8 @@
 import org.junit.Before;
 import org.junit.Test;
 
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.BackendInfoDAO;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.BackendInfoDAO;
 import com.redhat.thermostat.storage.model.AgentInformation;
 
 public class AgentInformationDisplayModelTest {
--- a/client/core/src/test/java/com/redhat/thermostat/client/ui/HostInformationControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/test/java/com/redhat/thermostat/client/ui/HostInformationControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -53,7 +53,7 @@
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.client.core.views.HostInformationView;
 import com.redhat.thermostat.client.core.views.HostInformationViewProvider;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class HostInformationControllerTest {
 
--- a/client/core/src/test/java/com/redhat/thermostat/client/ui/SummaryControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/test/java/com/redhat/thermostat/client/ui/SummaryControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -58,8 +58,8 @@
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 
 public class SummaryControllerTest {
 
--- a/client/core/src/test/java/com/redhat/thermostat/client/ui/VmInformationControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/core/src/test/java/com/redhat/thermostat/client/ui/VmInformationControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -53,7 +53,7 @@
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.client.core.views.VmInformationView;
 import com.redhat.thermostat.client.core.views.VmInformationViewProvider;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class VmInformationControllerTest {
 
--- a/client/living-vm-filter/core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/living-vm-filter/core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -72,6 +72,13 @@
       <artifactId>thermostat-client-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
 
   </dependencies>
 </project>
--- a/client/living-vm-filter/core/src/main/java/com/redhat/thermostat/client/filter/vm/core/LivingVMFilter.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/living-vm-filter/core/src/main/java/com/redhat/thermostat/client/filter/vm/core/LivingVMFilter.java	Wed Jan 16 18:58:59 2013 +0100
@@ -37,8 +37,8 @@
 package com.redhat.thermostat.client.filter.vm.core;
 
 import com.redhat.thermostat.client.core.Filter;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 
 public class LivingVMFilter implements Filter<VmRef> {
--- a/client/living-vm-filter/core/src/main/java/com/redhat/thermostat/client/filter/vm/core/VMFilterActivator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/living-vm-filter/core/src/main/java/com/redhat/thermostat/client/filter/vm/core/VMFilterActivator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -52,8 +52,8 @@
 import com.redhat.thermostat.client.core.Filter;
 import com.redhat.thermostat.client.osgi.service.MenuAction;
 import com.redhat.thermostat.common.Constants;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 
 public class VMFilterActivator implements BundleActivator {
 
--- a/client/living-vm-filter/core/src/test/java/com/redhat/thermostat/client/filter/vm/core/LivingVMFilterTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/living-vm-filter/core/src/test/java/com/redhat/thermostat/client/filter/vm/core/LivingVMFilterTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -46,8 +46,8 @@
 
 import com.redhat.thermostat.client.filter.vm.core.LivingVMFilter;
 import com.redhat.thermostat.client.filter.vm.core.LivingVMFilterMenuAction;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 
 public class LivingVMFilterTest {
--- a/client/living-vm-filter/core/src/test/java/com/redhat/thermostat/client/filter/vm/core/VMFilterActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/living-vm-filter/core/src/test/java/com/redhat/thermostat/client/filter/vm/core/VMFilterActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,8 +45,10 @@
 
 import com.redhat.thermostat.client.core.Filter;
 import com.redhat.thermostat.client.osgi.service.MenuAction;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
+import com.redhat.thermostat.testutils.StubBundleContext;
+import com.redhat.thermostat.testutils.StubServiceReference;
+import com.redhat.thermostat.testutils.StubServiceRegistration;
 
 public class VMFilterActivatorTest {
     
--- a/client/living-vm-filter/swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/living-vm-filter/swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -80,6 +80,13 @@
       <artifactId>thermostat-client-swing</artifactId>
       <version>${project.version}</version>
     </dependency>
+    
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
 
   </dependencies>
 </project>
--- a/client/living-vm-filter/swing/src/main/java/com/redhat/thermostat/client/filter/vm/swing/DeadVMDecoratorProvider.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/living-vm-filter/swing/src/main/java/com/redhat/thermostat/client/filter/vm/swing/DeadVMDecoratorProvider.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,8 +42,8 @@
 import com.redhat.thermostat.client.osgi.service.DecoratorProvider;
 import com.redhat.thermostat.client.ui.Decorator;
 import com.redhat.thermostat.client.ui.IconDescriptor;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 
 public class DeadVMDecoratorProvider implements DecoratorProvider<VmRef> {
--- a/client/living-vm-filter/swing/src/main/java/com/redhat/thermostat/client/filter/vm/swing/LivingVMDecoratorProvider.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/living-vm-filter/swing/src/main/java/com/redhat/thermostat/client/filter/vm/swing/LivingVMDecoratorProvider.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,8 +44,8 @@
 import com.redhat.thermostat.client.swing.IconResource;
 import com.redhat.thermostat.client.ui.Decorator;
 import com.redhat.thermostat.client.ui.IconDescriptor;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 
 public class LivingVMDecoratorProvider implements DecoratorProvider<VmRef> {
     
--- a/client/living-vm-filter/swing/src/main/java/com/redhat/thermostat/client/filter/vm/swing/VMFilterActivator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/living-vm-filter/swing/src/main/java/com/redhat/thermostat/client/filter/vm/swing/VMFilterActivator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -51,8 +51,8 @@
 
 import com.redhat.thermostat.client.osgi.service.DecoratorProvider;
 import com.redhat.thermostat.common.Constants;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 
 public class VMFilterActivator implements BundleActivator {
 
--- a/client/living-vm-filter/swing/src/test/java/com/redhat/thermostat/client/filter/vm/swing/VMFilterActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/living-vm-filter/swing/src/test/java/com/redhat/thermostat/client/filter/vm/swing/VMFilterActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,8 +44,10 @@
 import org.osgi.framework.ServiceRegistration;
 
 import com.redhat.thermostat.client.osgi.service.DecoratorProvider;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
+import com.redhat.thermostat.testutils.StubBundleContext;
+import com.redhat.thermostat.testutils.StubServiceReference;
+import com.redhat.thermostat.testutils.StubServiceRegistration;
 
 public class VMFilterActivatorTest {
     
--- a/client/swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -99,6 +99,12 @@
     </dependency>
     
     <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-storage-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    
+    <dependency>
       <groupId>org.jfree</groupId>
       <artifactId>jfreechart</artifactId>
     </dependency>
@@ -113,6 +119,12 @@
       <artifactId>org.osgi.compendium</artifactId>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/HostFilterRegistry.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/HostFilterRegistry.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,7 +42,7 @@
 
 import com.redhat.thermostat.client.core.Filter;
 import com.redhat.thermostat.common.ThermostatExtensionRegistry;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostRef;
 
 class HostFilterRegistry extends ThermostatExtensionRegistry<Filter> {
 
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/HostIconDecoratorProvider.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/HostIconDecoratorProvider.java	Wed Jan 16 18:58:59 2013 +0100
@@ -47,8 +47,8 @@
 import com.redhat.thermostat.client.swing.IconResource;
 import com.redhat.thermostat.client.ui.Decorator;
 import com.redhat.thermostat.client.ui.IconDescriptor;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.utils.StreamUtils;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class HostIconDecoratorProvider implements DecoratorProvider<HostRef> {
 
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/HostTreeDecoratorRegistry.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/HostTreeDecoratorRegistry.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,7 +42,7 @@
 
 import com.redhat.thermostat.client.osgi.service.DecoratorProvider;
 import com.redhat.thermostat.common.ThermostatExtensionRegistry;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostRef;
 
 @SuppressWarnings("rawtypes")
 class HostTreeDecoratorRegistry extends ThermostatExtensionRegistry<DecoratorProvider> {
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/Main.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/Main.java	Wed Jan 16 18:58:59 2013 +0100
@@ -60,8 +60,6 @@
 import com.redhat.thermostat.common.ApplicationService;
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.config.ClientPreferences;
-import com.redhat.thermostat.common.dao.DAOFactory;
-import com.redhat.thermostat.common.dao.DAOFactoryImpl;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.common.utils.OSGIUtils;
@@ -72,6 +70,8 @@
 import com.redhat.thermostat.storage.core.Connection.ConnectionType;
 import com.redhat.thermostat.storage.core.StorageProvider;
 import com.redhat.thermostat.storage.core.StorageProviderUtil;
+import com.redhat.thermostat.storage.dao.DAOFactory;
+import com.redhat.thermostat.storage.dao.DAOFactoryImpl;
 import com.redhat.thermostat.utils.keyring.Keyring;
 
 public class Main {
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/MainView.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/MainView.java	Wed Jan 16 18:58:59 2013 +0100
@@ -48,10 +48,10 @@
 import com.redhat.thermostat.client.osgi.service.MenuAction;
 import com.redhat.thermostat.common.ActionEvent;
 import com.redhat.thermostat.common.ActionListener;
-import com.redhat.thermostat.common.HostsVMsLoader;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.Ref;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.HostsVMsLoader;
+import com.redhat.thermostat.storage.core.Ref;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public interface MainView {
 
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/MainWindow.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/MainWindow.java	Wed Jan 16 18:58:59 2013 +0100
@@ -112,12 +112,12 @@
 import com.redhat.thermostat.common.ActionEvent;
 import com.redhat.thermostat.common.ActionListener;
 import com.redhat.thermostat.common.ActionNotifier;
-import com.redhat.thermostat.common.HostsVMsLoader;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.Ref;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.StringUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.HostsVMsLoader;
+import com.redhat.thermostat.storage.core.Ref;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class MainWindow extends JFrame implements MainView {
     
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/MainWindowControllerImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/MainWindowControllerImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -72,19 +72,19 @@
 import com.redhat.thermostat.common.ActionListener;
 import com.redhat.thermostat.common.ApplicationInfo;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.DefaultHostsVMsLoader;
-import com.redhat.thermostat.common.HostsVMsLoader;
 import com.redhat.thermostat.common.ThermostatExtensionRegistry;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.config.ClientPreferences;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.Ref;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.DefaultHostsVMsLoader;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.HostsVMsLoader;
+import com.redhat.thermostat.storage.core.Ref;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.utils.keyring.Keyring;
 
 public class MainWindowControllerImpl implements MainWindowController {
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/UiFacadeFactoryImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/UiFacadeFactoryImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -55,11 +55,11 @@
 import com.redhat.thermostat.client.ui.UiFacadeFactory;
 import com.redhat.thermostat.client.ui.VmInformationController;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 
 public class UiFacadeFactoryImpl implements UiFacadeFactory {
 
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/VMInformationRegistry.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/VMInformationRegistry.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,7 +42,7 @@
 
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.common.ThermostatExtensionRegistry;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 @SuppressWarnings("rawtypes")
 class VMInformationRegistry extends ThermostatExtensionRegistry<InformationService> {
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/VMTreeDecoratorRegistry.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/VMTreeDecoratorRegistry.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,7 +42,7 @@
 
 import com.redhat.thermostat.client.osgi.service.DecoratorProvider;
 import com.redhat.thermostat.common.ThermostatExtensionRegistry;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 @SuppressWarnings("rawtypes")
 class VMTreeDecoratorRegistry extends ThermostatExtensionRegistry<DecoratorProvider> {
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/VmFilterRegistry.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/VmFilterRegistry.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,7 +42,7 @@
 
 import com.redhat.thermostat.client.core.Filter;
 import com.redhat.thermostat.common.ThermostatExtensionRegistry;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 class VmFilterRegistry extends ThermostatExtensionRegistry<Filter> {
 
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/components/DecoratedDefaultMutableTreeNode.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/components/DecoratedDefaultMutableTreeNode.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,7 +42,7 @@
 import javax.swing.tree.DefaultMutableTreeNode;
 
 import com.redhat.thermostat.client.ui.Decorator;
-import com.redhat.thermostat.common.dao.Ref;
+import com.redhat.thermostat.storage.core.Ref;
 
 public class DecoratedDefaultMutableTreeNode  extends DefaultMutableTreeNode {
     
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/osgi/InformationServiceTracker.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/osgi/InformationServiceTracker.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,9 +45,9 @@
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.client.ui.UiFacadeFactory;
 import com.redhat.thermostat.common.Constants;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.LoggingUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 @SuppressWarnings("rawtypes")
 public class InformationServiceTracker extends ServiceTracker {
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/osgi/ThermostatActivator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/osgi/ThermostatActivator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -64,7 +64,7 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.cli.CommandRegistry;
 import com.redhat.thermostat.common.cli.CommandRegistryImpl;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.utils.keyring.Keyring;
 
 public class ThermostatActivator implements BundleActivator {
--- a/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/HostIconDecoratorProviderTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/HostIconDecoratorProviderTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -51,7 +51,7 @@
 
 import com.redhat.thermostat.client.core.Filter;
 import com.redhat.thermostat.client.ui.Decorator;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class HostIconDecoratorProviderTest {
 
--- a/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/MainTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/MainTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -58,11 +58,11 @@
 import com.redhat.thermostat.client.ui.UiFacadeFactory;
 import com.redhat.thermostat.common.ApplicationService;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.DAOFactory;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.storage.core.Connection;
 import com.redhat.thermostat.storage.core.Connection.ConnectionListener;
 import com.redhat.thermostat.storage.core.Connection.ConnectionStatus;
+import com.redhat.thermostat.storage.dao.DAOFactory;
 
 public class MainTest {
 
--- a/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/MainWindowControllerImplTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/MainWindowControllerImplTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -77,16 +77,16 @@
 import com.redhat.thermostat.common.ActionEvent;
 import com.redhat.thermostat.common.ActionListener;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.HostsVMsLoader;
 import com.redhat.thermostat.common.ThermostatExtensionRegistry;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.ThermostatExtensionRegistry.Action;
 import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.HostsVMsLoader;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 import com.redhat.thermostat.test.Bug;
 
--- a/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/MainWindowTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/MainWindowTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -84,8 +84,8 @@
 import com.redhat.thermostat.client.ui.Decorator;
 import com.redhat.thermostat.common.ActionEvent;
 import com.redhat.thermostat.common.ActionListener;
-import com.redhat.thermostat.common.HostsVMsLoader;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.HostsVMsLoader;
 
 @RunWith(CacioFESTRunner.class)
 public class MainWindowTest {
--- a/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/osgi/HostContextActionServiceTrackerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/osgi/HostContextActionServiceTrackerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,7 +44,7 @@
 
 import com.redhat.thermostat.client.osgi.service.HostContextAction;
 import com.redhat.thermostat.client.ui.UiFacadeFactory;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class HostContextActionServiceTrackerTest {
 
--- a/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/osgi/ThermostatActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/client/swing/src/test/java/com/redhat/thermostat/client/swing/internal/osgi/ThermostatActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -53,7 +53,7 @@
 import com.redhat.thermostat.client.swing.internal.views.SwingHostInformationViewProvider;
 import com.redhat.thermostat.client.swing.internal.views.SwingSummaryViewProvider;
 import com.redhat.thermostat.client.swing.internal.views.SwingVmInformationViewProvider;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ThermostatActivatorTest {
 
--- a/common/core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/common/core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -84,7 +84,6 @@
               com.redhat.thermostat.common,
               com.redhat.thermostat.common.appctx,
               com.redhat.thermostat.common.config,
-              com.redhat.thermostat.common.dao,
               com.redhat.thermostat.common.utils,
               com.redhat.thermostat.common.heap,
               com.redhat.thermostat.common.locale,
@@ -170,12 +169,6 @@
     	<artifactId>thermostat-keyring</artifactId>
     	<version>${project.version}</version>
     </dependency>
-    <dependency>
-        <groupId>com.redhat.thermostat</groupId>
-        <artifactId>thermostat-storage-core</artifactId>
-        <version>${project.version}</version>
-    </dependency>
-
   </dependencies>
 
 </project>
--- a/common/core/src/main/java/com/redhat/thermostat/common/DbService.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common;
-
-import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.storage.core.ConnectionException;
-
-@Service
-public interface DbService {
-
-    /**
-     * Connects to the given database.
-     * 
-     * @throws ConnectionException
-     *             If DB connection cannot be established.
-     */
-    void connect() throws ConnectionException;
-
-    /**
-     * Disconnects from the database.
-     * 
-     * @throws ConnectionException
-     */
-    void disconnect() throws ConnectionException;
-
-    /**
-     * @returns the storage URL which was used for connection.
-     * 
-     * @throws IllegalStateException
-     *             if not connected to storage.
-     */
-    String getConnectionUrl();
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/DbServiceFactory.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common;
-
-import org.osgi.framework.BundleContext;
-
-import com.redhat.thermostat.common.internal.DbServiceImpl;
-
-/*
- * Factory in order to be able to hide the DbService implementation. Note that
- * this package will be part of Export-Package whereas the package where *Impl
- * classes are won't be.
- *
- */
-public class DbServiceFactory {
-
-    public DbService createDbService(String username, String password, String dbUrl) {
-        return DbServiceImpl.create(username, password, dbUrl);
-    }
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/DefaultHostsVMsLoader.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common;
-
-import java.util.Collection;
-
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
-
-public class DefaultHostsVMsLoader implements HostsVMsLoader {
-
-    private HostInfoDAO hostsDAO;
-    private VmInfoDAO vmsDAO;
-    private boolean liveHosts;
-    
-    /**
-     * 
-     * @param hostDAO
-     * @param vmsDAO
-     * @param liveHosts {@code true} if only alive agent documents should get retrieved.
-     */
-    public DefaultHostsVMsLoader(HostInfoDAO hostDAO, VmInfoDAO vmsDAO, boolean liveHosts) {
-        this.hostsDAO = hostDAO;
-        this.vmsDAO = vmsDAO;
-        this.liveHosts = liveHosts;
-    }
-    
-    @Override
-    public Collection<HostRef> getHosts() {
-        if (liveHosts) {
-            return hostsDAO.getAliveHosts();
-        } else {
-            return hostsDAO.getHosts();
-        }
-    }
-
-    @Override
-    public Collection<VmRef> getVMs(HostRef host) {
-        return vmsDAO.getVMs(host);
-    }
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/HostsVMsLoader.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common;
-
-import java.util.Collection;
-
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
-
-/**
- * Provides a way to load the current hosts and VMs.
- */
-public interface HostsVMsLoader {
-
-    Collection<HostRef> getHosts();
-    Collection<VmRef> getVMs(HostRef host);
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/core/src/main/java/com/redhat/thermostat/common/Launcher.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.common;
+
+import java.util.Collection;
+
+import com.redhat.thermostat.annotations.Service;
+import com.redhat.thermostat.common.ActionListener;
+import com.redhat.thermostat.common.tools.ApplicationState;
+
+/**
+ * Launcher is the main entry point for all Thermostat commands.
+ */
+@Service
+public interface Launcher {
+
+    /**
+     * Invoked in order to start a command, either when Thermostat starts, or within
+     * the thermostat shell.  Equivalent to calling run(null).
+     */
+    void run();
+
+    /**
+     * Invoked in order to start a command, either when Thermostat starts, or within
+     * the thermostat shell.  If the command being run happens to be a BasicCommand,
+     * and the argument is non-null, the listeners will be added to the command for
+     * life cycle notifications.  Otherwise, the argument is ignored.
+     */
+    void run(Collection<ActionListener<ApplicationState>> listeners);
+
+    /**
+     * Should be set before calling run()
+     * @param command line arguments to the program
+     */
+    void setArgs(String[] args);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/core/src/main/java/com/redhat/thermostat/common/cli/BasicCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.common.cli;
+
+import com.redhat.thermostat.common.ActionNotifier;
+import com.redhat.thermostat.common.tools.ApplicationState;
+
+/**
+ * Common base class for all daemon and application
+ */
+public abstract class BasicCommand extends CommandWithInfo {
+
+    private ActionNotifier<ApplicationState> notifier;
+    private boolean storageRequired;
+    
+    public BasicCommand() {
+        this.notifier = new ActionNotifier<>(this);
+    }
+
+    public ActionNotifier<ApplicationState> getNotifier() {
+        return notifier;
+    }
+
+    @Override
+    public boolean isStorageRequired() {
+        return storageRequired;
+    }
+
+    protected void setStorageRequired(boolean storageRequired) {
+        this.storageRequired = storageRequired;
+    }
+
+    @Override
+    public boolean isAvailableInShell() {
+        return true;
+    }
+
+    @Override
+    public boolean isAvailableOutsideShell() {
+        return true;
+    }
+}
+
--- a/common/core/src/main/java/com/redhat/thermostat/common/cli/HostVMArguments.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.cli;
-
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
-
-public class HostVMArguments {
-
-    static final String HOST_ID_ARGUMENT = "hostId";
-    static final String VM_ID_ARGUMENT = "vmId";
-
-    private HostRef host;
-    private VmRef vm;
-
-    public HostVMArguments(Arguments args) throws CommandException {
-        this(args, true, true);
-    }
-
-    public HostVMArguments(Arguments args, boolean hostRequired, boolean vmRequired) throws CommandException {
-        String hostId = args.getArgument(HOST_ID_ARGUMENT);
-        String vmId = args.getArgument(VM_ID_ARGUMENT);
-        if (hostRequired && hostId == null) {
-            throw new CommandException("a " + HOST_ID_ARGUMENT + " is required");
-        } else if (hostId == null) {
-            host = null;
-        } else {
-            host = new HostRef(hostId, "dummy");
-        }
-        try {
-            int parsedVmId = parseVmId(vmId);
-            vm = new VmRef(host, parsedVmId, "dummy");
-        } catch (CommandException ce) {
-            if (vmRequired) {
-                throw ce;
-            }
-            vm = null;
-        }
-    }
-
-    private int parseVmId(String vmId) throws CommandException {
-        try {
-            return Integer.parseInt(vmId);
-        } catch (NumberFormatException ex) {
-            throw new CommandException("Invalid VM ID: " + vmId, ex);
-        }
-    }
-
-    public HostRef getHost() {
-        return host;
-    }
-
-    public VmRef getVM() {
-        return vm;
-    }
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/AgentInfoDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.List;
-
-import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.model.AgentInformation;
-
-@Service
-public interface AgentInfoDAO extends Countable {
-
-    static final Key<Long> START_TIME_KEY = new Key<>("startTime", false);
-    static final Key<Long> STOP_TIME_KEY = new Key<>("stopTime", false);
-    static final Key<Boolean> ALIVE_KEY = new Key<>("alive", false);
-    static final Key<String> CONFIG_LISTEN_ADDRESS = new Key<>("configListenAddress", false);
-
-    static final Category<AgentInformation> CATEGORY = new Category<>("agent-config", AgentInformation.class,
-            Key.AGENT_ID,
-            START_TIME_KEY,
-            STOP_TIME_KEY,
-            ALIVE_KEY,
-            CONFIG_LISTEN_ADDRESS);
-
-    List<AgentInformation> getAllAgentInformation();
-
-    List<AgentInformation> getAliveAgents();
-
-    AgentInformation getAgentInformation(HostRef agentRef);
-
-    void addAgentInformation(AgentInformation agentInfo);
-
-    void updateAgentInformation(AgentInformation agentInfo);
-
-    void removeAgentInformation(AgentInformation agentInfo);
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/AgentInfoDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Put;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Remove;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.core.Update;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.model.AgentInformation;
-
-public class AgentInfoDAOImpl implements AgentInfoDAO {
-
-    private final Storage storage;
-
-    public AgentInfoDAOImpl(Storage storage) {
-        this.storage = storage;
-        storage.registerCategory(CATEGORY);
-    }
-
-    @Override
-    public long getCount() {
-        return storage.getCount(CATEGORY);
-    }
-
-    @Override
-    public List<AgentInformation> getAllAgentInformation() {
-        Query<AgentInformation> query = storage.createQuery(CATEGORY);
-        Cursor<AgentInformation> agentCursor = query.execute();
-
-        List<AgentInformation> results = new ArrayList<>();
-
-        while (agentCursor.hasNext()) {
-            AgentInformation agentInfo = agentCursor.next();
-            results.add(agentInfo);
-        }
-        return results;
-    }
-
-    @Override
-    public List<AgentInformation> getAliveAgents() {
-        Query<AgentInformation> query = storage.createQuery(CATEGORY);
-        query.where(AgentInfoDAO.ALIVE_KEY, Criteria.EQUALS, true);
-
-        Cursor<AgentInformation> agentCursor = query.execute();
-
-        List<AgentInformation> results = new ArrayList<>();
-
-        while (agentCursor.hasNext()) {
-            AgentInformation agentInfo = agentCursor.next();
-            results.add(agentInfo);
-        }
-        return results;
-    }
-
-    @Override
-    public AgentInformation getAgentInformation(HostRef agentRef) {
-        Query<AgentInformation> query = storage.createQuery(CATEGORY);
-        query.where(Key.AGENT_ID, Criteria.EQUALS, agentRef.getAgentId());
-        query.limit(1);
-        return query.execute().next();
-    }
-
-    @Override
-    public void addAgentInformation(AgentInformation agentInfo) {
-        Put replace = storage.createReplace(CATEGORY);
-        replace.setPojo(agentInfo);
-        replace.apply();
-    }
-
-    @Override
-    public void removeAgentInformation(AgentInformation agentInfo) {
-        Remove remove = storage.createRemove().from(CATEGORY).where(Key.AGENT_ID, agentInfo.getAgentId());
-        storage.removePojo(remove);
-    }
-
-    @Override
-    public void updateAgentInformation(AgentInformation agentInfo) {
-        Update update = storage.createUpdate(CATEGORY);
-        update.where(Key.AGENT_ID, agentInfo.getAgentId());
-        update.set(START_TIME_KEY, agentInfo.getStartTime());
-        update.set(STOP_TIME_KEY, agentInfo.getStopTime());
-        update.set(ALIVE_KEY, agentInfo.isAlive());
-        update.set(CONFIG_LISTEN_ADDRESS, agentInfo.getConfigListenAddress());
-        update.apply();
-    }
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/BackendInfoDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.List;
-
-import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.model.BackendInformation;
-
-@Service
-public interface BackendInfoDAO {
-
-    static final Key<String> BACKEND_NAME = new Key<>("name", true);
-    static final Key<String> BACKEND_DESCRIPTION = new Key<>("description", false);
-    static final Key<Boolean> IS_ACTIVE = new Key<>("active", false);
-    static final Key<Boolean> SHOULD_MONITOR_NEW_PROCESSES = new Key<>("observeNewJvm", false);
-    static final Key<List<Integer>> PIDS_TO_MONITOR = new Key<>("pids", false);
-    static final Key<Integer> ORDER_VALUE = new Key<>("orderValue", false);
-
-    static final Category<BackendInformation> CATEGORY = new Category<>("backend-info", BackendInformation.class,
-            Key.AGENT_ID,
-            BACKEND_NAME,
-            BACKEND_DESCRIPTION,
-            IS_ACTIVE,
-            SHOULD_MONITOR_NEW_PROCESSES,
-            PIDS_TO_MONITOR,
-            ORDER_VALUE);
-
-    List<BackendInformation> getBackendInformation(HostRef host);
-
-    void addBackendInformation(BackendInformation info);
-
-    void removeBackendInformation(BackendInformation info);
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/BackendInfoDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Put;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.core.Remove;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.model.BackendInformation;
-
-public class BackendInfoDAOImpl implements BackendInfoDAO {
-
-    private final Storage storage;
-
-    public BackendInfoDAOImpl(Storage storage) {
-        this.storage = storage;
-        storage.registerCategory(CATEGORY);
-    }
-
-    @Override
-    public List<BackendInformation> getBackendInformation(HostRef host) {
-        // Sort by order value
-        Query<BackendInformation> query = storage.createQuery(CATEGORY);
-        query.where(Key.AGENT_ID, Criteria.EQUALS, host.getAgentId());
-
-        List<BackendInformation> results = new ArrayList<>();
-        Cursor<BackendInformation> cursor = query.execute();
-        while (cursor.hasNext()) {
-            BackendInformation backendInfo = cursor.next();
-            results.add(backendInfo);
-        }
-        
-        // Sort before returning
-        Collections.sort(results, new Comparator<BackendInformation>() {
-
-            // TODO Use OrderedComparator when common-core
-            // doesn't depend on storage-core
-            @Override
-            public int compare(BackendInformation o1, BackendInformation o2) {
-                int result = o1.getOrderValue() - o2.getOrderValue();
-                // Break ties using class name
-                if (result == 0) {
-                    result = o1.getClass().getName().compareTo(o2.getClass().getName());
-                }
-                return result;
-            }
-        });
-        
-        return results;
-    }
-
-    @Override
-    public void addBackendInformation(BackendInformation info) {
-        Put add = storage.createAdd(BackendInfoDAO.CATEGORY);
-        add.setPojo(info);
-        add.apply();
-    }
-
-    @Override
-    public void removeBackendInformation(BackendInformation info) {
-        Remove remove = storage.createRemove().from(CATEGORY).where(BACKEND_NAME, info.getName());
-        storage.removePojo(remove);
-    }
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/Countable.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-public interface Countable {
-
-    public long getCount();
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/DAOException.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-public class DAOException extends RuntimeException {
-
-    public DAOException() {
-        super();
-    }
-
-    public DAOException(String message) {
-        super(message);
-    }
-
-    public DAOException(Throwable cause) {
-        super(cause);
-    }
-
-    public DAOException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/DAOFactory.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import com.redhat.thermostat.storage.core.Connection;
-import com.redhat.thermostat.storage.core.Storage;
-
-public interface DAOFactory {
-
-    // TODO this is temporary until DAO is made for those that are still using Storage directly.
-    public Storage getStorage();
-
-    public Connection getConnection();
-
-    public AgentInfoDAO getAgentInfoDAO();
-
-    public BackendInfoDAO getBackendInfoDAO();
-
-    public HostInfoDAO getHostInfoDAO();
-
-    public NetworkInterfaceInfoDAO getNetworkInterfaceInfoDAO();
-
-    public VmInfoDAO getVmInfoDAO();
-
-    public void registerDAOsAndStorageAsOSGiServices();
-    public void unregisterDAOsAndStorageAsOSGiServices();
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/DAOFactoryImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceRegistration;
-
-import com.redhat.thermostat.storage.core.Connection;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.core.StorageProvider;
-
-public class DAOFactoryImpl implements DAOFactory {
-
-    private final Storage storage;
-    private final BundleContext bundleContext;
-    @SuppressWarnings("rawtypes")
-    private final List<ServiceRegistration> registeredServices = new ArrayList<>();
-    private AgentInfoDAO agentDAO;
-    private BackendInfoDAO backendInfoDAO;
-    private HostInfoDAO hostInfoDAO;
-    private NetworkInterfaceInfoDAO networkInfoDAO;
-    private VmInfoDAO vmInfoDAO;
-
-    public DAOFactoryImpl(StorageProvider prov) {
-        this(FrameworkUtil.getBundle(DAOFactoryImpl.class).getBundleContext(), prov);
-    }
-
-    public DAOFactoryImpl(BundleContext bundleContext, StorageProvider prov) {
-        this.bundleContext = bundleContext;
-        storage = prov.createStorage();
-    }
-
-    @Override
-    public Connection getConnection() {
-        return storage.getConnection();
-    }
-
-    @Override
-    public AgentInfoDAO getAgentInfoDAO() {
-        ensureStorageConnected();
-        return agentDAO;
-    }
-
-    @Override
-    public BackendInfoDAO getBackendInfoDAO() {
-        ensureStorageConnected();
-        return backendInfoDAO;
-    }
-
-    @Override
-    public HostInfoDAO getHostInfoDAO() {
-        ensureStorageConnected();
-        return hostInfoDAO;
-    }
-
-    @Override
-    public NetworkInterfaceInfoDAO getNetworkInterfaceInfoDAO() {
-        ensureStorageConnected();
-        return networkInfoDAO;
-    }
-
-    @Override
-    public VmInfoDAO getVmInfoDAO() {
-        ensureStorageConnected();
-        return vmInfoDAO;
-    }
-
-    @Override
-    public Storage getStorage() {
-        return storage;
-    }
-
-    private void ensureStorageConnected() {
-        if (!storage.getConnection().isConnected()) {
-            throw new IllegalStateException("Set up connection before accessing DAO");
-        }
-    }
-
-    @Override
-    public void registerDAOsAndStorageAsOSGiServices() {
-        ensureStorageConnected();
-        createDAOs();
-        registerAndRecordService(Storage.class, getStorage());
-
-        registerAndRecordService(AgentInfoDAO.class, getAgentInfoDAO());
-        registerAndRecordService(BackendInfoDAO.class, getBackendInfoDAO());
-
-        registerAndRecordService(HostInfoDAO.class, getHostInfoDAO());
-        registerAndRecordService(NetworkInterfaceInfoDAO.class, getNetworkInterfaceInfoDAO());
-
-        registerAndRecordService(VmInfoDAO.class, getVmInfoDAO());
-    }
-
-    /*
-     * Pre: Db connected
-     */
-    void createDAOs() {
-        agentDAO = new AgentInfoDAOImpl(storage);
-        backendInfoDAO = new BackendInfoDAOImpl(storage);
-        hostInfoDAO = new HostInfoDAOImpl(storage, agentDAO);
-        networkInfoDAO = new NetworkInterfaceInfoDAOImpl(storage);
-        vmInfoDAO = new VmInfoDAOImpl(storage);
-    }
-
-    private <K> void registerAndRecordService(Class<K> serviceType, K serviceImplementation) {
-        registeredServices.add(bundleContext.registerService(serviceType, serviceImplementation, null));
-    }
-
-    public void unregisterDAOsAndStorageAsOSGiServices() {
-        Iterator<ServiceRegistration> iter = registeredServices.iterator();
-        while (iter.hasNext()) {
-            ServiceRegistration registration = iter.next();
-            registration.unregister();
-            iter.remove();
-        }
-    }
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/HostInfoDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.Collection;
-
-import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.model.HostInfo;
-
-@Service
-public interface HostInfoDAO extends Countable {
-
-    static Key<String> hostNameKey = new Key<>("hostname", true);
-    static Key<String> osNameKey = new Key<>("osName", false);
-    static Key<String> osKernelKey = new Key<>("osKernel", false);
-    static Key<Integer> cpuCountKey = new Key<>("cpuCount", false);
-    static Key<String> cpuModelKey = new Key<>("cpuModel", false);
-    static Key<Long> hostMemoryTotalKey = new Key<>("totalMemory", false);
-
-    static final Category<HostInfo> hostInfoCategory = new Category<>("host-info", HostInfo.class,
-            Key.AGENT_ID, hostNameKey, osNameKey, osKernelKey,
-            cpuCountKey, cpuModelKey, hostMemoryTotalKey);
-
-    HostInfo getHostInfo(HostRef ref);
-
-    void putHostInfo(HostInfo info);
-
-    Collection<HostRef> getHosts();
-    Collection<HostRef> getAliveHosts();
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/HostInfoDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Put;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.model.AgentInformation;
-import com.redhat.thermostat.storage.model.HostInfo;
-
-class HostInfoDAOImpl implements HostInfoDAO {
-
-    private final Storage storage;
-    private final AgentInfoDAO agentInfoDao;
-
-
-    public HostInfoDAOImpl(Storage storage, AgentInfoDAO agentInfo) {
-        this.storage = storage;
-        this.agentInfoDao = agentInfo;
-        storage.registerCategory(hostInfoCategory);
-    }
-
-    @Override
-    public HostInfo getHostInfo(HostRef ref) {
-        Query<HostInfo> query = storage.createQuery(hostInfoCategory);
-        query.where(Key.AGENT_ID, Criteria.EQUALS, ref.getAgentId());
-        query.limit(1);
-        HostInfo result = query.execute().next();
-        return result;
-    }
-
-    @Override
-    public void putHostInfo(HostInfo info) {
-        Put add = storage.createAdd(hostInfoCategory);
-        add.setPojo(info);
-        add.apply();
-    }
-
-    @Override
-    public Collection<HostRef> getHosts() {
-        Query<HostInfo> allHosts = storage.createQuery(hostInfoCategory);
-        return getHosts(allHosts);
-    }
-
-    @Override
-    public Collection<HostRef> getAliveHosts() {
-        List<HostRef> hosts = new ArrayList<>();
-        List<AgentInformation> agentInfos = agentInfoDao.getAliveAgents();
-        for (AgentInformation agentInfo : agentInfos) {
-            Query<HostInfo> filter = storage.createQuery(hostInfoCategory);
-            filter.where(Key.AGENT_ID, Criteria.EQUALS, agentInfo.getAgentId());
-            hosts.addAll(getHosts(filter));
-        }
-
-        return hosts;
-    }
-
-
-    private Collection<HostRef> getHosts(Query<HostInfo> filter) {
-        Collection<HostRef> hosts = new ArrayList<HostRef>();
-        
-        Cursor<HostInfo> hostsCursor = filter.execute();
-        while(hostsCursor.hasNext()) {
-            HostInfo host = hostsCursor.next();
-            String agentId = host.getAgentId();
-            String hostName = host.getHostname();
-            hosts.add(new HostRef(agentId, hostName));
-        }
-        return hosts;
-    }
-
-    @Override
-    public long getCount() {
-        return storage.getCount(hostInfoCategory);
-    }
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/HostLatestPojoListGetter.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.model.TimeStampedPojo;
-
-public class HostLatestPojoListGetter<T extends TimeStampedPojo> {
-
-    private final Storage storage;
-    private final Category<T> cat;
-
-    public HostLatestPojoListGetter(Storage storage, Category<T> cat) {
-        this.storage = storage;
-        this.cat = cat;
-    }
-
-    public List<T> getLatest(HostRef hostRef, long since) {
-        Query<T> query = buildQuery(hostRef, since);
-        return getLatest(query);
-    }
-
-    private List<T> getLatest(Query<T> query) {
-        Cursor<T> cursor = query.execute();
-        List<T> result = new ArrayList<>();
-        while (cursor.hasNext()) {
-            T pojo = cursor.next();
-            result.add(pojo);
-        }
-        return result;
-    }
-
-    protected Query<T> buildQuery(HostRef hostRef, long since) {
-        Query<T> query = storage.createQuery(cat);
-        query.where(Key.AGENT_ID, Criteria.EQUALS, hostRef.getAgentId());
-        query.where(Key.TIMESTAMP, Criteria.GREATER_THAN, since);
-        query.sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
-        return query;
-    }
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/HostRef.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-public class HostRef implements Ref {
-
-    private final String uid;
-    private final String name;
-
-    public HostRef(String id, String name) {
-        this.uid = id;
-        this.name = name;
-    }
-
-    @Override
-    public String toString() {
-        return name;
-    }
-
-    public String getAgentId() {
-        return uid;
-    }
-
-    public String getHostName() {
-        return name;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (obj == this) {
-            return true;
-        }
-        if (obj.getClass() != this.getClass()) {
-            return false;
-        }
-        HostRef other = (HostRef) obj;
-        if (equals(this.uid, other.uid) && equals(this.name, other.name)) {
-            return true;
-        }
-        return false;
-    }
-
-    private static boolean equals(Object obj1, Object obj2) {
-        return (obj1 == null && obj2 == null) || (obj1 != null && obj1.equals(obj2));
-    }
-
-    @Override
-    public int hashCode() {
-        return uid.hashCode();
-    }
-
-    @Override
-    public String getStringID() {
-        return getAgentId();
-    }
-    
-    @Override
-    public String getName() {
-        return getHostName();
-    }
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/NetworkInterfaceInfoDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.List;
-
-import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.model.NetworkInterfaceInfo;
-
-@Service
-public interface NetworkInterfaceInfoDAO {
-
-    static Key<String> ifaceKey = new Key<>("interfaceName", true);
-    static Key<String> ip4AddrKey = new Key<>("ip4Addr", false);
-    static Key<String> ip6AddrKey = new Key<>("ip6Addr", false);
-
-    static final Category<NetworkInterfaceInfo> networkInfoCategory = new Category<>("network-info", NetworkInterfaceInfo.class,
-            Key.AGENT_ID, ifaceKey, ip4AddrKey, ip6AddrKey);
-
-    public List<NetworkInterfaceInfo> getNetworkInterfaces(HostRef ref);
-
-    public void putNetworkInterfaceInfo(NetworkInterfaceInfo info);
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/NetworkInterfaceInfoDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Put;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.model.NetworkInterfaceInfo;
-
-class NetworkInterfaceInfoDAOImpl implements NetworkInterfaceInfoDAO {
-
-    private Storage storage;
-
-    NetworkInterfaceInfoDAOImpl(Storage storage) {
-        this.storage = storage;
-        storage.registerCategory(networkInfoCategory);
-    }
-
-    @Override
-    public List<NetworkInterfaceInfo> getNetworkInterfaces(HostRef ref) {
-        Query<NetworkInterfaceInfo> allHostNetworkInterfaces = storage.createQuery(networkInfoCategory);
-        allHostNetworkInterfaces.where(Key.AGENT_ID, Criteria.EQUALS, ref.getAgentId());
-
-        Cursor<NetworkInterfaceInfo> cursor = allHostNetworkInterfaces.execute();
-        List<NetworkInterfaceInfo> result = new ArrayList<>();
-        while (cursor.hasNext()) {
-            NetworkInterfaceInfo stat = cursor.next();
-            result.add(stat);
-        }
-        return result;
-    }
-
-    @Override
-    public void putNetworkInterfaceInfo(NetworkInterfaceInfo info) {
-        Put replace = storage.createReplace(networkInfoCategory);
-        replace.setPojo(info);
-        replace.apply();
-    }
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/Ref.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-public interface Ref {
-
-    String getStringID();
-    String getName();
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/VmInfoDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.model.VmInfo;
-
-@Service
-public interface VmInfoDAO extends Countable {
-
-    static final Key<Integer> vmPidKey = new Key<>("vmPid", false);
-    static final Key<String> runtimeVersionKey = new Key<>("javaVersion", false);
-    static final Key<String> javaHomeKey = new Key<>("javaHome", false);
-    static final Key<String> mainClassKey = new Key<>("mainClass", false);
-    static final Key<String> commandLineKey = new Key<>("javaCommandLine", false);
-    static final Key<String> vmArgumentsKey = new Key<>("vmArguments", false);
-    static final Key<String> vmNameKey = new Key<>("vmName", false);
-    static final Key<String> vmInfoKey = new Key<>("vmInfo", false);
-    static final Key<String> vmVersionKey = new Key<>("vmVersion", false);
-    static final Key<Map<String, String>> propertiesKey = new Key<>("properties", false);
-    static final Key<Map<String, String>> environmentKey = new Key<>("environment", false);
-    static final Key<List<String>> librariesKey = new Key<>("loadedNativeLibraries", false);
-    static final Key<Long> startTimeKey = new Key<>("startTimeStamp", false);
-    static final Key<Long> stopTimeKey = new Key<>("stopTimeStamp", false);
-
-    static final Category<VmInfo> vmInfoCategory = new Category<>("vm-info", VmInfo.class,
-            Key.AGENT_ID, Key.VM_ID, vmPidKey, runtimeVersionKey, javaHomeKey,
-            mainClassKey, commandLineKey,
-            vmArgumentsKey, vmNameKey, vmInfoKey, vmVersionKey,
-            propertiesKey, environmentKey, librariesKey,
-            startTimeKey, stopTimeKey);
-
-    public VmInfo getVmInfo(VmRef ref);
-
-    Collection<VmRef> getVMs(HostRef host);
-
-    public void putVmInfo(VmInfo info);
-
-    public void putVmStoppedTime(int vmId, long since);
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/VmInfoDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Put;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.core.Update;
-import com.redhat.thermostat.storage.model.VmInfo;
-
-class VmInfoDAOImpl implements VmInfoDAO {
-
-    private final Storage storage;
-
-    VmInfoDAOImpl(Storage storage) {
-        this.storage = storage;
-        storage.registerCategory(vmInfoCategory);
-    }
-
-    @Override
-    public VmInfo getVmInfo(VmRef ref) {
-        Query<VmInfo> findMatchingVm = storage.createQuery(vmInfoCategory);
-        findMatchingVm.where(Key.AGENT_ID, Criteria.EQUALS, ref.getAgent().getAgentId());
-        findMatchingVm.where(Key.VM_ID, Criteria.EQUALS, ref.getId());
-        findMatchingVm.limit(1);
-        VmInfo result = findMatchingVm.execute().next();
-        if (result == null) {
-            throw new DAOException("Unknown VM: host:" + ref.getAgent().getAgentId() + ";vm:" + ref.getId());
-        }
-        return result;
-    }
-
-    @Override
-    public Collection<VmRef> getVMs(HostRef host) {
-
-        Query<VmInfo> query = buildQuery(host);
-        Cursor<VmInfo> cursor = query.execute();
-        return buildVMsFromQuery(cursor, host);
-    }
-
-    private Query<VmInfo> buildQuery(HostRef host) {
-        Query<VmInfo> query = storage.createQuery(vmInfoCategory);
-        query.where(Key.AGENT_ID, Criteria.EQUALS, host.getAgentId());
-        return query;
-    }
-
-    private Collection<VmRef> buildVMsFromQuery(Cursor<VmInfo> cursor, HostRef host) {
-        List<VmRef> vmRefs = new ArrayList<VmRef>();
-        while (cursor.hasNext()) {
-            VmInfo vmInfo = cursor.next();
-            VmRef vm = buildVmRefFromChunk(vmInfo, host);
-            vmRefs.add(vm);
-        }
-
-        return vmRefs;
-    }
-
-    private VmRef buildVmRefFromChunk(VmInfo vmInfo, HostRef host) {
-        Integer id = vmInfo.getVmId();
-        // TODO can we do better than the main class?
-        String mainClass = vmInfo.getMainClass();
-        VmRef ref = new VmRef(host, id, mainClass);
-        return ref;
-    }
-
-    @Override
-    public long getCount() {
-        return storage.getCount(vmInfoCategory);
-    }
-
-    @Override
-    public void putVmInfo(VmInfo info) {
-        Put replace = storage.createReplace(vmInfoCategory);
-        replace.setPojo(info);
-        replace.apply();
-    }
-
-    @Override
-    public void putVmStoppedTime(int vmId, long timestamp) {
-        Update update = storage.createUpdate(vmInfoCategory);
-        update.where(Key.VM_ID, vmId);
-        update.set(VmInfoDAO.stopTimeKey, timestamp);
-        update.apply();
-    }
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/VmLatestPojoListGetter.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.model.TimeStampedPojo;
-
-public class VmLatestPojoListGetter<T extends TimeStampedPojo> {
-
-    private final Storage storage;
-    private final Category<T> cat;
-
-    public VmLatestPojoListGetter(Storage storage, Category<T> cat) {
-        this.storage = storage;
-        this.cat = cat;
-    }
-
-    public List<T> getLatest(VmRef vmRef, long since) {
-        Query<T> query = buildQuery(vmRef, since);
-        return getLatest(query);
-    }
-
-    private List<T> getLatest(Query<T> query) {
-        Cursor<T> cursor = query.execute();
-        List<T> result = new ArrayList<>();
-        while (cursor.hasNext()) {
-            T pojo = cursor.next();
-            result.add(pojo);
-        }
-        return result;
-    }
-
-    protected Query<T> buildQuery(VmRef vmRef, long since) {
-        Query<T> query = storage.createQuery(cat);
-        query.where(Key.AGENT_ID, Criteria.EQUALS, vmRef.getAgent().getAgentId());
-        query.where(Key.VM_ID, Criteria.EQUALS, vmRef.getId());
-        query.where(Key.TIMESTAMP, Criteria.GREATER_THAN, since);
-        query.sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
-        return query;
-    }
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/dao/VmRef.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-public class VmRef implements Ref {
-
-    private final HostRef hostRef;
-    private final Integer uid;
-    private final String uidString;
-    private final String name;
-
-    public VmRef(HostRef hostRef, Integer id, String name) {
-        this.hostRef = hostRef;
-        this.uid = id;
-        this.uidString = id.toString();
-        this.name = name;
-    }
-
-    @Override
-    public String toString() {
-        return name;
-    }
-
-    public HostRef getAgent() {
-        return hostRef;
-    }
-
-    public Integer getId() {
-        return uid;
-    }
-
-    /**
-     * Equivalent to {@link #getStringID()}.
-     */
-    public String getIdString() {
-        return uidString;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (obj == this) {
-            return true;
-        }
-        if (obj.getClass() != this.getClass()) {
-            return false;
-        }
-        VmRef other = (VmRef) obj;
-        if (equals(this.hostRef, other.hostRef) && equals(this.uid, other.uid) && equals(this.name, other.name)) {
-            return true;
-        }
-        return false;
-    }
-
-    private static boolean equals(Object obj1, Object obj2) {
-        return (obj1 == null && obj2 == null) || (obj1 != null && obj1.equals(obj2));
-    }
-
-    @Override
-    public int hashCode() {
-        return uid.hashCode();
-    }
-
-    @Override
-    public String getStringID() {
-        return getIdString();
-    }
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/internal/DbServiceImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.internal;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceRegistration;
-
-import com.redhat.thermostat.common.DbService;
-import com.redhat.thermostat.common.dao.DAOFactory;
-import com.redhat.thermostat.common.dao.DAOFactoryImpl;
-import com.redhat.thermostat.storage.config.ConnectionConfiguration;
-import com.redhat.thermostat.storage.config.StartupConfiguration;
-import com.redhat.thermostat.storage.core.ConnectionException;
-import com.redhat.thermostat.storage.core.StorageException;
-import com.redhat.thermostat.storage.core.StorageProvider;
-import com.redhat.thermostat.storage.core.StorageProviderUtil;
-
-public class DbServiceImpl implements DbService {
-    
-    @SuppressWarnings("rawtypes")
-    private ServiceRegistration registration;
-    
-    private DAOFactory daoFactory;
-    private BundleContext context;
-    private String dbUrl;
-    
-    DbServiceImpl(String username, String password, String dbUrl) throws StorageException {
-        this(FrameworkUtil.getBundle(DbService.class).getBundleContext(), getDAOFactory(username, password, dbUrl), dbUrl);
-    }
-
-    // for testing
-    DbServiceImpl(BundleContext context, DAOFactory daoFactory, String dbUrl) {
-        this.daoFactory = daoFactory;
-        this.context = context;
-        this.dbUrl = dbUrl;
-    }
-
-    public void connect() throws ConnectionException {
-        try {
-            daoFactory.getConnection().connect();
-            registration = context.registerService(DbService.class, this, null);
-            daoFactory.registerDAOsAndStorageAsOSGiServices();
-        } catch (Exception cause) {
-            throw new ConnectionException(cause);
-        }
-    }
-    
-    public void disconnect() throws ConnectionException {
-        try {
-            daoFactory.unregisterDAOsAndStorageAsOSGiServices();
-            daoFactory.getConnection().disconnect();
-            registration.unregister();
-        } catch (Exception cause) {
-            throw new ConnectionException(cause);
-        }
-    }
-    
-    @Override
-    public String getConnectionUrl() {
-        return dbUrl;
-    }
-
-    /**
-     * Factory method for creating a DbService instance.
-     * 
-     * @param username
-     * @param password
-     * @param dbUrl
-     * @return a DbService instance
-     * @throws StorageException if no storage provider exists for the given {@code dbUrl}.
-     */
-    public static DbService create(String username, String password, String dbUrl) throws StorageException {
-        return new DbServiceImpl(username, password, dbUrl);
-    }
-
-    private static DAOFactory getDAOFactory(String username, String password, String dbUrl) throws StorageException {
-        StartupConfiguration config = new ConnectionConfiguration(dbUrl, username, password);
-        StorageProvider prov = StorageProviderUtil.getStorageProvider(config);
-        if (prov == null) {
-            // no suitable provider found
-            throw new StorageException("No storage found for URL " + dbUrl);
-        }
-        return new DAOFactoryImpl(prov);
-    }
-    
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/common/tools/BasicCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.tools;
-
-import com.redhat.thermostat.common.ActionNotifier;
-import com.redhat.thermostat.common.cli.CommandWithInfo;
-import com.redhat.thermostat.storage.config.StartupConfiguration;
-
-/**
- * Common base class for all daemon and application
- */
-public abstract class BasicCommand extends CommandWithInfo {
-
-    private ActionNotifier<ApplicationState> notifier;
-    private boolean storageRequired;
-    
-    public BasicCommand() {
-        this.notifier = new ActionNotifier<>(this);
-    }
-
-    public ActionNotifier<ApplicationState> getNotifier() {
-        return notifier;
-    }
-
-    public abstract StartupConfiguration getConfiguration();
-
-    @Override
-    public boolean isStorageRequired() {
-        return storageRequired;
-    }
-
-    protected void setStorageRequired(boolean storageRequired) {
-        this.storageRequired = storageRequired;
-    }
-
-    @Override
-    public boolean isAvailableInShell() {
-        return true;
-    }
-
-    @Override
-    public boolean isAvailableOutsideShell() {
-        return true;
-    }
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/test/StubBundleContext.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,404 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.test;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.BundleListener;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Filter;
-import org.osgi.framework.FrameworkListener;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceFactory;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-
-import com.redhat.thermostat.common.NotImplementedException;
-
-/**
- * An implementation of BundleContext that's useful for writing unit tests.
- * <p>
- * WARNING: if you static mock {@link FrameworkUtil#createFilter(String)}, you
- * are going to have a bad time.
- */
-public class StubBundleContext implements BundleContext {
-
-    static class ServiceInformation {
-        public Object implementation;
-        public Dictionary properties;
-        public int exportedReferences;
-
-        public ServiceInformation(Object impl, Dictionary props) {
-            this.implementation = impl;
-            this.properties = props;
-        }
-    }
-
-    private int nextServiceId = 0;
-
-    private Map<String, String> frameworkProperties = new HashMap<>();
-    private List<Bundle> bundles = new ArrayList<>();
-    private List<ServiceInformation> registeredServices = new ArrayList<>();
-    private Map<ServiceListener, Filter> registeredListeners = new HashMap<>();
-    private Bundle contextBundle = null;
-
-    /*
-     * Interface methods
-     */
-
-    @Override
-    public String getProperty(String key) {
-        String result = null;
-        result = frameworkProperties.get(key);
-        if (result == null) {
-            result = System.getProperty(key);
-        }
-        return result;
-    }
-
-    @Override
-    public Bundle getBundle() {
-        return contextBundle;
-    }
-
-    @Override
-    public Bundle installBundle(String location, InputStream input) throws BundleException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public Bundle installBundle(String location) throws BundleException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public Bundle getBundle(long id) {
-        if (id > Integer.MAX_VALUE) {
-            throw new NotImplementedException();
-        }
-        if (id >= bundles.size()) {
-            return null;
-        }
-
-        return bundles.get((int) id);
-    }
-
-    @Override
-    public Bundle getBundle(String location) {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public Bundle[] getBundles() {
-        return bundles.toArray(new Bundle[bundles.size()]);
-    }
-
-    @Override
-    public void addServiceListener(ServiceListener listener, String filter) throws InvalidSyntaxException {
-        registeredListeners.put(listener, filter == null ? null : createFilter(filter));
-    }
-
-    @Override
-    public void addServiceListener(ServiceListener listener) {
-        try {
-            addServiceListener(listener, null);
-        } catch (InvalidSyntaxException e) {
-            throw new AssertionError("a null filter can not have invalid systax");
-        }
-    }
-
-    @Override
-    public void removeServiceListener(ServiceListener listener) {
-        registeredListeners.remove(listener);
-    }
-
-    @Override
-    public void addBundleListener(BundleListener listener) {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void removeBundleListener(BundleListener listener) {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void addFrameworkListener(FrameworkListener listener) {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void removeFrameworkListener(FrameworkListener listener) {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public ServiceRegistration registerService(Class clazz, Object service, Dictionary properties) {
-        return registerService(clazz.getName(), service, properties);
-    }
-
-    @Override
-    public ServiceRegistration registerService(String className, Object service, Dictionary properties) {
-        return registerService(new String[] { className }, service, properties);
-    }
-
-    @Override
-    public ServiceRegistration registerService(String[] clazzes, Object service, Dictionary properties) {
-        if (service instanceof ServiceFactory) {
-            throw new NotImplementedException("support for service factories is not implemented");
-        }
-
-        for (String className : clazzes) {
-            try {
-                Class<?> clazz = Class.forName(className);
-                if (!clazz.isAssignableFrom(service.getClass())) {
-                    throw new IllegalArgumentException("service is not a subclass of " + className);
-                }
-            } catch (ClassNotFoundException classNotFound) {
-                throw new IllegalArgumentException("not a valid class: " + className);
-            }
-        }
-
-        Object specifiedRanking = null;
-        Hashtable<String, Object> newProperties = new Hashtable<>();
-        if (properties != null) {
-            Enumeration<?> enumeration = properties.keys();
-            while (enumeration.hasMoreElements()) {
-                Object key = enumeration.nextElement();
-                newProperties.put((String)key, properties.get(key));
-            }
-            specifiedRanking = properties.get(Constants.SERVICE_RANKING);
-        }
-
-        newProperties.put(Constants.OBJECTCLASS, clazzes);
-        newProperties.put(Constants.SERVICE_ID, nextServiceId);
-        nextServiceId++;
-        if (specifiedRanking == null || !(specifiedRanking instanceof Integer)) {
-            specifiedRanking = 0;
-        }
-        newProperties.put(Constants.SERVICE_RANKING, (Integer) specifiedRanking);
-
-        ServiceInformation info = new ServiceInformation(service, newProperties);
-        registeredServices.add(info);
-
-        notifyServiceChange(new StubServiceReference(info, contextBundle), true);
-
-        return new StubServiceRegistration(this, info);
-    }
-
-    @Override
-    public ServiceReference getServiceReference(Class clazz) {
-        return getServiceReference(clazz.getName());
-    }
-
-    @Override
-    public ServiceReference getServiceReference(String clazz) {
-        try {
-            ServiceReference[] initial = getServiceReferences(clazz, null);
-            if (initial == null) {
-                return null;
-            }
-
-            Arrays.sort(initial);
-            return initial[initial.length-1];
-        } catch (InvalidSyntaxException invalidFilterSyntax) {
-            throw new AssertionError("a null filter can not have an invalid syntax");
-        }
-    }
-
-    @Override
-    public Collection getServiceReferences(Class clazz, String filter) throws InvalidSyntaxException {
-        return Arrays.asList(getServiceReferences(clazz.getName(), filter));
-    }
-
-    @Override
-    public ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
-        ServiceReference[] allRefs = getAllServiceReferences(clazz, filter);
-        if (allRefs == null) {
-            return null;
-        }
-
-        List<ServiceReference> result = new ArrayList<>();
-        for (ServiceReference ref : allRefs) {
-            if (ref.isAssignableTo(contextBundle, clazz)) {
-                result.add(ref);
-            }
-        }
-        return result.toArray(new ServiceReference[0]);
-    }
-
-    @Override
-    public ServiceReference[] getAllServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
-        List<ServiceReference> toReturn = new ArrayList<>();
-
-        Filter toMatch = (filter == null) ? null : createFilter(filter);
-
-        for (ServiceInformation info : registeredServices) {
-            for (String serviceInterface : (String[]) info.properties.get(Constants.OBJECTCLASS)) {
-                if (clazz == null || serviceInterface.equals(clazz)) {
-                    if (toMatch == null || toMatch.match(info.properties)) {
-                        toReturn.add(new StubServiceReference(info, contextBundle));
-                    }
-                }
-            }
-        }
-
-        if (toReturn.size() == 0) {
-            return null;
-        }
-        return toReturn.toArray(new ServiceReference[0]);
-    }
-
-
-    @Override
-    public Filter createFilter(String filter) throws InvalidSyntaxException {
-        // FIXME this will break service trackers if FrameworkUtil is mocked.
-        // The following call will return null if FrameworkUtil is mocked.
-        // that's a problem because this is meant to be used (mostly) in test
-        // environments and that's where FrameworkUtil is likely to be mocked.
-        return FrameworkUtil.createFilter(filter);
-    }
-
-    @Override
-    public Object getService(ServiceReference reference) {
-        StubServiceReference ref = (StubServiceReference) reference;
-        ServiceInformation info = ref.getInformation();
-        info.exportedReferences++;
-        return info.implementation;
-    }
-
-    @Override
-    public boolean ungetService(ServiceReference reference) {
-        StubServiceReference ref = (StubServiceReference) reference;
-        ServiceInformation info = ref.getInformation();
-        if (info.exportedReferences == 0) {
-            return false;
-        }
-        if (!registeredServices.contains(info)) {
-            return false;
-        }
-        info.exportedReferences--;
-        return true;
-    }
-
-    @Override
-    public File getDataFile(String filename) {
-        throw new NotImplementedException();
-    }
-
-    /*
-     * Our custom methods
-     */
-    public void setProperty(String key, String value) {
-        frameworkProperties.put(key, value);
-    }
-
-    /** Set the context bundle */
-    public void setBundle(Bundle bundle) {
-        this.contextBundle = bundle;
-    }
-
-    /** Set the bundle associated with an id */
-    public void setBundle(int i, Bundle bundle) {
-        bundles.add(i, bundle);
-    }
-
-    public boolean isServiceRegistered(String serviceName, Class<?> implementationClass) {
-        for (ServiceInformation info : registeredServices) {
-            for (String serviceInterface : (String[]) info.properties.get(Constants.OBJECTCLASS)) {
-                if (serviceInterface.equals(serviceName)
-                        && info.implementation.getClass().equals(implementationClass)) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    public Collection<ServiceInformation> getAllServices() {
-        return registeredServices;
-    }
-
-    public Collection<ServiceListener> getServiceListeners() {
-        return registeredListeners.keySet();
-    }
-
-    public void removeService(ServiceInformation info) {
-        if (!registeredServices.contains(info)) {
-            throw new IllegalArgumentException("service not registered");
-        }
-        registeredServices.remove(info);
-        notifyServiceChange(new StubServiceReference(info, contextBundle), false);
-    }
-
-    private void notifyServiceChange(ServiceReference serviceReference, boolean registered) {
-        int eventType = registered ? ServiceEvent.REGISTERED : ServiceEvent.UNREGISTERING;
-        ServiceEvent event = new ServiceEvent(eventType, serviceReference);
-        for (Entry<ServiceListener, Filter> entry : registeredListeners.entrySet()) {
-            ServiceListener listener = entry.getKey();
-            Filter filter = entry.getValue();
-            if (filter == null || filter.match(serviceReference)) {
-                listener.serviceChanged(event);
-            }
-        }
-    }
-
-    public int getExportedServiceCount(ServiceRegistration registration) {
-        StubServiceRegistration reg = (StubServiceRegistration) registration;
-        return reg.getInfo().exportedReferences;
-    }
-
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/test/StubServiceReference.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.test;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.List;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-
-import com.redhat.thermostat.common.NotImplementedException;
-import com.redhat.thermostat.test.StubBundleContext.ServiceInformation;
-
-public class StubServiceReference implements ServiceReference {
-
-    private final Bundle sourceBundle;
-    private final ServiceInformation information;
-
-    public StubServiceReference(ServiceInformation info, Bundle sourceBundle) {
-        this.information = info;
-        this.sourceBundle = sourceBundle;
-    }
-
-    @Override
-    public Object getProperty(String key) {
-        return information.properties.get(key);
-    }
-
-    @Override
-    public String[] getPropertyKeys() {
-        Dictionary props = information.properties;
-        List<String> toReturn = new ArrayList<>(props.size());
-        Enumeration keyEnumeration = props.keys();
-        while (keyEnumeration.hasMoreElements()) {
-            toReturn.add((String) keyEnumeration.nextElement());
-        }
-        return toReturn.toArray(new String[0]);
-    }
-
-    @Override
-    public Bundle getBundle() {
-        return sourceBundle;
-    }
-
-    @Override
-    public Bundle[] getUsingBundles() {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public boolean isAssignableTo(Bundle bundle, String className) {
-        if (sourceBundle == bundle) {
-            return true;
-        }
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public int compareTo(Object reference) {
-        if (!(reference instanceof ServiceReference)) {
-            throw new NotImplementedException();
-        }
-
-        ServiceReference ref = (ServiceReference) reference;
-
-        Integer myRanking = (Integer) getProperty(Constants.SERVICE_RANKING);
-        Integer otherRanking = (Integer) ref.getProperty(Constants.SERVICE_RANKING);
-
-        if (myRanking > otherRanking) {
-            return 1;
-        } else if (myRanking < otherRanking) {
-            return -1;
-        } else {
-            Integer myServiceId = (Integer) getProperty(Constants.SERVICE_ID);
-            Integer otherServiceId = (Integer) ref.getProperty(Constants.SERVICE_ID);
-
-            if (myServiceId < otherServiceId) {
-                return 1;
-            } else if (myServiceId > otherServiceId) {
-                return -1;
-            } else {
-                return 0;
-            }
-        }
-    }
-
-    public ServiceInformation getInformation() {
-        return information;
-    }
-
-}
-
--- a/common/core/src/main/java/com/redhat/thermostat/test/StubServiceRegistration.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.test;
-
-import java.util.Dictionary;
-
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-
-import com.redhat.thermostat.common.NotImplementedException;
-import com.redhat.thermostat.test.StubBundleContext.ServiceInformation;
-
-public class StubServiceRegistration implements ServiceRegistration {
-
-    private StubBundleContext bundleContext;
-    private ServiceInformation info;
-
-    public StubServiceRegistration(StubBundleContext ctx, ServiceInformation info) {
-        this.bundleContext = ctx;
-        this.info = info;
-    }
-
-    @Override
-    public ServiceReference getReference() {
-        return new StubServiceReference(info, bundleContext.getBundle());
-    }
-
-    @Override
-    public void setProperties(Dictionary properties) {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void unregister() {
-        bundleContext.removeService(info);
-    }
-
-    public ServiceInformation getInfo() {
-        return info;
-    }
-
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/DefaultHostsVMsLoaderTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.redhat.thermostat.common.DefaultHostsVMsLoader;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
-
-public class DefaultHostsVMsLoaderTest {
-
-    private HostInfoDAO mockHostsDAO;
-    private VmInfoDAO mockVmsDAO;
-    private DefaultHostsVMsLoader loader;
-    
-    @Before
-    public void setUp() throws Exception {
-        mockHostsDAO = mock(HostInfoDAO.class);
-        mockVmsDAO = mock(VmInfoDAO.class);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        mockHostsDAO = null;
-        mockVmsDAO = null;
-        loader = null;
-    }
-
-    @Test
-    public void canGetHosts() {
-        Collection<HostRef> expectedHosts = new ArrayList<>();
-        expectedHosts.add(new HostRef("123", "fluffhost1"));
-        expectedHosts.add(new HostRef("456", "fluffhost2"));
-        expectedHosts.add(new HostRef("007", "deadHost"));
-
-        loader = new DefaultHostsVMsLoader(mockHostsDAO, mockVmsDAO, false);
-        when(mockHostsDAO.getHosts()).thenReturn(expectedHosts);
-        assertEquals(loader.getHosts(), expectedHosts);
-        
-        loader = new DefaultHostsVMsLoader(mockHostsDAO, mockVmsDAO, true);
-        Collection<HostRef> aliveHosts = new ArrayList<>();
-        expectedHosts.add(new HostRef("123", "fluffhost1"));
-        expectedHosts.add(new HostRef("456", "fluffhost2"));
-        when(mockHostsDAO.getAliveHosts()).thenReturn(aliveHosts);
-        assertEquals(loader.getHosts(), aliveHosts);
-    }
-    
-    @Test
-    public void canGetVms() {
-        HostRef hostR = mock(HostRef.class);
-        Collection<VmRef> expectedVms = new ArrayList<>();
-        expectedVms.add(new VmRef(hostR, 1, "test1"));
-        expectedVms.add(new VmRef(hostR, 2, "test2"));
-
-        loader = new DefaultHostsVMsLoader(mockHostsDAO, mockVmsDAO, false /* irrelevant */);
-        when(mockVmsDAO.getVMs(hostR)).thenReturn(expectedVms);
-        assertEquals(loader.getVMs(hostR), expectedVms);
-        
-        assertEquals(0, loader.getVMs(mock(HostRef.class)).size());
-    }
-
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/core/src/test/java/com/redhat/thermostat/common/cli/BasicCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.common.cli;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.commons.cli.Options;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.redhat.thermostat.common.cli.BasicCommand;
+import com.redhat.thermostat.common.cli.CommandContext;
+import com.redhat.thermostat.common.cli.CommandException;
+
+public class BasicCommandTest {
+
+    private BasicCommand application;
+
+    @Before
+    public void setUp() {
+        application = new BasicCommand() {
+
+            @Override
+            public void run(CommandContext ctx) throws CommandException {
+                // Nothing to do here.
+            }
+
+            @Override
+            public String getName() {
+                return null;
+            }
+
+            @Override
+            public String getDescription() {
+                return null;
+            }
+
+            @Override
+            public String getUsage() {
+                return null;
+            }
+
+            @Override
+            public Options getOptions() {
+                return new Options();
+            }
+
+            @Override
+            public boolean isStorageRequired() {
+                return false;
+            }
+        };
+    }
+
+    @After
+    public void tearDown() {
+        application = null;
+    }
+
+    @Test
+    public void testNotfier() {
+        assertNotNull(application.getNotifier());
+    }
+}
+
--- a/common/core/src/test/java/com/redhat/thermostat/common/dao/AgentInfoDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.core.Remove;
-import com.redhat.thermostat.storage.core.Replace;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.core.Update;
-import com.redhat.thermostat.storage.model.AgentInformation;
-
-public class AgentInfoDAOTest {
-
-    private AgentInformation agentInfo1;
-    private AgentInformation agent1;
-
-    @Before
-    public void setUp() {
-        agentInfo1 = new AgentInformation();
-        agentInfo1.setAgentId("1234");
-        agentInfo1.setAlive(true);
-        agentInfo1.setConfigListenAddress("foobar:666");
-        agentInfo1.setStartTime(100);
-        agentInfo1.setStopTime(10);
-
-        agent1 = new AgentInformation();
-        agent1.setAgentId("1234");
-        agent1.setAlive(true);
-        agent1.setConfigListenAddress("foobar:666");
-        agent1.setStartTime(100);
-        agent1.setStopTime(10);
-    }
-
-    @Test
-    public void verifyCategoryName() {
-        Category category = AgentInfoDAO.CATEGORY;
-        assertEquals("agent-config", category.getName());
-    }
-
-    @Test
-    public void verifyKeyNames() {
-        assertEquals("agentId", Key.AGENT_ID.getName());
-        assertEquals("alive", AgentInfoDAO.ALIVE_KEY.getName());
-        assertEquals("startTime", AgentInfoDAO.START_TIME_KEY.getName());
-        assertEquals("stopTime", AgentInfoDAO.STOP_TIME_KEY.getName());
-        assertEquals("configListenAddress", AgentInfoDAO.CONFIG_LISTEN_ADDRESS.getName());
-    }
-
-    @Test
-    public void verifyCategoryHasAllKeys() {
-        Collection<Key<?>> keys = AgentInfoDAO.CATEGORY.getKeys();
-
-        assertTrue(keys.contains(Key.AGENT_ID));
-        assertTrue(keys.contains(AgentInfoDAO.ALIVE_KEY));
-        assertTrue(keys.contains(AgentInfoDAO.START_TIME_KEY));
-        assertTrue(keys.contains(AgentInfoDAO.STOP_TIME_KEY));
-        assertTrue(keys.contains(AgentInfoDAO.CONFIG_LISTEN_ADDRESS));
-    }
-
-    @Test
-    public void verifyGetAllAgentInformationWithOneAgentInStorage() {
-        @SuppressWarnings("unchecked")
-        Cursor<AgentInformation> agentCursor = mock(Cursor.class);
-        when(agentCursor.hasNext()).thenReturn(true).thenReturn(false);
-        when(agentCursor.next()).thenReturn(agent1).thenReturn(null);
-
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(query.execute()).thenReturn(agentCursor);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        AgentInfoDAOImpl dao = new AgentInfoDAOImpl(storage);
-
-        List<AgentInformation> allAgentInfo = dao.getAllAgentInformation();
-
-        assertEquals(1, allAgentInfo.size());
-
-        AgentInformation result = allAgentInfo.get(0);
-        AgentInformation expected = agentInfo1;
-        assertEquals(expected, result);
-    }
-
-    @Test
-    public void verifyGetAliveAgent() {
-        @SuppressWarnings("unchecked")
-        Cursor<AgentInformation> agentCursor = mock(Cursor.class);
-        when(agentCursor.hasNext()).thenReturn(true).thenReturn(false);
-        when(agentCursor.next()).thenReturn(agent1).thenReturn(null);
-
-        Query query = mock(Query.class);
-        Storage storage = mock(Storage.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        when(query.execute()).thenReturn(agentCursor);
-
-        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
-        List<AgentInformation> aliveAgents = dao.getAliveAgents();
-
-        verify(storage).createQuery(AgentInfoDAO.CATEGORY);
-        verify(query).where(AgentInfoDAO.ALIVE_KEY, Criteria.EQUALS, true);
-        verify(query).execute();
-        verifyNoMoreInteractions(query);
-
-        assertEquals(1, aliveAgents.size());
-
-        AgentInformation result = aliveAgents.get(0);
-        AgentInformation expected = agentInfo1;
-        assertEquals(expected, result);
-    }
-
-    @Test
-    public void verifyGetAgentInformationWhenStorageCantFindIt() {
-        HostRef agentRef = mock(HostRef.class);
-
-        Query query = mock(Query.class);
-        Cursor cursor = mock(Cursor.class);
-        when(cursor.hasNext()).thenReturn(false);
-        when(cursor.next()).thenReturn(null);
-        when(query.execute()).thenReturn(cursor);
-
-        Storage storage = mock(Storage.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-
-        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
-
-        AgentInformation computed = dao.getAgentInformation(agentRef);
-
-        assertEquals(null, computed);
-    }
-
-    @Test
-    public void verifyGetAgentInformation() {
-        HostRef agentRef = mock(HostRef.class);
-        when(agentRef.getAgentId()).thenReturn(agentInfo1.getAgentId());
-
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        Cursor cursor = mock(Cursor.class);
-        when(cursor.hasNext()).thenReturn(true).thenReturn(false);
-        when(cursor.next()).thenReturn(agentInfo1).thenReturn(null);
-        when(query.execute()).thenReturn(cursor);
-        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
-
-        AgentInformation computed = dao.getAgentInformation(agentRef);
-
-        verify(storage).createQuery(AgentInfoDAO.CATEGORY);
-        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, agentInfo1.getAgentId());
-        verify(query).limit(1);
-        verify(query).execute();
-        verifyNoMoreInteractions(query);
-        AgentInformation expected = agentInfo1;
-        assertSame(expected, computed);
-    }
-
-    @Test
-    public void verifyAddAgentInformation() {
-        Storage storage = mock(Storage.class);
-        Replace replace = mock(Replace.class);
-        when(storage.createReplace(any(Category.class))).thenReturn(replace);
-
-        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
-
-        dao.addAgentInformation(agentInfo1);
-
-        verify(storage).createReplace(AgentInfoDAO.CATEGORY);
-        verify(replace).setPojo(agentInfo1);
-        verify(replace).apply();
-    }
-
-    @Test
-    public void verifyUpdateAgentInformation() {
-
-        Update mockUpdate = mock(Update.class);
-        Storage storage = mock(Storage.class);
-        when(storage.createUpdate(any(Category.class))).thenReturn(mockUpdate);
-        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
-
-        dao.updateAgentInformation(agentInfo1);
-
-        verify(storage).createUpdate(AgentInfoDAO.CATEGORY);
-        verify(mockUpdate).where(Key.AGENT_ID, "1234");
-        verify(mockUpdate).set(AgentInfoDAO.START_TIME_KEY, 100L);
-        verify(mockUpdate).set(AgentInfoDAO.STOP_TIME_KEY, 10L);
-        verify(mockUpdate).set(AgentInfoDAO.CONFIG_LISTEN_ADDRESS, "foobar:666");
-        verify(mockUpdate).set(AgentInfoDAO.ALIVE_KEY, true);
-        verify(mockUpdate).apply();
-        verifyNoMoreInteractions(mockUpdate);
-
-    }
-
-    @Test
-    public void verifyRemoveAgentInformation() {
-        Remove mockRemove = QueryTestHelper.createMockRemove();
-        Storage storage = mock(Storage.class);
-        when(storage.createRemove()).thenReturn(mockRemove);
-        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
-
-        dao.removeAgentInformation(agentInfo1);
-
-        verify(storage).removePojo(mockRemove);
-        verify(mockRemove).from(AgentInfoDAO.CATEGORY);
-        verify(mockRemove).where(Key.AGENT_ID, "1234");
-    }
-
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/dao/BackendInfoDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InOrder;
-
-import com.redhat.thermostat.storage.core.Add;
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.core.Remove;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.model.BackendInformation;
-
-public class BackendInfoDAOTest {
-
-    private BackendInformation backendInfo1;
-    private BackendInformation backend1;
-
-    @Before
-    public void setUp() {
-
-        backendInfo1 = new BackendInformation();
-
-        backendInfo1.setName("backend-name");
-        backendInfo1.setDescription("description");
-        backendInfo1.setActive(true);
-        backendInfo1.setObserveNewJvm(true);
-        backendInfo1.setPids(new int[] { -1, 0, 1});
-        backendInfo1.setOrderValue(100);
-
-        backend1 = new BackendInformation();
-        backend1.setName("backend-name");
-        backend1.setDescription("description");
-        backend1.setActive(true);
-        backend1.setObserveNewJvm(true);
-        backend1.setPids(new int[] { -1, 0, 1});
-        backend1.setOrderValue(100);
-    }
-
-    @Test
-    public void verifyCategoryName() {
-        Category c = BackendInfoDAO.CATEGORY;
-        assertEquals("backend-info", c.getName());
-    }
-
-    @Test
-    public void verifyCategoryHasAllKeys() {
-        Category c = BackendInfoDAO.CATEGORY;
-        Collection<Key<?>> keys = c.getKeys();
-
-        assertTrue(keys.contains(Key.AGENT_ID));
-        assertTrue(keys.contains(BackendInfoDAO.BACKEND_NAME));
-        assertTrue(keys.contains(BackendInfoDAO.BACKEND_DESCRIPTION));
-        assertTrue(keys.contains(BackendInfoDAO.IS_ACTIVE));
-        assertTrue(keys.contains(BackendInfoDAO.PIDS_TO_MONITOR));
-        assertTrue(keys.contains(BackendInfoDAO.SHOULD_MONITOR_NEW_PROCESSES));
-        assertTrue(keys.contains(BackendInfoDAO.ORDER_VALUE));
-    }
-
-    @Test
-    public void verifyAddBackendInformation() {
-        Storage storage = mock(Storage.class);
-        Add add = mock(Add.class);
-        when(storage.createAdd(any(Category.class))).thenReturn(add);
-
-        BackendInfoDAO dao = new BackendInfoDAOImpl(storage);
-
-        dao.addBackendInformation(backendInfo1);
-
-        verify(storage).createAdd(BackendInfoDAO.CATEGORY);
-        verify(add).setPojo(backendInfo1);
-        verify(add).apply();
-    }
-
-    @Test
-    public void verifyGetBackendInformation() {
-        final String AGENT_ID = "agent-id";
-        HostRef agentref = mock(HostRef.class);
-        when(agentref.getAgentId()).thenReturn(AGENT_ID);
-
-        @SuppressWarnings("unchecked")
-        Cursor<BackendInformation> backendCursor = mock(Cursor.class);
-        when(backendCursor.hasNext()).thenReturn(true).thenReturn(false);
-        when(backendCursor.next()).thenReturn(backend1).thenReturn(null);
-
-        Query query = mock(Query.class);
-        Storage storage = mock(Storage.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        when(query.execute()).thenReturn(backendCursor);
-
-        BackendInfoDAO dao = new BackendInfoDAOImpl(storage);
-
-        List<BackendInformation> result = dao.getBackendInformation(agentref);
-
-        verify(storage).createQuery(BackendInfoDAO.CATEGORY);
-        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
-        verify(query).execute();
-        verifyNoMoreInteractions(query);
-
-        assertEquals(Arrays.asList(backendInfo1), result);
-    }
-
-    @Test
-    public void verifyRemoveBackendInformation() {
-        Remove remove = QueryTestHelper.createMockRemove();
-        Storage storage = mock(Storage.class);
-        when(storage.createRemove()).thenReturn(remove);
-        BackendInfoDAO dao = new BackendInfoDAOImpl(storage);
-
-        dao.removeBackendInformation(backendInfo1);
-
-        verify(storage).removePojo(remove);
-        InOrder inOrder = inOrder(remove);
-        inOrder.verify(remove).from(BackendInfoDAO.CATEGORY);
-        inOrder.verify(remove).where(BackendInfoDAO.BACKEND_NAME, "backend-name");
-    }
-
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/dao/HostInfoDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,341 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.atLeast;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.junit.Test;
-
-import com.redhat.thermostat.storage.core.Add;
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.model.AgentInformation;
-import com.redhat.thermostat.storage.model.HostInfo;
-
-
-public class HostInfoDAOTest {
-
-    static class Pair<T,U> {
-        final T first;
-        final U second;
-
-        public Pair(T first, U second) {
-            this.first = first;
-            this.second = second;
-        }
-    }
-
-    private static final String HOST_NAME = "a host name";
-    private static final String OS_NAME = "some os";
-    private static final String OS_KERNEL = "some kernel";
-    private static final String CPU_MODEL = "some cpu that runs fast";
-    private static final int CPU_NUM = -1;
-    private static final long MEMORY_TOTAL = 0xCAFEBABEl;
-
-    @Test
-    public void testCategory() {
-        assertEquals("host-info", HostInfoDAO.hostInfoCategory.getName());
-        Collection<Key<?>> keys = HostInfoDAO.hostInfoCategory.getKeys();
-        assertTrue(keys.contains(new Key<>("agentId", true)));
-        assertTrue(keys.contains(new Key<String>("hostname", true)));
-        assertTrue(keys.contains(new Key<String>("osName", false)));
-        assertTrue(keys.contains(new Key<String>("osKernel", false)));
-        assertTrue(keys.contains(new Key<String>("cpuModel", false)));
-        assertTrue(keys.contains(new Key<Integer>("cpuCount", false)));
-        assertTrue(keys.contains(new Key<Long>("totalMemory", false)));
-        assertEquals(7, keys.size());
-    }
-
-    @Test
-    public void testGetHostInfo() {
-
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        HostInfo info = new HostInfo(HOST_NAME, OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
-        Cursor cursor = mock(Cursor.class);
-        when(cursor.hasNext()).thenReturn(true).thenReturn(false);
-        when(cursor.next()).thenReturn(info).thenReturn(null);
-        when(query.execute()).thenReturn(cursor);
-        AgentInfoDAO agentInfoDao = mock(AgentInfoDAO.class);
-
-        HostInfo result = new HostInfoDAOImpl(storage, agentInfoDao).getHostInfo(new HostRef("some uid", HOST_NAME));
-        assertSame(result, info);
-    }
-
-    @Test
-    public void testGetHostsSingleHost() {
-
-        Storage storage = setupStorageForSingleHost();
-        AgentInfoDAO agentInfo = mock(AgentInfoDAO.class);
-
-        HostInfoDAO hostsDAO = new HostInfoDAOImpl(storage, agentInfo);
-        Collection<HostRef> hosts = hostsDAO.getHosts();
-
-        assertEquals(1, hosts.size());
-        assertTrue(hosts.contains(new HostRef("123", "fluffhost1")));
-    }
-
-    private Storage setupStorageForSingleHost() {
-
-        HostInfo hostConfig = new HostInfo("fluffhost1", OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
-        hostConfig.setAgentId("123");
-
-        @SuppressWarnings("unchecked")
-        Cursor<HostInfo> cursor = mock(Cursor.class);
-        when(cursor.hasNext()).thenReturn(true).thenReturn(false);
-        when(cursor.next()).thenReturn(hostConfig);
-
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        when(query.execute()).thenReturn(cursor);
-        
-        return storage;
-    }
-
-    @Test
-    public void testGetHosts3Hosts() {
-
-        Storage storage = setupStorageFor3Hosts();
-        AgentInfoDAO agentInfo = mock(AgentInfoDAO.class);
-
-        HostInfoDAO hostsDAO = new HostInfoDAOImpl(storage, agentInfo);
-        Collection<HostRef> hosts = hostsDAO.getHosts();
-
-        assertEquals(3, hosts.size());
-        assertTrue(hosts.contains(new HostRef("123", "fluffhost1")));
-        assertTrue(hosts.contains(new HostRef("456", "fluffhost2")));
-        assertTrue(hosts.contains(new HostRef("789", "fluffhost3")));
-    }
-
-    private Storage setupStorageFor3Hosts() {
-
-        HostInfo hostConfig1 = new HostInfo("fluffhost1", OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
-        hostConfig1.setAgentId("123");
-        HostInfo hostConfig2 = new HostInfo("fluffhost2", OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
-        hostConfig2.setAgentId("456");
-        HostInfo hostConfig3 = new HostInfo("fluffhost3", OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
-        hostConfig3.setAgentId("789");
-
-
-        @SuppressWarnings("unchecked")
-        Cursor<HostInfo> cursor = mock(Cursor.class);
-        when(cursor.hasNext()).thenReturn(true).thenReturn(true).thenReturn(true).thenReturn(false);
-        when(cursor.next()).thenReturn(hostConfig1).thenReturn(hostConfig2).thenReturn(hostConfig3);
-
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        when(query.execute()).thenReturn(cursor);
-        
-        return storage;
-    }
-
-    @Test
-    public void testPutHostInfo() {
-        Storage storage = mock(Storage.class);
-        Add add = mock(Add.class);
-        when(storage.createAdd(any(Category.class))).thenReturn(add);
-
-        AgentInfoDAO agentInfo = mock(AgentInfoDAO.class);
-
-        HostInfo info = new HostInfo(HOST_NAME, OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
-        HostInfoDAO dao = new HostInfoDAOImpl(storage, agentInfo);
-        dao.putHostInfo(info);
-
-        verify(storage).createAdd(HostInfoDAO.hostInfoCategory);
-        verify(add).setPojo(info);
-        verify(add).apply();
-    }
-
-    @Test
-    public void testGetCount() {
-        Storage storage = mock(Storage.class);
-        when(storage.getCount(any(Category.class))).thenReturn(5L);
-        AgentInfoDAO agentInfoDao = mock(AgentInfoDAO.class);
-
-        HostInfoDAO dao = new HostInfoDAOImpl(storage, agentInfoDao);
-        Long count = dao.getCount();
-        assertEquals((Long) 5L, count);
-    }
-    
-    @Test
-    public void getAliveHostSingle() {
-        Pair<Storage, AgentInfoDAO> setup = setupForSingleAliveHost();
-        Storage storage = setup.first;
-        AgentInfoDAO agentInfoDao = setup.second;
-
-        HostInfoDAO hostsDAO = new HostInfoDAOImpl(storage, agentInfoDao);
-        Collection<HostRef> hosts = hostsDAO.getAliveHosts();
-
-        assertEquals(1, hosts.size());
-        assertTrue(hosts.contains(new HostRef("123", "fluffhost1")));
-        verify(storage).createQuery(HostInfoDAO.hostInfoCategory);
-    }
-    
-    private Pair<Storage, AgentInfoDAO> setupForSingleAliveHost() {
-        
-        // agents
-        
-        AgentInformation agentConfig1 = new AgentInformation();
-        agentConfig1.setAgentId("123");
-        agentConfig1.setAlive(true);
-
-        AgentInformation agentInfo1 = new AgentInformation();
-        agentInfo1.setAgentId("123");
-        agentInfo1.setAlive(true);
-        
-        // hosts
-        
-        HostInfo hostConfig1 = new HostInfo();
-        hostConfig1.setHostname("fluffhost1");
-        hostConfig1.setAgentId("123");
-        
-        HostInfo hostConfig2 = new HostInfo();
-        hostConfig2.setHostname("fluffhost2");
-        hostConfig2.setAgentId("456");
-        
-        // cursor
-
-        @SuppressWarnings("unchecked")
-        Cursor<HostInfo> cursor1 = mock(Cursor.class);
-        when(cursor1.hasNext()).thenReturn(true).thenReturn(false);
-        when(cursor1.next()).thenReturn(hostConfig1);
-
-        // storage
-        
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        when(query.execute()).thenReturn(cursor1);
-
-        AgentInfoDAO agentDao = mock(AgentInfoDAO.class);
-        when(agentDao.getAliveAgents()).thenReturn(Arrays.asList(agentInfo1));
-
-        return new Pair<>(storage, agentDao);
-    }
-
-    @Test
-    public void getAliveHost3() {
-        Pair<Storage, AgentInfoDAO> setup = setupForAliveHost3();
-        Storage storage = setup.first;
-        AgentInfoDAO agentInfoDao = setup.second;
-
-        HostInfoDAO hostsDAO = new HostInfoDAOImpl(storage, agentInfoDao);
-        Collection<HostRef> hosts = hostsDAO.getAliveHosts();
-
-        // cursor 3 from the above storage should not be used
-        assertEquals(3, hosts.size());
-        assertTrue(hosts.contains(new HostRef("123", "fluffhost1")));
-        assertTrue(hosts.contains(new HostRef("456", "fluffhost2")));
-        assertTrue(hosts.contains(new HostRef("678", "fluffhost3")));
-        verify(storage, atLeast(3)).createQuery(HostInfoDAO.hostInfoCategory);
-    }
-    
-    private Pair<Storage, AgentInfoDAO> setupForAliveHost3() {
-        
-        // agents
-        AgentInformation agentInfo1 = new AgentInformation();
-        agentInfo1.setAgentId("123");
-        agentInfo1.setAlive(true);
-
-        AgentInformation agentInfo2 = new AgentInformation();
-        agentInfo2.setAgentId("456");
-        agentInfo2.setAlive(true);
-
-        AgentInformation agentInfo3 = new AgentInformation();
-        agentInfo3.setAgentId("678");
-        agentInfo3.setAlive(true);
-        
-        // hosts
-        
-        HostInfo hostConfig1 = new HostInfo();
-        hostConfig1.setHostname("fluffhost1");
-        hostConfig1.setAgentId("123");
-
-        HostInfo hostConfig2 = new HostInfo();
-        hostConfig2.setHostname("fluffhost2");
-        hostConfig2.setAgentId("456");
-
-        HostInfo hostConfig3 = new HostInfo();
-        hostConfig3.setHostname("fluffhost3");
-        hostConfig3.setAgentId("678");
-
-        @SuppressWarnings("unchecked")
-        Cursor<HostInfo> cursor1 = mock(Cursor.class);
-        when(cursor1.hasNext()).thenReturn(true).thenReturn(false);
-        when(cursor1.next()).thenReturn(hostConfig1);
-
-        @SuppressWarnings("unchecked")
-        Cursor<HostInfo> cursor2 = mock(Cursor.class);
-        when(cursor2.hasNext()).thenReturn(true).thenReturn(false);
-        when(cursor2.next()).thenReturn(hostConfig2);
-
-        @SuppressWarnings("unchecked")
-        Cursor<HostInfo> cursor3 = mock(Cursor.class);
-        when(cursor3.hasNext()).thenReturn(true).thenReturn(false);
-        when(cursor3.next()).thenReturn(hostConfig3);
-
-        // storage
-        
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        when(query.execute()).thenReturn(cursor1).thenReturn(cursor2).thenReturn(cursor3);
-        
-        AgentInfoDAO agentDao = mock(AgentInfoDAO.class);
-        when(agentDao.getAliveAgents()).thenReturn(Arrays.asList(agentInfo1, agentInfo2, agentInfo3));
-
-        return new Pair<>(storage, agentDao);
-    }
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/dao/HostLatestPojoListGetterTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.util.List;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.model.CpuStat;
-
-public class HostLatestPojoListGetterTest {
-    private static final String AGENT_ID = "agentid";
-    private static final String HOSTNAME = "host.example.com";
-    private static final String CATEGORY_NAME = "hostcategory";
-    // Make this one static so we don't get IllegalStateException from trying
-    // to make category of same name while running tests in same classloader.
-    private static final Category<CpuStat> cat =  new Category<>(CATEGORY_NAME, CpuStat.class);
-
-    private static long t1 = 1;
-    private static long t2 = 5;
-    private static long t3 = 10;
-
-    private static Double load5_1 = 2.0;
-    private static Double load5_2 = 6.0;
-    private static Double load5_3 = 11.0;
-
-    private static Double load10_1 = 3.0;
-    private static Double load10_2 = 7.0;
-    private static Double load10_3 = 12.0;
-
-    private static Double load15_1 = 4.0;
-    private static Double load15_2 = 8.0;
-    private static Double load15_3 = 13.0;
-
-    private HostRef ref;
-    private CpuStat result1, result2, result3;
-
-    @Before
-    public void setUp() {
-        ref = new HostRef(AGENT_ID, HOSTNAME);
-        result1 = new CpuStat(t1, new double[] { load5_1, load10_1, load15_1 } );
-        result2 = new CpuStat(t2, new double[] { load5_2, load10_2, load15_2 } );
-        result3 = new CpuStat(t3, new double[] { load5_3, load10_3, load15_3 } );
-    }
-
-    @Test
-    public void testBuildQuery() {
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when (storage.createQuery(any(Category.class))).thenReturn(query);
-
-        HostLatestPojoListGetter<CpuStat> getter = new HostLatestPojoListGetter<>(storage, cat);
-        query = getter.buildQuery(ref, 123);
-
-        assertNotNull(query);
-        verify(storage).createQuery(cat);
-        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, 123l);
-        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
-        verify(query).sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
-        verifyNoMoreInteractions(query);
-    }
-
-    @Test
-    public void testBuildQueryPopulatesUpdateTimes() {
-        Storage storage = mock(Storage.class);
-        Query ignored = mock(Query.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(ignored).thenReturn(query);
-
-        HostLatestPojoListGetter<CpuStat> getter = new HostLatestPojoListGetter<>(storage, cat);
-        ignored = getter.buildQuery(ref,Long.MIN_VALUE); // Ignore first return value.
-
-        query = getter.buildQuery(ref, Long.MIN_VALUE);
-
-        assertNotNull(query);
-        verify(storage, times(2)).createQuery(cat);
-        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
-        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, Long.MIN_VALUE);
-        verify(query).sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
-        verifyNoMoreInteractions(query);
-    }
-
-    @Test
-    public void testGetLatest() {
-        @SuppressWarnings("unchecked")
-        Cursor<CpuStat> cursor = mock(Cursor.class);
-        when(cursor.hasNext()).thenReturn(true).thenReturn(true).thenReturn(false);
-        when(cursor.next()).thenReturn(result1).thenReturn(result2).thenReturn(null);
-
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        when(query.execute()).thenReturn(cursor);
-
-        HostLatestPojoListGetter<CpuStat> getter = new HostLatestPojoListGetter<>(storage, cat);
-
-        List<CpuStat> stats = getter.getLatest(ref, Long.MIN_VALUE);
-
-        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
-        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, Long.MIN_VALUE);
-
-        assertNotNull(stats);
-        assertEquals(2, stats.size());
-        CpuStat stat1 = stats.get(0);
-        assertEquals(t1, stat1.getTimeStamp());
-        assertArrayEquals(new double[] {load5_1, load10_1, load15_1}, stat1.getPerProcessorUsage(), 0.001);
-        CpuStat stat2 = stats.get(1);
-        assertEquals(t2, stat2.getTimeStamp());
-        assertArrayEquals(new double[] {load5_2, load10_2, load15_2}, stat2.getPerProcessorUsage(), 0.001);
-    }
-
-    @After
-    public void tearDown() {
-        ref = null;
-        result1 = null;
-        result2 = null;
-        result3 = null;
-    }
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/dao/MongoDAOFactoryTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.redhat.thermostat.storage.core.Connection;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.core.StorageProvider;
-import com.redhat.thermostat.test.StubBundleContext;
-
-public class MongoDAOFactoryTest {
-
-    private StubBundleContext bundleContext;
-    private Storage storage;
-    private Connection connection;
-    private StorageProvider provider;
-    private DAOFactory daoFactory;
-
-    @Before
-    public void setUp() {
-        bundleContext = new StubBundleContext();
-
-        storage = mock(Storage.class);
-        connection = mock(Connection.class);
-        when(storage.getConnection()).thenReturn(connection);
-        when(connection.isConnected()).thenReturn(true);
-        provider = mock(StorageProvider.class);
-        when(provider.createStorage()).thenReturn(storage);
-        daoFactory = new DAOFactoryImpl(bundleContext, provider);
-        ((DAOFactoryImpl)daoFactory).createDAOs();
-    }
-
-    @Test
-    public void testGetConnection() {
-        assertSame(storage, daoFactory.getStorage());
-    }
-
-    @Test
-    public void testGetAgentInfoDAO() {
-        AgentInfoDAO dao = daoFactory.getAgentInfoDAO();
-        assertNotNull(dao);
-    }
-
-    @Test
-    public void testGetBackendInfoDAO() {
-        BackendInfoDAO dao = daoFactory.getBackendInfoDAO();
-        assertNotNull(dao);
-    }
-
-    @Test
-    public void testGetVmInfoDAO() {
-        VmInfoDAO dao = daoFactory.getVmInfoDAO();
-        assertNotNull(dao);
-    }
-
-    @Test
-    public void testGetHostInfoDAO() {
-        HostInfoDAO dao = daoFactory.getHostInfoDAO();
-        assertNotNull(dao);
-    }
-
-    @Test
-    public void testGetNetworkInterfaceInfoDAO() {
-        NetworkInterfaceInfoDAO dao = daoFactory.getNetworkInterfaceInfoDAO();
-        assertNotNull(dao);
-    }
-
-    @Test
-    public void testServiceRegistration() {
-        assertEquals(0, bundleContext.getAllServices().size());
-
-        daoFactory.registerDAOsAndStorageAsOSGiServices();
-
-        // currently 6 DAOs and Storage are registered
-        assertEquals(6, bundleContext.getAllServices().size());
-    }
-
-    @Test
-    public void testServiceDeregistration() {
-        daoFactory.registerDAOsAndStorageAsOSGiServices();
-        daoFactory.unregisterDAOsAndStorageAsOSGiServices();
-
-        assertEquals(0, bundleContext.getAllServices().size());
-        assertEquals(0, bundleContext.getServiceListeners().size());
-    }
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/dao/NetworkInterfaceInfoDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.junit.Test;
-
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.core.Replace;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.model.NetworkInterfaceInfo;
-
-public class NetworkInterfaceInfoDAOTest {
-
-    private static final String INTERFACE_NAME = "some interface. maybe eth0";
-    private static final String IPV4_ADDR = "256.256.256.256";
-    private static final String IPV6_ADDR = "100:100:100::::1";
-
-    @Test
-    public void testCategory() {
-        Collection<Key<?>> keys;
-
-        assertEquals("network-info", NetworkInterfaceInfoDAO.networkInfoCategory.getName());
-        keys = NetworkInterfaceInfoDAO.networkInfoCategory.getKeys();
-        assertTrue(keys.contains(new Key<>("agentId", true)));
-        assertTrue(keys.contains(new Key<String>("interfaceName", true)));
-        assertTrue(keys.contains(new Key<String>("ip4Addr", false)));
-        assertTrue(keys.contains(new Key<String>("ip6Addr", false)));
-        assertEquals(4, keys.size());
-    }
-
-    @Test
-    public void testGetNetworkInterfaces() {
-
-        NetworkInterfaceInfo niInfo = new NetworkInterfaceInfo(INTERFACE_NAME);
-        niInfo.setIp4Addr(IPV4_ADDR);
-        niInfo.setIp6Addr(IPV6_ADDR);
-
-        @SuppressWarnings("unchecked")
-        Cursor<NetworkInterfaceInfo> cursor = mock(Cursor.class);
-        when(cursor.hasNext()).thenReturn(true).thenReturn(false);
-        when(cursor.next()).thenReturn(niInfo);
-
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        when(query.execute()).thenReturn(cursor);
-
-        HostRef hostRef = mock(HostRef.class);
-        when(hostRef.getAgentId()).thenReturn("system");
-
-        NetworkInterfaceInfoDAO dao = new NetworkInterfaceInfoDAOImpl(storage);
-        List<NetworkInterfaceInfo> netInfo = dao.getNetworkInterfaces(hostRef);
-
-        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, "system");
-        verify(query).execute();
-        verifyNoMoreInteractions(query);
-
-        assertEquals(1, netInfo.size());
-
-        NetworkInterfaceInfo info = netInfo.get(0);
-
-        assertEquals(INTERFACE_NAME, info.getInterfaceName());
-        assertEquals(IPV4_ADDR, info.getIp4Addr());
-        assertEquals(IPV6_ADDR, info.getIp6Addr());
-    }
-
-    @Test
-    public void testPutNetworkInterfaceInfo() {
-        Storage storage = mock(Storage.class);
-        Replace replace = mock(Replace.class);
-        when(storage.createReplace(any(Category.class))).thenReturn(replace);
-
-        NetworkInterfaceInfo info = new NetworkInterfaceInfo(INTERFACE_NAME);
-        info.setIp4Addr(IPV4_ADDR);
-        info.setIp6Addr(IPV6_ADDR);
-        NetworkInterfaceInfoDAO dao = new NetworkInterfaceInfoDAOImpl(storage);
-        dao.putNetworkInterfaceInfo(info);
-
-        verify(storage).createReplace(NetworkInterfaceInfoDAO.networkInfoCategory);
-        verify(replace).setPojo(info);
-        verify(replace).apply();
-    }
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/dao/QueryTestHelper.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-
-package com.redhat.thermostat.common.dao;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Remove;
-
-public class QueryTestHelper {
-
-    @SuppressWarnings("unchecked")
-    public static Remove createMockRemove() {
-        Remove mockRemove = mock(Remove.class);
-        when(mockRemove.from(any(Category.class))).thenReturn(mockRemove);
-        when(mockRemove.where(any(Key.class), any())).thenReturn(mockRemove);
-        return mockRemove;
-    }
-
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/dao/VmInfoDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,286 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Replace;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.core.Update;
-import com.redhat.thermostat.storage.model.VmInfo;
-
-public class VmInfoDAOTest {
-
-    private int vmId;
-    private long startTime;
-    private long stopTime;
-    private String jVersion;
-    private String jHome;
-    private String mainClass;
-    private String commandLine;
-    private String vmName;
-    private String vmInfo;
-    private String vmVersion;
-    private String vmArgs;
-    private Map<String, String> props;
-    private Map<String, String> env;
-    private String[] libs;
-
-    @Before
-    public void setUp() {
-        vmId = 1;
-        startTime = 2;
-        stopTime = 3;
-        jVersion = "java 1.0";
-        jHome = "/path/to/jdk/home";
-        mainClass = "Hello.class";
-        commandLine = "World";
-        vmArgs = "-XX=+FastestJITPossible";
-        vmName = "Hotspot";
-        vmInfo = "Some info";
-        vmVersion = "1.0";
-        props = new HashMap<>();
-        env = new HashMap<>();
-        libs = new String[0];
-    }
-
-    @Test
-    public void testCategory() {
-        assertEquals("vm-info", VmInfoDAO.vmInfoCategory.getName());
-        Collection<Key<?>> keys = VmInfoDAO.vmInfoCategory.getKeys();
-        assertTrue(keys.contains(new Key<>("agentId", true)));
-        assertTrue(keys.contains(new Key<Integer>("vmId", true)));
-        assertTrue(keys.contains(new Key<Integer>("vmPid", false)));
-        assertTrue(keys.contains(new Key<String>("javaVersion", false)));
-        assertTrue(keys.contains(new Key<String>("javaHome", false)));
-        assertTrue(keys.contains(new Key<String>("mainClass", false)));
-        assertTrue(keys.contains(new Key<String>("javaCommandLine", false)));
-        assertTrue(keys.contains(new Key<String>("vmArguments", false)));
-        assertTrue(keys.contains(new Key<String>("vmName", false)));
-        assertTrue(keys.contains(new Key<String>("vmInfo", false)));
-        assertTrue(keys.contains(new Key<String>("vmVersion", false)));
-        assertTrue(keys.contains(new Key<Map<String, String>>("properties", false)));
-        assertTrue(keys.contains(new Key<Map<String, String>>("environment", false)));
-        assertTrue(keys.contains(new Key<List<String>>("loadedNativeLibraries", false)));
-        assertTrue(keys.contains(new Key<Long>("startTimeStamp", false)));
-        assertTrue(keys.contains(new Key<Long>("stopTimeStamp", false)));
-        assertEquals(16, keys.size());
-    }
-
-    @Test
-    public void testGetVmInfo() {
-
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        VmInfo expected = new VmInfo(vmId, startTime, stopTime, jVersion, jHome, mainClass, commandLine, vmName, vmInfo, vmVersion, vmArgs, props, env, libs);
-        Cursor cursor = mock(Cursor.class);
-        when(cursor.hasNext()).thenReturn(true).thenReturn(false);
-        when(cursor.next()).thenReturn(expected).thenReturn(null);
-        when(query.execute()).thenReturn(cursor);
-
-        HostRef hostRef = mock(HostRef.class);
-        when(hostRef.getAgentId()).thenReturn("system");
-
-        VmRef vmRef = mock(VmRef.class);
-        when(vmRef.getAgent()).thenReturn(hostRef);
-        when(vmRef.getId()).thenReturn(321);
-
-        VmInfoDAO dao = new VmInfoDAOImpl(storage);
-        VmInfo info = dao.getVmInfo(vmRef);
-        assertEquals(expected, info);
-    }
-
-    @Test
-    public void testGetVmInfoUnknownVM() {
-
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        Cursor cursor = mock(Cursor.class);
-        when(query.execute()).thenReturn(cursor);
-        
-        HostRef hostRef = mock(HostRef.class);
-        when(hostRef.getAgentId()).thenReturn("system");
-
-        VmRef vmRef = mock(VmRef.class);
-        when(vmRef.getAgent()).thenReturn(hostRef);
-        when(vmRef.getId()).thenReturn(321);
-
-        VmInfoDAO dao = new VmInfoDAOImpl(storage);
-        try {
-            dao.getVmInfo(vmRef);
-            fail();
-        } catch (DAOException ex) {
-            assertEquals("Unknown VM: host:system;vm:321", ex.getMessage());
-        }
-
-    }
-
-    @Test
-    public void testSingleVM() {
-        Storage storage = setupStorageForSingleVM();
-        VmInfoDAO dao = new VmInfoDAOImpl(storage);
-        HostRef host = new HostRef("123", "fluffhost");
-
-        Collection<VmRef> vms = dao.getVMs(host);
-
-        assertCollection(vms, new VmRef(host, 123, "mainClass1"));
-    }
-
-    private Storage setupStorageForSingleVM() {
-
-      VmInfo vm1 = new VmInfo();
-      vm1.setVmPid(123);
-      vm1.setMainClass("mainClass1");
-
-      @SuppressWarnings("unchecked")
-      Cursor<VmInfo> singleVMCursor = mock(Cursor.class);
-      when(singleVMCursor.hasNext()).thenReturn(true).thenReturn(false);
-      when(singleVMCursor.next()).thenReturn(vm1);
-
-      Storage storage = mock(Storage.class);
-      Query query = mock(Query.class);
-      when(storage.createQuery(any(Category.class))).thenReturn(query);
-      when(query.execute()).thenReturn(singleVMCursor);
-      return storage;
-  }
-
-    @Test
-    public void testMultiVMs() {
-        Storage storage = setupStorageForMultiVM();
-        VmInfoDAO dao = new VmInfoDAOImpl(storage);
-
-        HostRef host = new HostRef("456", "fluffhost");
-
-        Collection<VmRef> vms = dao.getVMs(host);
-
-        assertCollection(vms, new VmRef(host, 123, "mainClass1"), new VmRef(host, 456, "mainClass2"));
-    }
-
-    private Storage setupStorageForMultiVM() {
-
-      VmInfo vm1 = new VmInfo();
-      vm1.setVmPid(123);
-      vm1.setMainClass("mainClass1");
-
-      VmInfo vm2 = new VmInfo();
-      vm2.setVmPid(456);
-      vm2.setMainClass("mainClass2");
-
-      @SuppressWarnings("unchecked")
-      Cursor<VmInfo> multiVMsCursor = mock(Cursor.class);
-      when(multiVMsCursor.hasNext()).thenReturn(true).thenReturn(true).thenReturn(false);
-      when(multiVMsCursor.next()).thenReturn(vm1).thenReturn(vm2);
-
-      Storage storage = mock(Storage.class);
-      Query query = mock(Query.class);
-      when(storage.createQuery(any(Category.class))).thenReturn(query);
-      when(query.execute()).thenReturn(multiVMsCursor);
-      return storage;
-  }
-
-    private void assertCollection(Collection<VmRef> vms, VmRef... expectedVMs) {
-        assertEquals(expectedVMs.length, vms.size());
-        for (VmRef expectedVM : expectedVMs) {
-            assertTrue(vms.contains(expectedVM));
-        }
-    }
-
-    @Test
-    public void testGetCount() {
-        Storage storage = mock(Storage.class);
-        when(storage.getCount(any(Category.class))).thenReturn(5L);
-        VmInfoDAO dao = new VmInfoDAOImpl(storage);
-        Long count = dao.getCount();
-        assertEquals((Long) 5L, count);
-    }
-
-    @Test
-    public void testPutVmInfo() {
-
-        Storage storage = mock(Storage.class);
-        Replace replace = mock(Replace.class);
-        when(storage.createReplace(any(Category.class))).thenReturn(replace);
-
-        VmInfo info = new VmInfo(vmId, startTime, stopTime, jVersion, jHome,
-                mainClass, commandLine, vmName, vmInfo, vmVersion, vmArgs,
-                props, env, libs);
-        VmInfoDAO dao = new VmInfoDAOImpl(storage);
-        dao.putVmInfo(info);
-
-        verify(storage).createReplace(VmInfoDAO.vmInfoCategory);
-        verify(replace).setPojo(info);
-        verify(replace).apply();
-    }
-
-    @Test
-    public void testPutVmStoppedTime() {
-        Update mockUpdate = mock(Update.class);
-        Storage storage = mock(Storage.class);
-        when(storage.createUpdate(any(Category.class))).thenReturn(mockUpdate);
-
-        VmInfoDAO dao = new VmInfoDAOImpl(storage);
-        dao.putVmStoppedTime(vmId, stopTime);
-
-        verify(storage).createUpdate(VmInfoDAO.vmInfoCategory);
-        verify(mockUpdate).where(Key.VM_ID, 1);
-        verify(mockUpdate).set(VmInfoDAO.stopTimeKey, 3L);
-        verify(mockUpdate).apply();
-        verifyNoMoreInteractions(mockUpdate);
-    }
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/dao/VmLatestPojoListGetterTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.dao;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.util.List;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.redhat.thermostat.storage.core.Category;
-import com.redhat.thermostat.storage.core.Cursor;
-import com.redhat.thermostat.storage.core.Key;
-import com.redhat.thermostat.storage.core.Query;
-import com.redhat.thermostat.storage.core.Query.Criteria;
-import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.storage.model.VmClassStat;
-
-public class VmLatestPojoListGetterTest {
-    private static final String AGENT_ID = "agentid";
-    private static final String HOSTNAME = "host.example.com";
-    private static final int VM_PID = 123;
-    private static final String MAIN_CLASS = "Foo.class";
-    private static final String CATEGORY_NAME = "vmcategory";
-    // Make this one static so we don't get IllegalStateException from trying
-    // to make category of same name while running tests in same classloader.
-    private static final Category<VmClassStat> cat =  new Category<>(CATEGORY_NAME, VmClassStat.class);
-
-    private static long t1 = 1;
-    private static long t2 = 5;
-    private static long t3 = 10;
-
-    private static long lc1 = 10;
-    private static long lc2 = 20;
-    private static long lc3 = 30;
-
-    private HostRef hostRef;
-    private VmRef vmRef;
-    private VmClassStat result1, result2, result3;
-
-    @Before
-    public void setUp() {
-        hostRef = new HostRef(AGENT_ID, HOSTNAME);
-        vmRef = new VmRef(hostRef, VM_PID, MAIN_CLASS);
-        result1 = new VmClassStat(VM_PID, t1, lc1);
-        result2 = new VmClassStat(VM_PID, t2, lc2);
-        result3 = new VmClassStat(VM_PID, t3, lc3);
-    }
-
-    @Test
-    public void testBuildQuery() {
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-
-        VmLatestPojoListGetter<VmClassStat> getter = new VmLatestPojoListGetter<>(storage, cat);
-        query = getter.buildQuery(vmRef, 123l);
-
-        assertNotNull(query);
-        verify(storage).createQuery(cat);
-        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
-        verify(query).where(Key.VM_ID, Criteria.EQUALS, VM_PID);
-        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, 123l);
-        verify(query).sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
-        verifyNoMoreInteractions(query);
-    }
-
-    @Test
-    public void testBuildQueryPopulatesUpdateTimes() {
-        Storage storage = mock(Storage.class);
-        Query ignored = mock(Query.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(ignored).thenReturn(query);
-
-        VmLatestPojoListGetter<VmClassStat> getter = new VmLatestPojoListGetter<>(storage, cat);
-        getter.buildQuery(vmRef, Long.MIN_VALUE); // Ignore first return value.
-        query = getter.buildQuery(vmRef, Long.MIN_VALUE);
-
-        assertNotNull(query);
-        verify(storage, times(2)).createQuery(cat);
-        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
-        verify(query).where(Key.VM_ID, Criteria.EQUALS, VM_PID);
-        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, Long.MIN_VALUE);
-        verify(query).sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
-        verifyNoMoreInteractions(query);
-    }
-
-    @Test
-    public void testGetLatest() {
-        @SuppressWarnings("unchecked")
-        Cursor<VmClassStat> cursor = mock(Cursor.class);
-        when(cursor.hasNext()).thenReturn(true).thenReturn(true).thenReturn(false);
-        when(cursor.next()).thenReturn(result1).thenReturn(result2).thenReturn(null);
-
-        Storage storage = mock(Storage.class);
-        Query query = mock(Query.class);
-        when(storage.createQuery(any(Category.class))).thenReturn(query);
-        when(query.execute()).thenReturn(cursor);
-
-        VmLatestPojoListGetter<VmClassStat> getter = new VmLatestPojoListGetter<>(storage, cat);
-
-        List<VmClassStat> stats = getter.getLatest(vmRef, t2);
-
-        verify(storage).createQuery(cat);
-        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
-        verify(query).where(Key.VM_ID, Criteria.EQUALS, VM_PID);
-        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, t2);
-        verify(query).sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
-        verify(query).execute();
-        verifyNoMoreInteractions(query);
-
-        assertNotNull(stats);
-        assertEquals(2, stats.size());
-        VmClassStat stat1 = stats.get(0);
-        assertEquals(t1, stat1.getTimeStamp());
-        assertEquals(lc1, stat1.getLoadedClasses());
-        VmClassStat stat2 = stats.get(1);
-        assertEquals(t2, stat2.getTimeStamp());
-        assertEquals(lc2, stat2.getLoadedClasses());
-    }
-
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/internal/DbServiceTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.internal;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.ServiceReference;
-
-import com.redhat.thermostat.common.DbService;
-import com.redhat.thermostat.common.dao.DAOFactory;
-import com.redhat.thermostat.storage.core.Connection;
-import com.redhat.thermostat.test.StubBundleContext;
-
-public class DbServiceTest {
-    
-    private Connection connection;
-    private DAOFactory daoFactory;
-    private DbService dbService;
-    private StubBundleContext context;
-    
-    @Before
-    public void setup() {
-        context = new StubBundleContext();
-        connection = mock(Connection.class);
-
-        daoFactory = mock(DAOFactory.class);
-        when(daoFactory.getConnection()).thenReturn(connection);
-
-        dbService = new DbServiceImpl(context, daoFactory, "http://someUrl.ignored.com");
-    }
-    
-    @After
-    public void teardown() {
-        dbService = null;
-        context = null;
-    }
-
-    @Test
-    public void testConnect() {
-        dbService.connect();
-
-        verify(connection).connect();
-        verify(daoFactory).registerDAOsAndStorageAsOSGiServices();
-    }
-    
-    @Test
-    public void testConnectRegistersDbService() {
-        dbService.connect();
-
-        verify(connection).connect();
-        @SuppressWarnings("rawtypes")
-        ServiceReference dbServiceRef = context.getServiceReference(DbService.class);
-        // connect registers DbService
-        assertNotNull(dbServiceRef);
-        // make sure we really get the same instance
-        assertTrue(dbService.equals(context.getService(dbServiceRef)));
-        verify(daoFactory).registerDAOsAndStorageAsOSGiServices();
-    }
-
-    @Test
-    public void testDisconnect() {
-        dbService.connect();
-        assertNotNull(context.getServiceReference(DbService.class));
-        
-        dbService.disconnect();
-
-        verify(daoFactory).unregisterDAOsAndStorageAsOSGiServices();
-        verify(connection).disconnect();
-    }
-
-    @Test
-    public void testDisconnectUnregistersService() {
-        dbService.connect();
-        assertNotNull(context.getServiceReference(DbService.class));
-        
-        dbService.disconnect();
-
-        verify(daoFactory).unregisterDAOsAndStorageAsOSGiServices();
-        verify(connection).disconnect();
-        // disconnect unregisters DbService
-        assertNull(context.getServiceReference(DbService.class));
-    }
-    
-    @Test
-    public void canGetStorageUrl() {
-        String connectionURL = "http://test.example.com:8082";
-
-        dbService = new DbServiceImpl(context, null, connectionURL);
-        assertEquals(connectionURL, dbService.getConnectionUrl());
-    }
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/common/tools/BasicCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.common.tools;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.apache.commons.cli.Options;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.redhat.thermostat.common.cli.CommandContext;
-import com.redhat.thermostat.common.cli.CommandException;
-import com.redhat.thermostat.common.tools.BasicCommand;
-import com.redhat.thermostat.storage.config.StartupConfiguration;
-
-public class BasicCommandTest {
-
-    private BasicCommand application;
-
-    @Before
-    public void setUp() {
-        application = new BasicCommand() {
-
-            @Override
-            public void run(CommandContext ctx) throws CommandException {
-                // Nothing to do here.
-            }
-
-            @Override
-            public String getName() {
-                return null;
-            }
-
-            @Override
-            public String getDescription() {
-                return null;
-            }
-
-            @Override
-            public String getUsage() {
-                return null;
-            }
-
-            @Override
-            public StartupConfiguration getConfiguration() {
-                return null;
-            }
-
-            @Override
-            public Options getOptions() {
-                return new Options();
-            }
-
-            @Override
-            public boolean isStorageRequired() {
-                return false;
-            }
-        };
-    }
-
-    @After
-    public void tearDown() {
-        application = null;
-    }
-
-    @Test
-    public void testNotfier() {
-        assertNotNull(application.getNotifier());
-    }
-}
-
--- a/common/core/src/test/java/com/redhat/thermostat/test/StubBundleContextTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,574 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING. If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code. Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module. An independent module is a module
- * which is not derived from or based on this code. If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so. If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.test;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.atLeast;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-
-import java.io.ByteArrayInputStream;
-import java.util.Collection;
-import java.util.Hashtable;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.BundleListener;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Filter;
-import org.osgi.framework.FrameworkListener;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-
-import com.redhat.thermostat.common.NotImplementedException;
-import com.redhat.thermostat.test.StubBundleContext.ServiceInformation;
-
-/**
- * Test that StubBundleContext behaves like a BundleContext, based on what is
- * specified in the OSGi spec. Other optional methods to help in testing are
- * great, but adherence to spec is most important.
- */
-public class StubBundleContextTest {
-
-    private StubBundleContext bundleContext;
-
-    @Before
-    public void setUp() {
-        bundleContext = new StubBundleContext();
-        assertNotNull(bundleContext);
-    }
-
-    @Test
-    public void testSetAndGetContextBundle() {
-        assertEquals(null, bundleContext.getBundle());
-
-        Bundle bundle = mock(Bundle.class);
-        bundleContext.setBundle(bundle);
-        assertSame(bundle, bundleContext.getBundle());
-    }
-
-    @Test(expected = NotImplementedException.class)
-    public void testInstallBundleFromLocation() throws BundleException {
-        bundleContext.installBundle("");
-    }
-
-    @Test(expected = NotImplementedException.class)
-    public void testInstallBundleFromInputStream() throws BundleException {
-        bundleContext.installBundle("", new ByteArrayInputStream(new byte[0]));
-    }
-
-    @Test
-    public void testSetAndGetBundles() {
-        assertEquals(null, bundleContext.getBundle(0));
-
-        Bundle systemBundle = mock(Bundle.class);
-        bundleContext.setBundle(0, systemBundle);
-
-        assertEquals(systemBundle, bundleContext.getBundle(0));
-
-        assertArrayEquals(new Bundle[] { systemBundle }, bundleContext.getBundles());
-    }
-
-    @Test(expected = NotImplementedException.class)
-    public void testGetBundleByLargeId() {
-        bundleContext.getBundle(Long.MAX_VALUE);
-    }
-
-    @Test(expected = NotImplementedException.class)
-    public void testGetBundleByLocation() {
-        bundleContext.getBundle("");
-    }
-
-    @Test
-    public void testAddRemoveFrameworkListener() {
-        try {
-            bundleContext.addFrameworkListener(mock(FrameworkListener.class));
-            fail("not expected");
-        } catch (NotImplementedException notImplemented) {
-            /* okay: expected */
-        }
-
-        try {
-            bundleContext.removeFrameworkListener(mock(FrameworkListener.class));
-            fail("not expected");
-        } catch (NotImplementedException notImplemented) {
-            /* okay: expected */
-        }
-    }
-
-    @Test
-    public void testAddRemoveBundleListener() {
-        try {
-            bundleContext.addBundleListener(mock(BundleListener.class));
-            fail("not expected");
-        } catch (NotImplementedException notImplemented) {
-            /* okay: expected */
-        }
-
-        try {
-            bundleContext.removeBundleListener(mock(BundleListener.class));
-            fail("not expected");
-        } catch (NotImplementedException notImplemented) {
-            /* okay: expected */
-        }
-    }
-
-    @Test
-    public void testGetPropertyDelegatesToSystemProperties() {
-        assertEquals(System.getProperty("user.name"), bundleContext.getProperty("user.name"));
-    }
-
-    @Test
-    public void testGetAndSetProperty() {
-        final String PROPERTY_NAME = "foo.bar.baz";
-        final String PROPERTY_NEW_VALUE = "spam.eggs";
-
-        assertEquals(null, bundleContext.getProperty(PROPERTY_NAME));
-
-        bundleContext.setProperty(PROPERTY_NAME, PROPERTY_NEW_VALUE);
-
-        assertEquals(PROPERTY_NEW_VALUE, bundleContext.getProperty(PROPERTY_NAME));
-    }
-
-    @Test
-    public void testFilterCreationReturnsASaneFilter() throws InvalidSyntaxException {
-        Filter filter = bundleContext.createFilter("(foo=bar)");
-        assertNotNull(filter);
-
-        Hashtable<String, String> dict = new Hashtable<>();
-        dict.put("foo", "bar");
-
-        assertTrue(filter.match(dict));
-    }
-
-    @Test
-    public void testAddRemoveService() {
-        TestService service = mock(TestService.class);
-
-        assertEquals(0, bundleContext.getAllServices().size());
-        assertFalse(bundleContext.isServiceRegistered(TestService.class.getName(), service.getClass()));
-
-        ServiceRegistration registration = bundleContext.registerService(TestService.class, service, null);
-
-        assertEquals(1, bundleContext.getAllServices().size());
-        assertTrue(bundleContext.isServiceRegistered(TestService.class.getName(), service.getClass()));
-
-        registration.unregister();
-
-        assertEquals(0, bundleContext.getAllServices().size());
-        assertFalse(bundleContext.isServiceRegistered(TestService.class.getName(), service.getClass()));
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void testAddServiceThatDoesNotImplementInterfaceClass() {
-        AnotherTestService service = mock(AnotherTestService.class);
-
-        bundleContext.registerService(TestService.class.getName(), service, null);
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void testAddServiceThatDoesNotImplementInterfaceClass2() {
-        AnotherTestService service = mock(AnotherTestService.class);
-
-        bundleContext.registerService("foo.bar.Baz", service, null);
-    }
-
-    @Test
-    public void testAddServiceWithProperties() {
-        TestService service = mock(TestService.class);
-
-        Hashtable props = new Hashtable();
-        props.put(Constants.SERVICE_ID, -10);
-        props.put(Constants.SERVICE_RANKING, 10);
-        props.put(Constants.OBJECTCLASS, AnotherTestService.class.getName());
-
-        ServiceRegistration reg = bundleContext.registerService(TestService.class, service, props);
-
-        ServiceReference serviceRef = reg.getReference();
-
-        assertArrayEquals(new String[] { TestService.class.getName() },
-                (String[]) serviceRef.getProperty(Constants.OBJECTCLASS));
-
-        assertEquals(10, serviceRef.getProperty(Constants.SERVICE_RANKING));
-        assertEquals(0, serviceRef.getProperty(Constants.SERVICE_ID));
-    }
-
-    @Test
-    public void testAddServiceWithNonIntegerRanking() {
-        TestService service = mock(TestService.class);
-
-        Hashtable props = new Hashtable();
-        props.put(Constants.SERVICE_RANKING, new Object());
-
-        ServiceRegistration reg = bundleContext.registerService(TestService.class, service, props);
-
-        ServiceReference serviceRef = reg.getReference();
-
-        assertEquals(0, serviceRef.getProperty(Constants.SERVICE_RANKING));
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void testRemoveUnknownService() {
-        bundleContext.removeService(new ServiceInformation(mock(TestService.class), new Hashtable()));
-    }
-
-    @Test
-    public void testAddingAndRemovingListenerWorks() {
-        assertEquals(0, bundleContext.getServiceListeners().size());
-
-        ServiceListener listener = mock(ServiceListener.class);
-
-        bundleContext.addServiceListener(listener);
-
-        assertEquals(1, bundleContext.getServiceListeners().size());
-        assertEquals(listener, bundleContext.getServiceListeners().toArray()[0]);
-
-        bundleContext.removeServiceListener(listener);
-
-        assertEquals(0, bundleContext.getServiceListeners().size());
-    }
-
-    @Test
-    public void testAddingSameListenerReplacedTheOldOne() {
-        assertEquals(0, bundleContext.getServiceListeners().size());
-
-        ServiceListener listener = mock(ServiceListener.class);
-
-        bundleContext.addServiceListener(listener);
-
-        assertEquals(1, bundleContext.getServiceListeners().size());
-
-        bundleContext.addServiceListener(listener);
-
-        assertEquals(1, bundleContext.getServiceListeners().size());
-    }
-
-    @Test
-    public void testRemovingAnUnknownListenerIsANoOp() {
-        ServiceListener listener = mock(ServiceListener.class);
-        bundleContext.addServiceListener(listener);
-        assertEquals(1, bundleContext.getServiceListeners().size());
-
-        ServiceListener unknownListener = mock(ServiceListener.class);
-        bundleContext.removeServiceListener(unknownListener);
-
-        assertEquals(1, bundleContext.getServiceListeners().size());
-    }
-
-    @Test
-    public void testServiceListenersWithoutFiltersWork() {
-        ServiceListener listener = mock(ServiceListener.class);
-        bundleContext.addServiceListener(listener);
-
-        bundleContext.registerService(TestService.class, mock(TestService.class), null);
-
-        assertListenerRecievedRegisteredEvent(listener);
-    }
-
-    @Test
-    public void testServiceListenersWithFiltersWork() throws InvalidSyntaxException {
-        ServiceListener specificListener = mock(ServiceListener.class);
-        String specificFilter = "(" + Constants.OBJECTCLASS + "=" + TestService.class.getName() + ")";
-        bundleContext.addServiceListener(specificListener, specificFilter);
-
-        ServiceListener allListener = mock(ServiceListener.class);
-        String allListenerFilter = "(" + Constants.OBJECTCLASS + "=*)";
-        bundleContext.addServiceListener(allListener, allListenerFilter);
-
-        ServiceListener otherListener = mock(ServiceListener.class);
-        String otherListenerFilter = "(" + Constants.OBJECTCLASS + "=foo.bar.Baz)";
-        bundleContext.addServiceListener(otherListener, otherListenerFilter);
-
-        ServiceRegistration registration = bundleContext.registerService(TestService.class, mock(TestService.class), null);
-
-        assertListenerRecievedRegisteredEvent(specificListener);
-        assertListenerRecievedRegisteredEvent(allListener);
-
-        registration.unregister();
-
-        assertListenerRecievedUnregisteringEvent(specificListener);
-        assertListenerRecievedUnregisteringEvent(allListener);
-
-        verify(otherListener, never()).serviceChanged(isA(ServiceEvent.class));
-
-    }
-
-    private void assertListenerRecievedRegisteredEvent(ServiceListener listener) {
-        ArgumentCaptor<ServiceEvent> eventCaptor = ArgumentCaptor.forClass(ServiceEvent.class);
-        verify(listener).serviceChanged(eventCaptor.capture());
-        assertEquals(1, eventCaptor.getAllValues().size());
-        ServiceEvent event = eventCaptor.getValue();
-        assertEquals(ServiceEvent.REGISTERED, event.getType());
-        ServiceReference ref = event.getServiceReference();
-        assertTrue(ref instanceof StubServiceReference);
-    }
-
-    private void assertListenerRecievedUnregisteringEvent(ServiceListener listener) {
-        ArgumentCaptor<ServiceEvent> eventCaptor = ArgumentCaptor.forClass(ServiceEvent.class);
-        verify(listener, atLeast(1)).serviceChanged(eventCaptor.capture());
-
-        ServiceEvent event = eventCaptor.getValue();
-        assertEquals(ServiceEvent.UNREGISTERING, event.getType());
-        ServiceReference ref = event.getServiceReference();
-        assertTrue(ref instanceof StubServiceReference);
-    }
-
-    @Test
-    public void testGetServiceReferenceReturnsNullForNoMatch() {
-        assertNull(bundleContext.getServiceReference(TestService.class));
-    }
-
-    @Test
-    public void testGetServiceReferenceReturnsServiceWithHighestServiceRanking() {
-        TestService service1 = mock(TestService.class);
-        TestService service2 = mock(TestService.class);
-
-        Hashtable service2Props = new Hashtable();
-        service2Props.put(Constants.SERVICE_RANKING, 1000);
-
-        bundleContext.registerService(TestService.class, service1, null);
-        bundleContext.registerService(TestService.class, service2, service2Props);
-
-        ServiceReference ref = bundleContext.getServiceReference(TestService.class);
-
-        assertSame(service2, bundleContext.getService(ref));
-    }
-
-    @Test
-    public void testGetServiceReferenceReturnsServiceWithLowerServiceId() {
-        TestService service1 = mock(TestService.class);
-        TestService service2 = mock(TestService.class);
-
-        bundleContext.registerService(TestService.class, service1, null);
-        bundleContext.registerService(TestService.class, service2, null);
-
-        ServiceReference ref = bundleContext.getServiceReference(TestService.class);
-
-        assertSame(service1, bundleContext.getService(ref));
-    }
-
-    @Test
-    public void testGetServiceReferences() throws InvalidSyntaxException {
-        TestService service = mock(TestService.class);
-
-        bundleContext.registerService(TestService.class, service, null);
-        bundleContext.registerService(AnotherTestService.class, mock(AnotherTestService.class), null);
-
-        Collection refs = bundleContext.getServiceReferences(TestService.class, null);
-
-        assertEquals(1, refs.size());
-        assertEquals(service, ((StubServiceReference) refs.toArray()[0]).getInformation().implementation);
-    }
-
-    @Test
-    public void testGetAllServiceReferencesNoMatch() throws InvalidSyntaxException {
-        TestService service = mock(TestService.class);
-
-        bundleContext.registerService(TestService.class, service, null);
-        bundleContext.registerService(TestService.class, mock(TestService.class), null);
-
-        ServiceReference[] refs = bundleContext.getAllServiceReferences(AnotherTestService.class.getName(), null);
-
-        assertEquals(null, (Object) refs);
-    }
-
-    @Test
-    public void testGetAllServiceReferencesWithoutFilter() throws InvalidSyntaxException {
-        TestService service = mock(TestService.class);
-
-        bundleContext.registerService(TestService.class, service, null);
-        bundleContext.registerService(AnotherTestService.class, mock(AnotherTestService.class), null);
-
-        ServiceReference[] refs = bundleContext.getAllServiceReferences(TestService.class.getName(), null);
-
-        assertEquals(1, refs.length);
-        assertEquals(service, ((StubServiceReference) refs[0]).getInformation().implementation);
-    }
-
-    @Test
-    public void testGetAllServiceReferencesWithFilter() throws InvalidSyntaxException {
-        TestService service = mock(TestService.class);
-
-        bundleContext.registerService(TestService.class, service, null);
-        bundleContext.registerService(AnotherTestService.class, mock(AnotherTestService.class), null);
-
-        String filter = "(" + Constants.OBJECTCLASS + "=" + TestService.class.getName() + ")";
-        ServiceReference[] refs = bundleContext.getAllServiceReferences(TestService.class.getName(), filter);
-
-        assertEquals(1, refs.length);
-        assertEquals(service, ((StubServiceReference) refs[0]).getInformation().implementation);
-    }
-
-    @Test
-    public void testGetAllServiceReferencesWithNoClassNameJustFilter() throws InvalidSyntaxException {
-        TestService service = mock(TestService.class);
-
-        bundleContext.registerService(TestService.class, service, null);
-        bundleContext.registerService(AnotherTestService.class, mock(AnotherTestService.class), null);
-
-        String filter = "(" + Constants.OBJECTCLASS + "=" + TestService.class.getName() + ")";
-        ServiceReference[] refs = bundleContext.getAllServiceReferences(null, filter);
-
-        assertEquals(1, refs.length);
-        assertEquals(service, ((StubServiceReference) refs[0]).getInformation().implementation);
-    }
-
-    @Test
-    public void testGetServiceUsingClassObject() {
-        TestService service = mock(TestService.class);
-
-        bundleContext.registerService(TestService.class, service, null);
-
-        ServiceReference ref = bundleContext.getServiceReference(TestService.class);
-        assertNotNull(ref);
-
-        Object returnedService = bundleContext.getService(ref);
-
-        assertSame(service, returnedService);
-    }
-
-    @Test
-    public void testGetServiceUsingClassName() {
-        TestService service = mock(TestService.class);
-
-        bundleContext.registerService(TestService.class, service, null);
-
-        ServiceReference ref = bundleContext.getServiceReference(TestService.class.getName());
-        assertNotNull(ref);
-
-        Object returnedService = bundleContext.getService(ref);
-
-        assertSame(service, returnedService);
-    }
-
-    @Test
-    public void testUngetService() {
-        bundleContext.registerService(TestService.class, mock(TestService.class), null);
-
-        ServiceReference ref = bundleContext.getServiceReference(TestService.class.getName());
-        Object returnedService = bundleContext.getService(ref);
-
-        assertTrue(bundleContext.ungetService(ref));
-
-        assertFalse(bundleContext.ungetService(ref));
-    }
-
-    @Test
-    public void testUngetServiceOnUnregisteredService() {
-        ServiceRegistration registration = bundleContext.registerService(TestService.class, mock(TestService.class), null);
-
-        ServiceReference ref = bundleContext.getServiceReference(TestService.class.getName());
-        Object returnedService = bundleContext.getService(ref);
-
-        registration.unregister();
-
-        assertFalse(bundleContext.ungetService(ref));
-    }
-
-    @Test
-    public void testReferenceExportCountIsCorrect() {
-        TestService service = mock(TestService.class);
-
-        ServiceRegistration reg = bundleContext.registerService(TestService.class, service, null);
-
-        ServiceReference ref = bundleContext.getServiceReference(TestService.class);
-        assertNotNull(ref);
-
-        assertEquals(0, bundleContext.getExportedServiceCount(reg));
-
-        Object returnedService = bundleContext.getService(ref);
-
-        assertEquals(1, bundleContext.getExportedServiceCount(reg));
-
-        bundleContext.ungetService(ref);
-
-        assertEquals(0, bundleContext.getExportedServiceCount(reg));
-    }
-
-    @Test(expected = NotImplementedException.class)
-    public void testGetDataFile() {
-        bundleContext.getDataFile("");
-    }
-
-    @Test
-    public void testIsServiceRegisteredForRegisteredService() {
-        ComplexService service = mock(ComplexService.class);
-
-        String[] ifaces = new String[] { TestService.class.getName(), AnotherTestService.class.getName() };
-        ServiceRegistration reg = bundleContext.registerService(ifaces, service, null);
-
-        assertTrue(bundleContext.isServiceRegistered(AnotherTestService.class.getName(), service.getClass()));
-
-    }
-
-    @Test
-    public void testIsServiceRegisteredForUnregisteredService() {
-        ComplexService service = mock(ComplexService.class);
-        TestService someOtherService = mock(TestService.class);
-
-        String[] ifaces = new String[] { TestService.class.getName(), AnotherTestService.class.getName() };
-        ServiceRegistration reg = bundleContext.registerService(ifaces, service, null);
-
-        assertFalse(bundleContext.isServiceRegistered(AnotherTestService.class.getName(), someOtherService.getClass()));
-    }
-
-    /*
-     * Dummy service interfaces
-     */
-
-    static interface TestService { /* just a marker */}
-
-    static interface AnotherTestService { /* just a marker */}
-
-    static interface ComplexService extends TestService, AnotherTestService { /* ditto */}
-}
-
--- a/common/test/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/common/test/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -53,13 +53,17 @@
 
   <dependencies>
     <dependency>
-      <groupId>com.redhat.thermostat</groupId>
-      <artifactId>thermostat-common-core</artifactId>
-      <version>${project.version}</version>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.framework</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
     </dependency>
   </dependencies>
   
@@ -74,8 +78,7 @@
             <Bundle-Vendor>Red Hat, Inc.</Bundle-Vendor>
             <Bundle-SymbolicName>com.redhat.thermostat.common.test</Bundle-SymbolicName>
             <Export-Package>
-              com.redhat.thermostat.test.cli,
-              com.redhat.thermostat.test.locale
+              com.redhat.thermostat.testutils
             </Export-Package>
             <!-- Do not autogenerate uses clauses in Manifests -->
             <_nouses>true</_nouses>
--- a/common/test/src/main/java/com/redhat/thermostat/test/cli/TestCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.test.cli;
-
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-
-import com.redhat.thermostat.common.cli.Command;
-import com.redhat.thermostat.common.cli.CommandContext;
-import com.redhat.thermostat.common.cli.CommandException;
-
-
-public class TestCommand implements Command {
-
-    private String name;
-    private Handle handle;
-    private String description;
-    private String usage;
-    private boolean storageRequired;
-    private boolean availableInShell = true;
-    private boolean availableOutsideShell = true;
-
-    private Options options = new Options();
-
-    public static interface Handle {
-        public void run(CommandContext ctx) throws CommandException;
-    }
-
-    public TestCommand(String name) {
-        this(name, null);
-    }
-
-    public TestCommand(String name, Handle r) {
-        this.name = name;
-        this.handle = r;
-    }
-
-    @Override
-    public void run(CommandContext ctx) throws CommandException {
-        if (handle != null) {
-            handle.run(ctx);
-        }
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String desc) {
-        description = desc;
-    }
-
-    @Override
-    public String getUsage() {
-        return usage;
-    }
-
-    public void setUsage(String usage) {
-        this.usage = usage;
-    }
-
-    @Override
-    public Options getOptions() {
-        return options;
-    }
-
-    public void addOptions(Option... options) {
-        for (Option option : options) {
-            this.options.addOption(option);
-        }
-    }
-
-    @Override
-    public boolean isStorageRequired() {
-        return storageRequired;
-    }
-
-    public void setStorageRequired(boolean storageRequired) {
-        this.storageRequired = storageRequired;
-    }
-
-    @Override
-    public boolean isAvailableInShell() {
-        return availableInShell;
-    }
-
-    void setAvailableInShell(boolean avaiable) {
-        this.availableInShell = avaiable;
-    }
-
-    @Override
-    public boolean isAvailableOutsideShell() {
-        return availableOutsideShell;
-    }
-
-    void setAvailableOutsideShell(boolean available) {
-        this.availableOutsideShell = available;
-    }
-}
-
--- a/common/test/src/main/java/com/redhat/thermostat/test/locale/AbstractLocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.test.locale;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public abstract class AbstractLocaleResourcesTest<T extends Enum<T>> {
-
-    @Test
-    public void testLocalizedStringsArePresent() throws IOException {
-        
-        String stringsResource = "/" + getResourceBundle().replace(".", "/") + ".properties";
-        
-        Properties props = new Properties();
-        props.load(getClass().getResourceAsStream(stringsResource));
-        
-        Assert.assertEquals(values().length, props.values().size());
-        for (T resource : values()) {
-            Assert.assertTrue("missing property from resource bound file: " + resource,
-                              props.containsKey(resource.name()));
-        }
-    }
-    
-    private T[] values() {
-        return getEnumClass().getEnumConstants();
-    }
-    
-    protected abstract Class<T> getEnumClass();
-    
-    protected abstract String getResourceBundle();
-
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/test/src/main/java/com/redhat/thermostat/testutils/AbstractLocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.testutils;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public abstract class AbstractLocaleResourcesTest<T extends Enum<T>> {
+
+    @Test
+    public void testLocalizedStringsArePresent() throws IOException {
+        
+        String stringsResource = "/" + getResourceBundle().replace(".", "/") + ".properties";
+        
+        Properties props = new Properties();
+        props.load(getClass().getResourceAsStream(stringsResource));
+        
+        Assert.assertEquals(values().length, props.values().size());
+        for (T resource : values()) {
+            Assert.assertTrue("missing property from resource bound file: " + resource,
+                              props.containsKey(resource.name()));
+        }
+    }
+    
+    private T[] values() {
+        return getEnumClass().getEnumConstants();
+    }
+    
+    protected abstract Class<T> getEnumClass();
+    
+    protected abstract String getResourceBundle();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/test/src/main/java/com/redhat/thermostat/testutils/NotImplementedException.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.testutils;
+
+public class NotImplementedException extends RuntimeException {
+
+    private static final long serialVersionUID = -1620198443624195618L;
+
+    public NotImplementedException() {
+        super();
+    }
+
+    public NotImplementedException(String message) {
+        super(message);
+    }
+
+    public NotImplementedException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/test/src/main/java/com/redhat/thermostat/testutils/StubBundleContext.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,402 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.testutils;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkListener;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceFactory;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * An implementation of BundleContext that's useful for writing unit tests.
+ * <p>
+ * WARNING: if you static mock {@link FrameworkUtil#createFilter(String)}, you
+ * are going to have a bad time.
+ */
+public class StubBundleContext implements BundleContext {
+
+    static class ServiceInformation {
+        public Object implementation;
+        public Dictionary properties;
+        public int exportedReferences;
+
+        public ServiceInformation(Object impl, Dictionary props) {
+            this.implementation = impl;
+            this.properties = props;
+        }
+    }
+
+    private int nextServiceId = 0;
+
+    private Map<String, String> frameworkProperties = new HashMap<>();
+    private List<Bundle> bundles = new ArrayList<>();
+    private List<ServiceInformation> registeredServices = new ArrayList<>();
+    private Map<ServiceListener, Filter> registeredListeners = new HashMap<>();
+    private Bundle contextBundle = null;
+
+    /*
+     * Interface methods
+     */
+
+    @Override
+    public String getProperty(String key) {
+        String result = null;
+        result = frameworkProperties.get(key);
+        if (result == null) {
+            result = System.getProperty(key);
+        }
+        return result;
+    }
+
+    @Override
+    public Bundle getBundle() {
+        return contextBundle;
+    }
+
+    @Override
+    public Bundle installBundle(String location, InputStream input) throws BundleException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public Bundle installBundle(String location) throws BundleException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public Bundle getBundle(long id) {
+        if (id > Integer.MAX_VALUE) {
+            throw new NotImplementedException();
+        }
+        if (id >= bundles.size()) {
+            return null;
+        }
+
+        return bundles.get((int) id);
+    }
+
+    @Override
+    public Bundle getBundle(String location) {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public Bundle[] getBundles() {
+        return bundles.toArray(new Bundle[bundles.size()]);
+    }
+
+    @Override
+    public void addServiceListener(ServiceListener listener, String filter) throws InvalidSyntaxException {
+        registeredListeners.put(listener, filter == null ? null : createFilter(filter));
+    }
+
+    @Override
+    public void addServiceListener(ServiceListener listener) {
+        try {
+            addServiceListener(listener, null);
+        } catch (InvalidSyntaxException e) {
+            throw new AssertionError("a null filter can not have invalid systax");
+        }
+    }
+
+    @Override
+    public void removeServiceListener(ServiceListener listener) {
+        registeredListeners.remove(listener);
+    }
+
+    @Override
+    public void addBundleListener(BundleListener listener) {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void removeBundleListener(BundleListener listener) {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void addFrameworkListener(FrameworkListener listener) {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void removeFrameworkListener(FrameworkListener listener) {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public ServiceRegistration registerService(Class clazz, Object service, Dictionary properties) {
+        return registerService(clazz.getName(), service, properties);
+    }
+
+    @Override
+    public ServiceRegistration registerService(String className, Object service, Dictionary properties) {
+        return registerService(new String[] { className }, service, properties);
+    }
+
+    @Override
+    public ServiceRegistration registerService(String[] clazzes, Object service, Dictionary properties) {
+        if (service instanceof ServiceFactory) {
+            throw new NotImplementedException("support for service factories is not implemented");
+        }
+
+        for (String className : clazzes) {
+            try {
+                Class<?> clazz = Class.forName(className);
+                if (!clazz.isAssignableFrom(service.getClass())) {
+                    throw new IllegalArgumentException("service is not a subclass of " + className);
+                }
+            } catch (ClassNotFoundException classNotFound) {
+                throw new IllegalArgumentException("not a valid class: " + className);
+            }
+        }
+
+        Object specifiedRanking = null;
+        Hashtable<String, Object> newProperties = new Hashtable<>();
+        if (properties != null) {
+            Enumeration<?> enumeration = properties.keys();
+            while (enumeration.hasMoreElements()) {
+                Object key = enumeration.nextElement();
+                newProperties.put((String)key, properties.get(key));
+            }
+            specifiedRanking = properties.get(Constants.SERVICE_RANKING);
+        }
+
+        newProperties.put(Constants.OBJECTCLASS, clazzes);
+        newProperties.put(Constants.SERVICE_ID, nextServiceId);
+        nextServiceId++;
+        if (specifiedRanking == null || !(specifiedRanking instanceof Integer)) {
+            specifiedRanking = 0;
+        }
+        newProperties.put(Constants.SERVICE_RANKING, (Integer) specifiedRanking);
+
+        ServiceInformation info = new ServiceInformation(service, newProperties);
+        registeredServices.add(info);
+
+        notifyServiceChange(new StubServiceReference(info, contextBundle), true);
+
+        return new StubServiceRegistration(this, info);
+    }
+
+    @Override
+    public ServiceReference getServiceReference(Class clazz) {
+        return getServiceReference(clazz.getName());
+    }
+
+    @Override
+    public ServiceReference getServiceReference(String clazz) {
+        try {
+            ServiceReference[] initial = getServiceReferences(clazz, null);
+            if (initial == null) {
+                return null;
+            }
+
+            Arrays.sort(initial);
+            return initial[initial.length-1];
+        } catch (InvalidSyntaxException invalidFilterSyntax) {
+            throw new AssertionError("a null filter can not have an invalid syntax");
+        }
+    }
+
+    @Override
+    public Collection getServiceReferences(Class clazz, String filter) throws InvalidSyntaxException {
+        return Arrays.asList(getServiceReferences(clazz.getName(), filter));
+    }
+
+    @Override
+    public ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
+        ServiceReference[] allRefs = getAllServiceReferences(clazz, filter);
+        if (allRefs == null) {
+            return null;
+        }
+
+        List<ServiceReference> result = new ArrayList<>();
+        for (ServiceReference ref : allRefs) {
+            if (ref.isAssignableTo(contextBundle, clazz)) {
+                result.add(ref);
+            }
+        }
+        return result.toArray(new ServiceReference[0]);
+    }
+
+    @Override
+    public ServiceReference[] getAllServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
+        List<ServiceReference> toReturn = new ArrayList<>();
+
+        Filter toMatch = (filter == null) ? null : createFilter(filter);
+
+        for (ServiceInformation info : registeredServices) {
+            for (String serviceInterface : (String[]) info.properties.get(Constants.OBJECTCLASS)) {
+                if (clazz == null || serviceInterface.equals(clazz)) {
+                    if (toMatch == null || toMatch.match(info.properties)) {
+                        toReturn.add(new StubServiceReference(info, contextBundle));
+                    }
+                }
+            }
+        }
+
+        if (toReturn.size() == 0) {
+            return null;
+        }
+        return toReturn.toArray(new ServiceReference[0]);
+    }
+
+
+    @Override
+    public Filter createFilter(String filter) throws InvalidSyntaxException {
+        // FIXME this will break service trackers if FrameworkUtil is mocked.
+        // The following call will return null if FrameworkUtil is mocked.
+        // that's a problem because this is meant to be used (mostly) in test
+        // environments and that's where FrameworkUtil is likely to be mocked.
+        return FrameworkUtil.createFilter(filter);
+    }
+
+    @Override
+    public Object getService(ServiceReference reference) {
+        StubServiceReference ref = (StubServiceReference) reference;
+        ServiceInformation info = ref.getInformation();
+        info.exportedReferences++;
+        return info.implementation;
+    }
+
+    @Override
+    public boolean ungetService(ServiceReference reference) {
+        StubServiceReference ref = (StubServiceReference) reference;
+        ServiceInformation info = ref.getInformation();
+        if (info.exportedReferences == 0) {
+            return false;
+        }
+        if (!registeredServices.contains(info)) {
+            return false;
+        }
+        info.exportedReferences--;
+        return true;
+    }
+
+    @Override
+    public File getDataFile(String filename) {
+        throw new NotImplementedException();
+    }
+
+    /*
+     * Our custom methods
+     */
+    public void setProperty(String key, String value) {
+        frameworkProperties.put(key, value);
+    }
+
+    /** Set the context bundle */
+    public void setBundle(Bundle bundle) {
+        this.contextBundle = bundle;
+    }
+
+    /** Set the bundle associated with an id */
+    public void setBundle(int i, Bundle bundle) {
+        bundles.add(i, bundle);
+    }
+
+    public boolean isServiceRegistered(String serviceName, Class<?> implementationClass) {
+        for (ServiceInformation info : registeredServices) {
+            for (String serviceInterface : (String[]) info.properties.get(Constants.OBJECTCLASS)) {
+                if (serviceInterface.equals(serviceName)
+                        && info.implementation.getClass().equals(implementationClass)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    public Collection<ServiceInformation> getAllServices() {
+        return registeredServices;
+    }
+
+    public Collection<ServiceListener> getServiceListeners() {
+        return registeredListeners.keySet();
+    }
+
+    public void removeService(ServiceInformation info) {
+        if (!registeredServices.contains(info)) {
+            throw new IllegalArgumentException("service not registered");
+        }
+        registeredServices.remove(info);
+        notifyServiceChange(new StubServiceReference(info, contextBundle), false);
+    }
+
+    private void notifyServiceChange(ServiceReference serviceReference, boolean registered) {
+        int eventType = registered ? ServiceEvent.REGISTERED : ServiceEvent.UNREGISTERING;
+        ServiceEvent event = new ServiceEvent(eventType, serviceReference);
+        for (Entry<ServiceListener, Filter> entry : registeredListeners.entrySet()) {
+            ServiceListener listener = entry.getKey();
+            Filter filter = entry.getValue();
+            if (filter == null || filter.match(serviceReference)) {
+                listener.serviceChanged(event);
+            }
+        }
+    }
+
+    public int getExportedServiceCount(ServiceRegistration registration) {
+        StubServiceRegistration reg = (StubServiceRegistration) registration;
+        return reg.getInfo().exportedReferences;
+    }
+
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/test/src/main/java/com/redhat/thermostat/testutils/StubServiceReference.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.testutils;
+
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.List;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+
+import com.redhat.thermostat.testutils.StubBundleContext.ServiceInformation;
+
+@SuppressWarnings({"rawtypes"})
+public class StubServiceReference implements ServiceReference {
+
+    private final Bundle sourceBundle;
+    private final ServiceInformation information;
+
+    public StubServiceReference(ServiceInformation info, Bundle sourceBundle) {
+        this.information = info;
+        this.sourceBundle = sourceBundle;
+    }
+
+    @Override
+    public Object getProperty(String key) {
+        return information.properties.get(key);
+    }
+
+    @Override
+    public String[] getPropertyKeys() {
+        Dictionary props = information.properties;
+        List<String> toReturn = new ArrayList<>(props.size());
+        Enumeration keyEnumeration = props.keys();
+        while (keyEnumeration.hasMoreElements()) {
+            toReturn.add((String) keyEnumeration.nextElement());
+        }
+        return toReturn.toArray(new String[0]);
+    }
+
+    @Override
+    public Bundle getBundle() {
+        return sourceBundle;
+    }
+
+    @Override
+    public Bundle[] getUsingBundles() {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public boolean isAssignableTo(Bundle bundle, String className) {
+        if (sourceBundle == bundle) {
+            return true;
+        }
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public int compareTo(Object reference) {
+        if (!(reference instanceof ServiceReference)) {
+            throw new NotImplementedException();
+        }
+
+        ServiceReference ref = (ServiceReference) reference;
+
+        Integer myRanking = (Integer) getProperty(Constants.SERVICE_RANKING);
+        Integer otherRanking = (Integer) ref.getProperty(Constants.SERVICE_RANKING);
+
+        if (myRanking > otherRanking) {
+            return 1;
+        } else if (myRanking < otherRanking) {
+            return -1;
+        } else {
+            Integer myServiceId = (Integer) getProperty(Constants.SERVICE_ID);
+            Integer otherServiceId = (Integer) ref.getProperty(Constants.SERVICE_ID);
+
+            if (myServiceId < otherServiceId) {
+                return 1;
+            } else if (myServiceId > otherServiceId) {
+                return -1;
+            } else {
+                return 0;
+            }
+        }
+    }
+
+    public ServiceInformation getInformation() {
+        return information;
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/test/src/main/java/com/redhat/thermostat/testutils/StubServiceRegistration.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.testutils;
+
+import java.util.Dictionary;
+
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+import com.redhat.thermostat.testutils.StubBundleContext.ServiceInformation;
+
+@SuppressWarnings({"rawtypes"})
+public class StubServiceRegistration implements ServiceRegistration {
+
+    private StubBundleContext bundleContext;
+    private ServiceInformation info;
+
+    public StubServiceRegistration(StubBundleContext ctx, ServiceInformation info) {
+        this.bundleContext = ctx;
+        this.info = info;
+    }
+
+    @Override
+    public ServiceReference getReference() {
+        return new StubServiceReference(info, bundleContext.getBundle());
+    }
+
+    @Override
+    public void setProperties(Dictionary properties) {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void unregister() {
+        bundleContext.removeService(info);
+    }
+
+    public ServiceInformation getInfo() {
+        return info;
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/test/src/test/java/com/redhat/thermostat/testutils/StubBundleContextTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,573 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING. If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code. Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module. An independent module is a module
+ * which is not derived from or based on this code. If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so. If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.testutils;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Matchers.isA;
+import static org.mockito.Mockito.atLeast;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+
+import java.io.ByteArrayInputStream;
+import java.util.Collection;
+import java.util.Hashtable;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkListener;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+import com.redhat.thermostat.testutils.StubBundleContext.ServiceInformation;
+
+/**
+ * Test that StubBundleContext behaves like a BundleContext, based on what is
+ * specified in the OSGi spec. Other optional methods to help in testing are
+ * great, but adherence to spec is most important.
+ */
+public class StubBundleContextTest {
+
+    private StubBundleContext bundleContext;
+
+    @Before
+    public void setUp() {
+        bundleContext = new StubBundleContext();
+        assertNotNull(bundleContext);
+    }
+
+    @Test
+    public void testSetAndGetContextBundle() {
+        assertEquals(null, bundleContext.getBundle());
+
+        Bundle bundle = mock(Bundle.class);
+        bundleContext.setBundle(bundle);
+        assertSame(bundle, bundleContext.getBundle());
+    }
+
+    @Test(expected = NotImplementedException.class)
+    public void testInstallBundleFromLocation() throws BundleException {
+        bundleContext.installBundle("");
+    }
+
+    @Test(expected = NotImplementedException.class)
+    public void testInstallBundleFromInputStream() throws BundleException {
+        bundleContext.installBundle("", new ByteArrayInputStream(new byte[0]));
+    }
+
+    @Test
+    public void testSetAndGetBundles() {
+        assertEquals(null, bundleContext.getBundle(0));
+
+        Bundle systemBundle = mock(Bundle.class);
+        bundleContext.setBundle(0, systemBundle);
+
+        assertEquals(systemBundle, bundleContext.getBundle(0));
+
+        assertArrayEquals(new Bundle[] { systemBundle }, bundleContext.getBundles());
+    }
+
+    @Test(expected = NotImplementedException.class)
+    public void testGetBundleByLargeId() {
+        bundleContext.getBundle(Long.MAX_VALUE);
+    }
+
+    @Test(expected = NotImplementedException.class)
+    public void testGetBundleByLocation() {
+        bundleContext.getBundle("");
+    }
+
+    @Test
+    public void testAddRemoveFrameworkListener() {
+        try {
+            bundleContext.addFrameworkListener(mock(FrameworkListener.class));
+            fail("not expected");
+        } catch (NotImplementedException notImplemented) {
+            /* okay: expected */
+        }
+
+        try {
+            bundleContext.removeFrameworkListener(mock(FrameworkListener.class));
+            fail("not expected");
+        } catch (NotImplementedException notImplemented) {
+            /* okay: expected */
+        }
+    }
+
+    @Test
+    public void testAddRemoveBundleListener() {
+        try {
+            bundleContext.addBundleListener(mock(BundleListener.class));
+            fail("not expected");
+        } catch (NotImplementedException notImplemented) {
+            /* okay: expected */
+        }
+
+        try {
+            bundleContext.removeBundleListener(mock(BundleListener.class));
+            fail("not expected");
+        } catch (NotImplementedException notImplemented) {
+            /* okay: expected */
+        }
+    }
+
+    @Test
+    public void testGetPropertyDelegatesToSystemProperties() {
+        assertEquals(System.getProperty("user.name"), bundleContext.getProperty("user.name"));
+    }
+
+    @Test
+    public void testGetAndSetProperty() {
+        final String PROPERTY_NAME = "foo.bar.baz";
+        final String PROPERTY_NEW_VALUE = "spam.eggs";
+
+        assertEquals(null, bundleContext.getProperty(PROPERTY_NAME));
+
+        bundleContext.setProperty(PROPERTY_NAME, PROPERTY_NEW_VALUE);
+
+        assertEquals(PROPERTY_NEW_VALUE, bundleContext.getProperty(PROPERTY_NAME));
+    }
+
+    @Test
+    public void testFilterCreationReturnsASaneFilter() throws InvalidSyntaxException {
+        Filter filter = bundleContext.createFilter("(foo=bar)");
+        assertNotNull(filter);
+
+        Hashtable<String, String> dict = new Hashtable<>();
+        dict.put("foo", "bar");
+
+        assertTrue(filter.match(dict));
+    }
+
+    @Test
+    public void testAddRemoveService() {
+        TestService service = mock(TestService.class);
+
+        assertEquals(0, bundleContext.getAllServices().size());
+        assertFalse(bundleContext.isServiceRegistered(TestService.class.getName(), service.getClass()));
+
+        ServiceRegistration registration = bundleContext.registerService(TestService.class, service, null);
+
+        assertEquals(1, bundleContext.getAllServices().size());
+        assertTrue(bundleContext.isServiceRegistered(TestService.class.getName(), service.getClass()));
+
+        registration.unregister();
+
+        assertEquals(0, bundleContext.getAllServices().size());
+        assertFalse(bundleContext.isServiceRegistered(TestService.class.getName(), service.getClass()));
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testAddServiceThatDoesNotImplementInterfaceClass() {
+        AnotherTestService service = mock(AnotherTestService.class);
+
+        bundleContext.registerService(TestService.class.getName(), service, null);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testAddServiceThatDoesNotImplementInterfaceClass2() {
+        AnotherTestService service = mock(AnotherTestService.class);
+
+        bundleContext.registerService("foo.bar.Baz", service, null);
+    }
+
+    @Test
+    public void testAddServiceWithProperties() {
+        TestService service = mock(TestService.class);
+
+        Hashtable props = new Hashtable();
+        props.put(Constants.SERVICE_ID, -10);
+        props.put(Constants.SERVICE_RANKING, 10);
+        props.put(Constants.OBJECTCLASS, AnotherTestService.class.getName());
+
+        ServiceRegistration reg = bundleContext.registerService(TestService.class, service, props);
+
+        ServiceReference serviceRef = reg.getReference();
+
+        assertArrayEquals(new String[] { TestService.class.getName() },
+                (String[]) serviceRef.getProperty(Constants.OBJECTCLASS));
+
+        assertEquals(10, serviceRef.getProperty(Constants.SERVICE_RANKING));
+        assertEquals(0, serviceRef.getProperty(Constants.SERVICE_ID));
+    }
+
+    @Test
+    public void testAddServiceWithNonIntegerRanking() {
+        TestService service = mock(TestService.class);
+
+        Hashtable props = new Hashtable();
+        props.put(Constants.SERVICE_RANKING, new Object());
+
+        ServiceRegistration reg = bundleContext.registerService(TestService.class, service, props);
+
+        ServiceReference serviceRef = reg.getReference();
+
+        assertEquals(0, serviceRef.getProperty(Constants.SERVICE_RANKING));
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testRemoveUnknownService() {
+        bundleContext.removeService(new ServiceInformation(mock(TestService.class), new Hashtable()));
+    }
+
+    @Test
+    public void testAddingAndRemovingListenerWorks() {
+        assertEquals(0, bundleContext.getServiceListeners().size());
+
+        ServiceListener listener = mock(ServiceListener.class);
+
+        bundleContext.addServiceListener(listener);
+
+        assertEquals(1, bundleContext.getServiceListeners().size());
+        assertEquals(listener, bundleContext.getServiceListeners().toArray()[0]);
+
+        bundleContext.removeServiceListener(listener);
+
+        assertEquals(0, bundleContext.getServiceListeners().size());
+    }
+
+    @Test
+    public void testAddingSameListenerReplacedTheOldOne() {
+        assertEquals(0, bundleContext.getServiceListeners().size());
+
+        ServiceListener listener = mock(ServiceListener.class);
+
+        bundleContext.addServiceListener(listener);
+
+        assertEquals(1, bundleContext.getServiceListeners().size());
+
+        bundleContext.addServiceListener(listener);
+
+        assertEquals(1, bundleContext.getServiceListeners().size());
+    }
+
+    @Test
+    public void testRemovingAnUnknownListenerIsANoOp() {
+        ServiceListener listener = mock(ServiceListener.class);
+        bundleContext.addServiceListener(listener);
+        assertEquals(1, bundleContext.getServiceListeners().size());
+
+        ServiceListener unknownListener = mock(ServiceListener.class);
+        bundleContext.removeServiceListener(unknownListener);
+
+        assertEquals(1, bundleContext.getServiceListeners().size());
+    }
+
+    @Test
+    public void testServiceListenersWithoutFiltersWork() {
+        ServiceListener listener = mock(ServiceListener.class);
+        bundleContext.addServiceListener(listener);
+
+        bundleContext.registerService(TestService.class, mock(TestService.class), null);
+
+        assertListenerRecievedRegisteredEvent(listener);
+    }
+
+    @Test
+    public void testServiceListenersWithFiltersWork() throws InvalidSyntaxException {
+        ServiceListener specificListener = mock(ServiceListener.class);
+        String specificFilter = "(" + Constants.OBJECTCLASS + "=" + TestService.class.getName() + ")";
+        bundleContext.addServiceListener(specificListener, specificFilter);
+
+        ServiceListener allListener = mock(ServiceListener.class);
+        String allListenerFilter = "(" + Constants.OBJECTCLASS + "=*)";
+        bundleContext.addServiceListener(allListener, allListenerFilter);
+
+        ServiceListener otherListener = mock(ServiceListener.class);
+        String otherListenerFilter = "(" + Constants.OBJECTCLASS + "=foo.bar.Baz)";
+        bundleContext.addServiceListener(otherListener, otherListenerFilter);
+
+        ServiceRegistration registration = bundleContext.registerService(TestService.class, mock(TestService.class), null);
+
+        assertListenerRecievedRegisteredEvent(specificListener);
+        assertListenerRecievedRegisteredEvent(allListener);
+
+        registration.unregister();
+
+        assertListenerRecievedUnregisteringEvent(specificListener);
+        assertListenerRecievedUnregisteringEvent(allListener);
+
+        verify(otherListener, never()).serviceChanged(isA(ServiceEvent.class));
+
+    }
+
+    private void assertListenerRecievedRegisteredEvent(ServiceListener listener) {
+        ArgumentCaptor<ServiceEvent> eventCaptor = ArgumentCaptor.forClass(ServiceEvent.class);
+        verify(listener).serviceChanged(eventCaptor.capture());
+        assertEquals(1, eventCaptor.getAllValues().size());
+        ServiceEvent event = eventCaptor.getValue();
+        assertEquals(ServiceEvent.REGISTERED, event.getType());
+        ServiceReference ref = event.getServiceReference();
+        assertTrue(ref instanceof StubServiceReference);
+    }
+
+    private void assertListenerRecievedUnregisteringEvent(ServiceListener listener) {
+        ArgumentCaptor<ServiceEvent> eventCaptor = ArgumentCaptor.forClass(ServiceEvent.class);
+        verify(listener, atLeast(1)).serviceChanged(eventCaptor.capture());
+
+        ServiceEvent event = eventCaptor.getValue();
+        assertEquals(ServiceEvent.UNREGISTERING, event.getType());
+        ServiceReference ref = event.getServiceReference();
+        assertTrue(ref instanceof StubServiceReference);
+    }
+
+    @Test
+    public void testGetServiceReferenceReturnsNullForNoMatch() {
+        assertNull(bundleContext.getServiceReference(TestService.class));
+    }
+
+    @Test
+    public void testGetServiceReferenceReturnsServiceWithHighestServiceRanking() {
+        TestService service1 = mock(TestService.class);
+        TestService service2 = mock(TestService.class);
+
+        Hashtable service2Props = new Hashtable();
+        service2Props.put(Constants.SERVICE_RANKING, 1000);
+
+        bundleContext.registerService(TestService.class, service1, null);
+        bundleContext.registerService(TestService.class, service2, service2Props);
+
+        ServiceReference ref = bundleContext.getServiceReference(TestService.class);
+
+        assertSame(service2, bundleContext.getService(ref));
+    }
+
+    @Test
+    public void testGetServiceReferenceReturnsServiceWithLowerServiceId() {
+        TestService service1 = mock(TestService.class);
+        TestService service2 = mock(TestService.class);
+
+        bundleContext.registerService(TestService.class, service1, null);
+        bundleContext.registerService(TestService.class, service2, null);
+
+        ServiceReference ref = bundleContext.getServiceReference(TestService.class);
+
+        assertSame(service1, bundleContext.getService(ref));
+    }
+
+    @Test
+    public void testGetServiceReferences() throws InvalidSyntaxException {
+        TestService service = mock(TestService.class);
+
+        bundleContext.registerService(TestService.class, service, null);
+        bundleContext.registerService(AnotherTestService.class, mock(AnotherTestService.class), null);
+
+        Collection refs = bundleContext.getServiceReferences(TestService.class, null);
+
+        assertEquals(1, refs.size());
+        assertEquals(service, ((StubServiceReference) refs.toArray()[0]).getInformation().implementation);
+    }
+
+    @Test
+    public void testGetAllServiceReferencesNoMatch() throws InvalidSyntaxException {
+        TestService service = mock(TestService.class);
+
+        bundleContext.registerService(TestService.class, service, null);
+        bundleContext.registerService(TestService.class, mock(TestService.class), null);
+
+        ServiceReference[] refs = bundleContext.getAllServiceReferences(AnotherTestService.class.getName(), null);
+
+        assertEquals(null, (Object) refs);
+    }
+
+    @Test
+    public void testGetAllServiceReferencesWithoutFilter() throws InvalidSyntaxException {
+        TestService service = mock(TestService.class);
+
+        bundleContext.registerService(TestService.class, service, null);
+        bundleContext.registerService(AnotherTestService.class, mock(AnotherTestService.class), null);
+
+        ServiceReference[] refs = bundleContext.getAllServiceReferences(TestService.class.getName(), null);
+
+        assertEquals(1, refs.length);
+        assertEquals(service, ((StubServiceReference) refs[0]).getInformation().implementation);
+    }
+
+    @Test
+    public void testGetAllServiceReferencesWithFilter() throws InvalidSyntaxException {
+        TestService service = mock(TestService.class);
+
+        bundleContext.registerService(TestService.class, service, null);
+        bundleContext.registerService(AnotherTestService.class, mock(AnotherTestService.class), null);
+
+        String filter = "(" + Constants.OBJECTCLASS + "=" + TestService.class.getName() + ")";
+        ServiceReference[] refs = bundleContext.getAllServiceReferences(TestService.class.getName(), filter);
+
+        assertEquals(1, refs.length);
+        assertEquals(service, ((StubServiceReference) refs[0]).getInformation().implementation);
+    }
+
+    @Test
+    public void testGetAllServiceReferencesWithNoClassNameJustFilter() throws InvalidSyntaxException {
+        TestService service = mock(TestService.class);
+
+        bundleContext.registerService(TestService.class, service, null);
+        bundleContext.registerService(AnotherTestService.class, mock(AnotherTestService.class), null);
+
+        String filter = "(" + Constants.OBJECTCLASS + "=" + TestService.class.getName() + ")";
+        ServiceReference[] refs = bundleContext.getAllServiceReferences(null, filter);
+
+        assertEquals(1, refs.length);
+        assertEquals(service, ((StubServiceReference) refs[0]).getInformation().implementation);
+    }
+
+    @Test
+    public void testGetServiceUsingClassObject() {
+        TestService service = mock(TestService.class);
+
+        bundleContext.registerService(TestService.class, service, null);
+
+        ServiceReference ref = bundleContext.getServiceReference(TestService.class);
+        assertNotNull(ref);
+
+        Object returnedService = bundleContext.getService(ref);
+
+        assertSame(service, returnedService);
+    }
+
+    @Test
+    public void testGetServiceUsingClassName() {
+        TestService service = mock(TestService.class);
+
+        bundleContext.registerService(TestService.class, service, null);
+
+        ServiceReference ref = bundleContext.getServiceReference(TestService.class.getName());
+        assertNotNull(ref);
+
+        Object returnedService = bundleContext.getService(ref);
+
+        assertSame(service, returnedService);
+    }
+
+    @Test
+    public void testUngetService() {
+        bundleContext.registerService(TestService.class, mock(TestService.class), null);
+
+        ServiceReference ref = bundleContext.getServiceReference(TestService.class.getName());
+        Object returnedService = bundleContext.getService(ref);
+
+        assertTrue(bundleContext.ungetService(ref));
+
+        assertFalse(bundleContext.ungetService(ref));
+    }
+
+    @Test
+    public void testUngetServiceOnUnregisteredService() {
+        ServiceRegistration registration = bundleContext.registerService(TestService.class, mock(TestService.class), null);
+
+        ServiceReference ref = bundleContext.getServiceReference(TestService.class.getName());
+        Object returnedService = bundleContext.getService(ref);
+
+        registration.unregister();
+
+        assertFalse(bundleContext.ungetService(ref));
+    }
+
+    @Test
+    public void testReferenceExportCountIsCorrect() {
+        TestService service = mock(TestService.class);
+
+        ServiceRegistration reg = bundleContext.registerService(TestService.class, service, null);
+
+        ServiceReference ref = bundleContext.getServiceReference(TestService.class);
+        assertNotNull(ref);
+
+        assertEquals(0, bundleContext.getExportedServiceCount(reg));
+
+        Object returnedService = bundleContext.getService(ref);
+
+        assertEquals(1, bundleContext.getExportedServiceCount(reg));
+
+        bundleContext.ungetService(ref);
+
+        assertEquals(0, bundleContext.getExportedServiceCount(reg));
+    }
+
+    @Test(expected = NotImplementedException.class)
+    public void testGetDataFile() {
+        bundleContext.getDataFile("");
+    }
+
+    @Test
+    public void testIsServiceRegisteredForRegisteredService() {
+        ComplexService service = mock(ComplexService.class);
+
+        String[] ifaces = new String[] { TestService.class.getName(), AnotherTestService.class.getName() };
+        ServiceRegistration reg = bundleContext.registerService(ifaces, service, null);
+
+        assertTrue(bundleContext.isServiceRegistered(AnotherTestService.class.getName(), service.getClass()));
+
+    }
+
+    @Test
+    public void testIsServiceRegisteredForUnregisteredService() {
+        ComplexService service = mock(ComplexService.class);
+        TestService someOtherService = mock(TestService.class);
+
+        String[] ifaces = new String[] { TestService.class.getName(), AnotherTestService.class.getName() };
+        ServiceRegistration reg = bundleContext.registerService(ifaces, service, null);
+
+        assertFalse(bundleContext.isServiceRegistered(AnotherTestService.class.getName(), someOtherService.getClass()));
+    }
+
+    /*
+     * Dummy service interfaces
+     */
+
+    static interface TestService { /* just a marker */}
+
+    static interface AnotherTestService { /* just a marker */}
+
+    static interface ComplexService extends TestService, AnotherTestService { /* ditto */}
+}
+
--- a/distribution/config/commands/dump-heap.properties	Fri Jan 25 16:33:19 2013 -0500
+++ b/distribution/config/commands/dump-heap.properties	Wed Jan 16 18:58:59 2013 +0100
@@ -1,5 +1,6 @@
 bundles = thermostat-common-core-@project.version@.jar, \
           thermostat-client-core-@project.version@.jar, \
+          thermostat-client-cli-@project.version@.jar, \
           thermostat-common-command-@project.version@.jar, \
           thermostat-client-command-@project.version@.jar, \
           thermostat-vm-heap-analysis-common-@project.version@.jar, \
--- a/distribution/config/commands/find-objects.properties	Fri Jan 25 16:33:19 2013 -0500
+++ b/distribution/config/commands/find-objects.properties	Wed Jan 16 18:58:59 2013 +0100
@@ -1,6 +1,7 @@
 bundles = thermostat-client-core-@project.version@.jar, \
           thermostat-common-command-@project.version@.jar, \
           thermostat-client-command-@project.version@.jar, \
+          thermostat-client-cli-@project.version@.jar, \
           thermostat-vm-heap-analysis-common-@project.version@.jar, \
           thermostat-vm-heap-analysis-command-@project.version@.jar, \
           thermostat-storage-mongodb-${project.version}.jar, \
--- a/distribution/config/commands/find-root.properties	Fri Jan 25 16:33:19 2013 -0500
+++ b/distribution/config/commands/find-root.properties	Wed Jan 16 18:58:59 2013 +0100
@@ -1,6 +1,7 @@
 bundles = thermostat-client-core-@project.version@.jar, \
           thermostat-common-command-@project.version@.jar, \
           thermostat-client-command-@project.version@.jar, \
+          thermostat-client-cli-@project.version@.jar, \
           thermostat-vm-heap-analysis-common-@project.version@.jar, \
           thermostat-vm-heap-analysis-command-@project.version@.jar, \
           thermostat-storage-mongodb-${project.version}.jar, \
--- a/distribution/config/commands/gui.properties	Fri Jan 25 16:33:19 2013 -0500
+++ b/distribution/config/commands/gui.properties	Wed Jan 16 18:58:59 2013 +0100
@@ -9,6 +9,7 @@
           thermostat-web-client-@project.version@.jar, \
           thermostat-common-command-@project.version@.jar, \
           thermostat-client-core-@project.version@.jar, \
+          thermostat-client-cli-@project.version@.jar, \
           thermostat-client-swing-@project.version@.jar, \
           thermostat-swing-components-@project.version@.jar, \
           thermostat-client-command-@project.version@.jar, \
--- a/distribution/config/commands/list-heap-dumps.properties	Fri Jan 25 16:33:19 2013 -0500
+++ b/distribution/config/commands/list-heap-dumps.properties	Wed Jan 16 18:58:59 2013 +0100
@@ -5,6 +5,7 @@
           commons-collections.jar, \
           commons-logging.jar, \
           thermostat-client-core-@project.version@.jar, \
+          thermostat-client-cli-@project.version@.jar, \
           thermostat-common-command-@project.version@.jar, \
           thermostat-client-command-@project.version@.jar, \
           thermostat-vm-heap-analysis-common-@project.version@.jar, \
--- a/distribution/config/commands/object-info.properties	Fri Jan 25 16:33:19 2013 -0500
+++ b/distribution/config/commands/object-info.properties	Wed Jan 16 18:58:59 2013 +0100
@@ -5,6 +5,7 @@
           commons-collections.jar, \
           commons-logging.jar, \
           thermostat-client-core-@project.version@.jar, \
+          thermostat-client-cli-@project.version@.jar, \
           thermostat-common-command-@project.version@.jar, \
           thermostat-client-command-@project.version@.jar, \
           thermostat-vm-heap-analysis-common-@project.version@.jar, \
--- a/distribution/config/commands/save-heap-dump-to-file.properties	Fri Jan 25 16:33:19 2013 -0500
+++ b/distribution/config/commands/save-heap-dump-to-file.properties	Wed Jan 16 18:58:59 2013 +0100
@@ -5,6 +5,7 @@
           commons-collections.jar, \
           commons-logging.jar, \
           thermostat-client-core-@project.version@.jar, \
+          thermostat-client-cli-@project.version@.jar, \
           thermostat-common-command-@project.version@.jar, \
           thermostat-client-command-@project.version@.jar, \
           thermostat-vm-heap-analysis-common-@project.version@.jar, \
--- a/distribution/config/commands/show-heap-histogram.properties	Fri Jan 25 16:33:19 2013 -0500
+++ b/distribution/config/commands/show-heap-histogram.properties	Wed Jan 16 18:58:59 2013 +0100
@@ -7,6 +7,7 @@
           thermostat-client-core-@project.version@.jar, \
           thermostat-common-command-@project.version@.jar, \
           thermostat-client-command-@project.version@.jar, \
+          thermostat-client-cli-@project.version@.jar, \
           thermostat-vm-heap-analysis-common-@project.version@.jar, \
           thermostat-vm-heap-analysis-command-@project.version@.jar, \
           thermostat-web-common-${project.version}.jar, \
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/META-INF/MANIFEST.MF	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/META-INF/MANIFEST.MF	Wed Jan 16 18:58:59 2013 +0100
@@ -12,7 +12,6 @@
  com.redhat.thermostat.client.osgi.service,
  com.redhat.thermostat.client.ui,
  com.redhat.thermostat.common,
- com.redhat.thermostat.common.dao,
  com.redhat.thermostat.common.locale,
  com.redhat.thermostat.common.utils,
  com.redhat.thermostat.eclipse,
@@ -22,6 +21,7 @@
  com.redhat.thermostat.host.memory.client.core,
  com.redhat.thermostat.host.memory.client.locale,
  com.redhat.thermostat.storage.core,
+ com.redhat.thermostat.storage.dao,
  com.redhat.thermostat.storage.model,
  com.redhat.thermostat.vm.cpu.client.core,
  com.redhat.thermostat.vm.cpu.client.locale,
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostCpuViewPart.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostCpuViewPart.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,12 +39,12 @@
 import org.eclipse.swt.widgets.Composite;
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.views.HostRefViewPart;
 import com.redhat.thermostat.host.cpu.client.core.HostCpuService;
 import com.redhat.thermostat.host.cpu.client.core.HostCpuViewProvider;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class HostCpuViewPart extends HostRefViewPart {
 
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostMemoryViewPart.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostMemoryViewPart.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,12 +39,12 @@
 import org.eclipse.swt.widgets.Composite;
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.views.HostRefViewPart;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryService;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryViewProvider;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class HostMemoryViewPart extends HostRefViewPart {
 
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmCpuViewPart.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmCpuViewPart.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,10 +39,10 @@
 import org.eclipse.swt.widgets.Composite;
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.views.VmRefViewPart;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuService;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuViewProvider;
 
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmGcViewPart.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmGcViewPart.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,10 +39,10 @@
 import org.eclipse.swt.widgets.Composite;
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.views.VmRefViewPart;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.gc.client.core.VmGcService;
 import com.redhat.thermostat.vm.gc.client.core.VmGcViewProvider;
 
--- a/eclipse/com.redhat.thermostat.eclipse.chart.vmclassstat/META-INF/MANIFEST.MF	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.vmclassstat/META-INF/MANIFEST.MF	Wed Jan 16 18:58:59 2013 +0100
@@ -14,13 +14,14 @@
  com.redhat.thermostat.client.osgi.service,
  com.redhat.thermostat.client.ui,
  com.redhat.thermostat.common,
- com.redhat.thermostat.common.dao,
+ com.redhat.thermostat.storage.dao,
  com.redhat.thermostat.common.locale,
  com.redhat.thermostat.common.utils,
  com.redhat.thermostat.eclipse,
  com.redhat.thermostat.eclipse.chart.common,
  com.redhat.thermostat.eclipse.internal.views,
  com.redhat.thermostat.eclipse.views,
+ com.redhat.thermostat.storage.core,
  com.redhat.thermostat.storage.model,
  com.redhat.thermostat.vm.classstat.client.core,
  com.redhat.thermostat.vm.classstat.client.locale,
--- a/eclipse/com.redhat.thermostat.eclipse.chart.vmclassstat/src/com/redhat/thermostat/eclipse/chart/vmclassstat/VmClassStatViewPart.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.vmclassstat/src/com/redhat/thermostat/eclipse/chart/vmclassstat/VmClassStatViewPart.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,10 +39,10 @@
 import org.eclipse.swt.widgets.Composite;
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.views.VmRefViewPart;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.classstat.client.core.VmClassStatService;
 import com.redhat.thermostat.vm.classstat.client.core.VmClassStatViewProvider;
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/META-INF/MANIFEST.MF	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.test/META-INF/MANIFEST.MF	Wed Jan 16 18:58:59 2013 +0100
@@ -17,7 +17,7 @@
  com.redhat.thermostat.client.osgi.service,
  com.redhat.thermostat.client.ui,
  com.redhat.thermostat.common,
- com.redhat.thermostat.common.dao,
+ com.redhat.thermostat.storage.dao,
  com.redhat.thermostat.common.utils,
  com.redhat.thermostat.eclipse,
  com.redhat.thermostat.eclipse.chart.common,
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostVmsTreeContentProviderTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostVmsTreeContentProviderTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,11 +50,11 @@
 import org.junit.Before;
 import org.junit.Test;
 
-import com.redhat.thermostat.common.HostsVMsLoader;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.eclipse.internal.model.HostsVmsTreeContentProvider;
 import com.redhat.thermostat.eclipse.internal.model.HostsVmsTreeRoot;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.HostsVMsLoader;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class HostVmsTreeContentProviderTest {
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostsVmsLabelProviderTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostsVmsLabelProviderTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,10 +45,10 @@
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.eclipse.internal.model.HostsVmsLabelProvider;
 import com.redhat.thermostat.eclipse.internal.model.HostsVmsTreeRoot;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class HostsVmsLabelProviderTest {
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/AbstractRefViewPartTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/AbstractRefViewPartTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -51,12 +51,12 @@
 import org.eclipse.ui.IWorkbenchWindow;
 import org.junit.Before;
 
-import com.redhat.thermostat.common.dao.Ref;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
 import com.redhat.thermostat.eclipse.internal.views.HostsVmsTreeViewPart;
 import com.redhat.thermostat.eclipse.internal.views.RefViewPart;
+import com.redhat.thermostat.storage.core.Ref;
 
 public abstract class AbstractRefViewPartTest<T extends Ref> {
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/HostCpuViewPartTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/HostCpuViewPartTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,8 +50,6 @@
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.client.core.views.UIComponent;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
 import com.redhat.thermostat.eclipse.chart.common.HostCpuViewPart;
 import com.redhat.thermostat.eclipse.chart.common.SWTHostCpuView;
@@ -59,6 +57,8 @@
 import com.redhat.thermostat.eclipse.internal.views.RefViewPart;
 import com.redhat.thermostat.host.cpu.client.core.HostCpuService;
 import com.redhat.thermostat.host.cpu.client.core.HostCpuViewProvider;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class HostCpuViewPartTest extends AbstractRefViewPartTest<HostRef> {
     
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/HostMemoryViewPartTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/HostMemoryViewPartTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -48,7 +48,6 @@
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.client.core.views.UIComponent;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
 import com.redhat.thermostat.eclipse.chart.common.HostMemoryViewPart;
 import com.redhat.thermostat.eclipse.chart.common.SWTHostMemoryView;
@@ -56,6 +55,7 @@
 import com.redhat.thermostat.eclipse.internal.views.RefViewPart;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryService;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryViewProvider;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class HostMemoryViewPartTest extends AbstractRefViewPartTest<HostRef> {
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/HostOverviewViewPartTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/HostOverviewViewPartTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -48,7 +48,6 @@
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.client.core.views.UIComponent;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
 import com.redhat.thermostat.eclipse.internal.views.HostOverviewViewPart;
 import com.redhat.thermostat.eclipse.internal.views.RefViewPart;
@@ -56,6 +55,7 @@
 import com.redhat.thermostat.eclipse.internal.views.SWTHostOverviewViewProvider;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewService;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewViewProvider;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class HostOverviewViewPartTest extends AbstractRefViewPartTest<HostRef> {
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/VmClassStatViewPartTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/VmClassStatViewPartTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -47,13 +47,13 @@
 import org.mockito.InOrder;
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.eclipse.chart.vmclassstat.Activator;
 import com.redhat.thermostat.eclipse.chart.vmclassstat.SWTVmClassStatView;
 import com.redhat.thermostat.eclipse.chart.vmclassstat.SWTVmClassStatViewProvider;
 import com.redhat.thermostat.eclipse.chart.vmclassstat.VmClassStatViewPart;
 import com.redhat.thermostat.eclipse.internal.views.RefViewPart;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.classstat.client.core.VmClassStatService;
 import com.redhat.thermostat.vm.classstat.client.core.VmClassStatViewProvider;
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/VmCpuViewPartTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/VmCpuViewPartTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,13 +49,13 @@
 import org.mockito.InOrder;
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
 import com.redhat.thermostat.eclipse.chart.common.SWTVmCpuView;
 import com.redhat.thermostat.eclipse.chart.common.SWTVmCpuViewProvider;
 import com.redhat.thermostat.eclipse.chart.common.VmCpuViewPart;
 import com.redhat.thermostat.eclipse.internal.views.RefViewPart;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuService;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuViewProvider;
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/VmGcViewPartTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/VmGcViewPartTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -47,13 +47,13 @@
 import org.mockito.InOrder;
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
 import com.redhat.thermostat.eclipse.chart.common.SWTVmGcView;
 import com.redhat.thermostat.eclipse.chart.common.SWTVmGcViewProvider;
 import com.redhat.thermostat.eclipse.chart.common.VmGcViewPart;
 import com.redhat.thermostat.eclipse.internal.views.RefViewPart;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.gc.client.core.VmGcService;
 import com.redhat.thermostat.vm.gc.client.core.VmGcViewProvider;
 
--- a/eclipse/com.redhat.thermostat.eclipse/META-INF/MANIFEST.MF	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse/META-INF/MANIFEST.MF	Wed Jan 16 18:58:59 2013 +0100
@@ -14,14 +14,14 @@
  com.redhat.thermostat.client.locale,
  com.redhat.thermostat.client.ui,
  com.redhat.thermostat.common,
- com.redhat.thermostat.common.dao,
  com.redhat.thermostat.common.locale,
  com.redhat.thermostat.common.utils,
  com.redhat.thermostat.host.overview.client.core,
  com.redhat.thermostat.host.overview.client.locale,
  com.redhat.thermostat.storage.config,
  com.redhat.thermostat.storage.core,
- com.redhat.thermostat.storage.model
+ com.redhat.thermostat.storage.model,
+ com.redhat.thermostat.storage.dao
 Export-Package: com.redhat.thermostat.eclipse,
  com.redhat.thermostat.eclipse.internal;x-friends:="com.redhat.thermostat.eclipse.test,com.redhat.thermostat.eclipse.test.ui",
  com.redhat.thermostat.eclipse.internal.controllers;x-friends:="com.redhat.thermostat.eclipse.test,com.redhat.thermostat.eclipse.test.ui",
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,12 +44,12 @@
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
 
-import com.redhat.thermostat.common.DbService;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.eclipse.LoggerFacility;
 import com.redhat.thermostat.eclipse.internal.views.SWTHostOverviewViewProvider;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewViewProvider;
 import com.redhat.thermostat.storage.core.ConnectionException;
+import com.redhat.thermostat.storage.core.DbService;
 
 /**
  * The activator class controls the plug-in life cycle
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/jobs/ConnectDbJob.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/jobs/ConnectDbJob.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,13 +41,13 @@
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 
-import com.redhat.thermostat.common.DbService;
-import com.redhat.thermostat.common.DbServiceFactory;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.eclipse.LoggerFacility;
 import com.redhat.thermostat.eclipse.internal.Activator;
 import com.redhat.thermostat.eclipse.internal.ConnectionConfiguration;
 import com.redhat.thermostat.storage.core.ConnectionException;
+import com.redhat.thermostat.storage.core.DbService;
+import com.redhat.thermostat.storage.core.DbServiceFactory;
 
 public class ConnectDbJob extends Job {
 
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsLabelProvider.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsLabelProvider.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,8 +39,8 @@
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.graphics.Image;
 
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class HostsVmsLabelProvider extends LabelProvider {
 
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsTreeContentProvider.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsTreeContentProvider.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,9 +42,9 @@
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 
-import com.redhat.thermostat.common.HostsVMsLoader;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.HostsVMsLoader;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class HostsVmsTreeContentProvider implements ITreeContentProvider {
 
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/HostOverviewViewPart.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/HostOverviewViewPart.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,12 +39,12 @@
 import org.eclipse.swt.widgets.Composite;
 
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.views.HostRefViewPart;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewService;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewViewProvider;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class HostOverviewViewPart extends HostRefViewPart {
 
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/HostsVmsTreeViewPart.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/HostsVmsTreeViewPart.java	Wed Jan 16 18:58:59 2013 +0100
@@ -51,10 +51,6 @@
 import org.eclipse.ui.part.PageBook;
 import org.eclipse.ui.part.ViewPart;
 
-import com.redhat.thermostat.common.DefaultHostsVMsLoader;
-import com.redhat.thermostat.common.HostsVMsLoader;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.eclipse.internal.Activator;
 import com.redhat.thermostat.eclipse.internal.ConnectionConfiguration;
@@ -64,6 +60,10 @@
 import com.redhat.thermostat.eclipse.internal.model.HostsVmsLabelProvider;
 import com.redhat.thermostat.eclipse.internal.model.HostsVmsTreeContentProvider;
 import com.redhat.thermostat.eclipse.internal.model.HostsVmsTreeRoot;
+import com.redhat.thermostat.storage.core.DefaultHostsVMsLoader;
+import com.redhat.thermostat.storage.core.HostsVMsLoader;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 
 /**
  * 
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/RefViewPart.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/RefViewPart.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,9 +50,9 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.part.ViewPart;
 
-import com.redhat.thermostat.common.dao.Ref;
 import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
+import com.redhat.thermostat.storage.core.Ref;
 
 public abstract class RefViewPart<T extends Ref> extends ViewPart implements
         ISelectionListener {
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/HostRefViewPart.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/HostRefViewPart.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,9 +36,9 @@
 
 package com.redhat.thermostat.eclipse.views;
 
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.eclipse.internal.views.RefViewPart;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public abstract class HostRefViewPart extends RefViewPart<HostRef> {
 
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/VmRefViewPart.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/VmRefViewPart.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,8 +36,8 @@
 
 package com.redhat.thermostat.eclipse.views;
 
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.eclipse.internal.views.RefViewPart;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public abstract class VmRefViewPart extends RefViewPart<VmRef> {
 
--- a/host-cpu/agent/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/agent/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -74,5 +74,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/host-cpu/agent/src/test/java/com/redhat/thermostat/host/cpu/agent/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/agent/src/test/java/com/redhat/thermostat/host/cpu/agent/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,7 +50,7 @@
 import com.redhat.thermostat.backend.Backend;
 import com.redhat.thermostat.backend.BackendService;
 import com.redhat.thermostat.host.cpu.common.CpuStatDAO;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/HostCpuService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/HostCpuService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,11 +41,11 @@
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.host.cpu.client.core.internal.HostCpuController;
 import com.redhat.thermostat.host.cpu.common.CpuStatDAO;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
 
 public class HostCpuService implements InformationService<HostRef> {
     
--- a/host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,10 +50,10 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.host.cpu.client.core.HostCpuService;
 import com.redhat.thermostat.host.cpu.common.CpuStatDAO;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
 
 public class Activator implements BundleActivator {
     
--- a/host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/internal/HostCpuController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/internal/HostCpuController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,13 +49,13 @@
 import com.redhat.thermostat.common.NotImplementedException;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.host.cpu.client.core.HostCpuView;
 import com.redhat.thermostat.host.cpu.client.core.HostCpuViewProvider;
 import com.redhat.thermostat.host.cpu.client.locale.LocaleResources;
 import com.redhat.thermostat.host.cpu.common.CpuStatDAO;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
 import com.redhat.thermostat.storage.model.CpuStat;
 import com.redhat.thermostat.storage.model.DiscreteTimeData;
 import com.redhat.thermostat.storage.model.HostInfo;
--- a/host-cpu/client-core/src/test/java/com/redhat/thermostat/host/cpu/client/core/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/client-core/src/test/java/com/redhat/thermostat/host/cpu/client/core/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,10 +45,10 @@
 
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
 import com.redhat.thermostat.host.cpu.client.core.HostCpuService;
 import com.redhat.thermostat.host.cpu.common.CpuStatDAO;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/host-cpu/client-core/src/test/java/com/redhat/thermostat/host/cpu/client/core/internal/HostCpuControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/client-core/src/test/java/com/redhat/thermostat/host/cpu/client/core/internal/HostCpuControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -62,12 +62,12 @@
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.host.cpu.client.core.HostCpuView;
 import com.redhat.thermostat.host.cpu.client.core.HostCpuViewProvider;
 import com.redhat.thermostat.host.cpu.client.core.internal.HostCpuController;
 import com.redhat.thermostat.host.cpu.common.CpuStatDAO;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
 import com.redhat.thermostat.storage.model.CpuStat;
 import com.redhat.thermostat.storage.model.DiscreteTimeData;
 import com.redhat.thermostat.storage.model.HostInfo;
--- a/host-cpu/client-core/src/test/java/com/redhat/thermostat/host/cpu/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/client-core/src/test/java/com/redhat/thermostat/host/cpu/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.host.cpu.client.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/host-cpu/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -83,5 +83,11 @@
       <artifactId>thermostat-host-cpu-client-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/host-cpu/client-swing/src/test/java/com/redhat/thermostat/host/cpu/client/swing/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/client-swing/src/test/java/com/redhat/thermostat/host/cpu/client/swing/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,7 +42,7 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.host.cpu.client.core.HostCpuViewProvider;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/host-cpu/common/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/common/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -64,5 +64,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/host-cpu/common/src/main/java/com/redhat/thermostat/host/cpu/common/CpuStatDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/common/src/main/java/com/redhat/thermostat/host/cpu/common/CpuStatDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,8 +39,8 @@
 import java.util.List;
 
 import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.common.dao.Countable;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.Countable;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.model.CpuStat;
--- a/host-cpu/common/src/main/java/com/redhat/thermostat/host/cpu/common/internal/CpuStatDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/common/src/main/java/com/redhat/thermostat/host/cpu/common/internal/CpuStatDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,8 +38,8 @@
 
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.HostLatestPojoListGetter;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostLatestPojoListGetter;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.host.cpu.common.CpuStatDAO;
 import com.redhat.thermostat.storage.core.Put;
 import com.redhat.thermostat.storage.core.Storage;
--- a/host-cpu/common/src/test/java/com/redhat/thermostat/host/cpu/common/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/common/src/test/java/com/redhat/thermostat/host/cpu/common/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,7 +44,7 @@
 
 import com.redhat.thermostat.host.cpu.common.CpuStatDAO;
 import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/host-cpu/common/src/test/java/com/redhat/thermostat/host/cpu/common/internal/CpuStatDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-cpu/common/src/test/java/com/redhat/thermostat/host/cpu/common/internal/CpuStatDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -53,7 +53,7 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.host.cpu.common.CpuStatDAO;
 import com.redhat.thermostat.storage.core.Add;
 import com.redhat.thermostat.storage.core.Category;
--- a/host-memory/agent/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/agent/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -74,5 +74,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/host-memory/agent/src/test/java/com/redhat/thermostat/host/memory/agent/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/agent/src/test/java/com/redhat/thermostat/host/memory/agent/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,7 +50,7 @@
 import com.redhat.thermostat.backend.Backend;
 import com.redhat.thermostat.backend.BackendService;
 import com.redhat.thermostat.host.memory.common.MemoryStatDAO;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/host-memory/client-core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/client-core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -76,5 +76,11 @@
       <artifactId>thermostat-host-memory-common</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/HostMemoryService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/HostMemoryService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,11 +41,11 @@
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.host.memory.client.core.internal.HostMemoryController;
 import com.redhat.thermostat.host.memory.common.MemoryStatDAO;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
 
 public class HostMemoryService implements InformationService<HostRef> {
     
--- a/host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,10 +50,10 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryService;
 import com.redhat.thermostat.host.memory.common.MemoryStatDAO;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
 
 public class Activator implements BundleActivator {
     
--- a/host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/internal/HostMemoryController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/internal/HostMemoryController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,14 +50,14 @@
 import com.redhat.thermostat.common.Size;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryView;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryViewProvider;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryView.GraphVisibilityChangeListener;
 import com.redhat.thermostat.host.memory.client.locale.LocaleResources;
 import com.redhat.thermostat.host.memory.common.MemoryStatDAO;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
 import com.redhat.thermostat.storage.model.DiscreteTimeData;
 import com.redhat.thermostat.storage.model.MemoryStat;
 import com.redhat.thermostat.storage.model.MemoryType;
--- a/host-memory/client-core/src/test/java/com/redhat/thermostat/host/memory/client/core/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/client-core/src/test/java/com/redhat/thermostat/host/memory/client/core/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,10 +45,10 @@
 
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryService;
 import com.redhat.thermostat.host.memory.common.MemoryStatDAO;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/host-memory/client-core/src/test/java/com/redhat/thermostat/host/memory/client/core/internal/HostMemoryControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/client-core/src/test/java/com/redhat/thermostat/host/memory/client/core/internal/HostMemoryControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -56,12 +56,12 @@
 import com.redhat.thermostat.common.ApplicationService;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryView;
 import com.redhat.thermostat.host.memory.client.core.HostMemoryViewProvider;
 import com.redhat.thermostat.host.memory.client.core.internal.HostMemoryController;
 import com.redhat.thermostat.host.memory.common.MemoryStatDAO;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
 import com.redhat.thermostat.storage.model.HostInfo;
 import com.redhat.thermostat.storage.model.MemoryStat;
 
--- a/host-memory/client-core/src/test/java/com/redhat/thermostat/host/memory/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/client-core/src/test/java/com/redhat/thermostat/host/memory/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.host.memory.client.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/host-memory/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -83,5 +83,11 @@
       <artifactId>thermostat-host-memory-client-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/host-memory/client-swing/src/test/java/com/redhat/thermostat/host/memory/client/swing/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/client-swing/src/test/java/com/redhat/thermostat/host/memory/client/swing/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,7 +42,7 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.host.memory.client.core.HostMemoryViewProvider;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/host-memory/common/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/common/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -64,5 +64,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/host-memory/common/src/main/java/com/redhat/thermostat/host/memory/common/MemoryStatDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/common/src/main/java/com/redhat/thermostat/host/memory/common/MemoryStatDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,8 +39,8 @@
 import java.util.List;
 
 import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.common.dao.Countable;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.Countable;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.model.MemoryStat;
--- a/host-memory/common/src/main/java/com/redhat/thermostat/host/memory/common/internal/MemoryStatDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/common/src/main/java/com/redhat/thermostat/host/memory/common/internal/MemoryStatDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,8 +38,8 @@
 
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.HostLatestPojoListGetter;
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostLatestPojoListGetter;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.host.memory.common.MemoryStatDAO;
 import com.redhat.thermostat.storage.core.Put;
 import com.redhat.thermostat.storage.core.Storage;
--- a/host-memory/common/src/test/java/com/redhat/thermostat/host/memory/common/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/common/src/test/java/com/redhat/thermostat/host/memory/common/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,7 +44,7 @@
 
 import com.redhat.thermostat.host.memory.common.MemoryStatDAO;
 import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/host-memory/common/src/test/java/com/redhat/thermostat/host/memory/common/internal/MemoryStatDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-memory/common/src/test/java/com/redhat/thermostat/host/memory/common/internal/MemoryStatDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,7 +39,6 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.same;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
@@ -49,11 +48,8 @@
 import java.util.List;
 
 import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
 
-import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.host.memory.common.MemoryStatDAO;
 import com.redhat.thermostat.storage.core.Add;
 import com.redhat.thermostat.storage.core.Category;
--- a/host-overview/client-core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-overview/client-core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -71,5 +71,11 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/HostOverviewService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/HostOverviewService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,11 +41,11 @@
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.NetworkInterfaceInfoDAO;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.host.overview.client.core.internal.HostOverviewController;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO;
 
 public class HostOverviewService implements InformationService<HostRef> {
     
--- a/host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,10 +50,10 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.NetworkInterfaceInfoDAO;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewService;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO;
 
 public class Activator implements BundleActivator {
     
--- a/host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/internal/HostOverviewController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/internal/HostOverviewController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -51,13 +51,13 @@
 import com.redhat.thermostat.common.Size;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.NetworkInterfaceInfoDAO;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewView;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewViewProvider;
 import com.redhat.thermostat.host.overview.client.locale.LocaleResources;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO;
 import com.redhat.thermostat.storage.model.HostInfo;
 import com.redhat.thermostat.storage.model.NetworkInterfaceInfo;
 
--- a/host-overview/client-core/src/test/java/com/redhat/thermostat/host/overview/client/core/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-overview/client-core/src/test/java/com/redhat/thermostat/host/overview/client/core/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,10 +45,10 @@
 
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.NetworkInterfaceInfoDAO;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewService;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/host-overview/client-core/src/test/java/com/redhat/thermostat/host/overview/client/core/internal/HostOverviewControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-overview/client-core/src/test/java/com/redhat/thermostat/host/overview/client/core/internal/HostOverviewControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -60,11 +60,11 @@
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.NetworkInterfaceInfoDAO;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewView;
 import com.redhat.thermostat.host.overview.client.core.HostOverviewViewProvider;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO;
 import com.redhat.thermostat.storage.model.HostInfo;
 import com.redhat.thermostat.storage.model.NetworkInterfaceInfo;
 
--- a/host-overview/client-core/src/test/java/com/redhat/thermostat/host/overview/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-overview/client-core/src/test/java/com/redhat/thermostat/host/overview/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.host.overview.client.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/host-overview/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-overview/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -78,5 +78,11 @@
       <artifactId>thermostat-host-overview-client-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/host-overview/client-swing/src/test/java/com/redhat/thermostat/host/overview/client/swing/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/host-overview/client-swing/src/test/java/com/redhat/thermostat/host/overview/client/swing/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,7 +42,7 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.host.overview.client.core.HostOverviewViewProvider;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/killvm/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/killvm/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -91,6 +91,11 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-storage-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
     	<groupId>com.redhat.thermostat</groupId>
     	<artifactId>thermostat-osgi-process-handler</artifactId>
     	<version>${project.version}</version>
--- a/killvm/client-swing/src/main/java/com/redhat/thermostat/killvm/client/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/killvm/client-swing/src/main/java/com/redhat/thermostat/killvm/client/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,8 +45,8 @@
 import com.redhat.thermostat.client.osgi.service.VMContextAction;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 
 public class Activator implements BundleActivator {
 
--- a/killvm/client-swing/src/main/java/com/redhat/thermostat/killvm/client/internal/KillVMAction.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/killvm/client-swing/src/main/java/com/redhat/thermostat/killvm/client/internal/KillVMAction.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,12 +45,12 @@
 import com.redhat.thermostat.common.command.Request;
 import com.redhat.thermostat.common.command.Request.RequestType;
 import com.redhat.thermostat.common.command.RequestResponseListener;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.killvm.client.locale.LocaleResources;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 
 /**
--- a/killvm/client-swing/src/test/java/com/redhat/thermostat/killvm/client/internal/KillVMActionTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/killvm/client-swing/src/test/java/com/redhat/thermostat/killvm/client/internal/KillVMActionTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -57,12 +57,12 @@
 import com.redhat.thermostat.client.core.Filter;
 import com.redhat.thermostat.common.command.Request;
 import com.redhat.thermostat.common.command.RequestResponseListener;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.killvm.client.internal.KillVMAction;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.AgentInformation;
 import com.redhat.thermostat.storage.model.VmInfo;
 
--- a/launcher/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/launcher/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -110,6 +110,11 @@
     </dependency>
     <dependency>
       <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-storage-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
       <artifactId>thermostat-common-test</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
--- a/launcher/src/main/java/com/redhat/thermostat/launcher/Launcher.java	Fri Jan 25 16:33:19 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat 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, or (at your
- * option) any later version.
- *
- * Thermostat 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 Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.launcher;
-
-import java.util.Collection;
-
-import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.common.ActionListener;
-import com.redhat.thermostat.common.tools.ApplicationState;
-
-/**
- * Launcher is the main entry point for all Thermostat commands.
- */
-@Service
-public interface Launcher {
-
-    /**
-     * Invoked in order to start a command, either when Thermostat starts, or within
-     * the thermostat shell.  Equivalent to calling run(null).
-     */
-    void run();
-
-    /**
-     * Invoked in order to start a command, either when Thermostat starts, or within
-     * the thermostat shell.  If the command being run happens to be a BasicCommand,
-     * and the argument is non-null, the listeners will be added to the command for
-     * life cycle notifications.  Otherwise, the argument is ignored.
-     */
-    void run(Collection<ActionListener<ApplicationState>> listeners);
-
-    /**
-     * Should be set before calling run()
-     * @param command line arguments to the program
-     */
-    void setArgs(String[] args);
-
-}
-
--- a/launcher/src/main/java/com/redhat/thermostat/launcher/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/launcher/src/main/java/com/redhat/thermostat/launcher/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,11 +45,11 @@
 import org.osgi.util.tracker.ServiceTrackerCustomizer;
 
 import com.redhat.thermostat.common.CommandLoadingBundleActivator;
+import com.redhat.thermostat.common.Launcher;
 import com.redhat.thermostat.common.cli.CommandContextFactory;
 import com.redhat.thermostat.common.cli.CommandInfoSource;
 import com.redhat.thermostat.common.config.Configuration;
 import com.redhat.thermostat.launcher.BundleManager;
-import com.redhat.thermostat.launcher.Launcher;
 import com.redhat.thermostat.utils.keyring.Keyring;
 
 public class Activator extends CommandLoadingBundleActivator {
--- a/launcher/src/main/java/com/redhat/thermostat/launcher/internal/LauncherImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/launcher/src/main/java/com/redhat/thermostat/launcher/internal/LauncherImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,11 +50,11 @@
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.ServiceReference;
 
+import com.redhat.thermostat.common.cli.BasicCommand;
 import com.redhat.thermostat.common.ActionListener;
 import com.redhat.thermostat.common.ActionNotifier;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.DbService;
-import com.redhat.thermostat.common.DbServiceFactory;
+import com.redhat.thermostat.common.Launcher;
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.common.cli.Arguments;
 import com.redhat.thermostat.common.cli.Command;
@@ -66,12 +66,12 @@
 import com.redhat.thermostat.common.config.ClientPreferences;
 import com.redhat.thermostat.common.config.InvalidConfigurationException;
 import com.redhat.thermostat.common.tools.ApplicationState;
-import com.redhat.thermostat.common.tools.BasicCommand;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.common.utils.OSGIUtils;
-import com.redhat.thermostat.launcher.Launcher;
 import com.redhat.thermostat.launcher.BundleManager;
 import com.redhat.thermostat.storage.core.ConnectionException;
+import com.redhat.thermostat.storage.core.DbService;
+import com.redhat.thermostat.storage.core.DbServiceFactory;
 import com.redhat.thermostat.storage.core.Storage;
 import com.redhat.thermostat.storage.core.StorageException;
 import com.redhat.thermostat.utils.keyring.Keyring;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/test/java/com/redhat/thermostat/launcher/TestCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.launcher;
+
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+
+import com.redhat.thermostat.common.cli.Command;
+import com.redhat.thermostat.common.cli.CommandContext;
+import com.redhat.thermostat.common.cli.CommandException;
+
+
+public class TestCommand implements Command {
+
+    private String name;
+    private Handle handle;
+    private String description;
+    private String usage;
+    private boolean storageRequired;
+    private boolean availableInShell = true;
+    private boolean availableOutsideShell = true;
+
+    private Options options = new Options();
+
+    public static interface Handle {
+        public void run(CommandContext ctx) throws CommandException;
+    }
+
+    public TestCommand(String name) {
+        this(name, null);
+    }
+
+    public TestCommand(String name, Handle r) {
+        this.name = name;
+        this.handle = r;
+    }
+
+    @Override
+    public void run(CommandContext ctx) throws CommandException {
+        if (handle != null) {
+            handle.run(ctx);
+        }
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String desc) {
+        description = desc;
+    }
+
+    @Override
+    public String getUsage() {
+        return usage;
+    }
+
+    public void setUsage(String usage) {
+        this.usage = usage;
+    }
+
+    @Override
+    public Options getOptions() {
+        return options;
+    }
+
+    public void addOptions(Option... options) {
+        for (Option option : options) {
+            this.options.addOption(option);
+        }
+    }
+
+    @Override
+    public boolean isStorageRequired() {
+        return storageRequired;
+    }
+
+    public void setStorageRequired(boolean storageRequired) {
+        this.storageRequired = storageRequired;
+    }
+
+    @Override
+    public boolean isAvailableInShell() {
+        return availableInShell;
+    }
+
+    void setAvailableInShell(boolean avaiable) {
+        this.availableInShell = avaiable;
+    }
+
+    @Override
+    public boolean isAvailableOutsideShell() {
+        return availableOutsideShell;
+    }
+
+    void setAvailableOutsideShell(boolean available) {
+        this.availableOutsideShell = available;
+    }
+}
+
--- a/launcher/src/test/java/com/redhat/thermostat/launcher/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/launcher/src/test/java/com/redhat/thermostat/launcher/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -71,6 +71,7 @@
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
+import com.redhat.thermostat.common.Launcher;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
 import com.redhat.thermostat.common.cli.Command;
@@ -79,9 +80,8 @@
 import com.redhat.thermostat.common.config.Configuration;
 import com.redhat.thermostat.common.utils.ServiceRegistry;
 import com.redhat.thermostat.launcher.BundleManager;
-import com.redhat.thermostat.launcher.Launcher;
 import com.redhat.thermostat.launcher.internal.Activator.RegisterLauncherCustomizer;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.utils.keyring.Keyring;
 
 @RunWith(PowerMockRunner.class)
--- a/launcher/src/test/java/com/redhat/thermostat/launcher/internal/HelpCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/launcher/src/test/java/com/redhat/thermostat/launcher/internal/HelpCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -64,9 +64,9 @@
 import com.redhat.thermostat.common.cli.CommandInfoNotFoundException;
 import com.redhat.thermostat.common.cli.CommandInfoSource;
 import com.redhat.thermostat.common.cli.SimpleArguments;
+import com.redhat.thermostat.launcher.TestCommand;
 import com.redhat.thermostat.launcher.internal.HelpCommand;
 import com.redhat.thermostat.test.TestCommandContextFactory;
-import com.redhat.thermostat.test.cli.TestCommand;
 
 @RunWith(PowerMockRunner.class)
 @PrepareForTest({HelpCommand.class, FrameworkUtil.class})
--- a/launcher/src/test/java/com/redhat/thermostat/launcher/internal/LauncherTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/launcher/src/test/java/com/redhat/thermostat/launcher/internal/LauncherTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -72,12 +72,11 @@
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
+import com.redhat.thermostat.common.cli.BasicCommand;
 import com.redhat.thermostat.common.ActionListener;
 import com.redhat.thermostat.common.ActionNotifier;
 import com.redhat.thermostat.common.ApplicationInfo;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.DbService;
-import com.redhat.thermostat.common.DbServiceFactory;
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.common.cli.Arguments;
 import com.redhat.thermostat.common.cli.Command;
@@ -90,15 +89,19 @@
 import com.redhat.thermostat.common.locale.LocaleResources;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.tools.ApplicationState;
-import com.redhat.thermostat.common.tools.BasicCommand;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.launcher.BundleManager;
+import com.redhat.thermostat.launcher.TestCommand;
+import com.redhat.thermostat.launcher.TestCommand.Handle;
+import com.redhat.thermostat.launcher.internal.HelpCommand;
+import com.redhat.thermostat.launcher.internal.LauncherImpl;
 import com.redhat.thermostat.launcher.internal.LauncherImpl.LoggingInitializer;
+import com.redhat.thermostat.storage.core.DbService;
+import com.redhat.thermostat.storage.core.DbServiceFactory;
 import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.test.StubBundleContext;
 import com.redhat.thermostat.test.TestCommandContextFactory;
 import com.redhat.thermostat.test.TestTimerFactory;
-import com.redhat.thermostat.test.cli.TestCommand;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.utils.keyring.Keyring;
 import com.redhat.thermostat.utils.keyring.KeyringProvider;
 
--- a/main/src/main/java/com/redhat/thermostat/main/Thermostat.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/main/src/main/java/com/redhat/thermostat/main/Thermostat.java	Wed Jan 16 18:58:59 2013 +0100
@@ -48,8 +48,8 @@
 import org.osgi.framework.BundleException;
 import org.osgi.util.tracker.ServiceTracker;
 
+import com.redhat.thermostat.common.Launcher;
 import com.redhat.thermostat.common.config.Configuration;
-import com.redhat.thermostat.launcher.Launcher;
 import com.redhat.thermostat.main.impl.FrameworkProvider;
 
 public class Thermostat implements Runnable {
--- a/main/src/main/java/com/redhat/thermostat/main/impl/FrameworkProvider.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/main/src/main/java/com/redhat/thermostat/main/impl/FrameworkProvider.java	Wed Jan 16 18:58:59 2013 +0100
@@ -59,9 +59,9 @@
 import org.osgi.framework.launch.FrameworkFactory;
 import org.osgi.util.tracker.ServiceTracker;
 
+import com.redhat.thermostat.common.Launcher;
 import com.redhat.thermostat.common.config.Configuration;
 import com.redhat.thermostat.launcher.BundleManager;
-import com.redhat.thermostat.launcher.Launcher;
 
 public class FrameworkProvider {
 
--- a/main/src/test/java/com/redhat/thermostat/main/ThermostatTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/main/src/test/java/com/redhat/thermostat/main/ThermostatTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -60,7 +60,7 @@
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.redhat.thermostat.launcher.Launcher;
+import com.redhat.thermostat.common.Launcher;
 import com.redhat.thermostat.launcher.BundleManager;
 import com.redhat.thermostat.main.impl.FrameworkProvider;
 
--- a/numa/agent/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/agent/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -69,5 +69,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/numa/agent/src/test/java/com/redhat/thermostat/numa/agent/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/agent/src/test/java/com/redhat/thermostat/numa/agent/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -54,7 +54,7 @@
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.TimerFactory;
 import com.redhat.thermostat.numa.common.NumaDAO;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/NumaInformationService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/NumaInformationService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,9 +41,9 @@
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.numa.client.core.internal.NumaController;
 import com.redhat.thermostat.numa.common.NumaDAO;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class NumaInformationService implements InformationService<HostRef> {
     
--- a/numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,10 +50,10 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.numa.client.core.NumaInformationService;
 import com.redhat.thermostat.numa.client.core.NumaViewProvider;
 import com.redhat.thermostat.numa.common.NumaDAO;
+import com.redhat.thermostat.storage.core.HostRef;
 
 public class Activator implements BundleActivator {
     
--- a/numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/internal/NumaController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/internal/NumaController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -48,7 +48,6 @@
 import com.redhat.thermostat.common.ApplicationService;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.numa.client.core.NumaView;
 import com.redhat.thermostat.numa.client.core.NumaView.GraphVisibilityChangeListener;
@@ -56,6 +55,7 @@
 import com.redhat.thermostat.numa.client.locale.LocaleResources;
 import com.redhat.thermostat.numa.common.NumaDAO;
 import com.redhat.thermostat.numa.common.NumaStat;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.storage.model.DiscreteTimeData;
 
 public class NumaController implements InformationServiceController<HostRef> {
--- a/numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/NumaInformationServiceTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/NumaInformationServiceTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,9 +44,9 @@
 import com.redhat.thermostat.common.Ordered;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.numa.client.core.internal.NumaController;
 import com.redhat.thermostat.numa.common.NumaDAO;
+import com.redhat.thermostat.storage.core.HostRef;
 
 import static org.mockito.Mockito.*;
 
--- a/numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -48,7 +48,7 @@
 import com.redhat.thermostat.numa.client.core.NumaInformationService;
 import com.redhat.thermostat.numa.client.core.NumaViewProvider;
 import com.redhat.thermostat.numa.common.NumaDAO;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/internal/NumaControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/internal/NumaControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -64,13 +64,13 @@
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.numa.client.core.NumaView;
 import com.redhat.thermostat.numa.client.core.NumaView.GraphVisibilityChangeListener;
 import com.redhat.thermostat.numa.client.core.NumaViewProvider;
 import com.redhat.thermostat.numa.common.NumaDAO;
 import com.redhat.thermostat.numa.common.NumaNodeStat;
 import com.redhat.thermostat.numa.common.NumaStat;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.storage.model.DiscreteTimeData;
 
 public class NumaControllerTest {
--- a/numa/client-core/src/test/java/com/redhat/thermostat/numa/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/client-core/src/test/java/com/redhat/thermostat/numa/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -37,7 +37,7 @@
 package com.redhat.thermostat.numa.client.locale;
 
 import com.redhat.thermostat.numa.client.locale.LocaleResources;
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/numa/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -70,6 +70,12 @@
     </dependency>
     <dependency>
       <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
       <artifactId>thermostat-client-swing</artifactId>
       <version>${project.version}</version>
     </dependency>
--- a/numa/client-swing/src/test/java/com/redhat/thermostat/numa/client/swing/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/client-swing/src/test/java/com/redhat/thermostat/numa/client/swing/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,7 +44,7 @@
 import com.redhat.thermostat.numa.client.core.NumaViewProvider;
 import com.redhat.thermostat.numa.client.swing.internal.Activator;
 import com.redhat.thermostat.numa.client.swing.internal.SwingNumaViewProvider;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/numa/common/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/common/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -64,5 +64,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/numa/common/src/main/java/com/redhat/thermostat/numa/common/NumaDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/common/src/main/java/com/redhat/thermostat/numa/common/NumaDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,8 +38,8 @@
 
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.storage.core.Key;
 
 public interface NumaDAO {
--- a/numa/common/src/main/java/com/redhat/thermostat/numa/common/internal/NumaDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/common/src/main/java/com/redhat/thermostat/numa/common/internal/NumaDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,12 +38,12 @@
 
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.HostLatestPojoListGetter;
-import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.numa.common.NumaDAO;
 import com.redhat.thermostat.numa.common.NumaHostInfo;
 import com.redhat.thermostat.numa.common.NumaStat;
 import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostLatestPojoListGetter;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.core.Put;
 import com.redhat.thermostat.storage.core.Query;
--- a/numa/common/src/test/java/com/redhat/thermostat/numa/common/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/numa/common/src/test/java/com/redhat/thermostat/numa/common/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -46,7 +46,7 @@
 import com.redhat.thermostat.numa.common.internal.Activator;
 import com.redhat.thermostat.numa.common.internal.NumaDAOImpl;
 import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class ActivatorTest {
     
--- a/storage/core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/storage/core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -65,6 +65,7 @@
               com.redhat.thermostat.storage.core,
               com.redhat.thermostat.storage.config,
               com.redhat.thermostat.storage.model,
+              com.redhat.thermostat.storage.dao,
             </Export-Package>
             <!-- TODO: For the thread tab (i.e. thread plug-in) the web server
                  bundle requires model classes provided by said bundle. Since
@@ -75,6 +76,11 @@
                  for user-provided bundles which contribute DAOs/models in the
                  same way. -->
             <DynamicImport-Package>com.redhat.thermostat.*</DynamicImport-Package>
+            <Private-Package>
+              com.redhat.thermostat.storage.internal.dao,
+              com.redhat.thermostat.storage.internal,
+              com.redhat.thermostat.storage.internal.test,
+            </Private-Package>
             <!-- Do not autogenerate uses clauses in Manifests -->
             <_nouses>true</_nouses>
           </instructions>
@@ -99,6 +105,12 @@
       <version>${project.version}</version>
       <scope>compile</scope>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>
--- a/storage/core/src/main/java/com/redhat/thermostat/storage/config/ConnectionConfiguration.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/config/ConnectionConfiguration.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,6 @@
 
 package com.redhat.thermostat.storage.config;
 
-
 public class ConnectionConfiguration implements StartupConfiguration, AuthenticationConfiguration {
 
     private String dbUrl;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/Countable.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+public interface Countable {
+
+    public long getCount();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/DbService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+import com.redhat.thermostat.annotations.Service;
+import com.redhat.thermostat.storage.core.ConnectionException;
+
+@Service
+public interface DbService {
+
+    /**
+     * Connects to the given database.
+     * 
+     * @throws ConnectionException
+     *             If DB connection cannot be established.
+     */
+    void connect() throws ConnectionException;
+
+    /**
+     * Disconnects from the database.
+     * 
+     * @throws ConnectionException
+     */
+    void disconnect() throws ConnectionException;
+
+    /**
+     * @returns the storage URL which was used for connection.
+     * 
+     * @throws IllegalStateException
+     *             if not connected to storage.
+     */
+    String getConnectionUrl();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/DbServiceFactory.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+import com.redhat.thermostat.storage.internal.DbServiceImpl;
+
+/*
+ * Factory in order to be able to hide the DbService implementation. Note that
+ * this package will be part of Export-Package whereas the package where *Impl
+ * classes are won't be.
+ *
+ */
+public class DbServiceFactory {
+
+    public DbService createDbService(String username, String password, String dbUrl) {
+        return DbServiceImpl.create(username, password, dbUrl);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/DefaultHostsVMsLoader.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+import java.util.Collection;
+
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
+
+public class DefaultHostsVMsLoader implements HostsVMsLoader {
+
+    private HostInfoDAO hostsDAO;
+    private VmInfoDAO vmsDAO;
+    private boolean liveHosts;
+    
+    /**
+     * 
+     * @param hostDAO
+     * @param vmsDAO
+     * @param liveHosts {@code true} if only alive agent documents should get retrieved.
+     */
+    public DefaultHostsVMsLoader(HostInfoDAO hostDAO, VmInfoDAO vmsDAO, boolean liveHosts) {
+        this.hostsDAO = hostDAO;
+        this.vmsDAO = vmsDAO;
+        this.liveHosts = liveHosts;
+    }
+    
+    @Override
+    public Collection<HostRef> getHosts() {
+        if (liveHosts) {
+            return hostsDAO.getAliveHosts();
+        } else {
+            return hostsDAO.getHosts();
+        }
+    }
+
+    @Override
+    public Collection<VmRef> getVMs(HostRef host) {
+        return vmsDAO.getVMs(host);
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/HostLatestPojoListGetter.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.model.TimeStampedPojo;
+
+public class HostLatestPojoListGetter<T extends TimeStampedPojo> {
+
+    private final Storage storage;
+    private final Category<T> cat;
+
+    public HostLatestPojoListGetter(Storage storage, Category<T> cat) {
+        this.storage = storage;
+        this.cat = cat;
+    }
+
+    public List<T> getLatest(HostRef hostRef, long since) {
+        Query<T> query = buildQuery(hostRef, since);
+        return getLatest(query);
+    }
+
+    private List<T> getLatest(Query<T> query) {
+        Cursor<T> cursor = query.execute();
+        List<T> result = new ArrayList<>();
+        while (cursor.hasNext()) {
+            T pojo = cursor.next();
+            result.add(pojo);
+        }
+        return result;
+    }
+
+    protected Query<T> buildQuery(HostRef hostRef, long since) {
+        Query<T> query = storage.createQuery(cat);
+        query.where(Key.AGENT_ID, Criteria.EQUALS, hostRef.getAgentId());
+        query.where(Key.TIMESTAMP, Criteria.GREATER_THAN, since);
+        query.sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
+        return query;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/HostRef.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+public class HostRef implements Ref {
+
+    private final String uid;
+    private final String name;
+
+    public HostRef(String id, String name) {
+        this.uid = id;
+        this.name = name;
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+
+    public String getAgentId() {
+        return uid;
+    }
+
+    public String getHostName() {
+        return name;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (obj == this) {
+            return true;
+        }
+        if (obj.getClass() != this.getClass()) {
+            return false;
+        }
+        HostRef other = (HostRef) obj;
+        if (equals(this.uid, other.uid) && equals(this.name, other.name)) {
+            return true;
+        }
+        return false;
+    }
+
+    private static boolean equals(Object obj1, Object obj2) {
+        return (obj1 == null && obj2 == null) || (obj1 != null && obj1.equals(obj2));
+    }
+
+    @Override
+    public int hashCode() {
+        return uid.hashCode();
+    }
+
+    @Override
+    public String getStringID() {
+        return getAgentId();
+    }
+    
+    @Override
+    public String getName() {
+        return getHostName();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/HostsVMsLoader.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+import java.util.Collection;
+
+
+/**
+ * Provides a way to load the current hosts and VMs.
+ */
+public interface HostsVMsLoader {
+
+    Collection<HostRef> getHosts();
+    Collection<VmRef> getVMs(HostRef host);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/Ref.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+public interface Ref {
+
+    String getStringID();
+    String getName();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/VmLatestPojoListGetter.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.model.TimeStampedPojo;
+
+public class VmLatestPojoListGetter<T extends TimeStampedPojo> {
+
+    private final Storage storage;
+    private final Category<T> cat;
+
+    public VmLatestPojoListGetter(Storage storage, Category<T> cat) {
+        this.storage = storage;
+        this.cat = cat;
+    }
+
+    public List<T> getLatest(VmRef vmRef, long since) {
+        Query<T> query = buildQuery(vmRef, since);
+        return getLatest(query);
+    }
+
+    private List<T> getLatest(Query<T> query) {
+        Cursor<T> cursor = query.execute();
+        List<T> result = new ArrayList<>();
+        while (cursor.hasNext()) {
+            T pojo = cursor.next();
+            result.add(pojo);
+        }
+        return result;
+    }
+
+    protected Query<T> buildQuery(VmRef vmRef, long since) {
+        Query<T> query = storage.createQuery(cat);
+        query.where(Key.AGENT_ID, Criteria.EQUALS, vmRef.getAgent().getAgentId());
+        query.where(Key.VM_ID, Criteria.EQUALS, vmRef.getId());
+        query.where(Key.TIMESTAMP, Criteria.GREATER_THAN, since);
+        query.sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
+        return query;
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/VmRef.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+public class VmRef implements Ref {
+
+    private final HostRef hostRef;
+    private final Integer uid;
+    private final String uidString;
+    private final String name;
+
+    public VmRef(HostRef hostRef, Integer id, String name) {
+        this.hostRef = hostRef;
+        this.uid = id;
+        this.uidString = id.toString();
+        this.name = name;
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+
+    public HostRef getAgent() {
+        return hostRef;
+    }
+
+    public Integer getId() {
+        return uid;
+    }
+
+    /**
+     * Equivalent to {@link #getStringID()}.
+     */
+    public String getIdString() {
+        return uidString;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (obj == this) {
+            return true;
+        }
+        if (obj.getClass() != this.getClass()) {
+            return false;
+        }
+        VmRef other = (VmRef) obj;
+        if (equals(this.hostRef, other.hostRef) && equals(this.uid, other.uid) && equals(this.name, other.name)) {
+            return true;
+        }
+        return false;
+    }
+
+    private static boolean equals(Object obj1, Object obj2) {
+        return (obj1 == null && obj2 == null) || (obj1 != null && obj1.equals(obj2));
+    }
+
+    @Override
+    public int hashCode() {
+        return uid.hashCode();
+    }
+
+    @Override
+    public String getStringID() {
+        return getIdString();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/dao/AgentInfoDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.dao;
+
+import java.util.List;
+
+import com.redhat.thermostat.annotations.Service;
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Countable;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.model.AgentInformation;
+
+@Service
+public interface AgentInfoDAO extends Countable {
+
+    static final Key<Long> START_TIME_KEY = new Key<>("startTime", false);
+    static final Key<Long> STOP_TIME_KEY = new Key<>("stopTime", false);
+    static final Key<Boolean> ALIVE_KEY = new Key<>("alive", false);
+    static final Key<String> CONFIG_LISTEN_ADDRESS = new Key<>("configListenAddress", false);
+
+    static final Category<AgentInformation> CATEGORY = new Category<>("agent-config", AgentInformation.class,
+            Key.AGENT_ID,
+            START_TIME_KEY,
+            STOP_TIME_KEY,
+            ALIVE_KEY,
+            CONFIG_LISTEN_ADDRESS);
+
+    List<AgentInformation> getAllAgentInformation();
+
+    List<AgentInformation> getAliveAgents();
+
+    AgentInformation getAgentInformation(HostRef agentRef);
+
+    void addAgentInformation(AgentInformation agentInfo);
+
+    void updateAgentInformation(AgentInformation agentInfo);
+
+    void removeAgentInformation(AgentInformation agentInfo);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/dao/BackendInfoDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.dao;
+
+import java.util.List;
+
+import com.redhat.thermostat.annotations.Service;
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.model.BackendInformation;
+
+@Service
+public interface BackendInfoDAO {
+
+    static final Key<String> BACKEND_NAME = new Key<>("name", true);
+    static final Key<String> BACKEND_DESCRIPTION = new Key<>("description", false);
+    static final Key<Boolean> IS_ACTIVE = new Key<>("active", false);
+    static final Key<Boolean> SHOULD_MONITOR_NEW_PROCESSES = new Key<>("observeNewJvm", false);
+    static final Key<List<Integer>> PIDS_TO_MONITOR = new Key<>("pids", false);
+    static final Key<Integer> ORDER_VALUE = new Key<>("orderValue", false);
+
+    static final Category<BackendInformation> CATEGORY = new Category<>("backend-info", BackendInformation.class,
+            Key.AGENT_ID,
+            BACKEND_NAME,
+            BACKEND_DESCRIPTION,
+            IS_ACTIVE,
+            SHOULD_MONITOR_NEW_PROCESSES,
+            PIDS_TO_MONITOR,
+            ORDER_VALUE);
+
+    List<BackendInformation> getBackendInformation(HostRef host);
+
+    void addBackendInformation(BackendInformation info);
+
+    void removeBackendInformation(BackendInformation info);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/dao/DAOException.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.dao;
+
+public class DAOException extends RuntimeException {
+
+    public DAOException() {
+        super();
+    }
+
+    public DAOException(String message) {
+        super(message);
+    }
+
+    public DAOException(Throwable cause) {
+        super(cause);
+    }
+
+    public DAOException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/dao/DAOFactory.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.dao;
+
+import com.redhat.thermostat.storage.core.Connection;
+import com.redhat.thermostat.storage.core.Storage;
+
+public interface DAOFactory {
+
+    // TODO this is temporary until DAO is made for those that are still using Storage directly.
+    public Storage getStorage();
+
+    public Connection getConnection();
+
+    public AgentInfoDAO getAgentInfoDAO();
+
+    public BackendInfoDAO getBackendInfoDAO();
+
+    public HostInfoDAO getHostInfoDAO();
+
+    public NetworkInterfaceInfoDAO getNetworkInterfaceInfoDAO();
+
+    public VmInfoDAO getVmInfoDAO();
+
+    public void registerDAOsAndStorageAsOSGiServices();
+    public void unregisterDAOsAndStorageAsOSGiServices();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/dao/DAOFactoryImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.dao;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceRegistration;
+
+import com.redhat.thermostat.storage.core.Connection;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.StorageProvider;
+import com.redhat.thermostat.storage.internal.dao.AgentInfoDAOImpl;
+import com.redhat.thermostat.storage.internal.dao.BackendInfoDAOImpl;
+import com.redhat.thermostat.storage.internal.dao.HostInfoDAOImpl;
+import com.redhat.thermostat.storage.internal.dao.NetworkInterfaceInfoDAOImpl;
+import com.redhat.thermostat.storage.internal.dao.VmInfoDAOImpl;
+
+/*
+ * TODO: This class should go away, but is still used in AgentApplication and (client) Main classes.
+ */
+public class DAOFactoryImpl implements DAOFactory {
+
+    private final Storage storage;
+    private final BundleContext bundleContext;
+    @SuppressWarnings("rawtypes")
+    private final List<ServiceRegistration> registeredServices = new ArrayList<>();
+    private AgentInfoDAO agentDAO;
+    private BackendInfoDAO backendInfoDAO;
+    private HostInfoDAO hostInfoDAO;
+    private NetworkInterfaceInfoDAO networkInfoDAO;
+    private VmInfoDAO vmInfoDAO;
+
+    public DAOFactoryImpl(StorageProvider prov) {
+        this(FrameworkUtil.getBundle(DAOFactoryImpl.class).getBundleContext(), prov);
+    }
+
+    public DAOFactoryImpl(BundleContext bundleContext, StorageProvider prov) {
+        this.bundleContext = bundleContext;
+        storage = prov.createStorage();
+    }
+
+    @Override
+    public Connection getConnection() {
+        return storage.getConnection();
+    }
+
+    @Override
+    public AgentInfoDAO getAgentInfoDAO() {
+        ensureStorageConnected();
+        return agentDAO;
+    }
+
+    @Override
+    public BackendInfoDAO getBackendInfoDAO() {
+        ensureStorageConnected();
+        return backendInfoDAO;
+    }
+
+    @Override
+    public HostInfoDAO getHostInfoDAO() {
+        ensureStorageConnected();
+        return hostInfoDAO;
+    }
+
+    @Override
+    public NetworkInterfaceInfoDAO getNetworkInterfaceInfoDAO() {
+        ensureStorageConnected();
+        return networkInfoDAO;
+    }
+
+    @Override
+    public VmInfoDAO getVmInfoDAO() {
+        ensureStorageConnected();
+        return vmInfoDAO;
+    }
+
+    @Override
+    public Storage getStorage() {
+        return storage;
+    }
+
+    private void ensureStorageConnected() {
+        if (!storage.getConnection().isConnected()) {
+            throw new IllegalStateException("Set up connection before accessing DAO");
+        }
+    }
+
+    @Override
+    public void registerDAOsAndStorageAsOSGiServices() {
+        ensureStorageConnected();
+        createDAOs();
+        registerAndRecordService(Storage.class, getStorage());
+
+        registerAndRecordService(AgentInfoDAO.class, getAgentInfoDAO());
+        registerAndRecordService(BackendInfoDAO.class, getBackendInfoDAO());
+
+        registerAndRecordService(HostInfoDAO.class, getHostInfoDAO());
+        registerAndRecordService(NetworkInterfaceInfoDAO.class, getNetworkInterfaceInfoDAO());
+
+        registerAndRecordService(VmInfoDAO.class, getVmInfoDAO());
+    }
+
+    /*
+     * Pre: Db connected
+     */
+    void createDAOs() {
+        agentDAO = new AgentInfoDAOImpl(storage);
+        backendInfoDAO = new BackendInfoDAOImpl(storage);
+        hostInfoDAO = new HostInfoDAOImpl(storage, agentDAO);
+        networkInfoDAO = new NetworkInterfaceInfoDAOImpl(storage);
+        vmInfoDAO = new VmInfoDAOImpl(storage);
+    }
+
+    private <K> void registerAndRecordService(Class<K> serviceType, K serviceImplementation) {
+        registeredServices.add(bundleContext.registerService(serviceType, serviceImplementation, null));
+    }
+
+    public void unregisterDAOsAndStorageAsOSGiServices() {
+        Iterator<ServiceRegistration> iter = registeredServices.iterator();
+        while (iter.hasNext()) {
+            ServiceRegistration registration = iter.next();
+            registration.unregister();
+            iter.remove();
+        }
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/dao/HostInfoDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.dao;
+
+import java.util.Collection;
+
+import com.redhat.thermostat.annotations.Service;
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Countable;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.model.HostInfo;
+
+@Service
+public interface HostInfoDAO extends Countable {
+
+    static Key<String> hostNameKey = new Key<>("hostname", true);
+    static Key<String> osNameKey = new Key<>("osName", false);
+    static Key<String> osKernelKey = new Key<>("osKernel", false);
+    static Key<Integer> cpuCountKey = new Key<>("cpuCount", false);
+    static Key<String> cpuModelKey = new Key<>("cpuModel", false);
+    static Key<Long> hostMemoryTotalKey = new Key<>("totalMemory", false);
+
+    static final Category<HostInfo> hostInfoCategory = new Category<>("host-info", HostInfo.class,
+            Key.AGENT_ID, hostNameKey, osNameKey, osKernelKey,
+            cpuCountKey, cpuModelKey, hostMemoryTotalKey);
+
+    HostInfo getHostInfo(HostRef ref);
+
+    void putHostInfo(HostInfo info);
+
+    Collection<HostRef> getHosts();
+    Collection<HostRef> getAliveHosts();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/dao/NetworkInterfaceInfoDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.dao;
+
+import java.util.List;
+
+import com.redhat.thermostat.annotations.Service;
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.model.NetworkInterfaceInfo;
+
+@Service
+public interface NetworkInterfaceInfoDAO {
+
+    static Key<String> ifaceKey = new Key<>("interfaceName", true);
+    static Key<String> ip4AddrKey = new Key<>("ip4Addr", false);
+    static Key<String> ip6AddrKey = new Key<>("ip6Addr", false);
+
+    static final Category<NetworkInterfaceInfo> networkInfoCategory = new Category<>("network-info", NetworkInterfaceInfo.class,
+            Key.AGENT_ID, ifaceKey, ip4AddrKey, ip6AddrKey);
+
+    public List<NetworkInterfaceInfo> getNetworkInterfaces(HostRef ref);
+
+    public void putNetworkInterfaceInfo(NetworkInterfaceInfo info);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/dao/VmInfoDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.dao;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import com.redhat.thermostat.annotations.Service;
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Countable;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.model.VmInfo;
+
+@Service
+public interface VmInfoDAO extends Countable {
+
+    static final Key<Integer> vmPidKey = new Key<>("vmPid", false);
+    static final Key<String> runtimeVersionKey = new Key<>("javaVersion", false);
+    static final Key<String> javaHomeKey = new Key<>("javaHome", false);
+    static final Key<String> mainClassKey = new Key<>("mainClass", false);
+    static final Key<String> commandLineKey = new Key<>("javaCommandLine", false);
+    static final Key<String> vmArgumentsKey = new Key<>("vmArguments", false);
+    static final Key<String> vmNameKey = new Key<>("vmName", false);
+    static final Key<String> vmInfoKey = new Key<>("vmInfo", false);
+    static final Key<String> vmVersionKey = new Key<>("vmVersion", false);
+    static final Key<Map<String, String>> propertiesKey = new Key<>("properties", false);
+    static final Key<Map<String, String>> environmentKey = new Key<>("environment", false);
+    static final Key<List<String>> librariesKey = new Key<>("loadedNativeLibraries", false);
+    static final Key<Long> startTimeKey = new Key<>("startTimeStamp", false);
+    static final Key<Long> stopTimeKey = new Key<>("stopTimeStamp", false);
+
+    static final Category<VmInfo> vmInfoCategory = new Category<>("vm-info", VmInfo.class,
+            Key.AGENT_ID, Key.VM_ID, vmPidKey, runtimeVersionKey, javaHomeKey,
+            mainClassKey, commandLineKey,
+            vmArgumentsKey, vmNameKey, vmInfoKey, vmVersionKey,
+            propertiesKey, environmentKey, librariesKey,
+            startTimeKey, stopTimeKey);
+
+    public VmInfo getVmInfo(VmRef ref);
+
+    Collection<VmRef> getVMs(HostRef host);
+
+    public void putVmInfo(VmInfo info);
+
+    public void putVmStoppedTime(int vmId, long since);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/internal/DbServiceImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceRegistration;
+
+import com.redhat.thermostat.storage.config.ConnectionConfiguration;
+import com.redhat.thermostat.storage.config.StartupConfiguration;
+import com.redhat.thermostat.storage.core.ConnectionException;
+import com.redhat.thermostat.storage.core.DbService;
+import com.redhat.thermostat.storage.core.StorageException;
+import com.redhat.thermostat.storage.core.StorageProvider;
+import com.redhat.thermostat.storage.core.StorageProviderUtil;
+import com.redhat.thermostat.storage.dao.DAOFactory;
+import com.redhat.thermostat.storage.dao.DAOFactoryImpl;
+
+public class DbServiceImpl implements DbService {
+    
+    @SuppressWarnings("rawtypes")
+    private ServiceRegistration registration;
+    
+    private DAOFactory daoFactory;
+    private BundleContext context;
+    private String dbUrl;
+    
+    DbServiceImpl(String username, String password, String dbUrl) throws StorageException {
+        this(FrameworkUtil.getBundle(DbService.class).getBundleContext(), getDAOFactory(username, password, dbUrl), dbUrl);
+    }
+
+    // for testing
+    DbServiceImpl(BundleContext context, DAOFactory daoFactory, String dbUrl) {
+        this.daoFactory = daoFactory;
+        this.context = context;
+        this.dbUrl = dbUrl;
+    }
+
+    public void connect() throws ConnectionException {
+        try {
+            daoFactory.getConnection().connect();
+            registration = context.registerService(DbService.class, this, null);
+            daoFactory.registerDAOsAndStorageAsOSGiServices();
+        } catch (Exception cause) {
+            throw new ConnectionException(cause);
+        }
+    }
+    
+    public void disconnect() throws ConnectionException {
+        try {
+            daoFactory.unregisterDAOsAndStorageAsOSGiServices();
+            daoFactory.getConnection().disconnect();
+            registration.unregister();
+        } catch (Exception cause) {
+            throw new ConnectionException(cause);
+        }
+    }
+    
+    @Override
+    public String getConnectionUrl() {
+        return dbUrl;
+    }
+
+    /**
+     * Factory method for creating a DbService instance.
+     * 
+     * @param username
+     * @param password
+     * @param dbUrl
+     * @return a DbService instance
+     * @throws StorageException if no storage provider exists for the given {@code dbUrl}.
+     */
+    public static DbService create(String username, String password, String dbUrl) throws StorageException {
+        return new DbServiceImpl(username, password, dbUrl);
+    }
+
+    private static DAOFactory getDAOFactory(String username, String password, String dbUrl) throws StorageException {
+        StartupConfiguration config = new ConnectionConfiguration(dbUrl, username, password);
+        StorageProvider prov = StorageProviderUtil.getStorageProvider(config);
+        if (prov == null) {
+            // no suitable provider found
+            throw new StorageException("No storage found for URL " + dbUrl);
+        }
+        return new DAOFactoryImpl(prov);
+    }
+    
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/internal/dao/AgentInfoDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Put;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Remove;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.Update;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.model.AgentInformation;
+
+public class AgentInfoDAOImpl implements AgentInfoDAO {
+
+    private final Storage storage;
+
+    public AgentInfoDAOImpl(Storage storage) {
+        this.storage = storage;
+        storage.registerCategory(CATEGORY);
+    }
+
+    @Override
+    public long getCount() {
+        return storage.getCount(CATEGORY);
+    }
+
+    @Override
+    public List<AgentInformation> getAllAgentInformation() {
+        Query<AgentInformation> query = storage.createQuery(CATEGORY);
+        Cursor<AgentInformation> agentCursor = query.execute();
+
+        List<AgentInformation> results = new ArrayList<>();
+
+        while (agentCursor.hasNext()) {
+            AgentInformation agentInfo = agentCursor.next();
+            results.add(agentInfo);
+        }
+        return results;
+    }
+
+    @Override
+    public List<AgentInformation> getAliveAgents() {
+        Query<AgentInformation> query = storage.createQuery(CATEGORY);
+        query.where(AgentInfoDAO.ALIVE_KEY, Criteria.EQUALS, true);
+
+        Cursor<AgentInformation> agentCursor = query.execute();
+
+        List<AgentInformation> results = new ArrayList<>();
+
+        while (agentCursor.hasNext()) {
+            AgentInformation agentInfo = agentCursor.next();
+            results.add(agentInfo);
+        }
+        return results;
+    }
+
+    @Override
+    public AgentInformation getAgentInformation(HostRef agentRef) {
+        Query<AgentInformation> query = storage.createQuery(CATEGORY);
+        query.where(Key.AGENT_ID, Criteria.EQUALS, agentRef.getAgentId());
+        query.limit(1);
+        return query.execute().next();
+    }
+
+    @Override
+    public void addAgentInformation(AgentInformation agentInfo) {
+        Put replace = storage.createReplace(CATEGORY);
+        replace.setPojo(agentInfo);
+        replace.apply();
+    }
+
+    @Override
+    public void removeAgentInformation(AgentInformation agentInfo) {
+        Remove remove = storage.createRemove().from(CATEGORY).where(Key.AGENT_ID, agentInfo.getAgentId());
+        storage.removePojo(remove);
+    }
+
+    @Override
+    public void updateAgentInformation(AgentInformation agentInfo) {
+        Update update = storage.createUpdate(CATEGORY);
+        update.where(Key.AGENT_ID, agentInfo.getAgentId());
+        update.set(START_TIME_KEY, agentInfo.getStartTime());
+        update.set(STOP_TIME_KEY, agentInfo.getStopTime());
+        update.set(ALIVE_KEY, agentInfo.isAlive());
+        update.set(CONFIG_LISTEN_ADDRESS, agentInfo.getConfigListenAddress());
+        update.apply();
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/internal/dao/BackendInfoDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Put;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.core.Remove;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.dao.BackendInfoDAO;
+import com.redhat.thermostat.storage.model.BackendInformation;
+
+public class BackendInfoDAOImpl implements BackendInfoDAO {
+
+    private final Storage storage;
+
+    public BackendInfoDAOImpl(Storage storage) {
+        this.storage = storage;
+        storage.registerCategory(CATEGORY);
+    }
+
+    @Override
+    public List<BackendInformation> getBackendInformation(HostRef host) {
+        // Sort by order value
+        Query<BackendInformation> query = storage.createQuery(CATEGORY);
+        query.where(Key.AGENT_ID, Criteria.EQUALS, host.getAgentId());
+
+        List<BackendInformation> results = new ArrayList<>();
+        Cursor<BackendInformation> cursor = query.execute();
+        while (cursor.hasNext()) {
+            BackendInformation backendInfo = cursor.next();
+            results.add(backendInfo);
+        }
+        
+        // Sort before returning
+        Collections.sort(results, new Comparator<BackendInformation>() {
+
+            // TODO Use OrderedComparator when common-core
+            // doesn't depend on storage-core
+            @Override
+            public int compare(BackendInformation o1, BackendInformation o2) {
+                int result = o1.getOrderValue() - o2.getOrderValue();
+                // Break ties using class name
+                if (result == 0) {
+                    result = o1.getClass().getName().compareTo(o2.getClass().getName());
+                }
+                return result;
+            }
+        });
+        
+        return results;
+    }
+
+    @Override
+    public void addBackendInformation(BackendInformation info) {
+        Put add = storage.createAdd(BackendInfoDAO.CATEGORY);
+        add.setPojo(info);
+        add.apply();
+    }
+
+    @Override
+    public void removeBackendInformation(BackendInformation info) {
+        Remove remove = storage.createRemove().from(CATEGORY).where(BACKEND_NAME, info.getName());
+        storage.removePojo(remove);
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/internal/dao/HostInfoDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Put;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.model.AgentInformation;
+import com.redhat.thermostat.storage.model.HostInfo;
+
+public class HostInfoDAOImpl implements HostInfoDAO {
+
+    private final Storage storage;
+    private final AgentInfoDAO agentInfoDao;
+
+
+    public HostInfoDAOImpl(Storage storage, AgentInfoDAO agentInfo) {
+        this.storage = storage;
+        this.agentInfoDao = agentInfo;
+        storage.registerCategory(hostInfoCategory);
+    }
+
+    @Override
+    public HostInfo getHostInfo(HostRef ref) {
+        Query<HostInfo> query = storage.createQuery(hostInfoCategory);
+        query.where(Key.AGENT_ID, Criteria.EQUALS, ref.getAgentId());
+        query.limit(1);
+        HostInfo result = query.execute().next();
+        return result;
+    }
+
+    @Override
+    public void putHostInfo(HostInfo info) {
+        Put add = storage.createAdd(hostInfoCategory);
+        add.setPojo(info);
+        add.apply();
+    }
+
+    @Override
+    public Collection<HostRef> getHosts() {
+        Query<HostInfo> allHosts = storage.createQuery(hostInfoCategory);
+        return getHosts(allHosts);
+    }
+
+    @Override
+    public Collection<HostRef> getAliveHosts() {
+        List<HostRef> hosts = new ArrayList<>();
+        List<AgentInformation> agentInfos = agentInfoDao.getAliveAgents();
+        for (AgentInformation agentInfo : agentInfos) {
+            Query<HostInfo> filter = storage.createQuery(hostInfoCategory);
+            filter.where(Key.AGENT_ID, Criteria.EQUALS, agentInfo.getAgentId());
+            hosts.addAll(getHosts(filter));
+        }
+
+        return hosts;
+    }
+
+
+    private Collection<HostRef> getHosts(Query<HostInfo> filter) {
+        Collection<HostRef> hosts = new ArrayList<HostRef>();
+        
+        Cursor<HostInfo> hostsCursor = filter.execute();
+        while(hostsCursor.hasNext()) {
+            HostInfo host = hostsCursor.next();
+            String agentId = host.getAgentId();
+            String hostName = host.getHostname();
+            hosts.add(new HostRef(agentId, hostName));
+        }
+        return hosts;
+    }
+
+    @Override
+    public long getCount() {
+        return storage.getCount(hostInfoCategory);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/internal/dao/NetworkInterfaceInfoDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Put;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO;
+import com.redhat.thermostat.storage.model.NetworkInterfaceInfo;
+
+public class NetworkInterfaceInfoDAOImpl implements NetworkInterfaceInfoDAO {
+
+    private Storage storage;
+
+    public NetworkInterfaceInfoDAOImpl(Storage storage) {
+        this.storage = storage;
+        storage.registerCategory(networkInfoCategory);
+    }
+
+    @Override
+    public List<NetworkInterfaceInfo> getNetworkInterfaces(HostRef ref) {
+        Query<NetworkInterfaceInfo> allHostNetworkInterfaces = storage.createQuery(networkInfoCategory);
+        allHostNetworkInterfaces.where(Key.AGENT_ID, Criteria.EQUALS, ref.getAgentId());
+
+        Cursor<NetworkInterfaceInfo> cursor = allHostNetworkInterfaces.execute();
+        List<NetworkInterfaceInfo> result = new ArrayList<>();
+        while (cursor.hasNext()) {
+            NetworkInterfaceInfo stat = cursor.next();
+            result.add(stat);
+        }
+        return result;
+    }
+
+    @Override
+    public void putNetworkInterfaceInfo(NetworkInterfaceInfo info) {
+        Put replace = storage.createReplace(networkInfoCategory);
+        replace.setPojo(info);
+        replace.apply();
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/main/java/com/redhat/thermostat/storage/internal/dao/VmInfoDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Put;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.Update;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.DAOException;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
+import com.redhat.thermostat.storage.model.VmInfo;
+
+public class VmInfoDAOImpl implements VmInfoDAO {
+
+    private final Storage storage;
+
+    public VmInfoDAOImpl(Storage storage) {
+        this.storage = storage;
+        storage.registerCategory(vmInfoCategory);
+    }
+
+    @Override
+    public VmInfo getVmInfo(VmRef ref) {
+        Query<VmInfo> findMatchingVm = storage.createQuery(vmInfoCategory);
+        findMatchingVm.where(Key.AGENT_ID, Criteria.EQUALS, ref.getAgent().getAgentId());
+        findMatchingVm.where(Key.VM_ID, Criteria.EQUALS, ref.getId());
+        findMatchingVm.limit(1);
+        VmInfo result = findMatchingVm.execute().next();
+        if (result == null) {
+            throw new DAOException("Unknown VM: host:" + ref.getAgent().getAgentId() + ";vm:" + ref.getId());
+        }
+        return result;
+    }
+
+    @Override
+    public Collection<VmRef> getVMs(HostRef host) {
+
+        Query<VmInfo> query = buildQuery(host);
+        Cursor<VmInfo> cursor = query.execute();
+        return buildVMsFromQuery(cursor, host);
+    }
+
+    private Query<VmInfo> buildQuery(HostRef host) {
+        Query<VmInfo> query = storage.createQuery(vmInfoCategory);
+        query.where(Key.AGENT_ID, Criteria.EQUALS, host.getAgentId());
+        return query;
+    }
+
+    private Collection<VmRef> buildVMsFromQuery(Cursor<VmInfo> cursor, HostRef host) {
+        List<VmRef> vmRefs = new ArrayList<VmRef>();
+        while (cursor.hasNext()) {
+            VmInfo vmInfo = cursor.next();
+            VmRef vm = buildVmRefFromChunk(vmInfo, host);
+            vmRefs.add(vm);
+        }
+
+        return vmRefs;
+    }
+
+    private VmRef buildVmRefFromChunk(VmInfo vmInfo, HostRef host) {
+        Integer id = vmInfo.getVmId();
+        // TODO can we do better than the main class?
+        String mainClass = vmInfo.getMainClass();
+        VmRef ref = new VmRef(host, id, mainClass);
+        return ref;
+    }
+
+    @Override
+    public long getCount() {
+        return storage.getCount(vmInfoCategory);
+    }
+
+    @Override
+    public void putVmInfo(VmInfo info) {
+        Put replace = storage.createReplace(vmInfoCategory);
+        replace.setPojo(info);
+        replace.apply();
+    }
+
+    @Override
+    public void putVmStoppedTime(int vmId, long timestamp) {
+        Update update = storage.createUpdate(vmInfoCategory);
+        update.where(Key.VM_ID, vmId);
+        update.set(VmInfoDAO.stopTimeKey, timestamp);
+        update.apply();
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/core/DefaultHostsVMsLoaderTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.redhat.thermostat.storage.core.DefaultHostsVMsLoader;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
+
+public class DefaultHostsVMsLoaderTest {
+
+    private HostInfoDAO mockHostsDAO;
+    private VmInfoDAO mockVmsDAO;
+    private DefaultHostsVMsLoader loader;
+    
+    @Before
+    public void setUp() throws Exception {
+        mockHostsDAO = mock(HostInfoDAO.class);
+        mockVmsDAO = mock(VmInfoDAO.class);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        mockHostsDAO = null;
+        mockVmsDAO = null;
+        loader = null;
+    }
+
+    @Test
+    public void canGetHosts() {
+        Collection<HostRef> expectedHosts = new ArrayList<>();
+        expectedHosts.add(new HostRef("123", "fluffhost1"));
+        expectedHosts.add(new HostRef("456", "fluffhost2"));
+        expectedHosts.add(new HostRef("007", "deadHost"));
+
+        loader = new DefaultHostsVMsLoader(mockHostsDAO, mockVmsDAO, false);
+        when(mockHostsDAO.getHosts()).thenReturn(expectedHosts);
+        assertEquals(loader.getHosts(), expectedHosts);
+        
+        loader = new DefaultHostsVMsLoader(mockHostsDAO, mockVmsDAO, true);
+        Collection<HostRef> aliveHosts = new ArrayList<>();
+        expectedHosts.add(new HostRef("123", "fluffhost1"));
+        expectedHosts.add(new HostRef("456", "fluffhost2"));
+        when(mockHostsDAO.getAliveHosts()).thenReturn(aliveHosts);
+        assertEquals(loader.getHosts(), aliveHosts);
+    }
+    
+    @Test
+    public void canGetVms() {
+        HostRef hostR = mock(HostRef.class);
+        Collection<VmRef> expectedVms = new ArrayList<>();
+        expectedVms.add(new VmRef(hostR, 1, "test1"));
+        expectedVms.add(new VmRef(hostR, 2, "test2"));
+
+        loader = new DefaultHostsVMsLoader(mockHostsDAO, mockVmsDAO, false /* irrelevant */);
+        when(mockVmsDAO.getVMs(hostR)).thenReturn(expectedVms);
+        assertEquals(loader.getVMs(hostR), expectedVms);
+        
+        assertEquals(0, loader.getVMs(mock(HostRef.class)).size());
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/core/HostLatestPojoListGetterTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.model.CpuStat;
+
+public class HostLatestPojoListGetterTest {
+    private static final String AGENT_ID = "agentid";
+    private static final String HOSTNAME = "host.example.com";
+    private static final String CATEGORY_NAME = "hostcategory";
+    // Make this one static so we don't get IllegalStateException from trying
+    // to make category of same name while running tests in same classloader.
+    private static final Category<CpuStat> cat =  new Category<>(CATEGORY_NAME, CpuStat.class);
+
+    private static long t1 = 1;
+    private static long t2 = 5;
+    private static long t3 = 10;
+
+    private static Double load5_1 = 2.0;
+    private static Double load5_2 = 6.0;
+    private static Double load5_3 = 11.0;
+
+    private static Double load10_1 = 3.0;
+    private static Double load10_2 = 7.0;
+    private static Double load10_3 = 12.0;
+
+    private static Double load15_1 = 4.0;
+    private static Double load15_2 = 8.0;
+    private static Double load15_3 = 13.0;
+
+    private HostRef ref;
+    private CpuStat result1, result2, result3;
+
+    @Before
+    public void setUp() {
+        ref = new HostRef(AGENT_ID, HOSTNAME);
+        result1 = new CpuStat(t1, new double[] { load5_1, load10_1, load15_1 } );
+        result2 = new CpuStat(t2, new double[] { load5_2, load10_2, load15_2 } );
+        result3 = new CpuStat(t3, new double[] { load5_3, load10_3, load15_3 } );
+    }
+
+    @Test
+    public void testBuildQuery() {
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when (storage.createQuery(any(Category.class))).thenReturn(query);
+
+        HostLatestPojoListGetter<CpuStat> getter = new HostLatestPojoListGetter<>(storage, cat);
+        query = getter.buildQuery(ref, 123);
+
+        assertNotNull(query);
+        verify(storage).createQuery(cat);
+        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, 123l);
+        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
+        verify(query).sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
+        verifyNoMoreInteractions(query);
+    }
+
+    @Test
+    public void testBuildQueryPopulatesUpdateTimes() {
+        Storage storage = mock(Storage.class);
+        Query ignored = mock(Query.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(ignored).thenReturn(query);
+
+        HostLatestPojoListGetter<CpuStat> getter = new HostLatestPojoListGetter<>(storage, cat);
+        ignored = getter.buildQuery(ref,Long.MIN_VALUE); // Ignore first return value.
+
+        query = getter.buildQuery(ref, Long.MIN_VALUE);
+
+        assertNotNull(query);
+        verify(storage, times(2)).createQuery(cat);
+        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
+        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, Long.MIN_VALUE);
+        verify(query).sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
+        verifyNoMoreInteractions(query);
+    }
+
+    @Test
+    public void testGetLatest() {
+        @SuppressWarnings("unchecked")
+        Cursor<CpuStat> cursor = mock(Cursor.class);
+        when(cursor.hasNext()).thenReturn(true).thenReturn(true).thenReturn(false);
+        when(cursor.next()).thenReturn(result1).thenReturn(result2).thenReturn(null);
+
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        when(query.execute()).thenReturn(cursor);
+
+        HostLatestPojoListGetter<CpuStat> getter = new HostLatestPojoListGetter<>(storage, cat);
+
+        List<CpuStat> stats = getter.getLatest(ref, Long.MIN_VALUE);
+
+        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
+        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, Long.MIN_VALUE);
+
+        assertNotNull(stats);
+        assertEquals(2, stats.size());
+        CpuStat stat1 = stats.get(0);
+        assertEquals(t1, stat1.getTimeStamp());
+        assertArrayEquals(new double[] {load5_1, load10_1, load15_1}, stat1.getPerProcessorUsage(), 0.001);
+        CpuStat stat2 = stats.get(1);
+        assertEquals(t2, stat2.getTimeStamp());
+        assertArrayEquals(new double[] {load5_2, load10_2, load15_2}, stat2.getPerProcessorUsage(), 0.001);
+    }
+
+    @After
+    public void tearDown() {
+        ref = null;
+        result1 = null;
+        result2 = null;
+        result3 = null;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/core/VmLatestPojoListGetterTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.core;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.model.VmClassStat;
+
+public class VmLatestPojoListGetterTest {
+    private static final String AGENT_ID = "agentid";
+    private static final String HOSTNAME = "host.example.com";
+    private static final int VM_PID = 123;
+    private static final String MAIN_CLASS = "Foo.class";
+    private static final String CATEGORY_NAME = "vmcategory";
+    // Make this one static so we don't get IllegalStateException from trying
+    // to make category of same name while running tests in same classloader.
+    private static final Category<VmClassStat> cat =  new Category<>(CATEGORY_NAME, VmClassStat.class);
+
+    private static long t1 = 1;
+    private static long t2 = 5;
+    private static long t3 = 10;
+
+    private static long lc1 = 10;
+    private static long lc2 = 20;
+    private static long lc3 = 30;
+
+    private HostRef hostRef;
+    private VmRef vmRef;
+    private VmClassStat result1, result2, result3;
+
+    @Before
+    public void setUp() {
+        hostRef = new HostRef(AGENT_ID, HOSTNAME);
+        vmRef = new VmRef(hostRef, VM_PID, MAIN_CLASS);
+        result1 = new VmClassStat(VM_PID, t1, lc1);
+        result2 = new VmClassStat(VM_PID, t2, lc2);
+        result3 = new VmClassStat(VM_PID, t3, lc3);
+    }
+
+    @Test
+    public void testBuildQuery() {
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+
+        VmLatestPojoListGetter<VmClassStat> getter = new VmLatestPojoListGetter<>(storage, cat);
+        query = getter.buildQuery(vmRef, 123l);
+
+        assertNotNull(query);
+        verify(storage).createQuery(cat);
+        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
+        verify(query).where(Key.VM_ID, Criteria.EQUALS, VM_PID);
+        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, 123l);
+        verify(query).sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
+        verifyNoMoreInteractions(query);
+    }
+
+    @Test
+    public void testBuildQueryPopulatesUpdateTimes() {
+        Storage storage = mock(Storage.class);
+        Query ignored = mock(Query.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(ignored).thenReturn(query);
+
+        VmLatestPojoListGetter<VmClassStat> getter = new VmLatestPojoListGetter<>(storage, cat);
+        getter.buildQuery(vmRef, Long.MIN_VALUE); // Ignore first return value.
+        query = getter.buildQuery(vmRef, Long.MIN_VALUE);
+
+        assertNotNull(query);
+        verify(storage, times(2)).createQuery(cat);
+        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
+        verify(query).where(Key.VM_ID, Criteria.EQUALS, VM_PID);
+        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, Long.MIN_VALUE);
+        verify(query).sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
+        verifyNoMoreInteractions(query);
+    }
+
+    @Test
+    public void testGetLatest() {
+        @SuppressWarnings("unchecked")
+        Cursor<VmClassStat> cursor = mock(Cursor.class);
+        when(cursor.hasNext()).thenReturn(true).thenReturn(true).thenReturn(false);
+        when(cursor.next()).thenReturn(result1).thenReturn(result2).thenReturn(null);
+
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        when(query.execute()).thenReturn(cursor);
+
+        VmLatestPojoListGetter<VmClassStat> getter = new VmLatestPojoListGetter<>(storage, cat);
+
+        List<VmClassStat> stats = getter.getLatest(vmRef, t2);
+
+        verify(storage).createQuery(cat);
+        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
+        verify(query).where(Key.VM_ID, Criteria.EQUALS, VM_PID);
+        verify(query).where(Key.TIMESTAMP, Criteria.GREATER_THAN, t2);
+        verify(query).sort(Key.TIMESTAMP, Query.SortDirection.DESCENDING);
+        verify(query).execute();
+        verifyNoMoreInteractions(query);
+
+        assertNotNull(stats);
+        assertEquals(2, stats.size());
+        VmClassStat stat1 = stats.get(0);
+        assertEquals(t1, stat1.getTimeStamp());
+        assertEquals(lc1, stat1.getLoadedClasses());
+        VmClassStat stat2 = stats.get(1);
+        assertEquals(t2, stat2.getTimeStamp());
+        assertEquals(lc2, stat2.getLoadedClasses());
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/dao/DAOFactoryTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.dao;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.redhat.thermostat.storage.core.Connection;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.StorageProvider;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.BackendInfoDAO;
+import com.redhat.thermostat.storage.dao.DAOFactory;
+import com.redhat.thermostat.storage.dao.DAOFactoryImpl;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
+import com.redhat.thermostat.testutils.StubBundleContext;
+
+public class DAOFactoryTest {
+
+    private StubBundleContext bundleContext;
+    private Storage storage;
+    private Connection connection;
+    private StorageProvider provider;
+    private DAOFactory daoFactory;
+
+    @Before
+    public void setUp() {
+        bundleContext = new StubBundleContext();
+
+        storage = mock(Storage.class);
+        connection = mock(Connection.class);
+        when(storage.getConnection()).thenReturn(connection);
+        when(connection.isConnected()).thenReturn(true);
+        provider = mock(StorageProvider.class);
+        when(provider.createStorage()).thenReturn(storage);
+        daoFactory = new DAOFactoryImpl(bundleContext, provider);
+        ((DAOFactoryImpl)daoFactory).createDAOs();
+    }
+
+    @Test
+    public void testGetConnection() {
+        assertSame(storage, daoFactory.getStorage());
+    }
+
+    @Test
+    public void testGetAgentInfoDAO() {
+        AgentInfoDAO dao = daoFactory.getAgentInfoDAO();
+        assertNotNull(dao);
+    }
+
+    @Test
+    public void testGetBackendInfoDAO() {
+        BackendInfoDAO dao = daoFactory.getBackendInfoDAO();
+        assertNotNull(dao);
+    }
+
+    @Test
+    public void testGetVmInfoDAO() {
+        VmInfoDAO dao = daoFactory.getVmInfoDAO();
+        assertNotNull(dao);
+    }
+
+    @Test
+    public void testGetHostInfoDAO() {
+        HostInfoDAO dao = daoFactory.getHostInfoDAO();
+        assertNotNull(dao);
+    }
+
+    @Test
+    public void testGetNetworkInterfaceInfoDAO() {
+        NetworkInterfaceInfoDAO dao = daoFactory.getNetworkInterfaceInfoDAO();
+        assertNotNull(dao);
+    }
+
+    @Test
+    public void testServiceRegistration() {
+        assertEquals(0, bundleContext.getAllServices().size());
+
+        daoFactory.registerDAOsAndStorageAsOSGiServices();
+
+        // currently 6 DAOs and Storage are registered
+        assertEquals(6, bundleContext.getAllServices().size());
+    }
+
+    @Test
+    public void testServiceDeregistration() {
+        daoFactory.registerDAOsAndStorageAsOSGiServices();
+        daoFactory.unregisterDAOsAndStorageAsOSGiServices();
+
+        assertEquals(0, bundleContext.getAllServices().size());
+        assertEquals(0, bundleContext.getServiceListeners().size());
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/internal/DbServiceTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.ServiceReference;
+
+import com.redhat.thermostat.storage.core.Connection;
+import com.redhat.thermostat.storage.core.DbService;
+import com.redhat.thermostat.storage.dao.DAOFactory;
+import com.redhat.thermostat.testutils.StubBundleContext;
+
+public class DbServiceTest {
+    
+    private Connection connection;
+    private DAOFactory daoFactory;
+    private DbService dbService;
+    private StubBundleContext context;
+    
+    @Before
+    public void setup() {
+        context = new StubBundleContext();
+        connection = mock(Connection.class);
+
+        daoFactory = mock(DAOFactory.class);
+        when(daoFactory.getConnection()).thenReturn(connection);
+
+        dbService = new DbServiceImpl(context, daoFactory, "http://someUrl.ignored.com");
+    }
+    
+    @After
+    public void teardown() {
+        dbService = null;
+        context = null;
+    }
+
+    @Test
+    public void testConnect() {
+        dbService.connect();
+
+        verify(connection).connect();
+        verify(daoFactory).registerDAOsAndStorageAsOSGiServices();
+    }
+    
+    @Test
+    public void testConnectRegistersDbService() {
+        dbService.connect();
+
+        verify(connection).connect();
+        @SuppressWarnings("rawtypes")
+        ServiceReference dbServiceRef = context.getServiceReference(DbService.class);
+        // connect registers DbService
+        assertNotNull(dbServiceRef);
+        // make sure we really get the same instance
+        assertTrue(dbService.equals(context.getService(dbServiceRef)));
+        verify(daoFactory).registerDAOsAndStorageAsOSGiServices();
+    }
+
+    @Test
+    public void testDisconnect() {
+        dbService.connect();
+        assertNotNull(context.getServiceReference(DbService.class));
+        
+        dbService.disconnect();
+
+        verify(daoFactory).unregisterDAOsAndStorageAsOSGiServices();
+        verify(connection).disconnect();
+    }
+
+    @Test
+    public void testDisconnectUnregistersService() {
+        dbService.connect();
+        assertNotNull(context.getServiceReference(DbService.class));
+        
+        dbService.disconnect();
+
+        verify(daoFactory).unregisterDAOsAndStorageAsOSGiServices();
+        verify(connection).disconnect();
+        // disconnect unregisters DbService
+        assertNull(context.getServiceReference(DbService.class));
+    }
+    
+    @Test
+    public void canGetStorageUrl() {
+        String connectionURL = "http://test.example.com:8082";
+
+        dbService = new DbServiceImpl(context, null, connectionURL);
+        assertEquals(connectionURL, dbService.getConnectionUrl());
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/AgentInfoDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,260 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.core.Remove;
+import com.redhat.thermostat.storage.core.Replace;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.Update;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.model.AgentInformation;
+
+public class AgentInfoDAOTest {
+
+    private AgentInformation agentInfo1;
+    private AgentInformation agent1;
+
+    @Before
+    public void setUp() {
+        agentInfo1 = new AgentInformation();
+        agentInfo1.setAgentId("1234");
+        agentInfo1.setAlive(true);
+        agentInfo1.setConfigListenAddress("foobar:666");
+        agentInfo1.setStartTime(100);
+        agentInfo1.setStopTime(10);
+
+        agent1 = new AgentInformation();
+        agent1.setAgentId("1234");
+        agent1.setAlive(true);
+        agent1.setConfigListenAddress("foobar:666");
+        agent1.setStartTime(100);
+        agent1.setStopTime(10);
+    }
+
+    @Test
+    public void verifyCategoryName() {
+        Category category = AgentInfoDAO.CATEGORY;
+        assertEquals("agent-config", category.getName());
+    }
+
+    @Test
+    public void verifyKeyNames() {
+        assertEquals("agentId", Key.AGENT_ID.getName());
+        assertEquals("alive", AgentInfoDAO.ALIVE_KEY.getName());
+        assertEquals("startTime", AgentInfoDAO.START_TIME_KEY.getName());
+        assertEquals("stopTime", AgentInfoDAO.STOP_TIME_KEY.getName());
+        assertEquals("configListenAddress", AgentInfoDAO.CONFIG_LISTEN_ADDRESS.getName());
+    }
+
+    @Test
+    public void verifyCategoryHasAllKeys() {
+        Collection<Key<?>> keys = AgentInfoDAO.CATEGORY.getKeys();
+
+        assertTrue(keys.contains(Key.AGENT_ID));
+        assertTrue(keys.contains(AgentInfoDAO.ALIVE_KEY));
+        assertTrue(keys.contains(AgentInfoDAO.START_TIME_KEY));
+        assertTrue(keys.contains(AgentInfoDAO.STOP_TIME_KEY));
+        assertTrue(keys.contains(AgentInfoDAO.CONFIG_LISTEN_ADDRESS));
+    }
+
+    @Test
+    public void verifyGetAllAgentInformationWithOneAgentInStorage() {
+        @SuppressWarnings("unchecked")
+        Cursor<AgentInformation> agentCursor = mock(Cursor.class);
+        when(agentCursor.hasNext()).thenReturn(true).thenReturn(false);
+        when(agentCursor.next()).thenReturn(agent1).thenReturn(null);
+
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(query.execute()).thenReturn(agentCursor);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        AgentInfoDAOImpl dao = new AgentInfoDAOImpl(storage);
+
+        List<AgentInformation> allAgentInfo = dao.getAllAgentInformation();
+
+        assertEquals(1, allAgentInfo.size());
+
+        AgentInformation result = allAgentInfo.get(0);
+        AgentInformation expected = agentInfo1;
+        assertEquals(expected, result);
+    }
+
+    @Test
+    public void verifyGetAliveAgent() {
+        @SuppressWarnings("unchecked")
+        Cursor<AgentInformation> agentCursor = mock(Cursor.class);
+        when(agentCursor.hasNext()).thenReturn(true).thenReturn(false);
+        when(agentCursor.next()).thenReturn(agent1).thenReturn(null);
+
+        Query query = mock(Query.class);
+        Storage storage = mock(Storage.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        when(query.execute()).thenReturn(agentCursor);
+
+        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
+        List<AgentInformation> aliveAgents = dao.getAliveAgents();
+
+        verify(storage).createQuery(AgentInfoDAO.CATEGORY);
+        verify(query).where(AgentInfoDAO.ALIVE_KEY, Criteria.EQUALS, true);
+        verify(query).execute();
+        verifyNoMoreInteractions(query);
+
+        assertEquals(1, aliveAgents.size());
+
+        AgentInformation result = aliveAgents.get(0);
+        AgentInformation expected = agentInfo1;
+        assertEquals(expected, result);
+    }
+
+    @Test
+    public void verifyGetAgentInformationWhenStorageCantFindIt() {
+        HostRef agentRef = mock(HostRef.class);
+
+        Query query = mock(Query.class);
+        Cursor cursor = mock(Cursor.class);
+        when(cursor.hasNext()).thenReturn(false);
+        when(cursor.next()).thenReturn(null);
+        when(query.execute()).thenReturn(cursor);
+
+        Storage storage = mock(Storage.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+
+        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
+
+        AgentInformation computed = dao.getAgentInformation(agentRef);
+
+        assertEquals(null, computed);
+    }
+
+    @Test
+    public void verifyGetAgentInformation() {
+        HostRef agentRef = mock(HostRef.class);
+        when(agentRef.getAgentId()).thenReturn(agentInfo1.getAgentId());
+
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        Cursor cursor = mock(Cursor.class);
+        when(cursor.hasNext()).thenReturn(true).thenReturn(false);
+        when(cursor.next()).thenReturn(agentInfo1).thenReturn(null);
+        when(query.execute()).thenReturn(cursor);
+        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
+
+        AgentInformation computed = dao.getAgentInformation(agentRef);
+
+        verify(storage).createQuery(AgentInfoDAO.CATEGORY);
+        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, agentInfo1.getAgentId());
+        verify(query).limit(1);
+        verify(query).execute();
+        verifyNoMoreInteractions(query);
+        AgentInformation expected = agentInfo1;
+        assertSame(expected, computed);
+    }
+
+    @Test
+    public void verifyAddAgentInformation() {
+        Storage storage = mock(Storage.class);
+        Replace replace = mock(Replace.class);
+        when(storage.createReplace(any(Category.class))).thenReturn(replace);
+
+        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
+
+        dao.addAgentInformation(agentInfo1);
+
+        verify(storage).createReplace(AgentInfoDAO.CATEGORY);
+        verify(replace).setPojo(agentInfo1);
+        verify(replace).apply();
+    }
+
+    @Test
+    public void verifyUpdateAgentInformation() {
+
+        Update mockUpdate = mock(Update.class);
+        Storage storage = mock(Storage.class);
+        when(storage.createUpdate(any(Category.class))).thenReturn(mockUpdate);
+        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
+
+        dao.updateAgentInformation(agentInfo1);
+
+        verify(storage).createUpdate(AgentInfoDAO.CATEGORY);
+        verify(mockUpdate).where(Key.AGENT_ID, "1234");
+        verify(mockUpdate).set(AgentInfoDAO.START_TIME_KEY, 100L);
+        verify(mockUpdate).set(AgentInfoDAO.STOP_TIME_KEY, 10L);
+        verify(mockUpdate).set(AgentInfoDAO.CONFIG_LISTEN_ADDRESS, "foobar:666");
+        verify(mockUpdate).set(AgentInfoDAO.ALIVE_KEY, true);
+        verify(mockUpdate).apply();
+        verifyNoMoreInteractions(mockUpdate);
+
+    }
+
+    @Test
+    public void verifyRemoveAgentInformation() {
+        Remove mockRemove = QueryTestHelper.createMockRemove();
+        Storage storage = mock(Storage.class);
+        when(storage.createRemove()).thenReturn(mockRemove);
+        AgentInfoDAO dao = new AgentInfoDAOImpl(storage);
+
+        dao.removeAgentInformation(agentInfo1);
+
+        verify(storage).removePojo(mockRemove);
+        verify(mockRemove).from(AgentInfoDAO.CATEGORY);
+        verify(mockRemove).where(Key.AGENT_ID, "1234");
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/BackendInfoDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InOrder;
+
+import com.redhat.thermostat.storage.core.Add;
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.core.Remove;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.dao.BackendInfoDAO;
+import com.redhat.thermostat.storage.model.BackendInformation;
+
+public class BackendInfoDAOTest {
+
+    private BackendInformation backendInfo1;
+    private BackendInformation backend1;
+
+    @Before
+    public void setUp() {
+
+        backendInfo1 = new BackendInformation();
+
+        backendInfo1.setName("backend-name");
+        backendInfo1.setDescription("description");
+        backendInfo1.setActive(true);
+        backendInfo1.setObserveNewJvm(true);
+        backendInfo1.setPids(new int[] { -1, 0, 1});
+        backendInfo1.setOrderValue(100);
+
+        backend1 = new BackendInformation();
+        backend1.setName("backend-name");
+        backend1.setDescription("description");
+        backend1.setActive(true);
+        backend1.setObserveNewJvm(true);
+        backend1.setPids(new int[] { -1, 0, 1});
+        backend1.setOrderValue(100);
+    }
+
+    @Test
+    public void verifyCategoryName() {
+        Category c = BackendInfoDAO.CATEGORY;
+        assertEquals("backend-info", c.getName());
+    }
+
+    @Test
+    public void verifyCategoryHasAllKeys() {
+        Category c = BackendInfoDAO.CATEGORY;
+        Collection<Key<?>> keys = c.getKeys();
+
+        assertTrue(keys.contains(Key.AGENT_ID));
+        assertTrue(keys.contains(BackendInfoDAO.BACKEND_NAME));
+        assertTrue(keys.contains(BackendInfoDAO.BACKEND_DESCRIPTION));
+        assertTrue(keys.contains(BackendInfoDAO.IS_ACTIVE));
+        assertTrue(keys.contains(BackendInfoDAO.PIDS_TO_MONITOR));
+        assertTrue(keys.contains(BackendInfoDAO.SHOULD_MONITOR_NEW_PROCESSES));
+        assertTrue(keys.contains(BackendInfoDAO.ORDER_VALUE));
+    }
+
+    @Test
+    public void verifyAddBackendInformation() {
+        Storage storage = mock(Storage.class);
+        Add add = mock(Add.class);
+        when(storage.createAdd(any(Category.class))).thenReturn(add);
+
+        BackendInfoDAO dao = new BackendInfoDAOImpl(storage);
+
+        dao.addBackendInformation(backendInfo1);
+
+        verify(storage).createAdd(BackendInfoDAO.CATEGORY);
+        verify(add).setPojo(backendInfo1);
+        verify(add).apply();
+    }
+
+    @Test
+    public void verifyGetBackendInformation() {
+        final String AGENT_ID = "agent-id";
+        HostRef agentref = mock(HostRef.class);
+        when(agentref.getAgentId()).thenReturn(AGENT_ID);
+
+        @SuppressWarnings("unchecked")
+        Cursor<BackendInformation> backendCursor = mock(Cursor.class);
+        when(backendCursor.hasNext()).thenReturn(true).thenReturn(false);
+        when(backendCursor.next()).thenReturn(backend1).thenReturn(null);
+
+        Query query = mock(Query.class);
+        Storage storage = mock(Storage.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        when(query.execute()).thenReturn(backendCursor);
+
+        BackendInfoDAO dao = new BackendInfoDAOImpl(storage);
+
+        List<BackendInformation> result = dao.getBackendInformation(agentref);
+
+        verify(storage).createQuery(BackendInfoDAO.CATEGORY);
+        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, AGENT_ID);
+        verify(query).execute();
+        verifyNoMoreInteractions(query);
+
+        assertEquals(Arrays.asList(backendInfo1), result);
+    }
+
+    @Test
+    public void verifyRemoveBackendInformation() {
+        Remove remove = QueryTestHelper.createMockRemove();
+        Storage storage = mock(Storage.class);
+        when(storage.createRemove()).thenReturn(remove);
+        BackendInfoDAO dao = new BackendInfoDAOImpl(storage);
+
+        dao.removeBackendInformation(backendInfo1);
+
+        verify(storage).removePojo(remove);
+        InOrder inOrder = inOrder(remove);
+        inOrder.verify(remove).from(BackendInfoDAO.CATEGORY);
+        inOrder.verify(remove).where(BackendInfoDAO.BACKEND_NAME, "backend-name");
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/HostInfoDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,344 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.atLeast;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.junit.Test;
+
+import com.redhat.thermostat.storage.core.Add;
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.model.AgentInformation;
+import com.redhat.thermostat.storage.model.HostInfo;
+
+
+public class HostInfoDAOTest {
+
+    static class Pair<T,U> {
+        final T first;
+        final U second;
+
+        public Pair(T first, U second) {
+            this.first = first;
+            this.second = second;
+        }
+    }
+
+    private static final String HOST_NAME = "a host name";
+    private static final String OS_NAME = "some os";
+    private static final String OS_KERNEL = "some kernel";
+    private static final String CPU_MODEL = "some cpu that runs fast";
+    private static final int CPU_NUM = -1;
+    private static final long MEMORY_TOTAL = 0xCAFEBABEl;
+
+    @Test
+    public void testCategory() {
+        assertEquals("host-info", HostInfoDAO.hostInfoCategory.getName());
+        Collection<Key<?>> keys = HostInfoDAO.hostInfoCategory.getKeys();
+        assertTrue(keys.contains(new Key<>("agentId", true)));
+        assertTrue(keys.contains(new Key<String>("hostname", true)));
+        assertTrue(keys.contains(new Key<String>("osName", false)));
+        assertTrue(keys.contains(new Key<String>("osKernel", false)));
+        assertTrue(keys.contains(new Key<String>("cpuModel", false)));
+        assertTrue(keys.contains(new Key<Integer>("cpuCount", false)));
+        assertTrue(keys.contains(new Key<Long>("totalMemory", false)));
+        assertEquals(7, keys.size());
+    }
+
+    @Test
+    public void testGetHostInfo() {
+
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        HostInfo info = new HostInfo(HOST_NAME, OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
+        Cursor cursor = mock(Cursor.class);
+        when(cursor.hasNext()).thenReturn(true).thenReturn(false);
+        when(cursor.next()).thenReturn(info).thenReturn(null);
+        when(query.execute()).thenReturn(cursor);
+        AgentInfoDAO agentInfoDao = mock(AgentInfoDAO.class);
+
+        HostInfo result = new HostInfoDAOImpl(storage, agentInfoDao).getHostInfo(new HostRef("some uid", HOST_NAME));
+        assertSame(result, info);
+    }
+
+    @Test
+    public void testGetHostsSingleHost() {
+
+        Storage storage = setupStorageForSingleHost();
+        AgentInfoDAO agentInfo = mock(AgentInfoDAO.class);
+
+        HostInfoDAO hostsDAO = new HostInfoDAOImpl(storage, agentInfo);
+        Collection<HostRef> hosts = hostsDAO.getHosts();
+
+        assertEquals(1, hosts.size());
+        assertTrue(hosts.contains(new HostRef("123", "fluffhost1")));
+    }
+
+    private Storage setupStorageForSingleHost() {
+
+        HostInfo hostConfig = new HostInfo("fluffhost1", OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
+        hostConfig.setAgentId("123");
+
+        @SuppressWarnings("unchecked")
+        Cursor<HostInfo> cursor = mock(Cursor.class);
+        when(cursor.hasNext()).thenReturn(true).thenReturn(false);
+        when(cursor.next()).thenReturn(hostConfig);
+
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        when(query.execute()).thenReturn(cursor);
+        
+        return storage;
+    }
+
+    @Test
+    public void testGetHosts3Hosts() {
+
+        Storage storage = setupStorageFor3Hosts();
+        AgentInfoDAO agentInfo = mock(AgentInfoDAO.class);
+
+        HostInfoDAO hostsDAO = new HostInfoDAOImpl(storage, agentInfo);
+        Collection<HostRef> hosts = hostsDAO.getHosts();
+
+        assertEquals(3, hosts.size());
+        assertTrue(hosts.contains(new HostRef("123", "fluffhost1")));
+        assertTrue(hosts.contains(new HostRef("456", "fluffhost2")));
+        assertTrue(hosts.contains(new HostRef("789", "fluffhost3")));
+    }
+
+    private Storage setupStorageFor3Hosts() {
+
+        HostInfo hostConfig1 = new HostInfo("fluffhost1", OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
+        hostConfig1.setAgentId("123");
+        HostInfo hostConfig2 = new HostInfo("fluffhost2", OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
+        hostConfig2.setAgentId("456");
+        HostInfo hostConfig3 = new HostInfo("fluffhost3", OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
+        hostConfig3.setAgentId("789");
+
+
+        @SuppressWarnings("unchecked")
+        Cursor<HostInfo> cursor = mock(Cursor.class);
+        when(cursor.hasNext()).thenReturn(true).thenReturn(true).thenReturn(true).thenReturn(false);
+        when(cursor.next()).thenReturn(hostConfig1).thenReturn(hostConfig2).thenReturn(hostConfig3);
+
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        when(query.execute()).thenReturn(cursor);
+        
+        return storage;
+    }
+
+    @Test
+    public void testPutHostInfo() {
+        Storage storage = mock(Storage.class);
+        Add add = mock(Add.class);
+        when(storage.createAdd(any(Category.class))).thenReturn(add);
+
+        AgentInfoDAO agentInfo = mock(AgentInfoDAO.class);
+
+        HostInfo info = new HostInfo(HOST_NAME, OS_NAME, OS_KERNEL, CPU_MODEL, CPU_NUM, MEMORY_TOTAL);
+        HostInfoDAO dao = new HostInfoDAOImpl(storage, agentInfo);
+        dao.putHostInfo(info);
+
+        verify(storage).createAdd(HostInfoDAO.hostInfoCategory);
+        verify(add).setPojo(info);
+        verify(add).apply();
+    }
+
+    @Test
+    public void testGetCount() {
+        Storage storage = mock(Storage.class);
+        when(storage.getCount(any(Category.class))).thenReturn(5L);
+        AgentInfoDAO agentInfoDao = mock(AgentInfoDAO.class);
+
+        HostInfoDAO dao = new HostInfoDAOImpl(storage, agentInfoDao);
+        Long count = dao.getCount();
+        assertEquals((Long) 5L, count);
+    }
+    
+    @Test
+    public void getAliveHostSingle() {
+        Pair<Storage, AgentInfoDAO> setup = setupForSingleAliveHost();
+        Storage storage = setup.first;
+        AgentInfoDAO agentInfoDao = setup.second;
+
+        HostInfoDAO hostsDAO = new HostInfoDAOImpl(storage, agentInfoDao);
+        Collection<HostRef> hosts = hostsDAO.getAliveHosts();
+
+        assertEquals(1, hosts.size());
+        assertTrue(hosts.contains(new HostRef("123", "fluffhost1")));
+        verify(storage).createQuery(HostInfoDAO.hostInfoCategory);
+    }
+    
+    private Pair<Storage, AgentInfoDAO> setupForSingleAliveHost() {
+        
+        // agents
+        
+        AgentInformation agentConfig1 = new AgentInformation();
+        agentConfig1.setAgentId("123");
+        agentConfig1.setAlive(true);
+
+        AgentInformation agentInfo1 = new AgentInformation();
+        agentInfo1.setAgentId("123");
+        agentInfo1.setAlive(true);
+        
+        // hosts
+        
+        HostInfo hostConfig1 = new HostInfo();
+        hostConfig1.setHostname("fluffhost1");
+        hostConfig1.setAgentId("123");
+        
+        HostInfo hostConfig2 = new HostInfo();
+        hostConfig2.setHostname("fluffhost2");
+        hostConfig2.setAgentId("456");
+        
+        // cursor
+
+        @SuppressWarnings("unchecked")
+        Cursor<HostInfo> cursor1 = mock(Cursor.class);
+        when(cursor1.hasNext()).thenReturn(true).thenReturn(false);
+        when(cursor1.next()).thenReturn(hostConfig1);
+
+        // storage
+        
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        when(query.execute()).thenReturn(cursor1);
+
+        AgentInfoDAO agentDao = mock(AgentInfoDAO.class);
+        when(agentDao.getAliveAgents()).thenReturn(Arrays.asList(agentInfo1));
+
+        return new Pair<>(storage, agentDao);
+    }
+
+    @Test
+    public void getAliveHost3() {
+        Pair<Storage, AgentInfoDAO> setup = setupForAliveHost3();
+        Storage storage = setup.first;
+        AgentInfoDAO agentInfoDao = setup.second;
+
+        HostInfoDAO hostsDAO = new HostInfoDAOImpl(storage, agentInfoDao);
+        Collection<HostRef> hosts = hostsDAO.getAliveHosts();
+
+        // cursor 3 from the above storage should not be used
+        assertEquals(3, hosts.size());
+        assertTrue(hosts.contains(new HostRef("123", "fluffhost1")));
+        assertTrue(hosts.contains(new HostRef("456", "fluffhost2")));
+        assertTrue(hosts.contains(new HostRef("678", "fluffhost3")));
+        verify(storage, atLeast(3)).createQuery(HostInfoDAO.hostInfoCategory);
+    }
+    
+    private Pair<Storage, AgentInfoDAO> setupForAliveHost3() {
+        
+        // agents
+        AgentInformation agentInfo1 = new AgentInformation();
+        agentInfo1.setAgentId("123");
+        agentInfo1.setAlive(true);
+
+        AgentInformation agentInfo2 = new AgentInformation();
+        agentInfo2.setAgentId("456");
+        agentInfo2.setAlive(true);
+
+        AgentInformation agentInfo3 = new AgentInformation();
+        agentInfo3.setAgentId("678");
+        agentInfo3.setAlive(true);
+        
+        // hosts
+        
+        HostInfo hostConfig1 = new HostInfo();
+        hostConfig1.setHostname("fluffhost1");
+        hostConfig1.setAgentId("123");
+
+        HostInfo hostConfig2 = new HostInfo();
+        hostConfig2.setHostname("fluffhost2");
+        hostConfig2.setAgentId("456");
+
+        HostInfo hostConfig3 = new HostInfo();
+        hostConfig3.setHostname("fluffhost3");
+        hostConfig3.setAgentId("678");
+
+        @SuppressWarnings("unchecked")
+        Cursor<HostInfo> cursor1 = mock(Cursor.class);
+        when(cursor1.hasNext()).thenReturn(true).thenReturn(false);
+        when(cursor1.next()).thenReturn(hostConfig1);
+
+        @SuppressWarnings("unchecked")
+        Cursor<HostInfo> cursor2 = mock(Cursor.class);
+        when(cursor2.hasNext()).thenReturn(true).thenReturn(false);
+        when(cursor2.next()).thenReturn(hostConfig2);
+
+        @SuppressWarnings("unchecked")
+        Cursor<HostInfo> cursor3 = mock(Cursor.class);
+        when(cursor3.hasNext()).thenReturn(true).thenReturn(false);
+        when(cursor3.next()).thenReturn(hostConfig3);
+
+        // storage
+        
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        when(query.execute()).thenReturn(cursor1).thenReturn(cursor2).thenReturn(cursor3);
+        
+        AgentInfoDAO agentDao = mock(AgentInfoDAO.class);
+        when(agentDao.getAliveAgents()).thenReturn(Arrays.asList(agentInfo1, agentInfo2, agentInfo3));
+
+        return new Pair<>(storage, agentDao);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/NetworkInterfaceInfoDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.junit.Test;
+
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Query.Criteria;
+import com.redhat.thermostat.storage.core.Replace;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO;
+import com.redhat.thermostat.storage.model.NetworkInterfaceInfo;
+
+public class NetworkInterfaceInfoDAOTest {
+
+    private static final String INTERFACE_NAME = "some interface. maybe eth0";
+    private static final String IPV4_ADDR = "256.256.256.256";
+    private static final String IPV6_ADDR = "100:100:100::::1";
+
+    @Test
+    public void testCategory() {
+        Collection<Key<?>> keys;
+
+        assertEquals("network-info", NetworkInterfaceInfoDAO.networkInfoCategory.getName());
+        keys = NetworkInterfaceInfoDAO.networkInfoCategory.getKeys();
+        assertTrue(keys.contains(new Key<>("agentId", true)));
+        assertTrue(keys.contains(new Key<String>("interfaceName", true)));
+        assertTrue(keys.contains(new Key<String>("ip4Addr", false)));
+        assertTrue(keys.contains(new Key<String>("ip6Addr", false)));
+        assertEquals(4, keys.size());
+    }
+
+    @Test
+    public void testGetNetworkInterfaces() {
+
+        NetworkInterfaceInfo niInfo = new NetworkInterfaceInfo(INTERFACE_NAME);
+        niInfo.setIp4Addr(IPV4_ADDR);
+        niInfo.setIp6Addr(IPV6_ADDR);
+
+        @SuppressWarnings("unchecked")
+        Cursor<NetworkInterfaceInfo> cursor = mock(Cursor.class);
+        when(cursor.hasNext()).thenReturn(true).thenReturn(false);
+        when(cursor.next()).thenReturn(niInfo);
+
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        when(query.execute()).thenReturn(cursor);
+
+        HostRef hostRef = mock(HostRef.class);
+        when(hostRef.getAgentId()).thenReturn("system");
+
+        NetworkInterfaceInfoDAO dao = new NetworkInterfaceInfoDAOImpl(storage);
+        List<NetworkInterfaceInfo> netInfo = dao.getNetworkInterfaces(hostRef);
+
+        verify(query).where(Key.AGENT_ID, Criteria.EQUALS, "system");
+        verify(query).execute();
+        verifyNoMoreInteractions(query);
+
+        assertEquals(1, netInfo.size());
+
+        NetworkInterfaceInfo info = netInfo.get(0);
+
+        assertEquals(INTERFACE_NAME, info.getInterfaceName());
+        assertEquals(IPV4_ADDR, info.getIp4Addr());
+        assertEquals(IPV6_ADDR, info.getIp6Addr());
+    }
+
+    @Test
+    public void testPutNetworkInterfaceInfo() {
+        Storage storage = mock(Storage.class);
+        Replace replace = mock(Replace.class);
+        when(storage.createReplace(any(Category.class))).thenReturn(replace);
+
+        NetworkInterfaceInfo info = new NetworkInterfaceInfo(INTERFACE_NAME);
+        info.setIp4Addr(IPV4_ADDR);
+        info.setIp6Addr(IPV6_ADDR);
+        NetworkInterfaceInfoDAO dao = new NetworkInterfaceInfoDAOImpl(storage);
+        dao.putNetworkInterfaceInfo(info);
+
+        verify(storage).createReplace(NetworkInterfaceInfoDAO.networkInfoCategory);
+        verify(replace).setPojo(info);
+        verify(replace).apply();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/QueryTestHelper.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Remove;
+
+public class QueryTestHelper {
+
+    @SuppressWarnings("unchecked")
+    public static Remove createMockRemove() {
+        Remove mockRemove = mock(Remove.class);
+        when(mockRemove.from(any(Category.class))).thenReturn(mockRemove);
+        when(mockRemove.where(any(Key.class), any())).thenReturn(mockRemove);
+        return mockRemove;
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/storage/core/src/test/java/com/redhat/thermostat/storage/internal/dao/VmInfoDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -0,0 +1,290 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat 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, or (at your
+ * option) any later version.
+ *
+ * Thermostat 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 Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.storage.internal.dao;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.Replace;
+import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.Update;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.DAOException;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
+import com.redhat.thermostat.storage.model.VmInfo;
+
+public class VmInfoDAOTest {
+
+    private int vmId;
+    private long startTime;
+    private long stopTime;
+    private String jVersion;
+    private String jHome;
+    private String mainClass;
+    private String commandLine;
+    private String vmName;
+    private String vmInfo;
+    private String vmVersion;
+    private String vmArgs;
+    private Map<String, String> props;
+    private Map<String, String> env;
+    private String[] libs;
+
+    @Before
+    public void setUp() {
+        vmId = 1;
+        startTime = 2;
+        stopTime = 3;
+        jVersion = "java 1.0";
+        jHome = "/path/to/jdk/home";
+        mainClass = "Hello.class";
+        commandLine = "World";
+        vmArgs = "-XX=+FastestJITPossible";
+        vmName = "Hotspot";
+        vmInfo = "Some info";
+        vmVersion = "1.0";
+        props = new HashMap<>();
+        env = new HashMap<>();
+        libs = new String[0];
+    }
+
+    @Test
+    public void testCategory() {
+        assertEquals("vm-info", VmInfoDAO.vmInfoCategory.getName());
+        Collection<Key<?>> keys = VmInfoDAO.vmInfoCategory.getKeys();
+        assertTrue(keys.contains(new Key<>("agentId", true)));
+        assertTrue(keys.contains(new Key<Integer>("vmId", true)));
+        assertTrue(keys.contains(new Key<Integer>("vmPid", false)));
+        assertTrue(keys.contains(new Key<String>("javaVersion", false)));
+        assertTrue(keys.contains(new Key<String>("javaHome", false)));
+        assertTrue(keys.contains(new Key<String>("mainClass", false)));
+        assertTrue(keys.contains(new Key<String>("javaCommandLine", false)));
+        assertTrue(keys.contains(new Key<String>("vmArguments", false)));
+        assertTrue(keys.contains(new Key<String>("vmName", false)));
+        assertTrue(keys.contains(new Key<String>("vmInfo", false)));
+        assertTrue(keys.contains(new Key<String>("vmVersion", false)));
+        assertTrue(keys.contains(new Key<Map<String, String>>("properties", false)));
+        assertTrue(keys.contains(new Key<Map<String, String>>("environment", false)));
+        assertTrue(keys.contains(new Key<List<String>>("loadedNativeLibraries", false)));
+        assertTrue(keys.contains(new Key<Long>("startTimeStamp", false)));
+        assertTrue(keys.contains(new Key<Long>("stopTimeStamp", false)));
+        assertEquals(16, keys.size());
+    }
+
+    @Test
+    public void testGetVmInfo() {
+
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        VmInfo expected = new VmInfo(vmId, startTime, stopTime, jVersion, jHome, mainClass, commandLine, vmName, vmInfo, vmVersion, vmArgs, props, env, libs);
+        Cursor cursor = mock(Cursor.class);
+        when(cursor.hasNext()).thenReturn(true).thenReturn(false);
+        when(cursor.next()).thenReturn(expected).thenReturn(null);
+        when(query.execute()).thenReturn(cursor);
+
+        HostRef hostRef = mock(HostRef.class);
+        when(hostRef.getAgentId()).thenReturn("system");
+
+        VmRef vmRef = mock(VmRef.class);
+        when(vmRef.getAgent()).thenReturn(hostRef);
+        when(vmRef.getId()).thenReturn(321);
+
+        VmInfoDAO dao = new VmInfoDAOImpl(storage);
+        VmInfo info = dao.getVmInfo(vmRef);
+        assertEquals(expected, info);
+    }
+
+    @Test
+    public void testGetVmInfoUnknownVM() {
+
+        Storage storage = mock(Storage.class);
+        Query query = mock(Query.class);
+        when(storage.createQuery(any(Category.class))).thenReturn(query);
+        Cursor cursor = mock(Cursor.class);
+        when(query.execute()).thenReturn(cursor);
+        
+        HostRef hostRef = mock(HostRef.class);
+        when(hostRef.getAgentId()).thenReturn("system");
+
+        VmRef vmRef = mock(VmRef.class);
+        when(vmRef.getAgent()).thenReturn(hostRef);
+        when(vmRef.getId()).thenReturn(321);
+
+        VmInfoDAO dao = new VmInfoDAOImpl(storage);
+        try {
+            dao.getVmInfo(vmRef);
+            fail();
+        } catch (DAOException ex) {
+            assertEquals("Unknown VM: host:system;vm:321", ex.getMessage());
+        }
+
+    }
+
+    @Test
+    public void testSingleVM() {
+        Storage storage = setupStorageForSingleVM();
+        VmInfoDAO dao = new VmInfoDAOImpl(storage);
+        HostRef host = new HostRef("123", "fluffhost");
+
+        Collection<VmRef> vms = dao.getVMs(host);
+
+        assertCollection(vms, new VmRef(host, 123, "mainClass1"));
+    }
+
+    private Storage setupStorageForSingleVM() {
+
+      VmInfo vm1 = new VmInfo();
+      vm1.setVmPid(123);
+      vm1.setMainClass("mainClass1");
+
+      @SuppressWarnings("unchecked")
+      Cursor<VmInfo> singleVMCursor = mock(Cursor.class);
+      when(singleVMCursor.hasNext()).thenReturn(true).thenReturn(false);
+      when(singleVMCursor.next()).thenReturn(vm1);
+
+      Storage storage = mock(Storage.class);
+      Query query = mock(Query.class);
+      when(storage.createQuery(any(Category.class))).thenReturn(query);
+      when(query.execute()).thenReturn(singleVMCursor);
+      return storage;
+  }
+
+    @Test
+    public void testMultiVMs() {
+        Storage storage = setupStorageForMultiVM();
+        VmInfoDAO dao = new VmInfoDAOImpl(storage);
+
+        HostRef host = new HostRef("456", "fluffhost");
+
+        Collection<VmRef> vms = dao.getVMs(host);
+
+        assertCollection(vms, new VmRef(host, 123, "mainClass1"), new VmRef(host, 456, "mainClass2"));
+    }
+
+    private Storage setupStorageForMultiVM() {
+
+      VmInfo vm1 = new VmInfo();
+      vm1.setVmPid(123);
+      vm1.setMainClass("mainClass1");
+
+      VmInfo vm2 = new VmInfo();
+      vm2.setVmPid(456);
+      vm2.setMainClass("mainClass2");
+
+      @SuppressWarnings("unchecked")
+      Cursor<VmInfo> multiVMsCursor = mock(Cursor.class);
+      when(multiVMsCursor.hasNext()).thenReturn(true).thenReturn(true).thenReturn(false);
+      when(multiVMsCursor.next()).thenReturn(vm1).thenReturn(vm2);
+
+      Storage storage = mock(Storage.class);
+      Query query = mock(Query.class);
+      when(storage.createQuery(any(Category.class))).thenReturn(query);
+      when(query.execute()).thenReturn(multiVMsCursor);
+      return storage;
+  }
+
+    private void assertCollection(Collection<VmRef> vms, VmRef... expectedVMs) {
+        assertEquals(expectedVMs.length, vms.size());
+        for (VmRef expectedVM : expectedVMs) {
+            assertTrue(vms.contains(expectedVM));
+        }
+    }
+
+    @Test
+    public void testGetCount() {
+        Storage storage = mock(Storage.class);
+        when(storage.getCount(any(Category.class))).thenReturn(5L);
+        VmInfoDAO dao = new VmInfoDAOImpl(storage);
+        Long count = dao.getCount();
+        assertEquals((Long) 5L, count);
+    }
+
+    @Test
+    public void testPutVmInfo() {
+
+        Storage storage = mock(Storage.class);
+        Replace replace = mock(Replace.class);
+        when(storage.createReplace(any(Category.class))).thenReturn(replace);
+
+        VmInfo info = new VmInfo(vmId, startTime, stopTime, jVersion, jHome,
+                mainClass, commandLine, vmName, vmInfo, vmVersion, vmArgs,
+                props, env, libs);
+        VmInfoDAO dao = new VmInfoDAOImpl(storage);
+        dao.putVmInfo(info);
+
+        verify(storage).createReplace(VmInfoDAO.vmInfoCategory);
+        verify(replace).setPojo(info);
+        verify(replace).apply();
+    }
+
+    @Test
+    public void testPutVmStoppedTime() {
+        Update mockUpdate = mock(Update.class);
+        Storage storage = mock(Storage.class);
+        when(storage.createUpdate(any(Category.class))).thenReturn(mockUpdate);
+
+        VmInfoDAO dao = new VmInfoDAOImpl(storage);
+        dao.putVmStoppedTime(vmId, stopTime);
+
+        verify(storage).createUpdate(VmInfoDAO.vmInfoCategory);
+        verify(mockUpdate).where(Key.VM_ID, 1);
+        verify(mockUpdate).set(VmInfoDAO.stopTimeKey, 3L);
+        verify(mockUpdate).apply();
+        verifyNoMoreInteractions(mockUpdate);
+    }
+}
+
--- a/storage/mongo/src/main/java/com/redhat/thermostat/storage/mongodb/internal/MongoConnection.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/storage/mongo/src/main/java/com/redhat/thermostat/storage/mongodb/internal/MongoConnection.java	Wed Jan 16 18:58:59 2013 +0100
@@ -70,6 +70,7 @@
             connected = true;
 
         } catch (IOException | MongoException | IllegalArgumentException e) {
+            e.printStackTrace();
             fireChanged(ConnectionStatus.FAILED_TO_CONNECT);
             throw new ConnectionException(e.getMessage(), e);
         }
--- a/system-backend/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/system-backend/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -73,6 +73,19 @@
       <artifactId>thermostat-agent-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-storage-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
                  
     <dependency>
       <groupId>org.osgi</groupId>
--- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/JvmStatHostListener.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/JvmStatHostListener.java	Wed Jan 16 18:58:59 2013 +0100
@@ -54,8 +54,8 @@
 
 import com.redhat.thermostat.agent.VmStatusListener;
 import com.redhat.thermostat.agent.VmStatusListener.Status;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
 import com.redhat.thermostat.common.utils.LoggingUtils;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 import com.redhat.thermostat.utils.ProcDataSource;
 
--- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/SystemBackend.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/SystemBackend.java	Wed Jan 16 18:58:59 2013 +0100
@@ -48,13 +48,12 @@
 import sun.jvmstat.monitor.MonitorException;
 import sun.jvmstat.monitor.MonitoredHost;
 
-import com.redhat.thermostat.agent.VmStatusListener;
 import com.redhat.thermostat.backend.Backend;
 import com.redhat.thermostat.backend.BackendID;
 import com.redhat.thermostat.backend.BackendsProperties;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.NetworkInterfaceInfoDAO;
 import com.redhat.thermostat.common.utils.LoggingUtils;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO;
 import com.redhat.thermostat.storage.model.NetworkInterfaceInfo;
 import com.redhat.thermostat.utils.ProcDataSource;
 
--- a/system-backend/src/test/java/com/redhat/thermostat/backend/system/JvmStatHostListenerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/system-backend/src/test/java/com/redhat/thermostat/backend/system/JvmStatHostListenerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -65,8 +65,8 @@
 import sun.jvmstat.monitor.event.VmStatusChangeEvent;
 
 import com.redhat.thermostat.agent.VmStatusListener.Status;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 
 public class JvmStatHostListenerTest {
     
@@ -197,4 +197,3 @@
         assertEquals(INFO_VMVER, info.getVmVersion());
     }
 }
-
--- a/system-backend/src/test/java/com/redhat/thermostat/backend/system/SystemBackendTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/system-backend/src/test/java/com/redhat/thermostat/backend/system/SystemBackendTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,10 +44,10 @@
 import org.junit.Before;
 import org.junit.Test;
 
-import com.redhat.thermostat.common.dao.DAOFactory;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.NetworkInterfaceInfoDAO;
 import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.dao.DAOFactory;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO;
 
 public class SystemBackendTest {
 
--- a/system-backend/src/test/java/com/redhat/thermostat/backend/system/VmStatusChangeNotifierTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/system-backend/src/test/java/com/redhat/thermostat/backend/system/VmStatusChangeNotifierTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -43,7 +43,7 @@
 
 import com.redhat.thermostat.agent.VmStatusListener;
 import com.redhat.thermostat.agent.VmStatusListener.Status;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
 public class VmStatusChangeNotifierTest {
 
--- a/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/ThreadCollector.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/ThreadCollector.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,7 +38,7 @@
 
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.thread.dao.ThreadDao;
 import com.redhat.thermostat.thread.model.ThreadInfoData;
 import com.redhat.thermostat.thread.model.ThreadSummary;
--- a/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/ThreadCollectorFactory.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/ThreadCollectorFactory.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,8 +36,8 @@
 
 package com.redhat.thermostat.thread.client.common.collector;
 
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.thread.dao.ThreadDao;
 
 public interface ThreadCollectorFactory {
--- a/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/impl/ThreadCollectorFactoryImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/impl/ThreadCollectorFactoryImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,8 +36,8 @@
 
 package com.redhat.thermostat.thread.client.common.collector.impl;
 
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.thread.client.common.collector.ThreadCollector;
 import com.redhat.thermostat.thread.client.common.collector.ThreadCollectorFactory;
 import com.redhat.thermostat.thread.dao.ThreadDao;
--- a/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/impl/ThreadMXBeanCollector.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/collector/impl/ThreadMXBeanCollector.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,10 +45,10 @@
 import com.redhat.thermostat.common.command.RequestResponseListener;
 import com.redhat.thermostat.common.command.Response;
 import com.redhat.thermostat.common.command.Request.RequestType;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.thread.client.common.collector.ThreadCollector;
 import com.redhat.thermostat.thread.collector.HarvesterCommand;
 import com.redhat.thermostat.thread.dao.ThreadDao;
--- a/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/osgi/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/osgi/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,7 +41,7 @@
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
 
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.thread.client.common.collector.ThreadCollectorFactory;
 import com.redhat.thermostat.thread.client.common.collector.impl.ThreadCollectorFactoryImpl;
 import com.redhat.thermostat.thread.dao.ThreadDao;
--- a/thread/client-common/src/test/java/com/redhat/thermostat/thread/client/common/collector/ThreadCollectorFactoryTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-common/src/test/java/com/redhat/thermostat/thread/client/common/collector/ThreadCollectorFactoryTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,8 +41,8 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.thread.client.common.collector.impl.ThreadCollectorFactoryImpl;
 import com.redhat.thermostat.thread.dao.ThreadDao;
 
--- a/thread/client-common/src/test/java/com/redhat/thermostat/thread/client/common/collector/impl/ThreadCollectorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-common/src/test/java/com/redhat/thermostat/thread/client/common/collector/impl/ThreadCollectorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -56,9 +56,9 @@
 import com.redhat.thermostat.common.command.RequestResponseListener;
 import com.redhat.thermostat.common.command.Response;
 import com.redhat.thermostat.common.command.Response.ResponseType;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.thread.client.common.collector.ThreadCollector;
 import com.redhat.thermostat.thread.client.common.collector.impl.ThreadMXBeanCollector;
 import com.redhat.thermostat.thread.collector.HarvesterCommand;
--- a/thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/impl/ThreadInformationController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/impl/ThreadInformationController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,9 +45,9 @@
 import com.redhat.thermostat.common.ActionListener;
 import com.redhat.thermostat.common.ApplicationService;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.LoggingUtils;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.thread.client.common.ThreadTableBean;
 import com.redhat.thermostat.thread.client.common.ThreadViewProvider;
 import com.redhat.thermostat.thread.client.common.collector.ThreadCollector;
--- a/thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/impl/ThreadInformationService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/impl/ThreadInformationService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,8 +41,8 @@
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.thread.client.common.ThreadViewProvider;
 import com.redhat.thermostat.thread.client.common.collector.ThreadCollectorFactory;
 
--- a/thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/osgi/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/osgi/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,8 +50,8 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.thread.client.common.ThreadViewProvider;
 import com.redhat.thermostat.thread.client.common.collector.ThreadCollectorFactory;
 import com.redhat.thermostat.thread.client.controller.impl.ThreadInformationService;
--- a/thread/client-controllers/src/test/java/com/redhat/thermostat/thread/client/controller/impl/ThreadInformationControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/client-controllers/src/test/java/com/redhat/thermostat/thread/client/controller/impl/ThreadInformationControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -55,9 +55,9 @@
 import com.redhat.thermostat.common.ApplicationService;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 import com.redhat.thermostat.thread.client.common.ThreadTableBean;
 import com.redhat.thermostat.thread.client.common.ThreadViewProvider;
--- a/thread/collector/src/main/java/com/redhat/thermostat/thread/dao/ThreadDao.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/collector/src/main/java/com/redhat/thermostat/thread/dao/ThreadDao.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,10 +38,10 @@
 
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.thread.model.ThreadInfoData;
 import com.redhat.thermostat.thread.model.ThreadSummary;
 import com.redhat.thermostat.thread.model.VMThreadCapabilities;
--- a/thread/collector/src/main/java/com/redhat/thermostat/thread/dao/impl/ThreadDaoImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/collector/src/main/java/com/redhat/thermostat/thread/dao/impl/ThreadDaoImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,7 +39,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Cursor;
 import com.redhat.thermostat.storage.core.Key;
@@ -47,6 +46,7 @@
 import com.redhat.thermostat.storage.core.Query;
 import com.redhat.thermostat.storage.core.Query.Criteria;
 import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.Pojo;
 import com.redhat.thermostat.thread.dao.ThreadDao;
 import com.redhat.thermostat.thread.model.ThreadInfoData;
--- a/thread/collector/src/test/java/com/redhat/thermostat/thread/dao/impl/ThreadDaoImplTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/thread/collector/src/test/java/com/redhat/thermostat/thread/dao/impl/ThreadDaoImplTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -46,15 +46,16 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.core.Query;
 import com.redhat.thermostat.storage.core.Query.Criteria;
 import com.redhat.thermostat.storage.core.Replace;
 import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.core.Query.Criteria;
 import com.redhat.thermostat.thread.dao.ThreadDao;
 import com.redhat.thermostat.thread.model.VMThreadCapabilities;
 
--- a/vm-classstat/agent/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/agent/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -74,5 +74,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-classstat/agent/src/test/java/com/redhat/thermostat/vm/classstat/agent/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/agent/src/test/java/com/redhat/thermostat/vm/classstat/agent/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,7 +49,7 @@
 
 import com.redhat.thermostat.backend.Backend;
 import com.redhat.thermostat.backend.BackendService;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.classstat.common.VmClassStatDAO;
 
 public class ActivatorTest {
--- a/vm-classstat/client-core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/client-core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -76,5 +76,11 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/VmClassStatService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/VmClassStatService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,8 +41,8 @@
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.classstat.client.core.internal.VmClassStatController;
 import com.redhat.thermostat.vm.classstat.common.VmClassStatDAO;
 
--- a/vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,7 +50,7 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.classstat.client.core.VmClassStatService;
 import com.redhat.thermostat.vm.classstat.common.VmClassStatDAO;
 
--- a/vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/internal/VmClassStatController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/internal/VmClassStatController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,8 +49,8 @@
 import com.redhat.thermostat.common.NotImplementedException;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.DiscreteTimeData;
 import com.redhat.thermostat.storage.model.VmClassStat;
 import com.redhat.thermostat.vm.classstat.client.core.VmClassStatView;
--- a/vm-classstat/client-core/src/test/java/com/redhat/thermostat/vm/classstat/client/core/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/client-core/src/test/java/com/redhat/thermostat/vm/classstat/client/core/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,7 +45,7 @@
 
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.classstat.client.core.VmClassStatService;
 import com.redhat.thermostat.vm.classstat.common.VmClassStatDAO;
 
--- a/vm-classstat/client-core/src/test/java/com/redhat/thermostat/vm/classstat/client/core/internal/VmClassStatControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/client-core/src/test/java/com/redhat/thermostat/vm/classstat/client/core/internal/VmClassStatControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -54,7 +54,7 @@
 import com.redhat.thermostat.common.ApplicationService;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.VmClassStat;
 import com.redhat.thermostat.vm.classstat.client.core.VmClassStatView;
 import com.redhat.thermostat.vm.classstat.client.core.VmClassStatViewProvider;
--- a/vm-classstat/client-core/src/test/java/com/redhat/thermostat/vm/classstat/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/client-core/src/test/java/com/redhat/thermostat/vm/classstat/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.vm.classstat.client.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/vm-classstat/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -78,5 +78,11 @@
       <artifactId>thermostat-vm-classstat-client-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-classstat/client-swing/src/test/java/com/redhat/thermostat/vm/classstat/client/swing/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/client-swing/src/test/java/com/redhat/thermostat/vm/classstat/client/swing/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,7 +41,7 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.classstat.client.core.VmClassStatViewProvider;
 
 public class ActivatorTest {
--- a/vm-classstat/common/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/common/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -64,5 +64,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-classstat/common/src/main/java/com/redhat/thermostat/vm/classstat/common/VmClassStatDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/common/src/main/java/com/redhat/thermostat/vm/classstat/common/VmClassStatDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,9 +39,9 @@
 import java.util.List;
 
 import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.VmClassStat;
 
 @Service
--- a/vm-classstat/common/src/main/java/com/redhat/thermostat/vm/classstat/common/internal/VmClassStatDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/common/src/main/java/com/redhat/thermostat/vm/classstat/common/internal/VmClassStatDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,10 +38,10 @@
 
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.VmLatestPojoListGetter;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Put;
 import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.VmLatestPojoListGetter;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.VmClassStat;
 import com.redhat.thermostat.vm.classstat.common.VmClassStatDAO;
 
--- a/vm-classstat/common/src/test/java/com/redhat/thermostat/vm/classstat/common/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/common/src/test/java/com/redhat/thermostat/vm/classstat/common/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -43,7 +43,7 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.classstat.common.VmClassStatDAO;
 
 public class ActivatorTest {
--- a/vm-classstat/common/src/test/java/com/redhat/thermostat/vm/classstat/common/internal/VmClassStatDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-classstat/common/src/test/java/com/redhat/thermostat/vm/classstat/common/internal/VmClassStatDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,10 +49,10 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Add;
 import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.core.Cursor;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.core.Query;
--- a/vm-cpu/agent/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/agent/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -74,5 +74,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,7 +49,7 @@
 
 import com.redhat.thermostat.backend.Backend;
 import com.redhat.thermostat.backend.BackendService;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
 
 public class ActivatorTest {
--- a/vm-cpu/client-cli/src/main/java/com/redhat/thermostat/vm/cpu/client/cli/internal/VmCpuStatPrintDelegate.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-cli/src/main/java/com/redhat/thermostat/vm/cpu/client/cli/internal/VmCpuStatPrintDelegate.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,8 +41,8 @@
 import java.util.List;
 
 import com.redhat.thermostat.client.cli.VMStatPrintDelegate;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.TimeStampedPojo;
 import com.redhat.thermostat.storage.model.VmCpuStat;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
--- a/vm-cpu/client-cli/src/test/java/com/redhat/thermostat/vm/cpu/client/cli/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-cli/src/test/java/com/redhat/thermostat/vm/cpu/client/cli/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -43,7 +43,7 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.client.cli.VMStatPrintDelegate;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
 
 public class ActivatorTest {
--- a/vm-cpu/client-cli/src/test/java/com/redhat/thermostat/vm/cpu/client/cli/internal/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-cli/src/test/java/com/redhat/thermostat/vm/cpu/client/cli/internal/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.vm.cpu.client.cli.internal;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/vm-cpu/client-cli/src/test/java/com/redhat/thermostat/vm/cpu/client/cli/internal/VmCpuStatPrintDelegateTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-cli/src/test/java/com/redhat/thermostat/vm/cpu/client/cli/internal/VmCpuStatPrintDelegateTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -51,8 +51,8 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.common.cli.CommandException;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.TimeStampedPojo;
 import com.redhat.thermostat.storage.model.VmCpuStat;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
--- a/vm-cpu/client-core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -76,5 +76,11 @@
       <artifactId>thermostat-vm-cpu-common</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/VmCpuService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/VmCpuService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,8 +41,8 @@
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.cpu.client.core.internal.VmCpuController;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
 
--- a/vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,7 +50,7 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuService;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
 
--- a/vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/internal/VmCpuController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/internal/VmCpuController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,8 +49,8 @@
 import com.redhat.thermostat.common.NotImplementedException;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.DiscreteTimeData;
 import com.redhat.thermostat.storage.model.VmCpuStat;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuView;
--- a/vm-cpu/client-core/src/test/java/com/redhat/thermostat/vm/cpu/client/core/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-core/src/test/java/com/redhat/thermostat/vm/cpu/client/core/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,7 +45,7 @@
 
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuService;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
 
--- a/vm-cpu/client-core/src/test/java/com/redhat/thermostat/vm/cpu/client/core/internal/VmCpuControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-core/src/test/java/com/redhat/thermostat/vm/cpu/client/core/internal/VmCpuControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -54,7 +54,7 @@
 import com.redhat.thermostat.common.ApplicationService;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.VmCpuStat;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuView;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuViewProvider;
--- a/vm-cpu/client-core/src/test/java/com/redhat/thermostat/vm/cpu/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-core/src/test/java/com/redhat/thermostat/vm/cpu/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.vm.cpu.client.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/vm-cpu/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -78,5 +78,11 @@
       <artifactId>thermostat-vm-cpu-client-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-cpu/client-swing/src/test/java/com/redhat/thermostat/vm/cpu/client/swing/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/client-swing/src/test/java/com/redhat/thermostat/vm/cpu/client/swing/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,7 +41,7 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuViewProvider;
 import com.redhat.thermostat.vm.cpu.client.swing.internal.Activator;
 import com.redhat.thermostat.vm.cpu.client.swing.internal.SwingVmCpuViewProvider;
--- a/vm-cpu/common/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/common/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -64,5 +64,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/VmCpuStatDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/VmCpuStatDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,7 +39,7 @@
 import java.util.List;
 
 import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.model.VmCpuStat;
--- a/vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/internal/VmCpuStatDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/internal/VmCpuStatDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,9 +38,9 @@
 
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.VmLatestPojoListGetter;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Put;
+import com.redhat.thermostat.storage.core.VmLatestPojoListGetter;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.core.Storage;
 import com.redhat.thermostat.storage.model.VmCpuStat;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
--- a/vm-cpu/common/src/test/java/com/redhat/thermostat/vm/cpu/common/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/common/src/test/java/com/redhat/thermostat/vm/cpu/common/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -43,7 +43,7 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
 
 public class ActivatorTest {
--- a/vm-cpu/common/src/test/java/com/redhat/thermostat/vm/cpu/common/internal/VmCpuStatDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-cpu/common/src/test/java/com/redhat/thermostat/vm/cpu/common/internal/VmCpuStatDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,10 +50,10 @@
 import org.junit.Before;
 import org.junit.Test;
 
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Add;
 import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.core.Cursor;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.core.Query;
--- a/vm-gc/agent/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/agent/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -74,5 +74,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-gc/agent/src/test/java/com/redhat/thermostat/vm/gc/agent/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/agent/src/test/java/com/redhat/thermostat/vm/gc/agent/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,7 +49,7 @@
 
 import com.redhat.thermostat.backend.Backend;
 import com.redhat.thermostat.backend.BackendService;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.gc.common.VmGcStatDAO;
 
 public class ActivatorTest {
--- a/vm-gc/client-core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/client-core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -81,5 +81,11 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/VmGcService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/VmGcService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,8 +41,8 @@
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.gc.client.core.internal.VmGcController;
 import com.redhat.thermostat.vm.gc.common.VmGcStatDAO;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
--- a/vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,7 +50,7 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.gc.client.core.VmGcService;
 import com.redhat.thermostat.vm.gc.common.VmGcStatDAO;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
--- a/vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/internal/VmGcController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/internal/VmGcController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -55,8 +55,8 @@
 import com.redhat.thermostat.common.NotImplementedException;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.IntervalTimeData;
 import com.redhat.thermostat.storage.model.TimeStampedPojoComparator;
 import com.redhat.thermostat.storage.model.VmGcStat;
--- a/vm-gc/client-core/src/test/java/com/redhat/thermostat/vm/gc/client/core/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/client-core/src/test/java/com/redhat/thermostat/vm/gc/client/core/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,7 +45,7 @@
 
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.gc.client.core.VmGcService;
 import com.redhat.thermostat.vm.gc.common.VmGcStatDAO;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
--- a/vm-gc/client-core/src/test/java/com/redhat/thermostat/vm/gc/client/core/internal/VmGcControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/client-core/src/test/java/com/redhat/thermostat/vm/gc/client/core/internal/VmGcControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -58,7 +58,7 @@
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.VmGcStat;
 import com.redhat.thermostat.storage.model.VmMemoryStat;
 import com.redhat.thermostat.storage.model.VmMemoryStat.Generation;
--- a/vm-gc/client-core/src/test/java/com/redhat/thermostat/vm/gc/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/client-core/src/test/java/com/redhat/thermostat/vm/gc/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.vm.gc.client.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/vm-gc/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -78,5 +78,11 @@
       <artifactId>thermostat-vm-gc-client-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-gc/client-swing/src/test/java/com/redhat/thermostat/vm/gc/client/swing/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/client-swing/src/test/java/com/redhat/thermostat/vm/gc/client/swing/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,7 +41,7 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.gc.client.core.VmGcViewProvider;
 import com.redhat.thermostat.vm.gc.client.swing.internal.Activator;
 import com.redhat.thermostat.vm.gc.client.swing.internal.SwingVmGcViewProvider;
--- a/vm-gc/common/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/common/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -64,5 +64,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/VmGcStatDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/VmGcStatDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,9 +39,9 @@
 import java.util.List;
 
 import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.VmGcStat;
 
 @Service
--- a/vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/internal/VmGcStatDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/internal/VmGcStatDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,10 +38,10 @@
 
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.VmLatestPojoListGetter;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Put;
 import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.VmLatestPojoListGetter;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.VmGcStat;
 import com.redhat.thermostat.vm.gc.common.VmGcStatDAO;
 
--- a/vm-gc/common/src/test/java/com/redhat/thermostat/vm/gc/common/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/common/src/test/java/com/redhat/thermostat/vm/gc/common/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -43,7 +43,7 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.gc.common.VmGcStatDAO;
 
 public class ActivatorTest {
--- a/vm-gc/common/src/test/java/com/redhat/thermostat/vm/gc/common/internal/VmGcStatDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/common/src/test/java/com/redhat/thermostat/vm/gc/common/internal/VmGcStatDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,10 +49,10 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Add;
 import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.core.Cursor;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.core.Query;
--- a/vm-gc/remote-collector-client-common/src/main/java/com/redhat/thermostat/gc/remote/common/GCRequest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/remote-collector-client-common/src/main/java/com/redhat/thermostat/gc/remote/common/GCRequest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,10 +42,10 @@
 import com.redhat.thermostat.common.command.Request;
 import com.redhat.thermostat.common.command.RequestResponseListener;
 import com.redhat.thermostat.common.command.Request.RequestType;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.gc.remote.common.command.GCCommand;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 
 public class GCRequest {
     
--- a/vm-gc/remote-collector-client-common/src/test/java/com/redhat/thermostat/gc/remote/common/GCRequestTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-gc/remote-collector-client-common/src/test/java/com/redhat/thermostat/gc/remote/common/GCRequestTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,10 +49,10 @@
 import com.redhat.thermostat.client.command.RequestQueue;
 import com.redhat.thermostat.common.command.Request;
 import com.redhat.thermostat.common.command.RequestResponseListener;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.gc.remote.common.command.GCCommand;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.storage.model.AgentInformation;
 
 public class GCRequestTest {
--- a/vm-heap-analysis/agent/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/agent/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -94,6 +94,13 @@
       <version>${project.version}</version>
     </dependency>
     
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+    
   </dependencies>
 
   <build>
--- a/vm-heap-analysis/agent/src/test/java/com/redhat/thermostat/vm/heap/analysis/agent/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/agent/src/test/java/com/redhat/thermostat/vm/heap/analysis/agent/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -46,7 +46,7 @@
 import org.osgi.framework.ServiceRegistration;
 
 import com.redhat.thermostat.agent.command.RequestReceiver;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.heap.analysis.agent.internal.Activator;
 import com.redhat.thermostat.vm.heap.analysis.agent.internal.HeapDumpReceiver;
 import com.redhat.thermostat.vm.heap.analysis.common.HeapDAO;
--- a/vm-heap-analysis/client-core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -157,6 +157,12 @@
       <scope>system</scope>
       <systemPath>${java.home}/../lib/tools.jar</systemPath>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
     
   </dependencies>
 </project>
--- a/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapDumperService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapDumperService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,9 +41,9 @@
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.vm.heap.analysis.client.core.internal.HeapDumpController;
 import com.redhat.thermostat.vm.heap.analysis.common.HeapDAO;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
--- a/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,8 +50,8 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.vm.heap.analysis.client.core.HeapDumperService;
 import com.redhat.thermostat.vm.heap.analysis.common.HeapDAO;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
--- a/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumpController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumpController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,8 +36,6 @@
 
 package com.redhat.thermostat.vm.heap.analysis.client.core.internal;
 
-import java.text.DecimalFormat;
-import java.text.NumberFormat;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -54,9 +52,9 @@
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.cli.CommandException;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.HeapInfo;
 import com.redhat.thermostat.storage.model.VmMemoryStat;
 import com.redhat.thermostat.storage.model.VmMemoryStat.Generation;
@@ -79,7 +77,6 @@
 
     private static final Translate<LocaleResources> translator = LocaleResources.createLocalizer();
 
-    private final VmInfoDAO vmInfoDao;
     private final VmMemoryStatDAO vmDao;
     private final VmRef ref;
     
@@ -124,7 +121,6 @@
         this.detailsViewProvider = detailsViewProvider;
         this.appService = appService;
         this.ref = ref;
-        this.vmInfoDao = vmInfoDao;
         this.vmDao = vmMemoryStatDao;
         this.heapDAO = heapDao;
         
--- a/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumper.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumper.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,7 +44,7 @@
 import com.redhat.thermostat.common.cli.CommandContextFactory;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleArguments;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class HeapDumper {
     
--- a/vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,8 +45,8 @@
 
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.heap.analysis.client.core.HeapDumperService;
 import com.redhat.thermostat.vm.heap.analysis.common.HeapDAO;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
--- a/vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumpControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumpControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -70,9 +70,9 @@
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.TimerFactory;
 import com.redhat.thermostat.common.cli.CommandException;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.HeapInfo;
 import com.redhat.thermostat.storage.model.VmInfo;
 import com.redhat.thermostat.storage.model.VmMemoryStat;
--- a/vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumperTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/core/internal/HeapDumperTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -53,8 +53,8 @@
 import com.redhat.thermostat.common.cli.CommandContextFactory;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.CommandRegistry;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 
 public class HeapDumperTest {
     private static final String TEST_HOST_ID = "1111111";
--- a/vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-core/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.vm.heap.analysis.client.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/vm-heap-analysis/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -137,6 +137,12 @@
       <scope>system</scope>
       <systemPath>${java.home}/../lib/tools.jar</systemPath>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
     
   </dependencies>
 </project>
--- a/vm-heap-analysis/client-swing/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/swing/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/client-swing/src/test/java/com/redhat/thermostat/vm/heap/analysis/client/swing/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,7 +41,7 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.heap.analysis.client.core.HeapDumpDetailsViewProvider;
 import com.redhat.thermostat.vm.heap.analysis.client.core.HeapHistogramViewProvider;
 import com.redhat.thermostat.vm.heap.analysis.client.core.HeapViewProvider;
--- a/vm-heap-analysis/command/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/command/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -83,6 +83,16 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-api-mockito</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-module-junit4</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
       <scope>provided</scope>
@@ -103,11 +113,11 @@
       <artifactId>thermostat-client-command</artifactId>
       <version>${project.version}</version>
     </dependency>
+    
     <dependency>
       <groupId>com.redhat.thermostat</groupId>
-      <artifactId>thermostat-common-test</artifactId>
+      <artifactId>thermostat-client-cli</artifactId>
       <version>${project.version}</version>
-      <scope>test</scope>
     </dependency>
 
     <dependency>
@@ -121,6 +131,12 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
 
     <dependency>
       <groupId>com.sun</groupId>
--- a/vm-heap-analysis/command/src/main/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/command/src/main/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,13 +38,13 @@
 
 import java.util.concurrent.Semaphore;
 
+import com.redhat.thermostat.client.cli.HostVMArguments;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
-import com.redhat.thermostat.common.cli.HostVMArguments;
 import com.redhat.thermostat.common.cli.SimpleCommand;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.vm.heap.analysis.command.locale.LocaleResources;
 
 
--- a/vm-heap-analysis/command/src/main/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapHelper.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/command/src/main/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapHelper.java	Wed Jan 16 18:58:59 2013 +0100
@@ -44,10 +44,10 @@
 import com.redhat.thermostat.common.command.RequestResponseListener;
 import com.redhat.thermostat.common.command.Response;
 import com.redhat.thermostat.common.command.Response.ResponseType;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 
 public class DumpHeapHelper {
     
--- a/vm-heap-analysis/command/src/main/java/com/redhat/thermostat/vm/heap/analysis/command/internal/ListHeapDumpsCommand.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/command/src/main/java/com/redhat/thermostat/vm/heap/analysis/command/internal/ListHeapDumpsCommand.java	Wed Jan 16 18:58:59 2013 +0100
@@ -40,17 +40,17 @@
 import java.util.Collection;
 import java.util.Date;
 
+import com.redhat.thermostat.client.cli.HostVMArguments;
 import com.redhat.thermostat.common.cli.CommandContext;
 import com.redhat.thermostat.common.cli.CommandException;
-import com.redhat.thermostat.common.cli.HostVMArguments;
 import com.redhat.thermostat.common.cli.SimpleCommand;
 import com.redhat.thermostat.common.cli.TableRenderer;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.HeapInfo;
 import com.redhat.thermostat.vm.heap.analysis.command.locale.LocaleResources;
 import com.redhat.thermostat.vm.heap.analysis.common.HeapDAO;
--- a/vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,17 +38,33 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.mock;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
 
 import com.redhat.thermostat.common.cli.Command;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({FrameworkUtil.class})
 public class ActivatorTest {
 
     @Test
     public void testCommandsRegistered() throws Exception {
         StubBundleContext ctx = new StubBundleContext();
+        
+        makeServiceLoaderHappy(ctx);
+        
         Activator activator = new Activator();
         
         activator.start(ctx);
@@ -65,5 +81,25 @@
         
         assertEquals(0, ctx.getAllServices().size());
     }
+
+    private void makeServiceLoaderHappy(StubBundleContext ctx) {
+        // ShellCommands no-arg constructor uses FrameworkUtil to get
+        // the bundle context. This results in NPEs when ServiceLoader
+        // attempts to load Command classes. Note that client-cli is
+        // a dep of this bundle and hence ServiceLoader wants to instantiate
+        // Command classes from there too.
+        PowerMockito.mockStatic(FrameworkUtil.class);
+        Bundle mockBundle = mock(Bundle.class);
+        when(FrameworkUtil.getBundle(any(Class.class))).thenReturn(mockBundle);
+        when(mockBundle.getBundleContext()).thenReturn(ctx);
+        Filter mockFilter = mock(Filter.class);
+        // StubBundleContext.createFilter() returns null if FrameworkUtil is
+        // mocked, so mock the offending static call too.
+        try {
+            when(FrameworkUtil.createFilter(any(String.class))).thenReturn(mockFilter);
+        } catch (InvalidSyntaxException e) {
+            // ignored
+        }
+    }
 }
 
--- a/vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -56,10 +56,10 @@
 import com.redhat.thermostat.common.cli.Command;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleArguments;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.test.TestCommandContextFactory;
 import com.redhat.thermostat.vm.heap.analysis.command.locale.LocaleResources;
 
--- a/vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapHelperTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/DumpHeapHelperTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -58,10 +58,10 @@
 import com.redhat.thermostat.common.command.RequestResponseListener;
 import com.redhat.thermostat.common.command.Response;
 import com.redhat.thermostat.common.command.Response.ResponseType;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
 import com.redhat.thermostat.storage.model.AgentInformation;
 import com.redhat.thermostat.vm.heap.analysis.command.internal.DumpHeapHelper;
 
--- a/vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/ListHeapDumpsCommandTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/internal/ListHeapDumpsCommandTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -55,11 +55,11 @@
 import com.redhat.thermostat.common.cli.Command;
 import com.redhat.thermostat.common.cli.CommandException;
 import com.redhat.thermostat.common.cli.SimpleArguments;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.HostInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.HeapInfo;
 import com.redhat.thermostat.test.TestCommandContextFactory;
 import com.redhat.thermostat.vm.heap.analysis.command.internal.ListHeapDumpsCommand;
--- a/vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/command/src/test/java/com/redhat/thermostat/vm/heap/analysis/command/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.vm.heap.analysis.command.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/vm-heap-analysis/common/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/common/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -107,6 +107,11 @@
       <artifactId>thermostat-common-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-storage-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
 </project>
 
--- a/vm-heap-analysis/common/src/main/java/com/redhat/thermostat/vm/heap/analysis/common/HeapDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/common/src/main/java/com/redhat/thermostat/vm/heap/analysis/common/HeapDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -42,9 +42,9 @@
 import java.util.Collection;
 
 import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.HeapInfo;
 
 @Service
--- a/vm-heap-analysis/common/src/main/java/com/redhat/thermostat/vm/heap/analysis/common/internal/HeapDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/common/src/main/java/com/redhat/thermostat/vm/heap/analysis/common/internal/HeapDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,12 +49,12 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.storage.core.Cursor;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.core.Put;
 import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.core.Query.Criteria;
 import com.redhat.thermostat.storage.core.Storage;
 import com.redhat.thermostat.storage.model.HeapInfo;
--- a/vm-heap-analysis/common/src/test/java/com/redhat/thermostat/vm/heap/analysis/common/internal/HeapDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-heap-analysis/common/src/test/java/com/redhat/thermostat/vm/heap/analysis/common/internal/HeapDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -61,13 +61,14 @@
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
 
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Add;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Cursor;
+import com.redhat.thermostat.storage.core.HostRef;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.core.Query;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.core.Query.Criteria;
 import com.redhat.thermostat.storage.core.Storage;
 import com.redhat.thermostat.storage.model.HeapInfo;
 import com.redhat.thermostat.vm.heap.analysis.common.HeapDAO;
--- a/vm-memory/agent/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/agent/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -74,5 +74,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-memory/agent/src/test/java/com/redhat/thermostat/vm/memory/agent/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/agent/src/test/java/com/redhat/thermostat/vm/memory/agent/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,7 +49,7 @@
 
 import com.redhat.thermostat.backend.Backend;
 import com.redhat.thermostat.backend.BackendService;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
 
 public class ActivatorTest {
--- a/vm-memory/client-cli/src/main/java/com/redhat/thermostat/vm/memory/client/cli/internal/VmMemoryStatPrintDelegate.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-cli/src/main/java/com/redhat/thermostat/vm/memory/client/cli/internal/VmMemoryStatPrintDelegate.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,8 +41,8 @@
 
 import com.redhat.thermostat.client.cli.VMStatPrintDelegate;
 import com.redhat.thermostat.common.Size;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.TimeStampedPojo;
 import com.redhat.thermostat.storage.model.VmMemoryStat;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
--- a/vm-memory/client-cli/src/test/java/com/redhat/thermostat/vm/memory/client/cli/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-cli/src/test/java/com/redhat/thermostat/vm/memory/client/cli/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -43,7 +43,7 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.client.cli.VMStatPrintDelegate;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
 
 public class ActivatorTest {
--- a/vm-memory/client-cli/src/test/java/com/redhat/thermostat/vm/memory/client/cli/internal/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-cli/src/test/java/com/redhat/thermostat/vm/memory/client/cli/internal/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.vm.memory.client.cli.internal;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/vm-memory/client-cli/src/test/java/com/redhat/thermostat/vm/memory/client/cli/internal/VmMemoryStatPrintDelegateTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-cli/src/test/java/com/redhat/thermostat/vm/memory/client/cli/internal/VmMemoryStatPrintDelegateTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,8 +49,8 @@
 
 import com.redhat.thermostat.client.cli.VMStatPrintDelegate;
 import com.redhat.thermostat.common.cli.CommandException;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.TimeStampedPojo;
 import com.redhat.thermostat.storage.model.VmMemoryStat;
 import com.redhat.thermostat.storage.model.VmMemoryStat.Generation;
--- a/vm-memory/client-core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -86,5 +86,11 @@
       <artifactId>thermostat-gc-remote-collector-client-common</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/MemoryStatsService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/MemoryStatsService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,11 +41,11 @@
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
 import com.redhat.thermostat.gc.remote.common.GCRequest;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.vm.memory.client.core.internal.MemoryStatsController;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
 
--- a/vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,10 +49,10 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.gc.remote.common.GCRequest;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.vm.memory.client.core.MemoryStatsService;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
 
--- a/vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/internal/MemoryStatsController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/internal/MemoryStatsController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -56,12 +56,12 @@
 import com.redhat.thermostat.common.command.RequestResponseListener;
 import com.redhat.thermostat.common.command.Response;
 import com.redhat.thermostat.common.command.Response.ResponseType;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.gc.remote.common.GCRequest;
 import com.redhat.thermostat.gc.remote.common.command.GCCommand;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmMemoryStat;
 import com.redhat.thermostat.storage.model.VmMemoryStat.Generation;
 import com.redhat.thermostat.storage.model.VmMemoryStat.Space;
--- a/vm-memory/client-core/src/test/java/com/redhat/thermostat/vm/memory/client/core/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-core/src/test/java/com/redhat/thermostat/vm/memory/client/core/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,10 +45,10 @@
 
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
 import com.redhat.thermostat.gc.remote.common.GCRequest;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.memory.client.core.MemoryStatsService;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
 
--- a/vm-memory/client-core/src/test/java/com/redhat/thermostat/vm/memory/client/core/internal/MemoryStatsControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-core/src/test/java/com/redhat/thermostat/vm/memory/client/core/internal/MemoryStatsControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -65,11 +65,11 @@
 import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.TimerFactory;
 import com.redhat.thermostat.common.command.RequestResponseListener;
-import com.redhat.thermostat.common.dao.AgentInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.gc.remote.common.GCRequest;
 import com.redhat.thermostat.gc.remote.common.command.GCCommand;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.AgentInfoDAO;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 import com.redhat.thermostat.storage.model.VmMemoryStat;
 import com.redhat.thermostat.storage.model.VmMemoryStat.Generation;
--- a/vm-memory/client-core/src/test/java/com/redhat/thermostat/vm/memory/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-core/src/test/java/com/redhat/thermostat/vm/memory/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.vm.memory.client.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/vm-memory/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -92,6 +92,12 @@
       <artifactId>thermostat-gc-remote-collector-client-swing</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
         
   </dependencies>
 </project>
--- a/vm-memory/client-swing/src/test/java/com/redhat/thermostat/vm/memory/client/swing/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/client-swing/src/test/java/com/redhat/thermostat/vm/memory/client/swing/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,7 +41,7 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.memory.client.core.MemoryStatsViewProvider;
 import com.redhat.thermostat.vm.memory.client.swing.internal.Activator;
 import com.redhat.thermostat.vm.memory.client.swing.internal.SwingMemoryStatsViewProvider;
--- a/vm-memory/common/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/common/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -64,5 +64,11 @@
       <artifactId>thermostat-storage-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/VmMemoryStatDAO.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/VmMemoryStatDAO.java	Wed Jan 16 18:58:59 2013 +0100
@@ -39,9 +39,9 @@
 import java.util.List;
 
 import com.redhat.thermostat.annotations.Service;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Category;
 import com.redhat.thermostat.storage.core.Key;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.VmMemoryStat;
 import com.redhat.thermostat.storage.model.VmMemoryStat.Generation;
 
--- a/vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/internal/VmMemoryStatDAOImpl.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/internal/VmMemoryStatDAOImpl.java	Wed Jan 16 18:58:59 2013 +0100
@@ -38,14 +38,14 @@
 
 import java.util.List;
 
-import com.redhat.thermostat.common.dao.VmLatestPojoListGetter;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Cursor;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.core.Put;
 import com.redhat.thermostat.storage.core.Query;
 import com.redhat.thermostat.storage.core.Query.Criteria;
 import com.redhat.thermostat.storage.core.Storage;
+import com.redhat.thermostat.storage.core.VmLatestPojoListGetter;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.model.VmMemoryStat;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
 
--- a/vm-memory/common/src/test/java/com/redhat/thermostat/vm/memory/common/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/common/src/test/java/com/redhat/thermostat/vm/memory/common/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -43,7 +43,7 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.storage.core.Storage;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
 
 public class ActivatorTest {
--- a/vm-memory/common/src/test/java/com/redhat/thermostat/vm/memory/common/internal/VmMemoryStatDAOTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-memory/common/src/test/java/com/redhat/thermostat/vm/memory/common/internal/VmMemoryStatDAOTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -52,10 +52,10 @@
 import org.junit.Before;
 import org.junit.Test;
 
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.storage.core.Add;
 import com.redhat.thermostat.storage.core.Category;
+import com.redhat.thermostat.storage.core.HostRef;
+import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.storage.core.Cursor;
 import com.redhat.thermostat.storage.core.Key;
 import com.redhat.thermostat.storage.core.Query;
--- a/vm-overview/client-core/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-overview/client-core/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -71,5 +71,11 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/VmOverviewService.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/VmOverviewService.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,9 +41,9 @@
 import com.redhat.thermostat.client.core.controllers.InformationServiceController;
 import com.redhat.thermostat.client.core.NameMatchingRefFilter;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.vm.overview.client.core.internal.VmOverviewController;
 
 public class VmOverviewService implements InformationService<VmRef> {
--- a/vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/internal/Activator.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/internal/Activator.java	Wed Jan 16 18:58:59 2013 +0100
@@ -50,8 +50,8 @@
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.MultipleServiceTracker;
 import com.redhat.thermostat.common.MultipleServiceTracker.Action;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.vm.overview.client.core.VmOverviewService;
 
 public class Activator implements BundleActivator {
--- a/vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/internal/VmOverviewController.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/internal/VmOverviewController.java	Wed Jan 16 18:58:59 2013 +0100
@@ -49,9 +49,9 @@
 import com.redhat.thermostat.common.NotImplementedException;
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 import com.redhat.thermostat.vm.overview.client.core.VmOverviewView;
 import com.redhat.thermostat.vm.overview.client.core.VmOverviewViewProvider;
--- a/vm-overview/client-core/src/test/java/com/redhat/thermostat/vm/overview/client/core/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-overview/client-core/src/test/java/com/redhat/thermostat/vm/overview/client/core/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -45,8 +45,8 @@
 
 import com.redhat.thermostat.client.core.InformationService;
 import com.redhat.thermostat.common.ApplicationService;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.overview.client.core.VmOverviewService;
 
 public class ActivatorTest {
--- a/vm-overview/client-core/src/test/java/com/redhat/thermostat/vm/overview/client/core/internal/VmOverviewControllerTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-overview/client-core/src/test/java/com/redhat/thermostat/vm/overview/client/core/internal/VmOverviewControllerTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -62,9 +62,9 @@
 import com.redhat.thermostat.common.Timer;
 import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.storage.core.VmRef;
+import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
 import com.redhat.thermostat.vm.overview.client.core.VmOverviewView;
 import com.redhat.thermostat.vm.overview.client.core.VmOverviewViewProvider;
--- a/vm-overview/client-core/src/test/java/com/redhat/thermostat/vm/overview/client/locale/LocaleResourcesTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-overview/client-core/src/test/java/com/redhat/thermostat/vm/overview/client/locale/LocaleResourcesTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -36,7 +36,7 @@
 
 package com.redhat.thermostat.vm.overview.client.locale;
 
-import com.redhat.thermostat.test.locale.AbstractLocaleResourcesTest;
+import com.redhat.thermostat.testutils.AbstractLocaleResourcesTest;
 
 public class LocaleResourcesTest extends AbstractLocaleResourcesTest<LocaleResources> {
 
--- a/vm-overview/client-swing/pom.xml	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-overview/client-swing/pom.xml	Wed Jan 16 18:58:59 2013 +0100
@@ -78,5 +78,11 @@
       <artifactId>thermostat-vm-overview-client-core</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat</groupId>
+      <artifactId>thermostat-common-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
--- a/vm-overview/client-swing/src/test/java/com/redhat/thermostat/vm/overview/client/swing/internal/ActivatorTest.java	Fri Jan 25 16:33:19 2013 -0500
+++ b/vm-overview/client-swing/src/test/java/com/redhat/thermostat/vm/overview/client/swing/internal/ActivatorTest.java	Wed Jan 16 18:58:59 2013 +0100
@@ -41,7 +41,7 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.test.StubBundleContext;
+import com.redhat.thermostat.testutils.StubBundleContext;
 import com.redhat.thermostat.vm.overview.client.core.VmOverviewViewProvider;
 import com.redhat.thermostat.vm.overview.client.swing.internal.Activator;
 import com.redhat.thermostat.vm.overview.client.swing.internal.SwingVmOverviewViewProvider;