Skip to content

Commit

Permalink
Creating publish and subscribe test
Browse files Browse the repository at this point in the history
  • Loading branch information
agosh01 committed Jul 24, 2024
1 parent 3b7226d commit e7bf0f4
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test_agent/cpp/src/TestAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ TestAgent::TestAgent(const std::string transportType, const std::string uEName)
return this->handleRpcServerCommand(doc);
})},

// Handle the "publisher" action
{string(Constants::PUBLISHER_COMMAND),
std::function<UStatus(Document&)>([this](Document& doc) {
return this->handlePublisherCommand(doc);
})},

// Handle the "removehandle" action
{string(Constants::REMOVE_HANDLE_COMMAND),
std::function<UStatus(Document&)>([this](Document& doc) {
Expand All @@ -82,7 +76,13 @@ TestAgent::TestAgent(const std::string transportType, const std::string uEName)
return this->handleNotificationSinkCommand(doc);
})},

// Handle the "deserializeUri" action
// Handle the "publisher" action
{string(Constants::PUBLISHER_COMMAND),
std::function<UStatus(Document&)>([this](Document& doc) {
return this->handlePublisherCommand(doc);
})},

// Handle the "subscriber" action
{string(Constants::SUBSCRIBER_COMMAND),
std::function<UStatus(Document&)>([this](Document& doc) {
return this->handleSubscriberCommand(doc);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# -------------------------------------------------------------------------
#
# SPDX-FileCopyrightText: Copyright (c) 2024 Contributors to
# the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: *www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: Apache-2.0
#
# -------------------------------------------------------------------------

Feature: Testing Publish and Subscribe Functionality

Scenario Outline: To test the rpc server and client apis
Given "uE1" creates data for "subscriber"
And sets "authority_name" to "me_authority"
And sets "ue_id" to "65538"
And sets "ue_version_major" to "1"
And sets "resource_id" to "32770"

And sends "subscriber" request
Then the status received with "code" is "OK"

When "uE2" creates data for "publisher"
And sets "attributes.source.authority_name" to "me_authority"
And sets "attributes.source.ue_id" to "65538"
And sets "attributes.source.ue_version_major" to "1"
And sets "attributes.source.resource_id" to "32770"
And sets "attributes.payload_format" to "UPAYLOAD_FORMAT_PROTOBUF_WRAPPED_IN_ANY"
And sets "payload" to b".type.googleapis.com/google.protobuf.Int32Value\x12\x02\x08\x03"
And sends "publisher" request

Then the status received with "code" is "OK"
And "uE1" sends onreceive message with field "payload" as b"type.googleapis.com/google.protobuf.Int32Value\x12\x02\x08\x03"

Examples:
| ignore | ignore |
| ignore | ignore |

0 comments on commit e7bf0f4

Please sign in to comment.