Skip to content

Commit

Permalink
Add modifiedBy to MaintenanceEvent to improve data validation
Browse files Browse the repository at this point in the history
  • Loading branch information
pnguyen committed Nov 21, 2009
1 parent de4e5d6 commit 4440ed8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion hqu/hqapi1/app/MaintenanceController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class MaintenanceController extends ApiController {
MaintenanceEvent(state: m.state,
groupId: m.groupId,
startTime: m.startTime,
endTime: m.endTime) {
endTime: m.endTime,
modifiedBy: m.modifiedBy) {
State(m.state)
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/org/hyperic/hq/hqapi1/test/MaintenanceTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ Group createGroup(List<Resource> resources) throws Exception {
void valididateMaintenanceEvent(MaintenanceEvent e, Group g, long start, long end) {
assertEquals(e.getGroupId(), g.getId().intValue());
assertEquals(e.getStartTime(), start);
assertEquals(e.getEndTime(), end);
assertEquals(e.getEndTime(), end);
assertNotNull(e.getModifiedBy());
assertTrue(e.getModifiedBy().trim().length() > 0);
}
}
3 changes: 2 additions & 1 deletion xsd/HQApi1.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,8 @@
</xs:sequence>
<xs:attribute name="endTime" type="xs:long" use="required"/>
<xs:attribute name="startTime" type="xs:long" use="required"/>
<xs:attribute name="groupId" type="xs:int" use="required"/>
<xs:attribute name="groupId" type="xs:int" use="required"/>
<xs:attribute name="modifiedBy" type="xs:string" use="optional" />
</xs:complexType>

<!-- Maintenance response objects -->
Expand Down

0 comments on commit 4440ed8

Please sign in to comment.