TASKPM/scripts/rest-clients/resources-sample.xml
Fernando Bellas Permuy f04de2d768 ItEr43S08CUImportacionRecursosProductivosItEr42S12: Added support for detecting overlapping in criterion satisfactions when importing resources.
Please note that criterion satisfaction overlapping means: (1) if criterion satisfactions refer to the same Criterion, they must not overlap (regardless of its CriterionType allows simultaneous criterion satisfactions per resource), and (2) if CriterionType does not allow simultaneous criterion satisfactions per resource, criterion satisfactions (of the same type) must not overlap (regardless of they refer to different Criterion objects).
2010-01-15 11:25:06 +01:00

252 lines
9.9 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>
<!-- Negative interval. -->
<worker first-name="w10-firstName" surname="w10-surname" nif="w10-nif">
<criterion-satisfaction-list>
<criterion-satisfaction
criterion-type-name="LEAVE"
criterion-name="paternityLeave"
start-date="2000-02-01"
end-date="2000-01-01"/>
</criterion-satisfaction-list>
</worker>
<!-- Criterion satisfaction overlapping in "LEAVE :: paternityLeave". -->
<worker first-name="w11-firstName" surname="w11-surname" nif="w11-nif">
<criterion-satisfaction-list>
<criterion-satisfaction
criterion-type-name="LEAVE"
criterion-name="paternityLeave"
start-date="2000-01-01"
end-date="2000-02-01"/>
<criterion-satisfaction
criterion-type-name="LEAVE"
criterion-name="paternityLeave"
start-date="2000-01-15"
end-date="2000-02-01"/>
</criterion-satisfaction-list>
</worker>
<!-- Criterion satisfaction overlapping (LEAVE does not allow
simultaneous criterion satisfactions in intervals that overlap). -->
<worker first-name="w12-firstName" surname="w12-surname" nif="w12-nif">
<criterion-satisfaction-list>
<criterion-satisfaction
criterion-type-name="LEAVE"
criterion-name="paternityLeave"
start-date="2000-01-01"
end-date="2000-02-01"/>
<criterion-satisfaction
criterion-type-name="LEAVE"
criterion-name="medicalLeave"
start-date="2000-01-15"
end-date="2000-02-01"/>
</criterion-satisfaction-list>
</worker>
<!-- [It assumes existence of "TestLocationGroupCriterion" and
"TestLocationGroupCriterion2"] OK
(LOCATION_GROUP allows simultaneous criterion satisfactions in
intervals that overlap). -->
<worker first-name="w13-firstName" surname="w13-surname" nif="w13-nif">
<criterion-satisfaction-list>
<criterion-satisfaction
criterion-type-name="LOCATION_GROUP"
criterion-name="TestLocationGroupCriterion"
start-date="2000-01-01"
end-date="2000-02-01"/>
<criterion-satisfaction
criterion-type-name="LOCATION_GROUP"
criterion-name="TestLocationGroupCriterion2"
start-date="2000-01-15"
end-date="2000-02-01"/>
</criterion-satisfaction-list>
</worker>
</resource-list>