ItEr20S04ArquitecturaServidorItEr19S04: Changing types of daos autowired to interfaces.

When autowiring you must specify the interface. If Spring proxifies
your daos, as if you want automatical exception translation, it
wouldn't autowire anymore.
This commit is contained in:
Óscar González Fernández 2009-08-05 14:07:15 +02:00
parent 344bdfcf25
commit 3e8d8e98d0
2 changed files with 17 additions and 18 deletions

View file

@ -1,5 +1,12 @@
package org.navalplanner.business.test.resources.daos;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static org.navalplanner.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
import static org.navalplanner.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;
import java.util.Calendar;
import java.util.Date;
@ -9,7 +16,7 @@ import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
import org.navalplanner.business.resources.daos.ICriterionDAO;
import org.navalplanner.business.resources.daos.ICriterionSatisfactionDAO;
import org.navalplanner.business.resources.daos.ICriterionTypeDAO;
import org.navalplanner.business.resources.daos.WorkerDAO;
import org.navalplanner.business.resources.daos.IWorkerDAO;
import org.navalplanner.business.resources.entities.Criterion;
import org.navalplanner.business.resources.entities.CriterionSatisfaction;
import org.navalplanner.business.resources.entities.CriterionType;
@ -20,14 +27,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static org.navalplanner.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
import static org.navalplanner.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;
/**
* Description goes here. <br />
* @author Óscar González Fernández <ogonzalez@igalia.com>
@ -48,7 +47,7 @@ public class CriterionSatisfactionDAOTest {
private ICriterionTypeDAO criterionTypeDAO;
@Autowired
private WorkerDAO workerDAO;
private IWorkerDAO workerDAO;
@Test
public void testSaveCriterions() throws Exception {

View file

@ -5,15 +5,15 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import org.navalplanner.business.orders.daos.OrderElementDAO;
import org.navalplanner.business.orders.daos.IOrderElementDAO;
import org.navalplanner.business.orders.entities.OrderElement;
import org.navalplanner.business.orders.entities.OrderLine;
import org.navalplanner.business.resources.daos.CriterionTypeDAO;
import org.navalplanner.business.resources.daos.ResourceDAO;
import org.navalplanner.business.resources.daos.ICriterionTypeDAO;
import org.navalplanner.business.resources.daos.IResourceDAO;
import org.navalplanner.business.resources.entities.CriterionType;
import org.navalplanner.business.resources.entities.Resource;
import org.navalplanner.business.resources.entities.Worker;
import org.navalplanner.business.workreports.daos.WorkReportTypeDAO;
import org.navalplanner.business.workreports.daos.IWorkReportTypeDAO;
import org.navalplanner.business.workreports.entities.WorkReport;
import org.navalplanner.business.workreports.entities.WorkReportLine;
import org.navalplanner.business.workreports.entities.WorkReportType;
@ -22,16 +22,16 @@ import org.springframework.beans.factory.annotation.Autowired;
public abstract class AbstractWorkReportTest {
@Autowired
CriterionTypeDAO criterionTypeDAO;
ICriterionTypeDAO criterionTypeDAO;
@Autowired
WorkReportTypeDAO workReportTypeDAO;
IWorkReportTypeDAO workReportTypeDAO;
@Autowired
ResourceDAO resourceDAO;
IResourceDAO resourceDAO;
@Autowired
OrderElementDAO orderElementDAO;
IOrderElementDAO orderElementDAO;
// Create a Set of CriterionType
public Set<CriterionType> createValidCriterionTypes() {