Remove uses of @NotTransactional
@NotTransactional is deprecrated and in the next major Spring version is removed.
This commit is contained in:
parent
7b54a5063e
commit
2c7246f868
82 changed files with 561 additions and 192 deletions
|
|
@ -49,7 +49,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class EntitySequenceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -67,6 +66,7 @@ public class EntitySequenceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCreateActiveEntitySequence() {
|
||||
try {
|
||||
entitySequenceDAO.save(givenEntitySequence("prefix-"
|
||||
|
|
@ -80,6 +80,7 @@ public class EntitySequenceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCreateEntitySequenceWithEmptyPrefix() {
|
||||
try {
|
||||
entitySequenceDAO.save(givenEntitySequence("",
|
||||
|
|
@ -92,6 +93,7 @@ public class EntitySequenceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCreateEntitySequenceWithPrefixWithWhiteSpace() {
|
||||
try {
|
||||
entitySequenceDAO.save(givenEntitySequence(
|
||||
|
|
@ -104,6 +106,7 @@ public class EntitySequenceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCreateEntitySequenceWithEmptyEntityName() {
|
||||
try {
|
||||
entitySequenceDAO.save(givenEntitySequence("prefix-"
|
||||
|
|
@ -116,6 +119,7 @@ public class EntitySequenceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCreateEntitySequenceWithNumberOfDigitsNotSpecified() {
|
||||
try {
|
||||
EntitySequence entitySequence = givenEntitySequence("prefix-"
|
||||
|
|
@ -130,6 +134,7 @@ public class EntitySequenceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCreateEntitySequenceWithNumberOfDigitsOutRange() {
|
||||
try {
|
||||
EntitySequence entitySequence = givenEntitySequence("prefix-"
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class DefaultAdvanceTypesBootstrapListenerTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -60,6 +59,7 @@ public class DefaultAdvanceTypesBootstrapListenerTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theBootstrapensuresExistenceOfPredefinedAdvanceTypes() {
|
||||
getAdvanceTypeBootstrap().loadRequiredData();
|
||||
for (PredefinedAdvancedTypes p : PredefinedAdvancedTypes.values()) {
|
||||
|
|
@ -68,6 +68,7 @@ public class DefaultAdvanceTypesBootstrapListenerTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAdvanceTypeFromEnum() {
|
||||
getAdvanceTypeBootstrap().loadRequiredData();
|
||||
for (PredefinedAdvancedTypes p : PredefinedAdvancedTypes.values()) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
*
|
||||
* @author Manuel Rego Casasnovas <rego@igalia.com>
|
||||
*/
|
||||
@Transactional
|
||||
public class AdvanceAssignmentDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -65,6 +64,7 @@ public class AdvanceAssignmentDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void saveValidAdvanceAssignment() {
|
||||
AdvanceAssignment advance = DirectAdvanceAssignment.create(false,
|
||||
BigDecimal.TEN);
|
||||
|
|
@ -74,6 +74,7 @@ public class AdvanceAssignmentDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void saveAdvanceAssignmentWithZeroAsMaxValue() {
|
||||
AdvanceAssignment advance = DirectAdvanceAssignment.create(false,
|
||||
BigDecimal.ZERO);
|
||||
|
|
@ -83,6 +84,7 @@ public class AdvanceAssignmentDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void saveAdvanceAssignmentWithNegativeNumberAsMaxValue() {
|
||||
AdvanceAssignment advance = DirectAdvanceAssignment.create(false,
|
||||
BigDecimal.valueOf(-10));
|
||||
|
|
|
|||
|
|
@ -39,13 +39,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class AdvanceTypeTest {
|
||||
|
||||
@Autowired
|
||||
private IAdvanceTypeDAO dao;
|
||||
|
||||
@Test(expected = DataIntegrityViolationException.class)
|
||||
@Transactional
|
||||
public void typeNameMustBeUniqueInDB() {
|
||||
String repeatedName = "bla";
|
||||
AdvanceType advanceType = AdvanceType.create(repeatedName, new BigDecimal(
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class BaseCalendarDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -96,6 +95,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void saveBasicCalendar() {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
baseCalendarDAO.save(calendar);
|
||||
|
|
@ -103,6 +103,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void saveBasicCalendarWithExceptionDay() {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
addChristmasAsExceptionDay(calendar);
|
||||
|
|
@ -128,6 +129,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void saveDerivedCalendar() {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
baseCalendarDAO.save(calendar);
|
||||
|
|
@ -152,6 +154,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void saveNextCalendar() {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
baseCalendarDAO.save(calendar);
|
||||
|
|
@ -171,6 +174,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = DataIntegrityViolationException.class)
|
||||
@Transactional
|
||||
public void notAllowRemoveCalendarWithChildren()
|
||||
throws InstanceNotFoundException {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
|
|
@ -188,6 +192,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = InstanceNotFoundException.class)
|
||||
@Transactional
|
||||
public void removeVersions() throws InstanceNotFoundException {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
baseCalendarDAO.save(calendar);
|
||||
|
|
@ -204,6 +209,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void findChildrens() {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
baseCalendarDAO.save(calendar);
|
||||
|
|
@ -236,6 +242,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = DataIntegrityViolationException.class)
|
||||
@Transactional
|
||||
public void notAllowRemoveCalendarWithChildrenInOtherVersions()
|
||||
throws InstanceNotFoundException {
|
||||
BaseCalendar parent1 = BaseCalendarTest.createBasicCalendar();
|
||||
|
|
@ -270,6 +277,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void notAllowTwoCalendarsWithNullName() {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
calendar.setName(null);
|
||||
|
|
@ -278,6 +286,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void notAllowTwoCalendarsWithEmptyName() {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
calendar.setName("");
|
||||
|
|
@ -286,6 +295,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void findByName() {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
baseCalendarDAO.save(calendar);
|
||||
|
|
@ -297,6 +307,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getBaseCalendarsAndNotResourceCalendars() {
|
||||
List<BaseCalendar> baseCalendars = baseCalendarDAO.getBaseCalendars();
|
||||
int previous = baseCalendars.size();
|
||||
|
|
@ -323,6 +334,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void doNotAllowToSaveCalendarWithZeroHours() {
|
||||
BaseCalendar calendar = BaseCalendar.create("calendar-"
|
||||
+ UUID.randomUUID());
|
||||
|
|
@ -331,6 +343,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveAndRemoveCalendar() {
|
||||
BaseCalendar calendar = BaseCalendarTest.createBasicCalendar();
|
||||
baseCalendarDAO.save(calendar);
|
||||
|
|
@ -343,6 +356,7 @@ public class BaseCalendarDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveAndRemoveResourceCalendar() {
|
||||
Worker worker = ResourceDAOTest.givenValidWorker();
|
||||
ResourceCalendar resourceCalendar = ResourceCalendar.create();
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class CostCategoryDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -67,6 +66,7 @@ public class CostCategoryDAOTest {
|
|||
ITypeOfWorkHoursDAO typeOfWorkHoursDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(costCategoryDAO);
|
||||
}
|
||||
|
|
@ -77,6 +77,7 @@ public class CostCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveCostCategory() {
|
||||
CostCategory costCategory = createValidCostCategory();
|
||||
costCategoryDAO.save(costCategory);
|
||||
|
|
@ -84,6 +85,7 @@ public class CostCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveCostCategory() throws InstanceNotFoundException {
|
||||
CostCategory costCategory = createValidCostCategory();
|
||||
costCategoryDAO.save(costCategory);
|
||||
|
|
@ -92,6 +94,7 @@ public class CostCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListCostCategories() {
|
||||
int previous = costCategoryDAO.list(CostCategory.class).size();
|
||||
CostCategory costCategory = createValidCostCategory();
|
||||
|
|
@ -101,6 +104,7 @@ public class CostCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCanAddHourCost() {
|
||||
CostCategory costCategory = createValidCostCategory();
|
||||
TypeOfWorkHours type1 = TypeOfWorkHours.create(UUID.randomUUID().toString(),
|
||||
|
|
@ -158,6 +162,7 @@ public class CostCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListHourCosts() {
|
||||
CostCategory costCategory = createValidCostCategory();
|
||||
HourCost hourCost = HourCost.create(BigDecimal.ONE, new LocalDate(2009,11,1));
|
||||
|
|
@ -177,6 +182,7 @@ public class CostCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected=ValidationException.class)
|
||||
@Transactional
|
||||
public void testHourCostsOverlap() {
|
||||
CostCategory costCategory = createValidCostCategory();
|
||||
TypeOfWorkHours type1 = TypeOfWorkHours.create(UUID.randomUUID().toString(),
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class HourCostDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -70,6 +69,7 @@ public class HourCostDAOTest {
|
|||
ICostCategoryDAO costCategoryDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(hourCostDAO);
|
||||
}
|
||||
|
|
@ -91,6 +91,7 @@ public class HourCostDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveHourCost() {
|
||||
HourCost hourCost = createValidHourCost();
|
||||
hourCostDAO.save(hourCost);
|
||||
|
|
@ -98,6 +99,7 @@ public class HourCostDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveHourCost() throws InstanceNotFoundException {
|
||||
HourCost hourCost = createValidHourCost();
|
||||
hourCostDAO.save(hourCost);
|
||||
|
|
@ -106,6 +108,7 @@ public class HourCostDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListHourCost() {
|
||||
int previous = hourCostDAO.list(HourCost.class).size();
|
||||
HourCost hourCost = createValidHourCost();
|
||||
|
|
@ -115,12 +118,14 @@ public class HourCostDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCategoryNavigation() {
|
||||
HourCost hourCost = createValidHourCost();
|
||||
assertTrue(hourCost.getCategory().getHourCosts().contains(hourCost));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testHourCostNotInTwoCategories() {
|
||||
HourCost hourCost = createValidHourCost();
|
||||
CostCategory costCategory1 = CostCategory.create(UUID.randomUUID().toString());
|
||||
|
|
@ -142,6 +147,7 @@ public class HourCostDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected=ValidationException.class)
|
||||
@Transactional
|
||||
public void testPositiveTimeInterval() {
|
||||
HourCost hourCost = createValidHourCost();
|
||||
hourCost.setInitDate(new LocalDate(2000,12,31));
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class ResourcesCostCategoryAssignmentDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -70,6 +69,7 @@ public class ResourcesCostCategoryAssignmentDAOTest {
|
|||
IWorkerDAO workerDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(resourcesCostCategoryAssignmentDAO);
|
||||
}
|
||||
|
|
@ -98,6 +98,7 @@ public class ResourcesCostCategoryAssignmentDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveResourcesCostCategoryAssignment() {
|
||||
ResourcesCostCategoryAssignment assignment = createValidResourcesCostCategoryAssignment();
|
||||
resourcesCostCategoryAssignmentDAO.save(assignment);
|
||||
|
|
@ -105,6 +106,7 @@ public class ResourcesCostCategoryAssignmentDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveResourcesCostCategoryAssignment() throws InstanceNotFoundException {
|
||||
ResourcesCostCategoryAssignment assignment = createValidResourcesCostCategoryAssignment();
|
||||
resourcesCostCategoryAssignmentDAO.save(assignment);
|
||||
|
|
@ -113,6 +115,7 @@ public class ResourcesCostCategoryAssignmentDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListResourcesCostCategoryAssignments() {
|
||||
int previous = resourcesCostCategoryAssignmentDAO.list(ResourcesCostCategoryAssignment.class).size();
|
||||
ResourcesCostCategoryAssignment assignment = createValidResourcesCostCategoryAssignment();
|
||||
|
|
@ -122,6 +125,7 @@ public class ResourcesCostCategoryAssignmentDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testNavigateRelations() {
|
||||
ResourcesCostCategoryAssignment assignment = createValidResourcesCostCategoryAssignment();
|
||||
resourcesCostCategoryAssignmentDAO.save(assignment);
|
||||
|
|
@ -135,6 +139,7 @@ public class ResourcesCostCategoryAssignmentDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected=ValidationException.class)
|
||||
@Transactional
|
||||
public void testPositiveTimeInterval() {
|
||||
ResourcesCostCategoryAssignment assignment = createValidResourcesCostCategoryAssignment();
|
||||
assignment.setInitDate(new LocalDate(2000,12,31));
|
||||
|
|
@ -144,6 +149,7 @@ public class ResourcesCostCategoryAssignmentDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testGetResourcesCostCategoryAssignmentsByCostCategory() {
|
||||
ResourcesCostCategoryAssignment assignment1 = createValidResourcesCostCategoryAssignment();
|
||||
ResourcesCostCategoryAssignment assignment2 = createValidResourcesCostCategoryAssignment();
|
||||
|
|
|
|||
|
|
@ -51,13 +51,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class TypeOfWorkHoursDAOTest {
|
||||
|
||||
@Autowired
|
||||
ITypeOfWorkHoursDAO typeOfWorkHoursDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(typeOfWorkHoursDAO);
|
||||
}
|
||||
|
|
@ -70,6 +70,7 @@ public class TypeOfWorkHoursDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveTypeOfWorkHours() {
|
||||
TypeOfWorkHours typeOfWorkHours = createValidTypeOfWorkHours();
|
||||
typeOfWorkHoursDAO.save(typeOfWorkHours);
|
||||
|
|
@ -77,6 +78,7 @@ public class TypeOfWorkHoursDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveTypeOfWorkHours() throws InstanceNotFoundException {
|
||||
TypeOfWorkHours typeOfWorkHours = createValidTypeOfWorkHours();
|
||||
typeOfWorkHoursDAO.save(typeOfWorkHours);
|
||||
|
|
@ -85,6 +87,7 @@ public class TypeOfWorkHoursDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListTypesOfWorkHours() {
|
||||
int previous = typeOfWorkHoursDAO.list(TypeOfWorkHours.class).size();
|
||||
TypeOfWorkHours typeOfWorkHours = createValidTypeOfWorkHours();
|
||||
|
|
@ -94,6 +97,7 @@ public class TypeOfWorkHoursDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindTypesOfWorkHoursByCode() {
|
||||
TypeOfWorkHours typeOfWorkHours = createValidTypeOfWorkHours();
|
||||
typeOfWorkHoursDAO.save(typeOfWorkHours);
|
||||
|
|
@ -108,6 +112,7 @@ public class TypeOfWorkHoursDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected=InstanceNotFoundException.class)
|
||||
@Transactional
|
||||
public void testFindTypesOfWorkHoursByCodeException() throws InstanceNotFoundException{
|
||||
TypeOfWorkHours typeOfWorkHours = createValidTypeOfWorkHours();
|
||||
typeOfWorkHoursDAO.save(typeOfWorkHours);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Susana Montes Pedreira <smontes@wirelessgalicia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class ExpenseSheetTestDAO {
|
||||
|
||||
@Before
|
||||
|
|
@ -112,6 +111,7 @@ public class ExpenseSheetTestDAO {
|
|||
private IScenarioManager scenarioManager;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(orderDAO);
|
||||
assertNotNull(calendarDAO);
|
||||
|
|
@ -151,6 +151,7 @@ public class ExpenseSheetTestDAO {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void invalidExpenseSheetWithoutLines() {
|
||||
ExpenseSheet expense = ExpenseSheet.create();
|
||||
expense.setCode("UUID.randomUUID().toString()");
|
||||
|
|
@ -170,6 +171,7 @@ public class ExpenseSheetTestDAO {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void validExpenseSheetWithInvalidExpenseSheetLineData() {
|
||||
// check out the expenseSheet without lines
|
||||
ExpenseSheet expense = ExpenseSheet.create();
|
||||
|
|
@ -191,6 +193,7 @@ public class ExpenseSheetTestDAO {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validExpenseSheetWithInvalidValuesInLines() {
|
||||
// create the expenseSheet without lines
|
||||
ExpenseSheet expense = ExpenseSheet.create();
|
||||
|
|
@ -246,6 +249,7 @@ public class ExpenseSheetTestDAO {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validExpenseSheetWithInvalidDateInLines() {
|
||||
// create the expenseSheet without lines
|
||||
ExpenseSheet expense = ExpenseSheet.create();
|
||||
|
|
@ -292,6 +296,7 @@ public class ExpenseSheetTestDAO {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validExpenseSheetData() {
|
||||
// check out the expenseSheet without lines
|
||||
int previousExpenses = expenseSheetDAO.getAll().size();
|
||||
|
|
@ -373,6 +378,7 @@ public class ExpenseSheetTestDAO {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveTwoExpenseSheetWithTheSameCode() {
|
||||
int previousExpenses = expenseSheetDAO.getAll().size();
|
||||
|
||||
|
|
@ -421,6 +427,7 @@ public class ExpenseSheetTestDAO {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveTwoValidExpenseSheets() {
|
||||
int previousExpenses = expenseSheetDAO.getAll().size();
|
||||
|
||||
|
|
@ -466,6 +473,7 @@ public class ExpenseSheetTestDAO {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void testSaveExpenseSheetWithoutCode() {
|
||||
ExpenseSheet expense = ExpenseSheet.create();
|
||||
expense.setCode(null);
|
||||
|
|
@ -477,6 +485,7 @@ public class ExpenseSheetTestDAO {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveExpenseSheet() throws InstanceNotFoundException {
|
||||
int previousExpenses = expenseSheetDAO.getAll().size();
|
||||
int previousExpenseLines = expenseSheetLineDAO.findAll().size();
|
||||
|
|
@ -504,6 +513,7 @@ public class ExpenseSheetTestDAO {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveExpenseSheetLine() {
|
||||
int previousExpenseLines = expenseSheetLineDAO.findAll().size();
|
||||
int previousExpenses = expenseSheetDAO.getAll().size();
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ import static org.junit.Assert.assertTrue;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CustomerCommunicationDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -100,16 +99,19 @@ public class CustomerCommunicationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testOrderDAOInSpringContainer() {
|
||||
assertNotNull(orderDAO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCustomerCommunicationDAOInSpringContainer() {
|
||||
assertNotNull(customerCommunicationDAO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveCustomerCommunication() {
|
||||
CustomerCommunication customerCommunication = createValidCustomerCommunication();
|
||||
customerCommunicationDAO.save(customerCommunication);
|
||||
|
|
@ -117,6 +119,7 @@ public class CustomerCommunicationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveCustomerCommunication()
|
||||
throws InstanceNotFoundException {
|
||||
CustomerCommunication customerCommunication = createValidCustomerCommunication();
|
||||
|
|
@ -128,6 +131,7 @@ public class CustomerCommunicationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveCustomerCommunicationWithoutOrder()
|
||||
throws InstanceNotFoundException {
|
||||
CustomerCommunication customerCommunication = createValidCustomerCommunication();
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ import org.libreplan.business.users.daos.IUserDAO;
|
|||
import org.libreplan.business.users.entities.User;
|
||||
import org.libreplan.business.users.entities.UserRole;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -63,7 +62,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class ExternalCompanyDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -84,11 +82,13 @@ public class ExternalCompanyDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(externalCompanyDAO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveExternalCompany() {
|
||||
ExternalCompany externalCompany = createValidExternalCompany();
|
||||
externalCompanyDAO.save(externalCompany);
|
||||
|
|
@ -96,6 +96,7 @@ public class ExternalCompanyDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveExternalCompany() throws InstanceNotFoundException {
|
||||
ExternalCompany externalCompany = createValidExternalCompany();
|
||||
externalCompanyDAO.save(externalCompany);
|
||||
|
|
@ -104,6 +105,7 @@ public class ExternalCompanyDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListExternalCompanies() {
|
||||
int previous = externalCompanyDAO.list(ExternalCompany.class).size();
|
||||
ExternalCompany externalCompany = createValidExternalCompany();
|
||||
|
|
@ -112,7 +114,6 @@ public class ExternalCompanyDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testRelationWithUser() throws InstanceNotFoundException {
|
||||
final User user = createValidUser();
|
||||
final ExternalCompany externalCompany = createValidExternalCompany();
|
||||
|
|
@ -147,6 +148,7 @@ public class ExternalCompanyDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindUniqueByName() throws InstanceNotFoundException {
|
||||
ExternalCompany externalCompany = createValidExternalCompany();
|
||||
externalCompanyDAO.save(externalCompany);
|
||||
|
|
@ -155,6 +157,7 @@ public class ExternalCompanyDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testExistsByName() throws InstanceNotFoundException {
|
||||
ExternalCompany externalCompany = createValidExternalCompany();
|
||||
assertFalse(externalCompanyDAO.existsByName(externalCompany.getName()));
|
||||
|
|
@ -163,7 +166,6 @@ public class ExternalCompanyDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected=ValidationException.class)
|
||||
@NotTransactional
|
||||
public void testUniqueCompanyNameCheck() throws ValidationException {
|
||||
final ExternalCompany externalCompany1 = createValidExternalCompany();
|
||||
|
||||
|
|
@ -181,7 +183,6 @@ public class ExternalCompanyDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected=ValidationException.class)
|
||||
@NotTransactional
|
||||
public void testUniqueCompanyNifCheck() throws ValidationException {
|
||||
final ExternalCompany externalCompany1 = createValidExternalCompany();
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Diego Pino Garcia <dpino@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class LabelDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -62,6 +61,7 @@ public class LabelDAOTest {
|
|||
ILabelTypeDAO labelTypeDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(labelDAO);
|
||||
}
|
||||
|
|
@ -75,6 +75,7 @@ public class LabelDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveLabel() {
|
||||
Label label = createValidLabel();
|
||||
labelDAO.save(label);
|
||||
|
|
@ -82,6 +83,7 @@ public class LabelDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveLabel() throws InstanceNotFoundException {
|
||||
Label label = createValidLabel();
|
||||
labelDAO.save(label);
|
||||
|
|
@ -90,6 +92,7 @@ public class LabelDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListLabels() {
|
||||
int previous = labelDAO.list(Label.class).size();
|
||||
Label label = createValidLabel();
|
||||
|
|
|
|||
|
|
@ -50,18 +50,19 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Diego Pino Garcia <dpino@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class LabelTypeDAOTest {
|
||||
|
||||
@Autowired
|
||||
ILabelTypeDAO labelTypeDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(labelTypeDAO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveLabelType() {
|
||||
LabelType labelType = LabelType.create(UUID.randomUUID().toString());
|
||||
labelTypeDAO.save(labelType);
|
||||
|
|
@ -69,6 +70,7 @@ public class LabelTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveLabelType() throws InstanceNotFoundException {
|
||||
LabelType labelType = LabelType.create(UUID.randomUUID().toString());
|
||||
labelTypeDAO.save(labelType);
|
||||
|
|
@ -77,6 +79,7 @@ public class LabelTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListLabelTypes() {
|
||||
int previous = labelTypeDAO.list(LabelType.class).size();
|
||||
LabelType labelType = LabelType.create(UUID.randomUUID().toString());
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class MaterialAssignmentDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -103,6 +102,7 @@ public class MaterialAssignmentDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testGetByMaterial() {
|
||||
MaterialAssignment assignment1 = createValidMaterialAssignment();
|
||||
MaterialAssignment assignment2 = createValidMaterialAssignment();
|
||||
|
|
|
|||
|
|
@ -51,13 +51,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class MaterialCategoryDAOTest {
|
||||
|
||||
@Autowired
|
||||
IMaterialCategoryDAO materialCategoryDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(materialCategoryDAO);
|
||||
}
|
||||
|
|
@ -68,6 +68,7 @@ public class MaterialCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveMaterialCategory() {
|
||||
MaterialCategory materialCategory = createValidMaterialCategory();
|
||||
materialCategoryDAO.save(materialCategory);
|
||||
|
|
@ -75,6 +76,7 @@ public class MaterialCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveMaterialCategory() throws InstanceNotFoundException {
|
||||
MaterialCategory materialCategory = createValidMaterialCategory();
|
||||
materialCategoryDAO.save(materialCategory);
|
||||
|
|
@ -83,6 +85,7 @@ public class MaterialCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListMaterialCategories() {
|
||||
int previous = materialCategoryDAO.list(MaterialCategory.class).size();
|
||||
MaterialCategory materialCategory = createValidMaterialCategory();
|
||||
|
|
@ -92,6 +95,7 @@ public class MaterialCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListChildrenMaterialCategories() {
|
||||
MaterialCategory category = createValidMaterialCategory();
|
||||
MaterialCategory subcategory = createValidMaterialCategory();
|
||||
|
|
@ -103,6 +107,7 @@ public class MaterialCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveChildrenMaterialCategories() {
|
||||
MaterialCategory category = createValidMaterialCategory();
|
||||
MaterialCategory subcategory = createValidMaterialCategory();
|
||||
|
|
@ -117,6 +122,7 @@ public class MaterialCategoryDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveMaterialSubcategoryTopDown() {
|
||||
MaterialCategory category = createValidMaterialCategory();
|
||||
MaterialCategory subcategory = createValidMaterialCategory();
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class MaterialDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -68,6 +67,7 @@ public class MaterialDAOTest {
|
|||
private IMaterialCategoryDAO materialCategoryDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(materialDAO);
|
||||
}
|
||||
|
|
@ -103,6 +103,7 @@ public class MaterialDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveMaterial() {
|
||||
Material material = createValidMaterial();
|
||||
materialDAO.save(material);
|
||||
|
|
@ -110,6 +111,7 @@ public class MaterialDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void testSaveMaterialWithoutDescription() {
|
||||
Material material = createValidMaterial();
|
||||
material.setDescription(null);
|
||||
|
|
@ -117,6 +119,7 @@ public class MaterialDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveMaterial() throws InstanceNotFoundException {
|
||||
Material material = createValidMaterial();
|
||||
materialDAO.save(material);
|
||||
|
|
@ -125,6 +128,7 @@ public class MaterialDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListMaterials() {
|
||||
int previous = materialDAO.list(Material.class).size();
|
||||
Material material = createValidMaterial();
|
||||
|
|
@ -134,6 +138,7 @@ public class MaterialDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListMaterialsFromCategory() {
|
||||
MaterialCategory category = createValidMaterialCategory();
|
||||
int previous = category.getMaterials().size();
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class OrderDAOTest {
|
||||
|
||||
@Before
|
||||
|
|
@ -90,6 +89,7 @@ public class OrderDAOTest {
|
|||
private IAdHocTransactionService transactionService;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(orderDAO);
|
||||
}
|
||||
|
|
@ -125,6 +125,7 @@ public class OrderDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveOrdersWithDeliveringDates() {
|
||||
Order order = createValidOrderWithDeadlineCommunications("test");
|
||||
orderDAO.save(order);
|
||||
|
|
@ -159,6 +160,7 @@ public class OrderDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveTwoOrdersWithDifferentNames() {
|
||||
transactionService.runOnAnotherTransaction(new IOnTransaction<Void>() {
|
||||
@Override
|
||||
|
|
@ -182,6 +184,7 @@ public class OrderDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void testSaveTwoOrdersWithSameNames() {
|
||||
transactionService.runOnAnotherTransaction(new IOnTransaction<Void>() {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -93,7 +93,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
/*
|
||||
* @author Diego Pino García <dpino@igalia.com>
|
||||
*/
|
||||
@Transactional
|
||||
public class OrderElementDAOTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -137,6 +136,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(orderElementDAO);
|
||||
}
|
||||
|
|
@ -201,6 +201,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveOrderLine() {
|
||||
OrderLine orderLine = createValidOrderLine();
|
||||
orderElementDAO.save(orderLine);
|
||||
|
|
@ -208,6 +209,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindUniqueByCode() throws InstanceNotFoundException {
|
||||
OrderLine orderLine = createValidOrderLine();
|
||||
orderElementDAO.save(orderLine);
|
||||
|
|
@ -221,6 +223,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindUniqueByCodeAndOrderLineGroup()
|
||||
throws InstanceNotFoundException {
|
||||
// Create OrderLineGroupLine
|
||||
|
|
@ -244,6 +247,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindByCodeInRoot() throws InstanceNotFoundException {
|
||||
// Create OrderLineGroupLine
|
||||
Order order = createValidOrder();
|
||||
|
|
@ -254,6 +258,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveOrderLineWithAdvanceAssignments()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException,
|
||||
|
|
@ -282,6 +287,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveOrderLineGroupWithAdvanceAssignments()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException,
|
||||
|
|
@ -332,6 +338,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveOrderLineWithAdvanceAssignments()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException,
|
||||
|
|
@ -361,6 +368,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveOrderLineGroupWithAdvanceAssignments()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException,
|
||||
|
|
@ -403,6 +411,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveAndRemoveTaskQualityForm() {
|
||||
OrderElement orderElement = OrderElementTest
|
||||
.givenOrderLineGroupWithTwoOrderLines(2000, 3000);
|
||||
|
|
@ -418,6 +427,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCheckUniqueQualityForm() {
|
||||
OrderElement orderElement = OrderElementTest
|
||||
.givenOrderLineGroupWithTwoOrderLines(2000, 3000);
|
||||
|
|
@ -443,6 +453,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSumChargedHoursRelation() throws InstanceNotFoundException {
|
||||
OrderLine orderLine = createValidOrderLine();
|
||||
orderLine.setSumChargedEffort(SumChargedEffort.create(orderLine));
|
||||
|
|
@ -475,6 +486,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindByLabels1() throws InstanceNotFoundException {
|
||||
Label label = givenStoredLabel();
|
||||
|
||||
|
|
@ -494,6 +506,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindByLabels2() throws InstanceNotFoundException {
|
||||
Label label1 = givenStoredLabel();
|
||||
Label label2 = givenStoredLabel();
|
||||
|
|
@ -528,6 +541,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindByLabelsOnTree() throws InstanceNotFoundException {
|
||||
Label label1 = givenStoredLabel();
|
||||
Label label2 = givenStoredLabel();
|
||||
|
|
@ -568,6 +582,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindByCriteria1() throws InstanceNotFoundException {
|
||||
Criterion criterion = givenStoredCriterion();
|
||||
|
||||
|
|
@ -588,6 +603,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindByCriteria2() throws InstanceNotFoundException {
|
||||
Criterion criterion1 = givenStoredCriterion();
|
||||
Criterion criterion2 = givenStoredCriterion();
|
||||
|
|
@ -626,6 +642,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindByCriteriaOnTree() throws InstanceNotFoundException {
|
||||
Criterion criterion1 = givenStoredCriterion();
|
||||
Criterion criterion2 = givenStoredCriterion();
|
||||
|
|
@ -654,6 +671,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindByLabelsAndCriteria1() throws InstanceNotFoundException {
|
||||
Label label = givenStoredLabel();
|
||||
Criterion criterion = givenStoredCriterion();
|
||||
|
|
@ -680,6 +698,7 @@ public class OrderElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindByLabelsAndCriteria2() throws InstanceNotFoundException {
|
||||
Label label1 = givenStoredLabel();
|
||||
Label label2 = givenStoredLabel();
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class AddAdvanceAssignmentsToOrderElementTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -158,6 +157,7 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void savingTheOrderSavesAlsoTheAddedAssignments()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -190,6 +190,7 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void addingSeveralAssignmentsOfDifferentTypes()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -213,6 +214,7 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void cannotAddDuplicatedAssignment()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -237,6 +239,7 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void cannotAddTwoAssignmetsWithGlobalReportValue()
|
||||
throws DuplicateAdvanceAssignmentForOrderElementException,
|
||||
DuplicateValueTrueReportGlobalAdvanceException {
|
||||
|
|
@ -262,6 +265,7 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void addingAssignmentsOfAnotherTypeToSon()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -294,6 +298,7 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void addingAnAdvanceAssignmentIncreasesTheNumberOfAdvanceAssignments()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -316,6 +321,7 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void cannotAddDuplicatedAssignmentToSon()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -346,6 +352,7 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void cannotAddDuplicateAssignmentToGrandParent()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -382,6 +389,7 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
}
|
||||
|
||||
@Test(expected = DuplicateAdvanceAssignmentForOrderElementException.class)
|
||||
@Transactional
|
||||
public void addingAnotherAdvanceAssignmentWithAnEquivalentTypeButDifferentInstance()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -420,6 +428,7 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
}
|
||||
|
||||
@Test(expected = DuplicateValueTrueReportGlobalAdvanceException.class)
|
||||
@Transactional
|
||||
public void cannotAddTwoAssignmetsDirectAndIndirectWithGlobalReportValue()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class OrderElementTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -252,6 +251,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkValidPropagation()throws ValidationException{
|
||||
OrderElement orderElement = givenOrderLineGroupWithTwoOrderLines(1000,
|
||||
2000);
|
||||
|
|
@ -272,12 +272,14 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageEmptyOrderLine() {
|
||||
OrderLine orderLine = givenOrderLine("name", "code", 1000);
|
||||
assertThat(orderLine.getAdvancePercentage(), equalTo(BigDecimal.ZERO));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderLineWithAdvanceAssignmentWithoutMesaurement()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -292,6 +294,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderLineWithTwoAssignments1()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -309,6 +312,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderLineWithFutureAdvanceMeasurement()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -324,6 +328,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderLineWithTwoAssignments3()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -342,6 +347,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderLineWithThreeAssignments()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -364,6 +370,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderGroupLine1()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -397,6 +404,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderGroupLine2()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -430,6 +438,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderGroupLine3()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -452,6 +461,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderGroupLineSameAdvanceType()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -483,6 +493,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderGroupLineSameAdvanceTypeChildren()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -515,6 +526,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderGroupLineWithAssignments1()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -540,6 +552,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderGroupLineWithAssignments2()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -562,6 +575,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvanceMeasurementMerge()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -673,6 +687,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkGetAdvanceAssignmentsIdempotenet()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -715,6 +730,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvanceMeasurementMergeWithDifferentAdvanceTypes()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -796,6 +812,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkGetAdvancePercentageTwoLevelOfDepth1()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -836,6 +853,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkGetAdvancePercentageTwoLevelOfDepth2()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -873,6 +891,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvancePercentageOrderGroupLineWithPercentageAdvanceType()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -906,6 +925,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAdvanceMeasurementMergePercentageAdvanceType()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -990,6 +1010,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkCalculateFakeOrderLineGroup1()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1036,6 +1057,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkCalculateFakeOrderLineGroup2()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1095,6 +1117,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkChangeIndirectCriterionToInvalid() {
|
||||
Order order = Order.create();
|
||||
order.useSchedulingDataFor(mockedOrderVersion);
|
||||
|
|
@ -1139,6 +1162,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkSpreadAdvanceInOrderLine()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1165,6 +1189,7 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkPositiveBudgetInOrderLine() {
|
||||
OrderLine line = givenOrderLine("task", "code", 10);
|
||||
line.setBudget(new BigDecimal(100));
|
||||
|
|
@ -1172,12 +1197,14 @@ public class OrderElementTest {
|
|||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Transactional
|
||||
public void checkNonNegativeBudgetInOrderLine() {
|
||||
OrderLine line = givenOrderLine("task", "code", 10);
|
||||
line.setBudget(new BigDecimal(-100));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkBudgetInOrderLineGroup() {
|
||||
OrderLineGroup group = givenOrderLineGroupWithTwoOrderLines(20, 30);
|
||||
((OrderLine) group.getChildren().get(0)).setBudget(new BigDecimal(50));
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class OrderLineTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -63,6 +62,7 @@ public class OrderLineTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void parentPropertyMustBeSetWhenAddingOrderLineToContainer() {
|
||||
OrderLineGroup orderLineGroup = OrderLineGroup.create();
|
||||
orderLineGroup.useSchedulingDataFor(TaskTest.mockOrderVersion());
|
||||
|
|
@ -77,6 +77,7 @@ public class OrderLineTest {
|
|||
* 100h, with one {@link HoursGroup} with 100h NO_FIXED.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursEmptyOrderLine() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -103,6 +104,7 @@ public class OrderLineTest {
|
|||
* work hours of {@link OrderLine} to -100h. Expected: Exception.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursEmptyOrderLineIllegal() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -127,6 +129,7 @@ public class OrderLineTest {
|
|||
* {@link OrderLine} with 120h. {@link HoursGroup} with 120h.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupNoFixedIncreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -153,6 +156,7 @@ public class OrderLineTest {
|
|||
* {@link OrderLine} with 75h. {@link HoursGroup} with 75h.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupNoFixedDecreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -180,6 +184,7 @@ public class OrderLineTest {
|
|||
* Expected: {@link OrderLine} with 120h. {@link HoursGroup} with 120h 100%.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupFixedPercentageIncreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -212,6 +217,7 @@ public class OrderLineTest {
|
|||
* Expected: {@link OrderLine} with 100h. {@link HoursGroup} with 75h 100%.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupFixedPercentageDecreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -245,6 +251,7 @@ public class OrderLineTest {
|
|||
* HoursGroup with 66h.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursTwoHoursGroupNoFixedIncreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -277,6 +284,7 @@ public class OrderLineTest {
|
|||
* {@link HoursGroup} with 16h.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursTwoHoursGroupNoFixedDecreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -309,6 +317,7 @@ public class OrderLineTest {
|
|||
* {@link HoursGroup} with 150h 75% and {@link HoursGroup} with 50h.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupFixedPercentageAndHoursGroupNoFixedIncreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -346,6 +355,7 @@ public class OrderLineTest {
|
|||
* {@link HoursGroup} with 37h 75% and HoursGroup with 13h.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupFixedPercentageAndHoursGroupNoFixedDecreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -383,6 +393,7 @@ public class OrderLineTest {
|
|||
* and {@link HoursGroup} with 50h 25%.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupFixedPercentageAndHoursGroupFixedPercentageIncreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -424,6 +435,7 @@ public class OrderLineTest {
|
|||
* {@link HoursGroup} with 20h 25%.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupFixedPercentageAndHoursGroupFixedPercentageDecreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -466,6 +478,7 @@ public class OrderLineTest {
|
|||
* {@link HoursGroup} with 150h 50%.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupNoFixedAndHoursGroupNoFixedAndHoursGroupFixedPercentageIncreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -508,6 +521,7 @@ public class OrderLineTest {
|
|||
* {@link HoursGroup} with 50h 50%.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupNoFixedAndHoursGroupNoFixedAndHoursGroupFixedPercentageDecreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -550,6 +564,7 @@ public class OrderLineTest {
|
|||
* {@link HoursGroup} with 200h 50%.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupNoFixedAndHoursGroupFixedPercentageAndHoursGroupFixedPercentageIncreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -596,6 +611,7 @@ public class OrderLineTest {
|
|||
* {@link HoursGroup} with 50h 50%.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupNoFixedAndHoursGroupFixedPercentageAndHoursGroupFixedPercentageDecreaseValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -641,6 +657,7 @@ public class OrderLineTest {
|
|||
* {@link HoursGroup} with 100h.
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkHoursHoursGroupNoFixedZeroValue() {
|
||||
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
|
|
@ -667,6 +684,7 @@ public class OrderLineTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddNewEmptyHoursGroup() {
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
HoursGroup hoursGroup = HoursGroup.create(orderLine);
|
||||
|
|
@ -678,6 +696,7 @@ public class OrderLineTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetWorkingHoursIllegal() {
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
HoursGroup hoursGroup = HoursGroup.create(orderLine);
|
||||
|
|
@ -692,6 +711,7 @@ public class OrderLineTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetPercentageIllegal() {
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
HoursGroup hoursGroup = HoursGroup.create(orderLine);
|
||||
|
|
@ -720,6 +740,7 @@ public class OrderLineTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetPercentageTwoHoursGroupIncrease() {
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
HoursGroup hoursGroup = HoursGroup.create(orderLine);
|
||||
|
|
@ -744,6 +765,7 @@ public class OrderLineTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetPercentageTwoHoursGroupDecrease() {
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
HoursGroup hoursGroup = HoursGroup.create(orderLine);
|
||||
|
|
@ -768,6 +790,7 @@ public class OrderLineTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSetPercentageThreeHoursGroupIncrease() {
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
HoursGroup hoursGroup = HoursGroup.create(orderLine);
|
||||
|
|
@ -796,6 +819,7 @@ public class OrderLineTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void createOrderLineWithAnHoursGroupTakingAll() {
|
||||
int[] hoursValues = { 0, 100, 10, 30 };
|
||||
for (int hours : hoursValues) {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class OrderTest {
|
||||
|
||||
private static OrderVersion mockedOrderVersion = TaskTest.mockOrderVersion();
|
||||
|
|
@ -63,6 +62,7 @@ public class OrderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddingOrderElement() {
|
||||
Order order = Order.create();
|
||||
order.useSchedulingDataFor(mockedOrderVersion);
|
||||
|
|
@ -74,6 +74,7 @@ public class OrderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testPreservesOrder() {
|
||||
OrderLineGroup container = OrderLineGroup.create();
|
||||
container.useSchedulingDataFor(mockedOrderVersion);
|
||||
|
|
|
|||
|
|
@ -46,13 +46,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
/*
|
||||
* @author Diego Pino García <dpino@igalia.com>
|
||||
*/
|
||||
@Transactional
|
||||
public class AssignmentFunctionDAOTest {
|
||||
|
||||
@Autowired
|
||||
private IAssignmentFunctionDAO assignmentFunctionDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertTrue(assignmentFunctionDAO != null);
|
||||
}
|
||||
|
|
@ -62,6 +62,7 @@ public class AssignmentFunctionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveAssignmentFunction() {
|
||||
AssignmentFunction assignmentFunction = createValidAssignmentFunction();
|
||||
assignmentFunctionDAO.save(assignmentFunction);
|
||||
|
|
@ -69,6 +70,7 @@ public class AssignmentFunctionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveAssignmentFunction()
|
||||
throws InstanceNotFoundException {
|
||||
AssignmentFunction assignmentFunction = createValidAssignmentFunction();
|
||||
|
|
@ -78,6 +80,7 @@ public class AssignmentFunctionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListAssignmentFunction() {
|
||||
int previous = assignmentFunctionDAO.list(AssignmentFunction.class).size();
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Diego Pino Garcia <dpino@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class LimitingResourceQueueElementDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -59,6 +58,7 @@ public class LimitingResourceQueueElementDAOTest {
|
|||
private ILimitingResourceQueueElementDAO limitingResourceQueueElementDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(limitingResourceQueueDAO);
|
||||
}
|
||||
|
|
@ -72,6 +72,7 @@ public class LimitingResourceQueueElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveLimitingResourceQueue() {
|
||||
LimitingResourceQueue limitingResourceQueue = createValidLimitingResourceQueue();
|
||||
limitingResourceQueueDAO.save(limitingResourceQueue);
|
||||
|
|
@ -79,6 +80,7 @@ public class LimitingResourceQueueElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveLimitingResourceQueue() throws InstanceNotFoundException {
|
||||
LimitingResourceQueue limitingResourceQueue = createValidLimitingResourceQueue();
|
||||
limitingResourceQueueDAO.save(limitingResourceQueue);
|
||||
|
|
@ -87,6 +89,7 @@ public class LimitingResourceQueueElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListLimitingResourceQueue() {
|
||||
int previous = limitingResourceQueueDAO.list(LimitingResourceQueue.class).size();
|
||||
|
||||
|
|
@ -102,6 +105,7 @@ public class LimitingResourceQueueElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testLimitingResourceQueueHasElements() {
|
||||
LimitingResourceQueueElement element = createValidLimitingResourceQueueElement();
|
||||
LimitingResourceQueue queue = createValidLimitingResourceQueue();
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
/*
|
||||
* @author Diego Pino García <dpino@igalia.com>
|
||||
*/
|
||||
@Transactional
|
||||
public class ResourceAllocationDAOTest {
|
||||
|
||||
public static OrderVersion setupVersionUsing(
|
||||
|
|
@ -191,6 +190,7 @@ public class ResourceAllocationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(resourceAllocationDAO);
|
||||
assertNotNull(orderElementDAO);
|
||||
|
|
@ -201,6 +201,7 @@ public class ResourceAllocationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveSpecificResourceAllocation() {
|
||||
SpecificResourceAllocation resourceAllocation = createValidSpecificResourceAllocation();
|
||||
resourceAllocationDAO.save(resourceAllocation);
|
||||
|
|
@ -208,6 +209,7 @@ public class ResourceAllocationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveGenericResourceAllocation() {
|
||||
GenericResourceAllocation resourceAllocation = createValidGenericResourceAllocation();
|
||||
resourceAllocationDAO.save(resourceAllocation);
|
||||
|
|
@ -215,6 +217,7 @@ public class ResourceAllocationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveSpecificResourceAllocation()
|
||||
throws InstanceNotFoundException {
|
||||
SpecificResourceAllocation resourceAllocation = createValidSpecificResourceAllocation();
|
||||
|
|
@ -224,6 +227,7 @@ public class ResourceAllocationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveGenericResourceAllocation()
|
||||
throws InstanceNotFoundException {
|
||||
GenericResourceAllocation resourceAllocation = createValidGenericResourceAllocation();
|
||||
|
|
@ -233,6 +237,7 @@ public class ResourceAllocationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListSpecificResourceAllocation() {
|
||||
int previous = resourceAllocationDAO.list(ResourceAllocation.class).size();
|
||||
|
||||
|
|
@ -248,6 +253,7 @@ public class ResourceAllocationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListGenericResourceAllocation() {
|
||||
int previous = resourceAllocationDAO.list(ResourceAllocation.class)
|
||||
.size();
|
||||
|
|
@ -264,6 +270,7 @@ public class ResourceAllocationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindAllocationsRelatedToResourcesWithDateFilter() {
|
||||
Scenario current = scenarioManager.getCurrent();
|
||||
ResourceAllocation<?> resourceAllocation1 = createValidSpecificResourceAllocation();
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class SubcontractorCommunicationDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -208,11 +207,13 @@ public class SubcontractorCommunicationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSubcontractorCommunicationDAOInSpringContainer() {
|
||||
assertNotNull(subcontractorCommunicationDAO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveSubcontractorCommunication() {
|
||||
SubcontractorCommunication subcontractorCommunication = createValidSubcontractorCommunication();
|
||||
subcontractorCommunicationDAO.save(subcontractorCommunication);
|
||||
|
|
@ -220,6 +221,7 @@ public class SubcontractorCommunicationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveSubcontractorCommunication()
|
||||
throws InstanceNotFoundException {
|
||||
SubcontractorCommunication subcontractorCommunication = createValidSubcontractorCommunication();
|
||||
|
|
@ -246,6 +248,7 @@ public class SubcontractorCommunicationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveSubcontractorCommunicationWithoutSubcontratedTaskData()
|
||||
throws InstanceNotFoundException {
|
||||
SubcontractorCommunication subcontractorCommunication = createValidSubcontractorCommunication();
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ import org.libreplan.business.externalcompanies.entities.ExternalCompany;
|
|||
import org.libreplan.business.orders.daos.IOrderDAO;
|
||||
import org.libreplan.business.orders.entities.HoursGroup;
|
||||
import org.libreplan.business.orders.entities.Order;
|
||||
import org.libreplan.business.orders.entities.OrderElement;
|
||||
import org.libreplan.business.orders.entities.OrderLine;
|
||||
import org.libreplan.business.orders.entities.SchedulingDataForVersion;
|
||||
import org.libreplan.business.orders.entities.TaskSource;
|
||||
|
|
@ -83,7 +82,6 @@ import org.libreplan.business.scenarios.entities.OrderVersion;
|
|||
import org.libreplan.business.test.externalcompanies.daos.ExternalCompanyDAOTest;
|
||||
import org.libreplan.business.workingday.IntraDayDate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -96,7 +94,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class TaskElementDAOTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -242,6 +239,7 @@ public class TaskElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void canSaveTask() {
|
||||
Task task = createValidTask();
|
||||
taskElementDAO.save(task);
|
||||
|
|
@ -260,6 +258,7 @@ public class TaskElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void canSaveMilestone() {
|
||||
TaskMilestone milestone = createValidTaskMilestone();
|
||||
taskElementDAO.save(milestone);
|
||||
|
|
@ -275,6 +274,7 @@ public class TaskElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void afterSavingTheVersionIsIncreased() {
|
||||
Task task = createValidTask();
|
||||
assertNull(task.getVersion());
|
||||
|
|
@ -284,6 +284,7 @@ public class TaskElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void canSaveTaskGroup() {
|
||||
TaskGroup taskGroup = createValidTaskGroup();
|
||||
taskElementDAO.save(taskGroup);
|
||||
|
|
@ -300,6 +301,7 @@ public class TaskElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theParentPropertyIsPresentWhenRetrievingTasks() {
|
||||
TaskGroup taskGroup = createValidTaskGroup();
|
||||
taskGroup.addTaskElement(createValidTask());
|
||||
|
|
@ -316,6 +318,7 @@ public class TaskElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void savingGroupSavesAssociatedTaskElements() {
|
||||
Task child1 = createValidTask();
|
||||
Task child2 = createValidTask();
|
||||
|
|
@ -338,7 +341,6 @@ public class TaskElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void savingTaskElementSavesAssociatedDependencies()
|
||||
throws InstanceNotFoundException {
|
||||
IOnTransaction<Task> createValidTask = new IOnTransaction<Task>() {
|
||||
|
|
@ -397,33 +399,7 @@ public class TaskElementDAOTest {
|
|||
task.getId()));
|
||||
}
|
||||
|
||||
@NotTransactional
|
||||
public void testInverseManyToOneRelationshipInOrderElementIsSavedCorrectly() {
|
||||
final Task task = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Task>() {
|
||||
|
||||
@Override
|
||||
public Task execute() {
|
||||
return createValidTask();
|
||||
}
|
||||
});
|
||||
transactionService.runOnReadOnlyTransaction(new IOnTransaction<Void>() {
|
||||
|
||||
@Override
|
||||
public Void execute() {
|
||||
TaskElement fromDB = taskElementDAO.findExistingEntity(task
|
||||
.getId());
|
||||
OrderElement orderElement = fromDB.getOrderElement();
|
||||
assertThat(orderElement.getTaskElements().size(), equalTo(1));
|
||||
assertThat(orderElement.getTaskElements().iterator().next(),
|
||||
equalTo(fromDB));
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void aTaskCanBeRemovedFromItsTaskSource() {
|
||||
final Task task = transactionService.runOnTransaction(new IOnTransaction<Task>(){
|
||||
|
||||
|
|
@ -450,7 +426,6 @@ public class TaskElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void aTaskGroupCanBeRemovedFromItsTaskSourceIfBelowTasksSourcesAreRemovedFirst() {
|
||||
final TaskGroup taskGroupWithOneChild = transactionService
|
||||
.runOnTransaction(new IOnTransaction<TaskGroup>() {
|
||||
|
|
@ -505,6 +480,7 @@ public class TaskElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testStoreSubcontractedTaskData()
|
||||
throws InstanceNotFoundException {
|
||||
Task task = createValidTask();
|
||||
|
|
@ -542,6 +518,7 @@ public class TaskElementDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveTaskElementUpdatesSumOfHoursAllocatedAttribute()
|
||||
throws InstanceNotFoundException {
|
||||
IOnTransaction<Long> createTaskElement =
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ import org.libreplan.business.workreports.entities.WorkReport;
|
|||
import org.libreplan.business.workreports.entities.WorkReportLine;
|
||||
import org.libreplan.business.workreports.entities.WorkReportType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -82,7 +81,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class MoneyCostCalculatorTest {
|
||||
|
||||
@javax.annotation.Resource
|
||||
|
|
@ -328,6 +326,7 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void basicTest() {
|
||||
givenBasicExample();
|
||||
assertThat(moneyCostCalculator.getHoursMoneyCost(orderElements.get(0)),
|
||||
|
|
@ -335,6 +334,7 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void basicTestWithoutCostCategoryRelationship() {
|
||||
givenBasicExampleWithoutCostCategoryRelationship();
|
||||
assertThat(moneyCostCalculator.getHoursMoneyCost(orderElements.get(0)),
|
||||
|
|
@ -342,6 +342,7 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exampleOrderLineGroup() {
|
||||
givenExampleOrderLineGroup();
|
||||
assertThat(moneyCostCalculator.getHoursMoneyCost(orderElements.get(0)),
|
||||
|
|
@ -353,6 +354,7 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exampleOrderLineGroupWithDifferentHours1() {
|
||||
givenExampleOrderLineGroupWithDifferentHours(Arrays.asList(0, 10, 5));
|
||||
assertThat(moneyCostCalculator.getHoursMoneyCost(orderElements.get(0)),
|
||||
|
|
@ -364,6 +366,7 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exampleOrderLineGroupWithDifferentHours2() {
|
||||
givenExampleOrderLineGroupWithDifferentHours(Arrays.asList(6, 0, 0));
|
||||
assertThat(moneyCostCalculator.getHoursMoneyCost(orderElements.get(0)),
|
||||
|
|
@ -375,6 +378,7 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exampleOrderLineGroupWithDifferentHours3() {
|
||||
givenExampleOrderLineGroupWithDifferentHours(Arrays.asList(6, 5, 10));
|
||||
assertThat(moneyCostCalculator.getHoursMoneyCost(orderElements.get(0)),
|
||||
|
|
@ -386,6 +390,7 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exampleWithoutCostCategoryRelationshipButDifferentTypeOfHours1() {
|
||||
givenExampleWithoutCostCategoryRelationshipButDifferentTypeOfHours(
|
||||
Arrays.asList(10, 5),
|
||||
|
|
@ -395,6 +400,7 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exampleWithoutCostCategoryRelationshipButDifferentTypeOfHours2() {
|
||||
givenExampleWithoutCostCategoryRelationshipButDifferentTypeOfHours(
|
||||
Arrays.asList(10, 5, 8), Arrays.asList(new BigDecimal(30),
|
||||
|
|
@ -452,7 +458,6 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testAddExpenseSheetWithTwoDirectLines() {
|
||||
transactionService.runOnTransaction(new IOnTransaction<Void>() {
|
||||
@Override
|
||||
|
|
@ -481,7 +486,6 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testAddExpenseSheetWithIndirectLines() {
|
||||
transactionService.runOnTransaction(new IOnTransaction<Void>() {
|
||||
@Override
|
||||
|
|
@ -512,4 +516,4 @@ public class MoneyCostCalculatorTest {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class TaskElementTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -92,22 +91,26 @@ public class TaskElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void initiallyAssociatedDependenciesAreEmpty() {
|
||||
assertTrue(task.getDependenciesWithThisDestination().isEmpty());
|
||||
assertTrue(task.getDependenciesWithThisOrigin().isEmpty());
|
||||
}
|
||||
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Transactional
|
||||
public void dependenciesWithThisOriginCollectionCannotBeModified() {
|
||||
task.getDependenciesWithThisOrigin().add(exampleDependency);
|
||||
}
|
||||
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Transactional
|
||||
public void dependenciesWithThisDestinationCollectionCannotBeModified() {
|
||||
task.getDependenciesWithThisDestination().add(exampleDependency);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskElementHasStartDatePropertyAndItIsRoundedToTheStartOfTheDay() {
|
||||
Date now = new Date();
|
||||
task.setStartDate(now);
|
||||
|
|
@ -122,6 +125,7 @@ public class TaskElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void aDependencyWithThisOriginCanBeRemoved() {
|
||||
Task origin = new Task();
|
||||
Task destination = new Task();
|
||||
|
|
@ -162,6 +166,7 @@ public class TaskElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void detachRemovesTaskFromParent() {
|
||||
TaskGroup parent = TaskGroupTest.createValidTaskGroup();
|
||||
Task child = (Task) TaskTest.createValidTask();
|
||||
|
|
@ -173,12 +178,14 @@ public class TaskElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void MilestoneOrderElementIsNull() {
|
||||
TaskMilestone milestone = TaskMilestone.create(new Date());
|
||||
assertThat(milestone.getOrderElement(), nullValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theDeadlineOfTheOrderElementIsCopied() {
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
addOrderTo(orderLine);
|
||||
|
|
@ -220,6 +227,7 @@ public class TaskElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void ifNoParentWithStartDateThePositionConstraintIsSoonAsPossible() {
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
addOrderTo(orderLine);
|
||||
|
|
@ -237,6 +245,7 @@ public class TaskElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@SuppressWarnings("unchecked")
|
||||
public void ifSomeParentHasInitDateThePositionConstraintIsNotEarlierThan() {
|
||||
LocalDate initDate = new LocalDate(2005, 10, 5);
|
||||
|
|
@ -253,6 +262,7 @@ public class TaskElementTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void unlessTheOnlyParentWithInitDateNotNullIsTheOrder() {
|
||||
OrderLine orderLine = OrderLine.create();
|
||||
addOrderTo(orderLine);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class TaskTest {
|
||||
|
||||
private static final OrderVersion mockedOrderVersion = mockOrderVersion();
|
||||
|
|
@ -143,16 +142,19 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsASubclassOfTaskElement() {
|
||||
assertTrue(task instanceof TaskElement);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskHasHoursSpecifiedAtOrderComingFromItsHoursGroup() {
|
||||
assertThat(task.getHoursSpecifiedAtOrder(), equalTo(hoursGroup.getWorkingHours()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskMustHaveOneHoursGroup() {
|
||||
HoursGroup hoursGroup = task.getHoursGroup();
|
||||
assertNotNull(hoursGroup);
|
||||
|
|
@ -180,6 +182,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getResourceAllocationsDoesntRetrieveUnsatisfiedAllocations() {
|
||||
assertThat(task.getSatisfiedResourceAllocations().size(), equalTo(0));
|
||||
|
||||
|
|
@ -194,6 +197,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void addingNoEmptyResourceAllocationAddsIt() {
|
||||
assertThat(task.getSatisfiedResourceAllocations().size(), equalTo(0));
|
||||
|
||||
|
|
@ -204,6 +208,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskRemoveResourceAllocation() {
|
||||
assertThat(task.getSatisfiedResourceAllocations().size(), equalTo(0));
|
||||
|
||||
|
|
@ -218,11 +223,13 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void aTaskWithoutAllocationsHasZeroAssignedHours() {
|
||||
assertThat(task.getAssignedHours(), equalTo(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void aTaskWithAllocationsReturnsTheSumOfItsAllocations() {
|
||||
task.addResourceAllocation(stubResourceAllocationWithAssignedHours(
|
||||
task, 5));
|
||||
|
|
@ -232,6 +239,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theWorkableDaysAreCalculatedBasedOnlyOnDatesNotHours() {
|
||||
task.setIntraDayStartDate(IntraDayDate.create(
|
||||
new LocalDate(2010, 1, 13), EffortDuration.hours(3)));
|
||||
|
|
@ -241,6 +249,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void atLeastOneWorkableDayEvenIfStartAndEndDatesAreAtTheSameDay() {
|
||||
LocalDate day = new LocalDate(2010, 1, 13);
|
||||
task.setIntraDayStartDate(IntraDayDate.create(day,
|
||||
|
|
@ -251,6 +260,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void ifTheEndIsInTheMiddleOfADayTheWholeDayIsCounted() {
|
||||
LocalDate start = new LocalDate(2010, 1, 13);
|
||||
task.setIntraDayStartDate(IntraDayDate.create(start,
|
||||
|
|
@ -261,6 +271,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void ifSomeDayIsNotWorkableIsNotCounted() {
|
||||
final LocalDate start = new LocalDate(2010, 1, 13);
|
||||
|
||||
|
|
@ -305,6 +316,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testIsLimiting() {
|
||||
LimitingResourceQueueElement element = LimitingResourceQueueElement.create();
|
||||
Task task = createValidTask();
|
||||
|
|
@ -315,6 +327,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testIsNonLimiting() {
|
||||
Task task = createValidTask();
|
||||
SpecificResourceAllocation resourceAllocation = SpecificResourceAllocation.create(task);
|
||||
|
|
@ -323,11 +336,13 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theoreticalHoursIsZeroIfNoResourcesAreAllocated() {
|
||||
assertThat(task.getTheoreticalCompletedTimeUntilDate(new Date()), equalTo(EffortDuration.zero()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theoreticalHoursIsTotalIfDateIsLaterThanEndDate() {
|
||||
prepareTaskForTheoreticalAdvanceTesting();
|
||||
EffortDuration totalAllocatedTime = AggregateOfDayAssignments.create(
|
||||
|
|
@ -337,6 +352,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theoreticalHoursIsZeroIfDateIsEarlierThanStartDate() {
|
||||
prepareTaskForTheoreticalAdvanceTesting();
|
||||
assertThat(task.getTheoreticalCompletedTimeUntilDate(task.getStartDate()), equalTo(EffortDuration.zero()));
|
||||
|
|
@ -344,6 +360,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theoreticalHoursWithADateWithinStartAndEndDateHead() {
|
||||
prepareTaskForTheoreticalAdvanceTesting();
|
||||
LocalDate limit = task.getStartAsLocalDate().plusDays(1);
|
||||
|
|
@ -353,6 +370,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theoreticalHoursWithADateWithinStartAndEndDateTail() {
|
||||
prepareTaskForTheoreticalAdvanceTesting();
|
||||
LocalDate limit = task.getEndAsLocalDate().minusDays(1);
|
||||
|
|
@ -362,11 +380,13 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theoreticalAdvancePercentageIsZeroIfNoResourcesAreAllocated() {
|
||||
assertThat(task.getTheoreticalAdvancePercentageUntilDate(new Date()), equalTo(new BigDecimal(0)));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theoreticalPercentageIsOneIfDateIsLaterThanEndDate() {
|
||||
prepareTaskForTheoreticalAdvanceTesting();
|
||||
assertThat(task.getTheoreticalAdvancePercentageUntilDate(task.getEndDate()),
|
||||
|
|
@ -375,6 +395,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theoreticalPercentageWithADateWithinStartAndEndDateHead() {
|
||||
prepareTaskForTheoreticalAdvanceTesting();
|
||||
LocalDate limit = task.getStartAsLocalDate().plusDays(1);
|
||||
|
|
@ -383,6 +404,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsFinishedIfAdvancePertentageIsOne() {
|
||||
task.setAdvancePercentage(BigDecimal.ONE);
|
||||
assertTrue(task.isFinished());
|
||||
|
|
@ -391,6 +413,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsProgressIfAdvancePercentageIsLessThanOne() {
|
||||
task.setAdvancePercentage(new BigDecimal("0.9999", new MathContext(4)));
|
||||
assertFalse(task.isFinished());
|
||||
|
|
@ -399,6 +422,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsProgressIfAdvancePercentageIsGreaterThanZero() {
|
||||
task.setAdvancePercentage(new BigDecimal("0.0001", new MathContext(4)));
|
||||
assertFalse(task.isFinished());
|
||||
|
|
@ -407,6 +431,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsNotInProgressIfAdvancePercentageIsZeroAndNoWorkReportsAttached() {
|
||||
task.setAdvancePercentage(BigDecimal.ZERO);
|
||||
SumChargedEffort sumChargedEffort = task.getOrderElement().getSumChargedEffort();
|
||||
|
|
@ -416,6 +441,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsInProgressIfAdvancePercentageIsZeroButWorkReportsAttached() {
|
||||
SumChargedEffort sumChargedEffort = SumChargedEffort.create(task
|
||||
.getOrderElement());
|
||||
|
|
@ -427,6 +453,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsReadyToStartIfAllEndStartDepsAreFinished() {
|
||||
Dependency dependency = mockDependency(Type.END_START);
|
||||
dependency.getOrigin().setAdvancePercentage(BigDecimal.ONE);
|
||||
|
|
@ -436,6 +463,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsReadyToStartIfAllStartStartDepsAreInProgressOrFinished() {
|
||||
Dependency dependency1 = mockDependency(Type.START_START);
|
||||
dependency1.getOrigin().setAdvancePercentage(BigDecimal.ONE);
|
||||
|
|
@ -447,6 +475,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsBlockedIfHasAnUnfinishedEndStartDependency() {
|
||||
Dependency dependency = mockDependency(Type.END_START);
|
||||
dependency.getOrigin().setAdvancePercentage(new BigDecimal("0.0001", new MathContext(4)));
|
||||
|
|
@ -456,6 +485,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsBlockedIfHasANotStartedStartStartDependency() {
|
||||
Dependency dependency = mockDependency(Type.START_START);
|
||||
dependency.getOrigin().setAdvancePercentage(BigDecimal.ZERO);
|
||||
|
|
@ -465,6 +495,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskStatusCalculationTakesIntoAccountDifferentDepType() {
|
||||
Dependency dependency1 = mockDependency(Type.END_START);
|
||||
dependency1.getOrigin().setAdvancePercentage(BigDecimal.ONE);
|
||||
|
|
@ -478,6 +509,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskIsBlockedIfHasAnUnfinishedEndStartDependencyUsingGroup() {
|
||||
Task task1 = createValidTaskWithFullProgress();
|
||||
Task task2 = createValidTask();
|
||||
|
|
@ -492,6 +524,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskDependenciesDontMatterIfProgressIsNotZero() {
|
||||
Task task1 = createValidTaskWithFullProgress();
|
||||
Task task2 = createValidTask();
|
||||
|
|
@ -508,6 +541,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskStatusNotAffectedByEndEndDeps() {
|
||||
Dependency dependency = mockDependency(Type.END_END);
|
||||
dependency.getOrigin().setAdvancePercentage(BigDecimal.ZERO);
|
||||
|
|
@ -515,6 +549,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskWithNoDeadlineHasCorrectDeadlineViolationStatus() {
|
||||
task.setDeadline(null);
|
||||
assertTrue(task.getDeadlineViolationStatus() ==
|
||||
|
|
@ -522,6 +557,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskWithViolatedDeadlineHasCorrectDeadlineViolationStatus() {
|
||||
task.setDeadline(new LocalDate());
|
||||
LocalDate tomorrow = new LocalDate().plusDays(1);
|
||||
|
|
@ -531,6 +567,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskWithUnviolatedDeadlineHasCorrectDeadlineViolationStatusJustInTime() {
|
||||
LocalDate now = new LocalDate();
|
||||
task.setDeadline(now);
|
||||
|
|
@ -540,6 +577,7 @@ public class TaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void taskWithUnviolatedDeadlineHasCorrectDeadlineViolationStatusMargin() {
|
||||
LocalDate now = new LocalDate();
|
||||
task.setDeadline(now);
|
||||
|
|
|
|||
|
|
@ -51,18 +51,19 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class QualityFormDAOTest extends AbstractQualityFormTest {
|
||||
|
||||
@Autowired
|
||||
IQualityFormDAO qualityFormDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(qualityFormDAO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveQualityForm() {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
qualityFormDAO.save(qualityForm);
|
||||
|
|
@ -70,6 +71,7 @@ public class QualityFormDAOTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveQualityForm() throws InstanceNotFoundException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
qualityFormDAO.save(qualityForm);
|
||||
|
|
@ -78,6 +80,7 @@ public class QualityFormDAOTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListQualityForm() {
|
||||
int previous = qualityFormDAO.list(QualityForm.class).size();
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
|
|
@ -87,6 +90,7 @@ public class QualityFormDAOTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveQualityFormItems() {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
QualityFormItem qualityFormItem = createValidQualityFormItem();
|
||||
|
|
@ -98,6 +102,7 @@ public class QualityFormDAOTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveAndRemoveQualityFormItem()
|
||||
throws InstanceNotFoundException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
|
|
|
|||
|
|
@ -47,13 +47,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class QualityFormTest extends AbstractQualityFormTest {
|
||||
|
||||
@Autowired
|
||||
IQualityFormDAO qualityFormDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidNameQualityForm() throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
qualityForm.setName("");
|
||||
|
|
@ -74,6 +74,7 @@ public class QualityFormTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidQualityFormType() throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
try {
|
||||
|
|
@ -88,6 +89,7 @@ public class QualityFormTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidRepeatedQualityFormItemPosition()
|
||||
throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
|
|
@ -111,6 +113,7 @@ public class QualityFormTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidNotConsecutivesQualityFormItemPosition()
|
||||
throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
|
|
@ -134,6 +137,7 @@ public class QualityFormTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidOutOfRangeQualityFormItemPosition()
|
||||
throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
|
|
@ -158,6 +162,7 @@ public class QualityFormTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidPercentageQualityFormItemPosition()
|
||||
throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
|
|
@ -191,6 +196,7 @@ public class QualityFormTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidQualityFormItemPositionByItems()
|
||||
throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
|
|
@ -247,6 +253,7 @@ public class QualityFormTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidQualityFormItemName() throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
QualityFormItem qualityFormItem = createValidQualityFormItem();
|
||||
|
|
@ -275,6 +282,7 @@ public class QualityFormTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkNotNullQualityFormItemPosition()
|
||||
throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
|
|
@ -290,6 +298,7 @@ public class QualityFormTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkNotNullQualityFormItemPercentage()
|
||||
throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
|
|
@ -305,6 +314,7 @@ public class QualityFormTest extends AbstractQualityFormTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIncorrectQualityFormItemPercentage()
|
||||
throws ValidationException {
|
||||
QualityForm qualityForm = createValidQualityForm();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CriterionsBootstrapTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -109,6 +108,7 @@ public class CriterionsBootstrapTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testBootstrap() {
|
||||
givenNoSomePredefinedCriterionExists();
|
||||
criterionsBootstrap.loadRequiredData();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ import org.libreplan.business.resources.entities.Resource;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -60,7 +59,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CriterionDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -75,6 +73,7 @@ public class CriterionDAOTest {
|
|||
private Criterion criterion;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(criterionDAO);
|
||||
}
|
||||
|
|
@ -105,6 +104,7 @@ public class CriterionDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class)
|
||||
@Transactional
|
||||
public void aCriterionRelatedToATransientTypeCannotBeSaved() {
|
||||
givenACriterionWithATransientCriterionType();
|
||||
criterionDAO.save(criterion);
|
||||
|
|
@ -115,6 +115,7 @@ public class CriterionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void afterSavingACriterionItExists() {
|
||||
givenACriterionWithAnExistentType();
|
||||
criterionDAO.save(criterion);
|
||||
|
|
@ -122,6 +123,7 @@ public class CriterionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void afterRemovingTheCriterionNoLongerExists()
|
||||
throws InstanceNotFoundException {
|
||||
givenACriterionWithAnExistentType();
|
||||
|
|
@ -143,6 +145,7 @@ public class CriterionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void listReturnsTheNewlyCreatedCriterions() {
|
||||
int previous = criterionDAO.list(Criterion.class).size();
|
||||
givenASavedCriterionWithAnExistentType();
|
||||
|
|
@ -158,6 +161,7 @@ public class CriterionDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = DataIntegrityViolationException.class)
|
||||
@Transactional
|
||||
public void schemaEnsuresCannotExistTwoDifferentCriterionsWithSameNameAndType()
|
||||
throws ValidationException {
|
||||
Criterion c = givenASavedCriterionWithAnExistentType();
|
||||
|
|
@ -171,6 +175,7 @@ public class CriterionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void findByTypeOnlyReturnsTheCriterionsMatchedByType() {
|
||||
givenASavedCriterionWithAnExistentType();
|
||||
// saving another
|
||||
|
|
@ -182,7 +187,6 @@ public class CriterionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void thereIsOtherWithSameNameAndTypeWorksIsolatedFromCurrentTransaction() {
|
||||
transactionService.runOnTransaction(new IOnTransaction<Void>() {
|
||||
|
||||
|
|
@ -196,7 +200,6 @@ public class CriterionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void thereIsNoOtherIfItsTheSame() {
|
||||
Criterion c = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Criterion>() {
|
||||
|
|
@ -210,7 +213,6 @@ public class CriterionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void ifItsDifferentThereIsOther() {
|
||||
Criterion c = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Criterion>() {
|
||||
|
|
@ -225,6 +227,7 @@ public class CriterionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void noOtherIfTheCriterionDoesntExist() {
|
||||
Criterion criterion = givenUniquelyNamedCriterion();
|
||||
assertFalse(criterionDAO.thereIsOtherWithSameNameAndType(criterion));
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CriterionSatisfactionDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -79,6 +78,7 @@ public class CriterionSatisfactionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveCriterions() {
|
||||
CriterionSatisfaction criterionSatisfaction = createValidCriterionSatisfaction(2007);
|
||||
satisfactionDAO.save(criterionSatisfaction);
|
||||
|
|
@ -110,6 +110,7 @@ public class CriterionSatisfactionDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class)
|
||||
@Transactional
|
||||
public void testNotSaveWithTransientCriterionAndWorker() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
saveCriterionType(criterion);
|
||||
|
|
@ -127,6 +128,7 @@ public class CriterionSatisfactionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemove() throws InstanceNotFoundException {
|
||||
CriterionSatisfaction satisfaction = createValidCriterionSatisfaction(2008);
|
||||
satisfactionDAO.save(satisfaction);
|
||||
|
|
@ -136,6 +138,7 @@ public class CriterionSatisfactionDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testList() {
|
||||
int previous = satisfactionDAO.list(CriterionSatisfaction.class).size();
|
||||
CriterionSatisfaction satisfaction1 = createValidCriterionSatisfaction(2007);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ import org.libreplan.business.resources.daos.ICriterionTypeDAO;
|
|||
import org.libreplan.business.resources.entities.CriterionType;
|
||||
import org.libreplan.business.resources.entities.ResourceEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -60,7 +59,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CriterionTypeDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -82,6 +80,7 @@ public class CriterionTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveCriterionType() {
|
||||
CriterionType criterionType = createValidCriterionType();
|
||||
criterionTypeDAO.save(criterionType);
|
||||
|
|
@ -89,6 +88,7 @@ public class CriterionTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCriterionTypeCanBeSavedTwice() throws ValidationException {
|
||||
CriterionType criterionType = createValidCriterionType();
|
||||
criterionTypeDAO.save(criterionType);
|
||||
|
|
@ -99,7 +99,6 @@ public class CriterionTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@NotTransactional
|
||||
public void testCannotSaveTwoDifferentCriterionTypesWithTheSameName() {
|
||||
IOnTransaction<Void> createTypeWithRepeatedName = new IOnTransaction<Void>() {
|
||||
|
||||
|
|
@ -116,7 +115,6 @@ public class CriterionTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testUpdateWithExistingName() {
|
||||
|
||||
final String name1 = getUniqueName();
|
||||
|
|
@ -157,7 +155,6 @@ public class CriterionTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testUpdateWithTheSameName() {
|
||||
|
||||
final String name1 = getUniqueName();
|
||||
|
|
@ -193,6 +190,7 @@ public class CriterionTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemove() throws InstanceNotFoundException {
|
||||
CriterionType criterionType = createValidCriterionType();
|
||||
criterionTypeDAO.save(criterionType);
|
||||
|
|
@ -201,6 +199,7 @@ public class CriterionTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testList() {
|
||||
int previous = criterionTypeDAO.list(CriterionType.class).size();
|
||||
CriterionType criterion1 = createValidCriterionType();
|
||||
|
|
@ -212,6 +211,7 @@ public class CriterionTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testGetCriterionTypes() {
|
||||
int previous = criterionTypeDAO.list(CriterionType.class).size();
|
||||
CriterionType criterion1 = createValidCriterionType();
|
||||
|
|
@ -223,6 +223,7 @@ public class CriterionTypeDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testGetCriterionTypesByResourceType() {
|
||||
// Add RESOURCE criterionType
|
||||
CriterionType criterionType = createValidCriterionType();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ import org.libreplan.business.resources.entities.Criterion;
|
|||
import org.libreplan.business.resources.entities.Machine;
|
||||
import org.libreplan.business.resources.entities.MachineWorkersConfigurationUnit;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -64,7 +63,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Diego Pino Garcia <dpino@igalia.com>
|
||||
* @author Javier Moran Rua <jmoran@igalia.com>
|
||||
*/
|
||||
@Transactional
|
||||
public class MachineDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -104,11 +102,13 @@ public class MachineDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(machineDAO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveMachine() {
|
||||
Machine machine = createValidMachine();
|
||||
machineDAO.save(machine);
|
||||
|
|
@ -116,6 +116,7 @@ public class MachineDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveMachine() throws InstanceNotFoundException {
|
||||
Machine machine = createValidMachine();
|
||||
machineDAO.save(machine);
|
||||
|
|
@ -124,6 +125,7 @@ public class MachineDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListMachines() {
|
||||
int previous = machineDAO.list(Machine.class).size();
|
||||
Machine machine = createValidMachine();
|
||||
|
|
@ -133,7 +135,6 @@ public class MachineDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testSaveConfigurationUnits() throws InstanceNotFoundException {
|
||||
final Machine machine = createValidMachine();
|
||||
MachineWorkersConfigurationUnit configurationUnit = MachineWorkersConfigurationUnit
|
||||
|
|
@ -157,7 +158,6 @@ public class MachineDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@NotTransactional
|
||||
public void testSaveTwoMachinesWithSameCodeForbidden() {
|
||||
final String sameCode = UUID.randomUUID().toString();
|
||||
transactionService.runOnTransaction(new IOnTransaction<Void>() {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ import org.libreplan.business.resources.entities.Worker;
|
|||
import org.libreplan.business.users.daos.IUserDAO;
|
||||
import org.libreplan.business.users.entities.User;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -75,7 +74,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class ResourceDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -108,6 +106,7 @@ public class ResourceDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void saveResourceWithCalendar() throws InstanceNotFoundException {
|
||||
Resource resource = givenValidWorker();
|
||||
ResourceCalendar resourceCalendar = givenValidResourceCalendar();
|
||||
|
|
@ -140,6 +139,7 @@ public class ResourceDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testResourceIsRelatedWithAllCriterions() {
|
||||
Collection<Criterion> criterions = createCriterions();
|
||||
createAndSaveResourceSatisfyingAllCriterions(criterions);
|
||||
|
|
@ -150,7 +150,6 @@ public class ResourceDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void theHierarchyOfCriterionsIsConsidered() {
|
||||
final Criterion[] parentCriteron = { null };
|
||||
Resource worker = transactionService
|
||||
|
|
@ -236,6 +235,7 @@ public class ResourceDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testResourceIsNotRelatedWithAllCriterions() {
|
||||
Collection<Criterion> criterions = createCriterions();
|
||||
createAndSaveResourceSatisfyingAllCriterions(criterions);
|
||||
|
|
@ -265,6 +265,7 @@ public class ResourceDAOTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void testWorkerBoundToUserAlreadyBound() {
|
||||
final User user = givenStoredUser();
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class ResourceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -85,6 +84,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testGetSatisfactionsForCriterion() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Criterion other = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -102,6 +102,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Transactional
|
||||
public void getSatisfactionsForWrongIntervalThrowsException() {
|
||||
Worker worker = Worker.create("firstName", "surName", "2333232");
|
||||
worker.query().from(CriterionDAOTest.createValidCriterion())
|
||||
|
|
@ -109,6 +110,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Transactional
|
||||
public void getSatisfactionsForWrongIntervalForCriterionTypeThrowsException() {
|
||||
Worker worker = Worker.create("firstName", "surName", "2333232");
|
||||
worker.query().from(createTypeThatMatches()).enforcedInAll(
|
||||
|
|
@ -116,6 +118,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRetrieveActiveCriterionsForCriterionType() {
|
||||
final Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -136,6 +139,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testActiveCriterions() {
|
||||
final Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -195,6 +199,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRetrieveSatisfactionsInIntervalForCriterionType()
|
||||
{
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -226,6 +231,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Transactional
|
||||
public void invalidadCriterionWithItsTypeNotAllowd() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -234,6 +240,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddAndRemoveSatisfactions() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -272,6 +279,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddAtDate() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -311,6 +319,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
// when type doesnt allow multiple active criterions per resource
|
||||
public void addOnlyUntilNextCriterionIsActive() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -330,6 +339,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Transactional
|
||||
// when type doesnt allow multiple active criterions per resource
|
||||
public void testCantAddOverlappingTotally() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -347,6 +357,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Transactional
|
||||
public void testCantAddIfOverlapsPartially() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -363,6 +374,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCantAddWrongCriterionSatisfaction() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -391,6 +403,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCantAddCriterionSatisfactionWithOverlap() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -417,6 +430,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCantAddCriterionSatisfactionWithTypeAllowMultipleResource() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
|
||||
|
|
@ -461,6 +475,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Transactional
|
||||
public void shouldntAdd() {
|
||||
Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Worker worker = Worker.create("firstName", "surName", "2333232");
|
||||
|
|
@ -500,12 +515,14 @@ public class ResourceTest {
|
|||
private List<DayAssignment> assignments;
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Transactional
|
||||
public void addNewAssignmentsMustReceiveNotNullArgument() {
|
||||
givenWorker();
|
||||
worker.addNewAssignments(null);
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Transactional
|
||||
public void mustHaveNoNullElements() {
|
||||
givenWorker();
|
||||
List<DayAssignment> list = new ArrayList<DayAssignment>();
|
||||
|
|
@ -514,6 +531,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void newAssignmentsImportsTheAssignments() {
|
||||
givenWorker();
|
||||
LocalDate today = new LocalDate();
|
||||
|
|
@ -531,6 +549,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void addingAdditionalAssignmentsKeepOld() {
|
||||
givenWorker();
|
||||
LocalDate today = new LocalDate();
|
||||
|
|
@ -548,6 +567,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void workerWithoutAssignmentsGivesNoAssignedHours() {
|
||||
givenWorker();
|
||||
LocalDate today = new LocalDate();
|
||||
|
|
@ -555,6 +575,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void workerWithAssignmentsGivesTheSumOfAssignedHoursForThatDay() {
|
||||
givenWorker();
|
||||
LocalDate today = new LocalDate();
|
||||
|
|
@ -570,6 +591,7 @@ public class ResourceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void afterAddingAnotherDontReturnTheOldResult() {
|
||||
givenWorker();
|
||||
LocalDate today = new LocalDate();
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class OnlyMainScenarioAwareManagerTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -51,6 +50,7 @@ public class OnlyMainScenarioAwareManagerTest {
|
|||
private IScenarioManager onlyMainScenarioAware;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theCurrentScenarioIsTheMain() {
|
||||
scenariosBootstrap.loadRequiredData();
|
||||
Scenario current = onlyMainScenarioAware.getCurrent();
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class ScenariosBootstrapTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -119,6 +118,7 @@ public class ScenariosBootstrapTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("FIXME failing in MySQL")
|
||||
public void loadBasicData() throws InstanceNotFoundException {
|
||||
removeCurrentScenarios();
|
||||
|
|
@ -130,6 +130,7 @@ public class ScenariosBootstrapTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("FIXME failing in MySQL")
|
||||
public void loadBasicDataAssociatedWithCurrentOrders()
|
||||
throws InstanceNotFoundException {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ import org.libreplan.business.scenarios.daos.IScenarioDAO;
|
|||
import org.libreplan.business.scenarios.entities.OrderVersion;
|
||||
import org.libreplan.business.scenarios.entities.Scenario;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -56,7 +55,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class ScenarioDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -104,7 +102,6 @@ public class ScenarioDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void afterSavingScenarioWithOrderNewlyRetrievedOrderHasScenariosInfo() {
|
||||
final Scenario scenario = createNewScenario();
|
||||
final Long orderId = transactionService
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class ScenarioTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -58,6 +57,7 @@ public class ScenarioTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkNewDerivedScenario() {
|
||||
String predecessorScenarioName = "parent";
|
||||
Scenario predecessor = Scenario.create(predecessorScenarioName);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class OrderAuthorizationDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -124,11 +123,13 @@ public class OrderAuthorizationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(orderAuthorizationDAO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveOrderAuthorization() {
|
||||
UserOrderAuthorization userOrderAuthorization = createValidUserOrderAuthorization();
|
||||
orderAuthorizationDAO.save(userOrderAuthorization);
|
||||
|
|
@ -140,6 +141,7 @@ public class OrderAuthorizationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveOrderAuthorization() throws InstanceNotFoundException {
|
||||
UserOrderAuthorization userOrderAuthorization = createValidUserOrderAuthorization();
|
||||
orderAuthorizationDAO.save(userOrderAuthorization);
|
||||
|
|
@ -153,6 +155,7 @@ public class OrderAuthorizationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListOrderAuthorizations() {
|
||||
int previous = orderAuthorizationDAO.list(OrderAuthorization.class).size();
|
||||
UserOrderAuthorization userOrderAuthorization = createValidUserOrderAuthorization();
|
||||
|
|
@ -163,6 +166,7 @@ public class OrderAuthorizationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListOrderAuthorizationsByOrder() {
|
||||
int previous = orderAuthorizationDAO.list(OrderAuthorization.class).size();
|
||||
|
||||
|
|
@ -185,6 +189,7 @@ public class OrderAuthorizationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testNavigateFromOrderAuthorizationToUser() {
|
||||
User user = createValidUser();
|
||||
userDAO.save(user);
|
||||
|
|
@ -195,6 +200,7 @@ public class OrderAuthorizationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testNavigateFromOrderAuthorizationToProfile() {
|
||||
Profile profile = createValidProfile();
|
||||
profileDAO.save(profile);
|
||||
|
|
@ -205,6 +211,7 @@ public class OrderAuthorizationDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testNavigateFromOrderAuthorizationToOrder() {
|
||||
Order order = createValidOrder();
|
||||
orderDAO.save(order);
|
||||
|
|
|
|||
|
|
@ -51,13 +51,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
public class ProfileDAOTest {
|
||||
|
||||
@Autowired
|
||||
IProfileDAO profileDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(profileDAO);
|
||||
}
|
||||
|
|
@ -68,6 +68,7 @@ public class ProfileDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveProfile() {
|
||||
Profile profile = createValidProfile();
|
||||
profileDAO.save(profile);
|
||||
|
|
@ -75,6 +76,7 @@ public class ProfileDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveProfile() throws InstanceNotFoundException {
|
||||
Profile profile = createValidProfile();
|
||||
profileDAO.save(profile);
|
||||
|
|
@ -83,6 +85,7 @@ public class ProfileDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListProfiles() {
|
||||
int previous = profileDAO.list(Profile.class).size();
|
||||
Profile profile = createValidProfile();
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ import org.libreplan.business.users.entities.Profile;
|
|||
import org.libreplan.business.users.entities.User;
|
||||
import org.libreplan.business.users.entities.UserRole;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -62,7 +61,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class UserDAOTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -78,6 +76,7 @@ public class UserDAOTest {
|
|||
private IWorkerDAO workerDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testBasicSave() throws InstanceNotFoundException {
|
||||
|
||||
User user = createUser(getUniqueName());
|
||||
|
|
@ -90,7 +89,6 @@ public class UserDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testExistsByLoginNameAnotherTransaction() {
|
||||
|
||||
final String loginName = getUniqueName();
|
||||
|
|
@ -114,7 +112,6 @@ public class UserDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testCreateWithExistingLoginName() {
|
||||
|
||||
final String loginName = getUniqueName();
|
||||
|
|
@ -138,7 +135,6 @@ public class UserDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testUpdateWithExistingLoginName() {
|
||||
|
||||
final String loginName1 = getUniqueName();
|
||||
|
|
@ -179,7 +175,6 @@ public class UserDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testUpdateWithTheSameLoginName() {
|
||||
|
||||
final String loginName1 = getUniqueName();
|
||||
|
|
@ -214,6 +209,7 @@ public class UserDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testFindByName() throws InstanceNotFoundException {
|
||||
User user = createUser(getUniqueName());
|
||||
user.setDisabled(true);
|
||||
|
|
@ -230,6 +226,7 @@ public class UserDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListNotDisabled() {
|
||||
User user1 = createUser(getUniqueName());
|
||||
user1.setDisabled(true);
|
||||
|
|
@ -244,6 +241,7 @@ public class UserDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListProfiles() throws InstanceNotFoundException{
|
||||
|
||||
User user = createUser(getUniqueName());
|
||||
|
|
@ -291,6 +289,7 @@ public class UserDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testUnoundUsers1() {
|
||||
int previous = transactionService
|
||||
.runOnAnotherReadOnlyTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -340,6 +339,7 @@ public class UserDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testUnoundUsers2() {
|
||||
int previous = transactionService
|
||||
.runOnAnotherReadOnlyTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -364,6 +364,7 @@ public class UserDAOTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testUnoundUsers3() {
|
||||
int previous = transactionService
|
||||
.runOnAnotherReadOnlyTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class EffortDurationTypeTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -60,6 +59,7 @@ public class EffortDurationTypeTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void canBeSavedAndRetrieved() {
|
||||
EffortDuration duration = hours(2).and(30, Granularity.MINUTES);
|
||||
givenEntity(duration);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class ResourcesPerDayTypeTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -60,6 +59,7 @@ public class ResourcesPerDayTypeTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void canBeSavedAndRetrieved() {
|
||||
ResourcesPerDay resourcesPerDay = ResourcesPerDay
|
||||
.amount(new BigDecimal(2.7));
|
||||
|
|
|
|||
|
|
@ -46,18 +46,19 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
/*
|
||||
* @author Diego Pino García <dpino@igalia.com>
|
||||
*/
|
||||
@Transactional
|
||||
public class WorkReportDAOTest extends AbstractWorkReportTest {
|
||||
|
||||
@Autowired
|
||||
private IWorkReportDAO workReportDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(workReportDAO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveWorkReport() {
|
||||
WorkReport workReport = createValidWorkReport();
|
||||
workReportDAO.save(workReport);
|
||||
|
|
@ -65,6 +66,7 @@ public class WorkReportDAOTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveWorkReport() throws InstanceNotFoundException {
|
||||
WorkReport workReport = createValidWorkReport();
|
||||
workReportDAO.save(workReport);
|
||||
|
|
@ -73,6 +75,7 @@ public class WorkReportDAOTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListWorkReport() {
|
||||
int previous = workReportDAO.list(WorkReport.class).size();
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
/*
|
||||
* @author Diego Pino García <dpino@igalia.com>
|
||||
*/
|
||||
@Transactional
|
||||
public class WorkReportLineDAOTest extends AbstractWorkReportTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -64,6 +63,7 @@ public class WorkReportLineDAOTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveWorkReportLine() {
|
||||
WorkReportLine workReportLine = createValidWorkReportLine();
|
||||
workReportLineDAO.save(workReportLine);
|
||||
|
|
@ -71,6 +71,7 @@ public class WorkReportLineDAOTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveWorkReportLine() throws InstanceNotFoundException {
|
||||
WorkReportLine workReportLine = createValidWorkReportLine();
|
||||
workReportLineDAO.save(workReportLine);
|
||||
|
|
@ -80,6 +81,7 @@ public class WorkReportLineDAOTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListWorkReportLine() {
|
||||
int previous = workReportLineDAO.list(WorkReportLine.class).size();
|
||||
|
||||
|
|
|
|||
|
|
@ -45,13 +45,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
/*
|
||||
* @author Diego Pino García <dpino@igalia.com>
|
||||
*/
|
||||
@Transactional
|
||||
public class WorkReportTypeDAOTest extends AbstractWorkReportTest {
|
||||
|
||||
@Autowired
|
||||
private IWorkReportTypeDAO workReportTypeDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testSaveWorkReportType() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
workReportTypeDAO.save(workReportType);
|
||||
|
|
@ -59,6 +59,7 @@ public class WorkReportTypeDAOTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveWorkReportType() throws InstanceNotFoundException {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
workReportTypeDAO.save(workReportType);
|
||||
|
|
@ -67,6 +68,7 @@ public class WorkReportTypeDAOTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListWorkReportType() {
|
||||
int previous = workReportTypeDAO.list(WorkReportType.class).size();
|
||||
|
||||
|
|
|
|||
|
|
@ -46,13 +46,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
|
||||
BUSINESS_SPRING_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class WorkReportTypeTest extends AbstractWorkReportTest {
|
||||
|
||||
@Autowired
|
||||
IWorkReportTypeDAO workReportTypeDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidNameWorkReportType()
|
||||
throws ValidationException {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
|
|
@ -75,6 +75,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidCodeWorkReportType() throws ValidationException {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
workReportType.setCode("");
|
||||
|
|
@ -105,6 +106,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIfCodeWorkReportTypeIsUnique() throws ValidationException {
|
||||
String code = new String("A");
|
||||
WorkReportType workReportTypeA = createValidWorkReportType();
|
||||
|
|
@ -125,6 +127,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIfNameWorkReportTypeIsUnique() throws ValidationException {
|
||||
WorkReportType workReportTypeA = createValidWorkReportType();
|
||||
workReportTypeA.setName("A");
|
||||
|
|
@ -144,6 +147,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkSaveDescriptionFieldsWorkReportType() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
|
||||
|
|
@ -161,6 +165,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIfFieldNameDescriptionFieldsIsUnique() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
|
||||
|
|
@ -180,6 +185,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidFieldNameDescriptionFields() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
|
||||
|
|
@ -209,6 +215,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkInvalidLenghtDescriptionFields() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
|
||||
|
|
@ -238,6 +245,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkSaveWorkReportLabelTypeAssigment() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
|
||||
|
|
@ -255,6 +263,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIfLabelTypeWorkReportLabelTypeAssigmentIsNull() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
WorkReportLabelTypeAssigment labelAssigment = createValidWorkReportLabelTypeAssigment();
|
||||
|
|
@ -269,6 +278,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIfLabelWorkReportLabelTypeAssigmentIsNull() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
WorkReportLabelTypeAssigment labelAssigment = createValidWorkReportLabelTypeAssigment();
|
||||
|
|
@ -283,6 +293,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIfIndexLabelsAndFieldsAreConsecutive() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
|
||||
|
|
@ -308,6 +319,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIfIndexLabelsAndFieldsInitInZero() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
|
||||
|
|
@ -333,6 +345,7 @@ public class WorkReportTypeTest extends AbstractWorkReportTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIfIndexLabelsAndFieldsAreUniques() {
|
||||
WorkReportType workReportType = createValidWorkReportType();
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class ExportTimesheetsToTimTest {
|
||||
|
||||
private Properties properties = null;
|
||||
|
|
@ -158,6 +157,7 @@ public class ExportTimesheetsToTimTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("Only working if you have a Tim server configured")
|
||||
public void testExportTimesheetsToTimWithValidCodeAndOrder()
|
||||
throws ConnectorException {
|
||||
|
|
@ -172,6 +172,7 @@ public class ExportTimesheetsToTimTest {
|
|||
}
|
||||
|
||||
@Test(expected = ConnectorException.class)
|
||||
@Transactional
|
||||
public void testExportTimesheetsToTimWithInvalidCode()
|
||||
throws ConnectorException {
|
||||
Order order = givenOrder();
|
||||
|
|
@ -179,6 +180,7 @@ public class ExportTimesheetsToTimTest {
|
|||
}
|
||||
|
||||
@Test(expected = ConnectorException.class)
|
||||
@Transactional
|
||||
public void testExportTimesheetsToTimWithOrderNull()
|
||||
throws ConnectorException {
|
||||
exportTimesheetsToTim.exportTimesheets("5160", null);
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class JiraOrderElementSynchronizerTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -212,6 +211,7 @@ public class JiraOrderElementSynchronizerTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("Only working if you have a JIRA server configured")
|
||||
public void testSyncOrderElementsOfAnExistingOrderWithNoOrderLines() {
|
||||
Order order = givenOrder();
|
||||
|
|
@ -223,6 +223,7 @@ public class JiraOrderElementSynchronizerTest {
|
|||
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("Only working if you have a JIRA server configured")
|
||||
public void testReSyncOrderElementsOfAnExistingOrderWithOrderLines() {
|
||||
Order order = givenOrderWithValidOrderLines();
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class JiraTimesheetSynchronizerTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -220,6 +219,7 @@ public class JiraTimesheetSynchronizerTest {
|
|||
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("Only working if you have a JIRA server configured")
|
||||
public void testSyncJiraTimesheet() throws ConnectorException {
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ import org.libreplan.business.common.IOnTransaction;
|
|||
import org.libreplan.business.common.exceptions.ValidationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -69,7 +68,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class BaseCalendarModelTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -98,6 +96,7 @@ public class BaseCalendarModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCreateAndSave() {
|
||||
int previous = baseCalendarModel.getBaseCalendars().size();
|
||||
baseCalendarModel.initCreate();
|
||||
|
|
@ -124,7 +123,6 @@ public class BaseCalendarModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testEditAndSave() throws ValidationException {
|
||||
final Capacity capacity = Capacity.create(hours(4));
|
||||
doEditsSaveAndThenAsserts(new IOnExistentCalendar() {
|
||||
|
|
@ -182,6 +180,7 @@ public class BaseCalendarModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testEditAndNewVersion() {
|
||||
final Capacity capacity = Capacity.create(hours(4));
|
||||
final LocalDate date = new LocalDate().plusWeeks(1);
|
||||
|
|
@ -215,6 +214,7 @@ public class BaseCalendarModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemove() {
|
||||
int previous = baseCalendarModel.getBaseCalendars().size();
|
||||
saveOneCalendar();
|
||||
|
|
@ -228,6 +228,7 @@ public class BaseCalendarModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testPossibleParentCalendars() throws ValidationException {
|
||||
int previous = baseCalendarModel.getPossibleParentCalendars().size();
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class OrderElementTreeModelTest {
|
||||
|
||||
private static final BigDecimal HUNDRED = new BigDecimal(100);
|
||||
|
|
@ -293,6 +292,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAddElementWithCriteriaAndAdvancesOnParent()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -340,6 +340,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkRemoveElementWithCriteriaAndAdvancesOnParent()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -358,6 +359,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkRemoveElementWithCriteriaAndAdvancesOnChild()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -377,6 +379,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAddCriterionOnChild()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -398,6 +401,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAddCriterionOnParent()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -420,6 +424,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAddAssignmentOnChild()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -434,6 +439,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAddAdvanceOnParent()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -448,6 +454,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAddElementOnOrderLineWithCriteriaAndAdvances()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -503,6 +510,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkAddElementOnOrderLineGroupWithCriteriaAndAdvances()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -539,6 +547,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkRemoveElementOnOnlyOrderLineWithCriteriaAndAdvances()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -657,6 +666,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkPreservationOfInvalidatedIndirectCriterionRequirementInToLeaf()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -711,6 +721,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIndentOrderLineWithCriteriaAndAdvances()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -759,6 +770,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIndentOnOrderLineWithCriteriaAndAdvances()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -805,6 +817,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkIndentOnOrderLineGroupWithCriteriaAndAdvances()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -847,6 +860,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkUnindentOrderLineWithCriteriaAndAdvances()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -917,6 +931,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineWithCriteriaAndAdvancesToOrderLineWithCriteriaAndAdvances()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1009,6 +1024,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineWithCriteriaAndAdvancesToOrderLineGroupWithCriteriaAndAdvances()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1141,6 +1157,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineWithLabelToOrderLineGroupWithSameLabel() {
|
||||
createTreeWithContainerAndTask();
|
||||
|
||||
|
|
@ -1162,6 +1179,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineWithLabelToOrderLineInGroupWithSameLabel() {
|
||||
createTreeWithContainerAndTask();
|
||||
|
||||
|
|
@ -1237,6 +1255,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderGroupLineWithLabelToOrderLineGroupWithSameLabel() {
|
||||
createTreeWithContainerAndContainer();
|
||||
|
||||
|
|
@ -1261,6 +1280,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderGroupLineWithLabelToOrderLineInGroupWithSameLabel() {
|
||||
createTreeWithContainerAndContainer();
|
||||
|
||||
|
|
@ -1285,6 +1305,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineGroupWithLabelOnChildToOrderLineGroupWithSameLabel() {
|
||||
createTreeWithContainerAndContainer();
|
||||
|
||||
|
|
@ -1309,6 +1330,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineGroupWithLabelOnChildToOrderLineInGroupWithSameLabel() {
|
||||
createTreeWithContainerAndContainer();
|
||||
|
||||
|
|
@ -1333,6 +1355,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineWithAdvanceToOrderLineGroupWithSameAdvanceType()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1366,6 +1389,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineWithAdvanceToOrderLineInGroupWithSameAdvanceType()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1399,6 +1423,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineGroupWithAdvanceToOrderLineGroupWithSameAdvance()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1442,6 +1467,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineGroupWithAdvanceToOrderLineInGroupWithSameAdvance()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1485,6 +1511,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineGroupWithAdvanceOnChildToOrderLineGroupWithSameAdvance()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1529,6 +1556,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineGroupWithAdvanceOnChildToOrderLineInGroupWithSameAdvance()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -1573,6 +1601,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineWithCriterionToOrderLineGroupWithSameCriterion() {
|
||||
createTreeWithContainerAndTask();
|
||||
|
||||
|
|
@ -1622,6 +1651,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineWithCriterionToOrderLineInGroupWithSameCriterion() {
|
||||
createTreeWithContainerAndTask();
|
||||
|
||||
|
|
@ -1671,6 +1701,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderGroupLineWithCriterionToOrderLineGroupWithSameCriterion() {
|
||||
createTreeWithContainerAndContainer();
|
||||
|
||||
|
|
@ -1753,6 +1784,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderGroupLineWithCriterionToOrderLineInGroupWithSameCriterion() {
|
||||
createTreeWithContainerAndContainer();
|
||||
|
||||
|
|
@ -1835,6 +1867,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineGroupWithCriterionOnChildToOrderLineGroupWithSameCriterion() {
|
||||
createTreeWithContainerAndContainer();
|
||||
|
||||
|
|
@ -1898,6 +1931,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMoveOrderLineGroupWithCriterionOnChildToOrderLineInGroupWithSameCriterion() {
|
||||
createTreeWithContainerAndContainer();
|
||||
|
||||
|
|
@ -1989,6 +2023,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkRemoveElementWithAdvanceOnChildWhichSpread()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
@ -2020,6 +2055,7 @@ public class OrderElementTreeModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkChildrenAdvanceIsCreatedAndMarkedAsSpreadInOrder()
|
||||
throws DuplicateValueTrueReportGlobalAdvanceException,
|
||||
DuplicateAdvanceAssignmentForOrderElementException {
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ import org.libreplan.web.calendars.BaseCalendarModel;
|
|||
import org.libreplan.web.planner.order.PlanningStateCreator;
|
||||
import org.libreplan.web.planner.order.PlanningStateCreator.PlanningState;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
|
@ -96,7 +95,6 @@ import org.zkoss.zk.ui.Desktop;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class OrderModelTest {
|
||||
|
||||
public static OrderVersion setupVersionUsing(
|
||||
|
|
@ -212,6 +210,7 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback(false)
|
||||
public void testNotRollback() {
|
||||
// Just to do not make rollback in order to have the default
|
||||
|
|
@ -220,6 +219,7 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("FIXME pending review after rename to libreplan")
|
||||
public void testCreation() throws ValidationException {
|
||||
Order order = createValidOrder();
|
||||
|
|
@ -247,6 +247,7 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("FIXME pending review after rename to libreplan")
|
||||
public void testCreationUsingPrepareForCreate() {
|
||||
Order order = givenOrderFromPrepareForCreate();
|
||||
|
|
@ -255,6 +256,7 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("FIXME pending review after rename to libreplan")
|
||||
public void createOrderWithScheduledOrderLine() {
|
||||
Order order = givenOrderFromPrepareForCreate();
|
||||
|
|
@ -270,6 +272,7 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void ifAnOrderLineIsScheduledItsTypeChanges() {
|
||||
Order order = givenOrderFromPrepareForCreate();
|
||||
OrderElement line = OrderLine.createOrderLineWithUnfixedPercentage(20);
|
||||
|
|
@ -284,6 +287,7 @@ public class OrderModelTest {
|
|||
@Ignore("Test ignored until having the possibility to have a user " +
|
||||
"session from tests")
|
||||
@Test
|
||||
@Transactional
|
||||
public void testListing() {
|
||||
List<Order> list = orderModel.getOrders();
|
||||
Order order = createValidOrder();
|
||||
|
|
@ -294,6 +298,7 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("FIXME pending review after rename to libreplan")
|
||||
public void testRemove() {
|
||||
Order order = createValidOrder();
|
||||
|
|
@ -305,6 +310,7 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
@Ignore("FIXME pending review after rename to libreplan")
|
||||
public void shouldSendValidationExceptionIfEndDateIsBeforeThanStartingDate()
|
||||
throws ValidationException {
|
||||
|
|
@ -315,6 +321,7 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("FIXME pending review after rename to libreplan")
|
||||
public void testFind() throws InstanceNotFoundException {
|
||||
Order order = createValidOrder();
|
||||
|
|
@ -324,7 +331,6 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
@Ignore("FIXME pending review after rename to libreplan")
|
||||
public void testOrderPreserved() throws ValidationException,
|
||||
InstanceNotFoundException {
|
||||
|
|
@ -412,7 +418,6 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
@Ignore("FIXME pending review after rename to libreplan")
|
||||
public void testAddingOrderElement() {
|
||||
final Order order = createValidOrder();
|
||||
|
|
@ -462,7 +467,6 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
@Ignore("FIXME pending review after rename to libreplan")
|
||||
public void testManyToManyHoursGroupCriterionMapping() {
|
||||
givenCriterion();
|
||||
|
|
@ -549,6 +553,7 @@ public class OrderModelTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
@Ignore("FIXME pending review after rename to libreplan")
|
||||
public void testAtLeastOneHoursGroup() {
|
||||
Order order = createValidOrder();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ package org.libreplan.web.resources;
|
|||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.libreplan.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
|
||||
import static org.libreplan.web.WebappGlobalNames.WEBAPP_SPRING_CONFIG_FILE;
|
||||
import static org.libreplan.web.WebappGlobalNames.WEBAPP_SPRING_SECURITY_CONFIG_FILE;
|
||||
|
|
@ -45,7 +44,6 @@ import org.libreplan.business.resources.entities.ICriterionType;
|
|||
import org.libreplan.business.resources.entities.PredefinedCriterionTypes;
|
||||
import org.libreplan.web.resources.criterion.CriterionsModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -60,7 +58,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CriterionModelTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -78,6 +75,7 @@ public class CriterionModelTest {
|
|||
private Criterion criterion;
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@Transactional
|
||||
public void cantSaveCriterionWithoutName() {
|
||||
givenValidCriterion();
|
||||
criterion.setName("");
|
||||
|
|
@ -110,6 +108,7 @@ public class CriterionModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void savingCriterionIncreasesTheNumberOfCriterions()
|
||||
{
|
||||
givenValidCriterionFor(PredefinedCriterionTypes.CATEGORY);
|
||||
|
|
@ -143,7 +142,6 @@ public class CriterionModelTest {
|
|||
}
|
||||
|
||||
/*@Test
|
||||
@NotTransactional
|
||||
public void modificationsAreSaved() {
|
||||
adHocTransactionService.runOnTransaction(new IOnTransaction<Void>() {
|
||||
|
||||
|
|
@ -173,6 +171,7 @@ public class CriterionModelTest {
|
|||
}*/
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void modifyingDontAlterTheNumberOfCriterions() {
|
||||
givenCreatedCriterionFor(PredefinedCriterionTypes.CATEGORY);
|
||||
int initial = getCriterionsNumber(PredefinedCriterionTypes.CATEGORY);
|
||||
|
|
@ -204,22 +203,22 @@ public class CriterionModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void theSameCriterionCanBeSavedTwice() throws ValidationException {
|
||||
givenValidCriterion();
|
||||
criterionDAO.save(criterion);
|
||||
criterionDAO.save(criterion);
|
||||
}
|
||||
|
||||
@NotTransactional
|
||||
public void twoDifferentCriterionsWithSameNameAndTypeAreDetectedIfPossible()
|
||||
throws ValidationException {
|
||||
final String unique = UUID.randomUUID().toString();
|
||||
@Test(expected = ValidationException.class)
|
||||
public void twoDifferentCriterionsWithSameNameAndTypeAreDetectedIfPossible() {
|
||||
final String repeatedName = UUID.randomUUID().toString();
|
||||
transactionService.runOnTransaction(new IOnTransaction<Void>() {
|
||||
|
||||
@Override
|
||||
public Void execute() {
|
||||
Criterion criterion = givenValidCriterionFor(
|
||||
PredefinedCriterionTypes.CATEGORY, unique);
|
||||
PredefinedCriterionTypes.CATEGORY, repeatedName);
|
||||
try {
|
||||
criterionDAO.save(criterion);
|
||||
} catch (ValidationException e) {
|
||||
|
|
@ -234,12 +233,14 @@ public class CriterionModelTest {
|
|||
public Void execute() {
|
||||
try {
|
||||
Criterion criterion2 = givenValidCriterionFor(
|
||||
PredefinedCriterionTypes.CATEGORY, unique);
|
||||
criterionDAO.save(criterion2);
|
||||
fail("must send "
|
||||
+ ValidationException.class.getSimpleName());
|
||||
PredefinedCriterionTypes.CATEGORY, repeatedName);
|
||||
CriterionType type = criterion2.getType();
|
||||
type.getCriterions().add(criterion2);
|
||||
criterionTypeDAO.save(type);
|
||||
} catch (ValidationException e) {
|
||||
// ok
|
||||
assertThat(e.getInvalidValues().size(), equalTo(1));
|
||||
// ValidationException is expected
|
||||
throw e;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,13 +62,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class WorkerModelTest {
|
||||
|
||||
@Autowired
|
||||
private IResourceDAO resourceDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testWorkerValid() throws ValidationException,
|
||||
InstanceNotFoundException {
|
||||
|
||||
|
|
@ -99,6 +99,7 @@ public class WorkerModelTest {
|
|||
|
||||
@Ignore
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Transactional
|
||||
public void testWorkerInvalid() throws ValidationException,
|
||||
InstanceNotFoundException, IllegalStateException {
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CurrentUserScenarioAwareManagerTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -70,6 +69,7 @@ public class CurrentUserScenarioAwareManagerTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void ifNoUserAuthenticatedMainScenarioIsReturned() {
|
||||
Scenario current = scenarioManager.getCurrent();
|
||||
assertEquals(PredefinedScenarios.MASTER.getName(), current.getName());
|
||||
|
|
@ -77,6 +77,7 @@ public class CurrentUserScenarioAwareManagerTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void retrievesTheScenarioAssociatedWithTheAuthentication() {
|
||||
Scenario customScenario = mockScenario();
|
||||
givenUserAuthenticatedWith(customScenario);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class ScenarioModelTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -181,12 +180,14 @@ public class ScenarioModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback(false)
|
||||
public void testNotRollback() {
|
||||
// Just to do not make rollback in order to have the default scenario
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("FIXME: test was causing problems in Debian Wheezy")
|
||||
public void testCreateAndSaveScenarioWithoutOrders() {
|
||||
int previous = scenarioModel.getScenarios().size();
|
||||
|
|
@ -204,6 +205,7 @@ public class ScenarioModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("FIXME: test was causing problems in Debian Wheezy")
|
||||
public void testCreateAndSaveScenarioWithOrders() {
|
||||
Order order = givenStoredOrderInDefaultScenario();
|
||||
|
|
@ -228,12 +230,14 @@ public class ScenarioModelTest {
|
|||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Transactional
|
||||
public void testRemoveDefaultScenario() {
|
||||
Scenario defaultScenario = PredefinedScenarios.MASTER.getScenario();
|
||||
scenarioModel.remove(defaultScenario);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveScenarioWithoutOrders() {
|
||||
Scenario scenario = givenStoredScenario();
|
||||
|
||||
|
|
@ -244,6 +248,7 @@ public class ScenarioModelTest {
|
|||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Transactional
|
||||
public void testRemoveScenarioWithDerivedScenraios() {
|
||||
Scenario scenario = givenStoredScenario();
|
||||
givenStoredScenario(scenario);
|
||||
|
|
@ -251,6 +256,7 @@ public class ScenarioModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Ignore("FIXME: test was causing problems in Debian Wheezy")
|
||||
public void testRemoveScenarioWithOrders() throws InstanceNotFoundException {
|
||||
Order order = givenStoredOrderInDefaultScenario();
|
||||
|
|
@ -268,6 +274,7 @@ public class ScenarioModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testRemoveScenarioWithOrdersJustInThisScenario()
|
||||
throws InstanceNotFoundException {
|
||||
Scenario scenario = givenStoredScenario();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ import org.libreplan.business.scenarios.bootstrap.PredefinedScenarios;
|
|||
import org.libreplan.business.scenarios.daos.IScenarioDAO;
|
||||
import org.libreplan.business.scenarios.entities.Scenario;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -63,7 +62,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class TransferOrdersModelTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -128,7 +126,6 @@ public class TransferOrdersModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testBasicTransferOrder() {
|
||||
final int numOrders = transactionService
|
||||
.runOnReadOnlyTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -202,7 +199,6 @@ public class TransferOrdersModelTest {
|
|||
}
|
||||
|
||||
@Test(expected = ValidationException.class)
|
||||
@NotTransactional
|
||||
public void testTransferOrderWithTheSameVersion() {
|
||||
final Order order = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Order>() {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class UsersBootstrapInDBTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -68,6 +67,7 @@ public class UsersBootstrapInDBTest {
|
|||
private IUserDAO userDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testMandatoryUsersCreated() throws InstanceNotFoundException {
|
||||
configurationBootstrap.loadRequiredData();
|
||||
profileBootstrap.loadRequiredData();
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class DBPasswordEncoderServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -72,6 +71,7 @@ public class DBPasswordEncoderServiceTest {
|
|||
private IUserDAO userDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testEncodePassword() throws InstanceNotFoundException {
|
||||
|
||||
configurationBootstrap.loadRequiredData();
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class DBUserDetailsServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -102,6 +101,7 @@ public class DBUserDetailsServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testLoadUserByUsername() {
|
||||
usersBootstrap.loadRequiredData();
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class LDAPUserDetailsServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -105,6 +104,7 @@ public class LDAPUserDetailsServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testLoadUserByUsername() {
|
||||
usersBootstrap.loadRequiredData();
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class BaseCalendarServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -221,6 +220,7 @@ public class BaseCalendarServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddValidBaseCalendar() throws InstanceNotFoundException {
|
||||
|
||||
/* Build valid base calendar "bc1" (5 constraint violations). */
|
||||
|
|
@ -290,6 +290,7 @@ public class BaseCalendarServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddInvalidBaseCalendar() throws InstanceNotFoundException {
|
||||
/* Build valid base calendar "bc1" (5 constraint violations). */
|
||||
/* Build two calendar exception with the same date */
|
||||
|
|
@ -333,6 +334,7 @@ public class BaseCalendarServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddInvalidCalendarData() {
|
||||
/* Build a calendar data */
|
||||
HoursPerDayDTO hoursPerDayDTO_1 = new HoursPerDayDTO("XXX",
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CalendarExceptionTypeServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -81,6 +80,7 @@ public class CalendarExceptionTypeServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exportExceptionTypes() {
|
||||
CalendarExceptionTypeListDTO list = calendarExceptionTypeService
|
||||
.getCalendarExceptionType();
|
||||
|
|
@ -88,6 +88,7 @@ public class CalendarExceptionTypeServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exportExceptionTypes2() {
|
||||
CalendarExceptionType calendarExceptionType = givenCalendarExceptionTypeStored();
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ import org.libreplan.ws.costcategories.api.CostCategoryListDTO;
|
|||
import org.libreplan.ws.costcategories.api.HourCostDTO;
|
||||
import org.libreplan.ws.costcategories.api.ICostCategoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
|
@ -75,7 +74,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CostCategoryServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -101,6 +99,7 @@ public class CostCategoryServiceTest {
|
|||
private IAdHocTransactionService transactionService;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback(false)
|
||||
public void createAPairTypeOfWorkHours() {
|
||||
givenTypeOfWorkHours(typeOfWorkHoursCodeA);
|
||||
|
|
@ -122,6 +121,7 @@ public class CostCategoryServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddAndGetCostCategories() {
|
||||
|
||||
/* Build cost category (5 constraint violations). */
|
||||
|
|
@ -186,7 +186,6 @@ public class CostCategoryServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testUpdateCostCategory() throws InstanceNotFoundException {
|
||||
|
||||
// First one it creates Valid cost category DTO with a hour cost
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CalendarServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -78,6 +77,7 @@ public class CalendarServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exportBaseCalendars() {
|
||||
int previous = baseCalendarDAO.getBaseCalendars().size();
|
||||
|
||||
|
|
@ -86,6 +86,7 @@ public class CalendarServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exportBaseCalendars2() {
|
||||
int previous = baseCalendarDAO.getBaseCalendars().size();
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ import org.libreplan.ws.labels.api.LabelDTO;
|
|||
import org.libreplan.ws.labels.api.LabelTypeDTO;
|
||||
import org.libreplan.ws.labels.api.LabelTypeListDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -69,7 +68,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class LabelServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -102,6 +100,7 @@ public class LabelServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exportLabelTypes() {
|
||||
int previous = labelTypeDAO.getAll().size();
|
||||
LabelTypeListDTO labelTypes = labelService.getLabelTypes();
|
||||
|
|
@ -109,6 +108,7 @@ public class LabelServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void exportLabelTypes2() {
|
||||
int previous = labelTypeDAO.getAll().size();
|
||||
|
||||
|
|
@ -127,6 +127,7 @@ public class LabelServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void importInvalidLabelWithoutAttributes() {
|
||||
int previous = labelTypeDAO.getAll().size();
|
||||
|
||||
|
|
@ -149,7 +150,6 @@ public class LabelServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void importValidLabelType() {
|
||||
int previous = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -180,7 +180,6 @@ public class LabelServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void importTwoValidLabelType() {
|
||||
int previous = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -235,7 +234,6 @@ public class LabelServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void importTwoLabelTypeWithRepeatedName() {
|
||||
int previous = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -272,7 +270,6 @@ public class LabelServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void importValidLabelTypeWithTwoValidLabels() {
|
||||
int previous = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -316,7 +313,6 @@ public class LabelServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void importLabelTypeWithNameAlreadyOnDatabase() {
|
||||
int previous = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -365,6 +361,7 @@ public class LabelServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void importValidLabelTypeWithTwoLabelsWithTheSameName() {
|
||||
int previous = labelTypeDAO.getAll().size();
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class MaterialServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -131,6 +130,7 @@ public class MaterialServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddAndGetMaterialCategories() {
|
||||
/* Build materialCategory (0 constraint violations). */
|
||||
// Missing material name and the unit type.
|
||||
|
|
@ -165,6 +165,7 @@ public class MaterialServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddMaterialRepeatedCodes() {
|
||||
/* Build material with same code (1 constraint violations). */
|
||||
MaterialDTO m1 = new MaterialDTO("CodeA", "material1", new BigDecimal(
|
||||
|
|
@ -189,6 +190,7 @@ public class MaterialServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddValidMaterialCategory() {
|
||||
/* Build material (0 constraint violations). */
|
||||
MaterialDTO m1 = new MaterialDTO("CodeM1", "material1", new BigDecimal(
|
||||
|
|
@ -224,6 +226,7 @@ public class MaterialServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddMaterialCategoryWithSameName() {
|
||||
/* Build material (0 constraint violations). */
|
||||
MaterialCategoryDTO mc1 = new MaterialCategoryDTO("subMC1",
|
||||
|
|
@ -249,6 +252,7 @@ public class MaterialServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddMaterialCategoryWithInconsistentParent() {
|
||||
/* Build material (0 constraint violations). */
|
||||
MaterialCategoryDTO mc1 = new MaterialCategoryDTO("subMCX1",
|
||||
|
|
@ -275,6 +279,7 @@ public class MaterialServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddAndUpdateMaterialCategory() {
|
||||
|
||||
/* Build material (0 constraint violations). */
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ import org.libreplan.ws.common.impl.DateConverter;
|
|||
import org.libreplan.ws.orders.api.IOrderElementService;
|
||||
import org.libreplan.ws.orders.api.OrderListDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -111,7 +110,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class OrderElementServiceTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -202,6 +200,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void invalidOrderWithoutCode() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -224,6 +223,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void invalidOrderWithoutAttributes() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -250,6 +250,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void invalidOrderWithoutNameAndInitDate() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -273,6 +274,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void invalidOrderWithoutInitDate() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -295,6 +297,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void invalidOrderWithoutName() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -320,6 +323,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validOrder() {
|
||||
String code = "order-code " + UUID.randomUUID().toString();
|
||||
|
||||
|
|
@ -338,6 +342,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void orderWithInvalidOrderLine() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -364,6 +369,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void orderWithOrderLineWithoutCode() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -389,6 +395,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void orderWithOrderLineWithInvalidHoursGroup() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -424,6 +431,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validOrderWithOrderLine() {
|
||||
String code = "order-code " + UUID.randomUUID().toString();
|
||||
|
||||
|
|
@ -450,6 +458,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void orderWithInvalidOrderLineGroup() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -478,6 +487,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void orderWithOrderLineGroupWithoutCode() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -505,6 +515,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void orderWithOrderLineGroupWithoutHoursGroup() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -535,6 +546,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validOrderWithOrderLineGroup() {
|
||||
String code = UUID.randomUUID().toString();
|
||||
|
||||
|
|
@ -575,6 +587,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void removeOrderElement() {
|
||||
final String code = UUID.randomUUID().toString();
|
||||
|
||||
|
|
@ -616,6 +629,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void orderWithInvalidMaterialAssignment() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -642,6 +656,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void orderWithInvalidMaterialAssignmentWithoutUnitsAndUnitPrice() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -674,6 +689,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validOrderWithMaterialAssignment() {
|
||||
String code = "order-code " + UUID.randomUUID().toString();
|
||||
|
||||
|
|
@ -699,6 +715,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void orderWithInvalidLabel() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -723,7 +740,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void validOrderWithLabel() {
|
||||
final String code = "order-code " + UUID.randomUUID().toString();
|
||||
|
||||
|
|
@ -768,7 +784,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void updateLabels() throws InstanceNotFoundException,
|
||||
IncompatibleTypeException {
|
||||
final String code = "order-code-" + UUID.randomUUID().toString();
|
||||
|
|
@ -861,7 +876,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void updateMaterialAssignment() throws InstanceNotFoundException,
|
||||
IncompatibleTypeException {
|
||||
final String code = "order-code" + UUID.randomUUID().toString();
|
||||
|
|
@ -970,7 +984,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void updateHoursGroup() throws InstanceNotFoundException,
|
||||
IncompatibleTypeException {
|
||||
final String code = "order-code" + UUID.randomUUID().toString();
|
||||
|
|
@ -1103,6 +1116,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
// FIXME move to subcontractors service when it exists
|
||||
public void invalidOrderWithInvalidAdvanceMeasurements()
|
||||
throws InstanceNotFoundException {
|
||||
|
|
@ -1145,7 +1159,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
// FIXME move to subcontractors service when it exists
|
||||
public void validOrderWithAdvanceMeasurements() {
|
||||
final String code = "order-code" + UUID.randomUUID().toString();
|
||||
|
|
@ -1201,7 +1214,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
// FIXME move to subcontractors service when it exists
|
||||
public void updateAdvanceMeasurements() throws InstanceNotFoundException,
|
||||
IncompatibleTypeException {
|
||||
|
|
@ -1312,6 +1324,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void invalidOrderWithCriterionRequirements()
|
||||
throws InstanceNotFoundException {
|
||||
String code = "order-code" + UUID.randomUUID().toString();
|
||||
|
|
@ -1346,7 +1359,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void validOrderWithCriterionRequirements()
|
||||
throws InstanceNotFoundException {
|
||||
final String code = "order-code" + UUID.randomUUID().toString();
|
||||
|
|
@ -1399,7 +1411,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void validOrderWithDirectCriterionRequirementsAndIndidirectCriterionRequirements()
|
||||
throws InstanceNotFoundException {
|
||||
final String code = "order-code" + UUID.randomUUID().toString();
|
||||
|
|
@ -1486,7 +1497,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void updateCriterionRequirements() throws InstanceNotFoundException,
|
||||
IncompatibleTypeException {
|
||||
final String code = "order-code" + UUID.randomUUID().toString();
|
||||
|
|
@ -1589,7 +1599,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void updateDirectCriterionRequirementsAndIndirectCriterionRequirements()
|
||||
throws InstanceNotFoundException, IncompatibleTypeException {
|
||||
final String code = "order-code" + UUID.randomUUID().toString();
|
||||
|
|
@ -1740,7 +1749,6 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void importDirectCriterionRequirementsAndIndirectCriterionRequirements()
|
||||
throws InstanceNotFoundException, IncompatibleTypeException {
|
||||
final String code = "order-code" + UUID.randomUUID().toString();
|
||||
|
|
@ -1841,6 +1849,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCannotExistTwoOrderElementsWithTheSameCode() {
|
||||
final String repeatedCode = "code1";
|
||||
|
||||
|
|
@ -1858,6 +1867,7 @@ public class OrderElementServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testCannotExistTwoHoursGroupWithTheSameCode() {
|
||||
final String repeatedCode = "code1";
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class ResourceServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -148,6 +147,7 @@ public class ResourceServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourcesWithBasicContraintViolations() {
|
||||
|
||||
/* Create resource DTOs. */
|
||||
|
|
@ -186,6 +186,7 @@ public class ResourceServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddWorkerWithExistingFirstNameSurnameAndNif() {
|
||||
|
||||
/* Create a worker. */
|
||||
|
|
@ -208,6 +209,7 @@ public class ResourceServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithCriterionSatisfactions() {
|
||||
|
||||
/* Create a criterion type. */
|
||||
|
|
@ -285,6 +287,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithCriterionSatisfactionWithoutStartDate() {
|
||||
|
||||
/* Create a criterion type. */
|
||||
|
|
@ -304,6 +307,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithCriterionSatisfactionWithNegativeInterval() {
|
||||
|
||||
/* Create a criterion type. */
|
||||
|
|
@ -323,6 +327,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithOverlappingCriterionSatisfactionsAllowed() {
|
||||
|
||||
/* Create a criterion type. */
|
||||
|
|
@ -345,6 +350,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithOverlappingCriterionSatisfactions() {
|
||||
|
||||
/* Create criterion types. */
|
||||
|
|
@ -386,6 +392,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourcesWithCriterionSatisfactionsWithIncorrectCriterionType() {
|
||||
|
||||
/* Create two criterion types. */
|
||||
|
|
@ -415,6 +422,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourcesWithCriterionSatisfactionsWithMissingNames() {
|
||||
|
||||
/* Create a criterion type. */
|
||||
|
|
@ -447,6 +455,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithCriterionSatisfactionsWithNonExistentCriterionType() {
|
||||
|
||||
/* Create a machine DTO. */
|
||||
|
|
@ -463,6 +472,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithCriterionSatisfactionsWithNonExistentCriterion() {
|
||||
|
||||
/* Create a criterion type. */
|
||||
|
|
@ -482,6 +492,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithDefaultCalendar() {
|
||||
|
||||
/* Create a machine DTO. */
|
||||
|
|
@ -497,6 +508,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithSpecificCalendar() {
|
||||
|
||||
/* Create a resource calendar DTO. */
|
||||
|
|
@ -520,6 +532,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithNonExistentCalendar() {
|
||||
|
||||
/* Create invalid calendar */
|
||||
|
|
@ -538,6 +551,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithCostAssignments() {
|
||||
|
||||
/* Create a CostCategory. */
|
||||
|
|
@ -600,6 +614,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourcesWithCostAssignmentWithMissingCostCategoryName() {
|
||||
|
||||
/* Create a resource DTO. */
|
||||
|
|
@ -616,6 +631,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourcesWithCostAssignmentWithNonExistentCostCategory() {
|
||||
|
||||
/* Create a resource DTO. */
|
||||
|
|
@ -632,6 +648,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithCostAssignmentWithoutStartDate() {
|
||||
|
||||
/* Create a CostCategory. */
|
||||
|
|
@ -652,6 +669,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourceWithCostAssignmentWithNegativeInterval() {
|
||||
|
||||
/* Create a CostCategory. */
|
||||
|
|
@ -671,6 +689,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddResourcesWithOverlappingInCostAssignments() {
|
||||
|
||||
/* Create a CostCategory. */
|
||||
|
|
@ -732,6 +751,7 @@ constraintViolations
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testUpdateResources() throws InstanceNotFoundException {
|
||||
|
||||
CriterionType ctMachine = createCriterionType(ResourceEnum.MACHINE);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class CriterionServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -74,6 +73,7 @@ public class CriterionServiceTest {
|
|||
private ICriterionTypeDAO criterionTypeDAO;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddCriterionWithSameCodeDistinctTypes() {
|
||||
|
||||
/* Build criterion type "ct1" (5 constraint violations). */
|
||||
|
|
@ -100,6 +100,7 @@ public class CriterionServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddAndGetCriterionTypes() {
|
||||
|
||||
/* Build criterion type "ct1" (5 constraint violations). */
|
||||
|
|
@ -241,6 +242,7 @@ public class CriterionServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testUpdateCriterionType() throws InstanceNotFoundException {
|
||||
|
||||
/* Build criterion type with criteria: c1, c2->c2-1. */
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_FILE,
|
||||
WEBAPP_SPRING_CONFIG_TEST_FILE, WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class ReportAdvancesServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -193,6 +192,7 @@ public class ReportAdvancesServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validAdvancesReport() {
|
||||
Order order = givenOrder();
|
||||
String orderElementCode = order.getChildren().get(0).getCode();
|
||||
|
|
@ -225,6 +225,7 @@ public class ReportAdvancesServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validAdvancesReportToSubcontratedOrderElement() {
|
||||
final OrderLine orderLine = createOrderLine();
|
||||
final ExternalCompany externalCompany = getSubcontractorExternalCompanySaved();
|
||||
|
|
@ -287,6 +288,7 @@ public class ReportAdvancesServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validEndDateReportToSubcontratedOrderElement() {
|
||||
final OrderLine orderLine = createOrderLine();
|
||||
final ExternalCompany externalCompany = getSubcontractorExternalCompanySaved();
|
||||
|
|
@ -358,6 +360,7 @@ public class ReportAdvancesServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validAdvancesAndEndDateReportToSubcontratedOrderElement() {
|
||||
final OrderLine orderLine = createOrderLine();
|
||||
final ExternalCompany externalCompany = getSubcontractorExternalCompanySaved();
|
||||
|
|
@ -441,6 +444,7 @@ public class ReportAdvancesServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validAdvancesReportWithSeveralDates() {
|
||||
Order order = givenOrder();
|
||||
final Long idOrder = order.getId();
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class SubcontractServiceTest {
|
||||
|
||||
@Resource
|
||||
|
|
@ -128,6 +127,7 @@ public class SubcontractServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback(false)
|
||||
public void testNotRollback() {
|
||||
// Just to do not make rollback in order to have the default
|
||||
|
|
@ -136,6 +136,7 @@ public class SubcontractServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void invalidSubcontractedTaskDataWithoutExternalCompanyNif() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -154,6 +155,7 @@ public class SubcontractServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void invalidSubcontractedTaskDataWithoutOrderElement() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
@ -171,6 +173,7 @@ public class SubcontractServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void validSubcontractedTaskData() {
|
||||
int previous = orderDAO.getOrders().size();
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ import org.libreplan.ws.typeofworkhours.api.ITypeOfWorkHoursService;
|
|||
import org.libreplan.ws.typeofworkhours.api.TypeOfWorkHoursDTO;
|
||||
import org.libreplan.ws.typeofworkhours.api.TypeOfWorkHoursListDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -64,7 +63,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class TypeOfWorkHoursServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -103,6 +101,7 @@ public class TypeOfWorkHoursServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddAndGetTypeOfWorkHours() {
|
||||
|
||||
// Missing TypeOfWorkHours name.
|
||||
|
|
@ -132,7 +131,6 @@ public class TypeOfWorkHoursServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testUpdateTypeOfWorkHours() throws InstanceNotFoundException {
|
||||
|
||||
// First one it creates valid type of work hours
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ import org.libreplan.ws.unittypes.api.IUnitTypeService;
|
|||
import org.libreplan.ws.unittypes.api.UnitTypeDTO;
|
||||
import org.libreplan.ws.unittypes.api.UnitTypeListDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -61,7 +60,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class UnitTypeServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -88,6 +86,7 @@ public class UnitTypeServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void testAddUnitTypeRepeatedMeasure() {
|
||||
loadRequiredaData();
|
||||
|
||||
|
|
@ -111,7 +110,6 @@ public class UnitTypeServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void testAddAndUpdateMaterialCategory() {
|
||||
transactionService.runOnTransaction(new IOnTransaction<Void>() {
|
||||
@Override
|
||||
|
|
@ -201,4 +199,4 @@ public class UnitTypeServiceTest {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ import org.libreplan.ws.workreports.api.WorkReportDTO;
|
|||
import org.libreplan.ws.workreports.api.WorkReportLineDTO;
|
||||
import org.libreplan.ws.workreports.api.WorkReportListDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.transaction.BeforeTransaction;
|
||||
|
|
@ -99,7 +98,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_FILE,
|
||||
WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
|
||||
@Transactional
|
||||
public class WorkReportServiceTest {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -490,7 +488,6 @@ public class WorkReportServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void importValidWorkReport() {
|
||||
int previous = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -545,6 +542,7 @@ public class WorkReportServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void importInvalidWorkReportWithoutDateAtWorkReportLevel() {
|
||||
int previous = workReportDAO.getAll().size();
|
||||
|
||||
|
|
@ -561,6 +559,7 @@ public class WorkReportServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void importValidWorkReportWithDateAtWorkReportLevel() {
|
||||
int previous = workReportDAO.getAll().size();
|
||||
|
||||
|
|
@ -609,6 +608,7 @@ public class WorkReportServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void importInvalidWorkReportCalculatedHours() {
|
||||
int previous = workReportDAO.getAll().size();
|
||||
|
||||
|
|
@ -625,7 +625,6 @@ public class WorkReportServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void importValidWorkReportCalculatedHours() {
|
||||
int previous = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -681,7 +680,6 @@ public class WorkReportServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotTransactional
|
||||
public void importAndUpdateValidWorkReport() {
|
||||
int previous = transactionService
|
||||
.runOnTransaction(new IOnTransaction<Integer>() {
|
||||
|
|
@ -736,4 +734,4 @@ public class WorkReportServiceTest {
|
|||
.size(), equalTo(0));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue