Code Review
/
ric-plt
/
xapp-frame.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Added new implementation for the following feature requests:
[ric-plt/xapp-frame.git]
/
pkg
/
xapp
/
xapp_test.go
diff --git
a/pkg/xapp/xapp_test.go
b/pkg/xapp/xapp_test.go
index
06345af
..
65c6b98
100755
(executable)
--- a/
pkg/xapp/xapp_test.go
+++ b/
pkg/xapp/xapp_test.go
@@
-32,8
+32,9
@@
import (
type Consumer struct {
}
type Consumer struct {
}
-func (m Consumer) Consume(mtype, sid, len int, payload []byte) (err error) {
- Sdl.Store("myKey", payload)
+func (m Consumer) Consume(params *RMRParams) (err error) {
+ //Logger.Info("Message received - type=%d subId=%d meid=%v xid=%s src=%s", params.Mtype, params.SubId, params.Meid, params.Xid, params.Src)
+ Sdl.Store("myKey", params.Payload)
return nil
}
return nil
}
@@
-100,7
+101,13
@@
func TestInjectQueryFailures(t *testing.T) {
func TestMessagesReceivedSuccessfully(t *testing.T) {
for i := 0; i < 100; i++ {
func TestMessagesReceivedSuccessfully(t *testing.T) {
for i := 0; i < 100; i++ {
- Rmr.Send(10004, 1111, 100, []byte{1, 2, 3, 4, 5, 6})
+ params := &RMRParams{}
+ params.Mtype = 10004
+ params.SubId = -1
+ params.Payload = []byte{1, 2, 3, 4, 5, 6}
+ params.Meid = &RMRMeid{PlmnID: "1234", EnbID: "7788"}
+ params.Xid = "TestXID"
+ Rmr.SendMsg(params)
}
// Allow time to process the messages
}
// Allow time to process the messages
@@
-132,16
+139,6
@@
func TestMessagesReceivedSuccessfully(t *testing.T) {
}
}
}
}
-func TestGetgNBList(t *testing.T) {
- Rnib.Store("Kiikale", "Hello")
- Rnib.Store("mykey", "myval")
-
- v, _ := Rnib.GetgNBList()
- if v["Kiikale"] != "Hello" || v["mykey"] != "myval" {
- t.Errorf("Error: GetgNBList failed!")
- }
-}
-
func TestSubscribeChannels(t *testing.T) {
var NotificationCb = func(ch string, events ...string) {
if ch != "channel1" {
func TestSubscribeChannels(t *testing.T) {
var NotificationCb = func(ch string, events ...string) {
if ch != "channel1" {
@@
-166,7
+163,7
@@
func TestGetRicMessageSuccess(t *testing.T) {
}
name := Rmr.GetRicMessageName(12010)
}
name := Rmr.GetRicMessageName(12010)
- if name !=
"RIC_SUB_REQ" {
+ if name != "RIC_SUB_REQ" {
t.Errorf("Error: GetRicMessageName failed: name=%s", name)
}
}
t.Errorf("Error: GetRicMessageName failed: name=%s", name)
}
}
@@
-178,14
+175,13
@@
func TestGetRicMessageFails(t *testing.T) {
}
name := Rmr.GetRicMessageName(123456)
}
name := Rmr.GetRicMessageName(123456)
- if name !=
"" {
+ if name != "" {
t.Errorf("Error: GetRicMessageName returned invalid value: name=%s", name)
}
}
func TestTeardown(t *testing.T) {
Sdl.Clear()
t.Errorf("Error: GetRicMessageName returned invalid value: name=%s", name)
}
}
func TestTeardown(t *testing.T) {
Sdl.Clear()
- Rnib.Clear()
}
// Helper functions
}
// Helper functions
@@
-209,4
+205,4
@@
func getMetrics(t *testing.T) string {
response := executeRequest(req)
return response.Body.String()
response := executeRequest(req)
return response.Body.String()
-}
\ No newline at end of file
+}