Skip to content

Commit

Permalink
!fixup test xml
Browse files Browse the repository at this point in the history
  • Loading branch information
ozdoganoguzhan committed Sep 28, 2023
1 parent 7d4df2e commit 1b5efbd
Showing 1 changed file with 95 additions and 51 deletions.
146 changes: 95 additions & 51 deletions schema/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,42 +627,64 @@ async fn operation_pull_messages() {

let transport = FakeTransport {
response: r#"
<tev:PullMessagesResponse>
<tev:CurrentTime>
2023-09-26T07:55:11Z
</tev:CurrentTime>
<tev:TerminationTime>
2023-09-26T07:56:05Z
</tev:TerminationTime>
<wsnt:NotificationMessage>
<wsnt:Topic
Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">
tns1:RuleEngine/CellMotionDetector/Motion
</wsnt:Topic>
<wsnt:Message>
<tt:Message
UtcTime="2023-09-26T07:55:05Z"
PropertyOperation="Initialized">
<tt:Source>
<tt:SimpleItem
Name="VideoSourceConfigurationToken"
Value="00000"/>
<tt:SimpleItem
Name="VideoAnalyticsConfigurationToken"
Value="00000"/>
<tt:SimpleItem
Name="Rule"
Value="00000"/>
</tt:Source>
<tt:Data>
<tt:SimpleItem
Name="IsMotion"
Value="true"/>
</tt:Data>
</tt:Message>
</wsnt:Message>
</wsnt:NotificationMessage>
</tev:PullMessagesResponse>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<s:Envelope
xmlns:sc="http://www.w3.org/2003/05/soap-encoding"
xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:tt="http://www.onvif.org/ver10/schema"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
xmlns:tev="http://www.onvif.org/ver10/events/wsdl"
xmlns:wsa5="http://www.w3.org/2005/08/addressing"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wstop="http://docs.oasis-open.org/wsn/t-1"
xmlns:tns1="http://www.onvif.org/ver10/topics">
<s:Header>
<wsa5:Action>
http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse
</wsa5:Action>
<wsa5:To>
http://192.168.88.108/onvif/Subscription?Idx=5
</wsa5:To>
</s:Header>
<s:Body>
<tev:PullMessagesResponse>
<tev:CurrentTime>
2023-09-28T16:01:15Z
</tev:CurrentTime>
<tev:TerminationTime>
2023-09-28T16:11:15Z
</tev:TerminationTime>
<wsnt:NotificationMessage>
<wsnt:Topic
Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">
tns1:RuleEngine/CellMotionDetector/Motion
</wsnt:Topic>
<wsnt:Message>
<tt:Message
UtcTime="2023-09-28T16:01:15Z"
PropertyOperation="Initialized">
<tt:Source>
<tt:SimpleItem
Name="VideoSourceConfigurationToken"
Value="00000"/>
<tt:SimpleItem
Name="VideoAnalyticsConfigurationToken"
Value="00000"/>
<tt:SimpleItem
Name="Rule"
Value="00000"/>
</tt:Source>
<tt:Data>
<tt:SimpleItem
Name="IsMotion"
Value="false"/>
</tt:Data>
</tt:Message>
</wsnt:Message>
</wsnt:NotificationMessage>
</tev:PullMessagesResponse>
</s:Body>
</s:Envelope>
"#
.into(),
};
Expand All @@ -683,7 +705,7 @@ async fn operation_pull_messages() {
);
assert_eq!(
resp.notification_message[0].message.msg.data.simple_item[0].value,
"true"
"false"
);
}

Expand All @@ -693,19 +715,41 @@ async fn operation_create_pullpoint_subscription() {

let transport = FakeTransport {
response: r#"
<tev:CreatePullPointSubscriptionResponse>
<tev:SubscriptionReference>
<wsa5:Address>
http://192.168.88.108/onvif/Subscription?Idx=162
</wsa5:Address>
</tev:SubscriptionReference>
<wsnt:CurrentTime>
2023-09-26T07:55:05Z
</wsnt:CurrentTime>
<wsnt:TerminationTime>
2023-09-26T07:56:05Z
</wsnt:TerminationTime>
</tev:CreatePullPointSubscriptionResponse>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<s:Envelope
xmlns:sc="http://www.w3.org/2003/05/soap-encoding"
xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:tt="http://www.onvif.org/ver10/schema"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
xmlns:tev="http://www.onvif.org/ver10/events/wsdl"
xmlns:wsa5="http://www.w3.org/2005/08/addressing"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wstop="http://docs.oasis-open.org/wsn/t-1"
xmlns:tns1="http://www.onvif.org/ver10/topics">
<s:Header>
<wsa5:Action>
http://www.onvif.org/ver10/events/wsdl/EventPortType/CreatePullPointSubscriptionResponse
</wsa5:Action>
<wsa5:To>
http://192.168.88.108/onvif/event_service
</wsa5:To>
</s:Header>
<s:Body>
<tev:CreatePullPointSubscriptionResponse>
<tev:SubscriptionReference>
<wsa5:Address>
http://192.168.88.108/onvif/Subscription?Idx=5
</wsa5:Address>
</tev:SubscriptionReference>
<wsnt:CurrentTime>
2023-09-28T16:01:15Z
</wsnt:CurrentTime>
<wsnt:TerminationTime>
2023-09-28T16:11:15Z
</wsnt:TerminationTime>
</tev:CreatePullPointSubscriptionResponse>
</s:Body>
</s:Envelope>
"#
.into(),
};
Expand All @@ -716,6 +760,6 @@ async fn operation_create_pullpoint_subscription() {

assert_eq!(
resp.subscription_reference.address,
"http://192.168.88.108/onvif/Subscription?Idx=162"
"http://192.168.88.108/onvif/Subscription?Idx=5"
);
}

0 comments on commit 1b5efbd

Please sign in to comment.