Support for importing resources with cost assignments has been implemented. Many test cases have been implemented for checking all constraint violations in cost assigments (special care has been taken to check time interval overlappings). toString method has been implemented in constraint violation related DTOs to facilitate debuging in testing.
189 lines
7.3 KiB
XML
189 lines
7.3 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
|
|
<!--
|
|
See org.navalplanner.web.test.ws.resources.api.ResourceServiceTest for a
|
|
complete list of test cases.
|
|
-->
|
|
|
|
<resource-list xmlns="http://rest.ws.navalplanner.org">
|
|
|
|
<!-- *** Machines *** -->
|
|
|
|
<!-- OK -->
|
|
<machine code="m1" name="m1-name" description="m1-desc"/>
|
|
|
|
<!-- Missing code and name (description is optional). -->
|
|
<machine code="" description=""/>
|
|
|
|
<!-- Criterion satisfaction of incorrect type. -->
|
|
<machine code="m2" name="m2-name" description="m2-desc">
|
|
<criterion-satisfaction-list>
|
|
<criterion-satisfaction
|
|
criterion-type-name="WORK_RELATIONSHIP"
|
|
criterion-name="hiredResourceWorkingRelationship"
|
|
start-date="2009-01-01"
|
|
end-date=""/>
|
|
</criterion-satisfaction-list>
|
|
</machine>
|
|
|
|
<!-- Another machine is being imported with the same code. -->
|
|
<machine code="m1" name="m3-name" description="m3-desc"/>
|
|
|
|
<!-- OK or not OK depending on the existence of "TestCalendar". -->
|
|
<machine code="m4" name="m4-name" description="m4-desc"
|
|
calendar-name="TestCalendar"/>
|
|
|
|
<!-- [It assumes existence of "TestCostCategory"] OK. -->
|
|
<machine code="m5" name="m5-name" description="m5-desc">
|
|
<resources-cost-category-assignment-list>
|
|
<resources-cost-category-assignment
|
|
cost-category-name="TestCostCategory"
|
|
start-date="2001-01-01"/>
|
|
<resources-cost-category-assignment
|
|
cost-category-name="TestCostCategory"
|
|
start-date="2000-01-01"
|
|
end-date="2000-04-01"/>
|
|
</resources-cost-category-assignment-list>
|
|
</machine>
|
|
|
|
<!-- [It assumes existence of "TestCostCategory"] Missing start date. -->
|
|
<machine code="m6" name="m6-name" description="m6-desc">
|
|
<resources-cost-category-assignment-list>
|
|
<resources-cost-category-assignment
|
|
cost-category-name="TestCostCategory"
|
|
end-date="2000-01-01"/>
|
|
</resources-cost-category-assignment-list>
|
|
</machine>
|
|
|
|
<!-- [It assumes existence of "TestCostCategory"] Negative interval. -->
|
|
<machine code="m7" name="m7-name" description="m7-desc">
|
|
<resources-cost-category-assignment-list>
|
|
<resources-cost-category-assignment
|
|
cost-category-name="TestCostCategory"
|
|
start-date="2000-02-01"
|
|
end-date="2000-01-01"/>
|
|
</resources-cost-category-assignment-list>
|
|
</machine>
|
|
|
|
<!-- [It assumes existence of "TestCostCategory"] Overlapping intervals. -->
|
|
<machine code="m8" name="m8-name" description="m8-desc">
|
|
<resources-cost-category-assignment-list>
|
|
<resources-cost-category-assignment
|
|
cost-category-name="TestCostCategory"
|
|
start-date="2000-02-01"
|
|
end-date="2000-05-01"/>
|
|
<resources-cost-category-assignment
|
|
cost-category-name="TestCostCategory"
|
|
start-date="2000-01-01"
|
|
end-date="2000-03-01"/>
|
|
</resources-cost-category-assignment-list>
|
|
</machine>
|
|
|
|
<!-- *** Workers *** -->
|
|
|
|
<!-- OK -->
|
|
<worker first-name="w1-firstName" surname="w1-surname" nif="w1-nif">
|
|
<criterion-satisfaction-list>
|
|
<criterion-satisfaction
|
|
criterion-type-name="WORK_RELATIONSHIP"
|
|
criterion-name="hiredResourceWorkingRelationship"
|
|
start-date="2009-01-01"
|
|
end-date=""/>
|
|
<criterion-satisfaction
|
|
criterion-type-name="LEAVE"
|
|
criterion-name="paternityLeave"
|
|
start-date="2009-12-24"
|
|
end-date="2009-12-25"/>
|
|
</criterion-satisfaction-list>
|
|
</worker>
|
|
|
|
<!-- Missing first name, surname, and nif. -->
|
|
<worker first-name="" nif=""/>
|
|
|
|
<!-- Missing start date in criterion satisfaction. -->
|
|
<worker first-name="w2-firstName" surname="w2-surname" nif="w2-nif">
|
|
<criterion-satisfaction-list>
|
|
<criterion-satisfaction
|
|
criterion-type-name="LEAVE"
|
|
criterion-name="paternityLeave"
|
|
end-date="2009-12-25"/>
|
|
</criterion-satisfaction-list>
|
|
</worker>
|
|
|
|
<!-- Non-existent criterion type. -->
|
|
<worker first-name="w3-firstName" surname="w3-surname" nif="w3-nif">
|
|
<criterion-satisfaction-list>
|
|
<criterion-satisfaction
|
|
criterion-type-name="WORK_RELATIONSHIP_XXX"
|
|
criterion-name="hiredResourceWorkingRelationship"
|
|
start-date="2009-01-01"
|
|
end-date=""/>
|
|
</criterion-satisfaction-list>
|
|
</worker>
|
|
|
|
<!-- Non-existent criterion. -->
|
|
<worker first-name="w4-firstName" surname="w4-surname" nif="w4-nif">
|
|
<criterion-satisfaction-list>
|
|
<criterion-satisfaction
|
|
criterion-type-name="WORK_RELATIONSHIP"
|
|
criterion-name="hiredResourceWorkingRelationshipXXX"
|
|
start-date="2009-01-01"
|
|
end-date=""/>
|
|
</criterion-satisfaction-list>
|
|
</worker>
|
|
|
|
<!-- Criterion not specified. -->
|
|
<worker first-name="w5-firstName" surname="w5-surname" nif="w5-nif">
|
|
<criterion-satisfaction-list>
|
|
<criterion-satisfaction
|
|
criterion-type-name="WORK_RELATIONSHIP"
|
|
start-date="2009-01-01"
|
|
end-date=""/>
|
|
</criterion-satisfaction-list>
|
|
</worker>
|
|
|
|
<!-- Criterion type not specified. -->
|
|
<worker first-name="w6-firstName" surname="w6-surname" nif="w6-nif">
|
|
<criterion-satisfaction-list>
|
|
<criterion-satisfaction
|
|
criterion-name="hiredResourceWorkingRelationship"
|
|
start-date="2009-01-01"
|
|
end-date=""/>
|
|
</criterion-satisfaction-list>
|
|
</worker>
|
|
|
|
<!-- Another worker is being imported with the same first name, surname,
|
|
and nif. -->
|
|
<worker first-name="w1-firstName" surname="w1-surname" nif="w1-nif"/>
|
|
|
|
<!-- OK or not OK depending on the existence of "TestCalendar". -->
|
|
<worker first-name="w8-firstName" surname="w8-surname" nif="w8-nif"
|
|
calendar-name="TestCalendar" />
|
|
|
|
<!-- [It assumes existence of "TestCalendar" and "TestCostCategory"] OK -->
|
|
<worker first-name="w9-firstName" surname="w9-surname" nif="w9-nif"
|
|
calendar-name="TestCalendar">
|
|
<criterion-satisfaction-list>
|
|
<criterion-satisfaction
|
|
criterion-type-name="WORK_RELATIONSHIP"
|
|
criterion-name="hiredResourceWorkingRelationship"
|
|
start-date="2009-01-01"
|
|
end-date=""/>
|
|
<criterion-satisfaction
|
|
criterion-type-name="LEAVE"
|
|
criterion-name="paternityLeave"
|
|
start-date="2009-12-24"
|
|
end-date="2009-12-25"/>
|
|
</criterion-satisfaction-list>
|
|
<resources-cost-category-assignment-list>
|
|
<resources-cost-category-assignment
|
|
cost-category-name="TestCostCategory"
|
|
start-date="2001-01-01"/>
|
|
<resources-cost-category-assignment
|
|
cost-category-name="TestCostCategory"
|
|
start-date="2000-01-01"
|
|
end-date="2000-04-01"/>
|
|
</resources-cost-category-assignment-list>
|
|
</worker>
|
|
|
|
</resource-list>
|