/*
 * Created on Jul 18, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.cosylab.acs.alarm;

import alma.acs.component.ComponentLifecycleException;

import com.cosylab.acs.laser.dao.ACSCategoryDAOImpl;
import com.cosylab.acs.laser.dao.ConfigurationAccessor;
import com.cosylab.acs.laser.dao.ConfigurationAccessorFactory;


/**
 * @author Simon Belak
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class ACSCategoryDAOTest extends AlarmTestBase
{
	ACSCategoryDAOImpl categoryDAO;
	
	public ACSCategoryDAOTest()
	{
		super();
		try	{
			init();
		} catch (Exception e) {
			System.out.println("Failed to init: " + e.toString());
			System.exit(-1);
		}
	}
	
	public void init() throws Exception
	{
		ConfigurationAccessor conf;
		conf = ConfigurationAccessorFactory.getInstance(client.getContainerServices());
		
		categoryDAO = new ACSCategoryDAOImpl();
		categoryDAO.setConfAccessor(conf);
	}
		
	public void testFindByCategoryTreeRoot()
	{
		System.out.print("Loading categories ... ");
		try	{
			categoryDAO.loadCategories();
		} catch (Exception e) {
			System.out.println("Failed");
			System.out.println(e.toString());
			return;
		}
		System.out.println("Done");
		
		categoryDAO.setCategoryTreeRoot("ROOT:SOURCE");
		System.out.println("categoryTreeRoot set to ROOT:SOURCE");
		
		System.out.print("Evoking findByCategoryTreeRoot() ... ");
		try {
			categoryDAO.findByCategoryTreeRoot();
		} catch (Exception e) {
			System.out.println("Failed");
			System.out.println(e.toString());
			return;
		}
		System.out.println("Done");
	}
}

@@ -240,16 +240,66 @@
 ption;%0A%0A
+import com.cosylab.acs.laser.dao.ACSAlarmDAOImpl;%0A
 import c
@@ -335,32 +335,32 @@
 ategoryDAOImpl;%0A
-
 import com.cosyl
@@ -685,16 +685,24 @@
 Base%0A%7B%0A%09
+private 
 ACSCateg
@@ -725,16 +725,51 @@
 oryDAO;%0A
+%09private ACSAlarmDAOImpl alarmDAO;%0A
 %09%0A%09publi
@@ -1088,24 +1088,61 @@
 ices());%0A%09%09%0A
+%09%09alarmDAO=new ACSAlarmDAOImpl(log);%0A
 %09%09categoryDA
@@ -1168,16 +1168,28 @@
 DAOImpl(
+log,alarmDAO
 );%0A%09%09cat

Build an alarmDAO needed by the caegoryDAO constructor