gt: 		DasuToDeployDao dtd3 = new DasuToDeployDao(dasu3, null, null);
context: 
  package org.eso.ias.cdb.test.rdb;
  
  import org.eso.ias.cdb.CdbReader;
  import org.eso.ias.cdb.CdbWriter;
  import org.eso.ias.cdb.pojos.*;
  import org.eso.ias.cdb.rdb.RdbReader;
  import org.eso.ias.cdb.rdb.RdbUtils;
  import org.eso.ias.cdb.rdb.RdbWriter;
  import org.eso.ias.cdb.test.json.TestJsonCdb;
  import org.junit.jupiter.api.AfterAll;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  import java.util.Collection;
  import java.util.HashSet;
  import java.util.Optional;
  import java.util.Set;
  
  import static org.junit.jupiter.api.Assertions.assertEquals;
  import static org.junit.jupiter.api.Assertions.assertTrue;
  
  /**
   * Test reading and writing data from/to the relational database.
   * <P>
   * Reading and writing is done by {@link CdbReader} and {@link CdbWriter}
   * implementators as it is done in {@link TestJsonCdb} so, in principle the same
   * test can be run for text files and relational database. <BR>
   * The reason to have a separate test is because with hibernate there is no need
   * to explicitly store objects contained in other objects as needed by the CDB
   * on files. Actually, this test should be shorter and easier to read.
   * 
   * 
   * <EM>Note</em>: with the current implementation, running this test will clear
   * the content of the production database
   * 
   * @author acaproni
   *
   */
  public class TestRdbCdb {
  
  	/**
  	 * Helper object to read and write the RDB
  	 */
  	private static final RdbUtils rdbUtils = RdbUtils.getRdbUtils();
  
  	/**
  	 * The reader for the CDB RDB
  	 */
  	private final CdbReader cdbReader = new RdbReader();
  
  	/**
  	 * The reader for the CDB RDB
  	 */
  	private final CdbWriter cdbWriter = new RdbWriter();
  
  	/**
  	 * The logger
  	 */
  	private final Logger logger = LoggerFactory.getLogger(TestRdbCdb.class);
  
  	/**
  	 * @throws java.lang.Exception
  	 */
  	@BeforeEach
  	public void setUp() throws Exception {
  		// Clear the content of the DB
  
  		// Remove all the tables
  		try {
  			rdbUtils.dropTables();
  		} catch (Throwable t) {
  			System.out.println("Failure dropping tables. Was the RDB empty?");
  			System.out.println("Error " + t.getMessage() + " ignored");
  		}
  
  		// The create empty tables
  		rdbUtils.createTables();
  
  		cdbReader.init();
  		cdbWriter.init();
  	}
  
  	/**
  	 * @throws java.lang.Exception
  	 */
  	@AfterEach
  	public void tearDown() throws Exception {
  		cdbReader.shutdown();
  		cdbReader.shutdown();
  	}
  
  	@AfterAll
  	public static void logout() {
  		rdbUtils.close();
  	}
  
  	/**
  	 * Test reading and writing the IAS
  	 */
  	@Test
  	public void testIas() throws Exception {
  		logger.info("testIas");
  		IasDao ias = new IasDao();
  		ias.setLogLevel(LogLevelDao.DEBUG);
  
  		PropertyDao p1 = new PropertyDao();
  		p1.setName("P1-name");
  		p1.setValue("1000");
  		PropertyDao p2 = new PropertyDao();
  		p2.setName("P2-name");
  		p2.setValue("Name of P2");
  
  		ias.getProps().add(p1);
  		ias.getProps().add(p2);
  
  		ias.setRefreshRate(4);
  		ias.setValidityThreshold(7);
  
  		ias.setHbFrequency(5);
  
  		ias.setBsdbUrl("localhost:9092");
  		ias.setSmtp("acaproni:inorpaca@another.smtp.org");
  
  		// Write the IAS
  		cdbWriter.writeIas(ias);
  
  		// Get the IAS from the reader
  		Optional<IasDao> optIas = cdbReader.getIas();
  		assertTrue( optIas.isPresent(),"Got an empty IAS!");
  		assertEquals(ias, optIas.get(),"The IASs differ!");
  
  		// Modify the IAS and save it again
  		IasDao ias2 = optIas.get();
  		ias2.setLogLevel(LogLevelDao.INFO);
  		assertTrue(ias2.getProps().remove(p1),"Error removing a property from the IAS");
  
  		ias2.setRefreshRate(5);
  		ias2.setValidityThreshold(8);
  		ias2.setHbFrequency(10);
  		ias.setBsdbUrl("bsdb-server:9092");
  		ias.setSmtp("acaproni:inorpaca@test.smtp.org");
  		cdbWriter.writeIas(ias2);
  
  		// Get the IAS from the reader
  		Optional<IasDao> optIas2 = cdbReader.getIas();
  		assertTrue(optIas2.isPresent(),"Got an empty IAS!");
  		assertEquals(ias2, optIas2.get(),"The IASs differ!");
  		assertEquals(1, optIas2.get().getProps().size(),"Wrong number of properties");
  	}
  
  	/**
  	 * Test reading and writing of Supervisor
  	 *
  	 * @throws Exception
  	 */
  	@Test
  	public void testSupervisor() throws Exception {
  		logger.info("testSupervisor");
  
  		TemplateDao tDao1 = new TemplateDao("tID1",3,9);
  		TemplateDao tDao2 = new TemplateDao("tID2",1,25);
  		cdbWriter.writeTemplate(tDao1);
  		cdbWriter.writeTemplate(tDao2);
  
  		SupervisorDao superv = new SupervisorDao();
  		superv.setId("Supervisor-ID");
  		superv.setHostName("almadev2.alma.cl");
  		superv.setLogLevel(LogLevelDao.INFO);
  
  		// Adds the DASU to deploy
  		DasuDao dasu1 = new DasuDao();
  		dasu1.setId("DasuID1");
  		dasu1.setLogLevel(LogLevelDao.TRACE);
  		DasuToDeployDao dtd1 = new DasuToDeployDao(dasu1, tDao1, 5);
  		superv.addDasuToDeploy(dtd1);
  
  		IasioDao dasuOut1 = new IasioDao("DASU-OUT-1", "descr", IasTypeDao.ALARM,"http://www.eso.org/1");
  		cdbWriter.writeIasio(dasuOut1, true);
  		dasu1.setOutput(dasuOut1);
  
  		DasuDao dasu2 = new DasuDao();
  		dasu2.setId("DasuID2");
  		dasu2.setLogLevel(LogLevelDao.WARN);
  		DasuToDeployDao dtd2 = new DasuToDeployDao(dasu2, tDao2, 1);
  		superv.addDasuToDeploy(dtd2);
  
  		IasioDao dasuOut2 = new IasioDao("DASU-OUT-2", "descr", IasTypeDao.DOUBLE,"http://www.eso.org/2");
  		cdbWriter.writeIasio(dasuOut2, true);
  		dasu2.setOutput(dasuOut2);
  
  		cdbWriter.writeDasu(dasu1);
  		cdbWriter.writeDasu(dasu2);
  		cdbWriter.writeSupervisor(superv);
  
  		Optional<SupervisorDao> optSuperv = cdbReader.getSupervisor(superv.getId());
  		assertTrue(optSuperv.isPresent(),"Got an empty Supervisor!");
  		assertEquals(superv, optSuperv.get(),"The Supervisors differ!");
  
  		// Modify the supervisor then save it again
  		superv.setHostName("almadev.hq.eso.org");
  		superv.removeDasu(dasu2.getId());
  
  		DasuDao dasu3 = new DasuDao();
  		dasu3.setId("DasuID3");
  		dasu3.setLogLevel(LogLevelDao.TRACE);
  