Code Review
/
ric-plt
/
submgr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Added E2AP interface wrapper for UT
[ric-plt/submgr.git]
/
pkg
/
control
/
transaction.go
diff --git
a/pkg/control/transaction.go
b/pkg/control/transaction.go
index
1298925
..
efb630c
100644
(file)
--- a/
pkg/control/transaction.go
+++ b/
pkg/control/transaction.go
@@
-20,12
+20,12
@@
package control
import (
package control
import (
- "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
- "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/xapptweaks"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
"strconv"
"sync"
"time"
"strconv"
"sync"
"time"
+
+ "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
)
//-----------------------------------------------------------------------------
)
//-----------------------------------------------------------------------------
@@
-53,7
+53,11
@@
type Transaction struct {
}
func (t *Transaction) String() string {
}
func (t *Transaction) String() string {
- return "trans(" + strconv.FormatUint(uint64(t.Seq), 10) + "/" + (&xapptweaks.RMRMeid{t.Meid}).String() + ")"
+ meidstr := "N/A"
+ if t.Meid != nil {
+ meidstr = t.Meid.String()
+ }
+ return "trans(" + strconv.FormatUint(uint64(t.Seq), 10) + "/" + meidstr + ")"
}
func (t *Transaction) SendEvent(event interface{}, waittime time.Duration) (bool, bool) {
}
func (t *Transaction) SendEvent(event interface{}, waittime time.Duration) (bool, bool) {
@@
-98,12
+102,13
@@
func (t *Transaction) GetMeid() *xapp.RMRMeid {
return nil
}
return nil
}
+/* // This function is not used. Commented out to get better test coverage result
func (t *Transaction) GetPayload() *e2ap.PackedData {
t.mutex.Lock()
defer t.mutex.Unlock()
return t.Payload
}
func (t *Transaction) GetPayload() *e2ap.PackedData {
t.mutex.Lock()
defer t.mutex.Unlock()
return t.Payload
}
-
+*/
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
@@
-126,7
+131,7
@@
func (t *TransactionSubs) Release() {
//
//-----------------------------------------------------------------------------
type TransactionXappKey struct {
//
//-----------------------------------------------------------------------------
type TransactionXappKey struct {
- RmrEndpoint
+
xapp.
RmrEndpoint
Xid string // xapp xid in req
}
Xid string // xapp xid in req
}
@@
-139,8
+144,8
@@
func (key *TransactionXappKey) String() string {
//-----------------------------------------------------------------------------
type TransactionXapp struct {
Transaction
//-----------------------------------------------------------------------------
type TransactionXapp struct {
Transaction
- XappKey *TransactionXappKey
- SubId uint32
+ XappKey
*TransactionXappKey
+ RequestId e2ap.RequestId
}
func (t *TransactionXapp) String() string {
}
func (t *TransactionXapp) String() string {
@@
-148,10
+153,10
@@
func (t *TransactionXapp) String() string {
if t.XappKey != nil {
transkey = t.XappKey.String()
}
if t.XappKey != nil {
transkey = t.XappKey.String()
}
- return "transxapp(" + t.Transaction.String() + "/" + transkey + "/" + strconv.FormatUint(uint64(t.
Sub
Id), 10) + ")"
+ return "transxapp(" + t.Transaction.String() + "/" + transkey + "/" + strconv.FormatUint(uint64(t.
RequestId.Instance
Id), 10) + ")"
}
}
-func (t *TransactionXapp) GetEndpoint() *RmrEndpoint {
+func (t *TransactionXapp) GetEndpoint() *
xapp.
RmrEndpoint {
t.mutex.Lock()
defer t.mutex.Unlock()
if t.XappKey != nil {
t.mutex.Lock()
defer t.mutex.Unlock()
if t.XappKey != nil {
@@
-169,6
+174,7
@@
func (t *TransactionXapp) GetXid() string {
return ""
}
return ""
}
+/* // This function is not used. Commented out to get better test coverage result
func (t *TransactionXapp) GetSrc() string {
t.mutex.Lock()
defer t.mutex.Unlock()
func (t *TransactionXapp) GetSrc() string {
t.mutex.Lock()
defer t.mutex.Unlock()
@@
-177,11
+183,11
@@
func (t *TransactionXapp) GetSrc() string {
}
return ""
}
}
return ""
}
-
+*/
func (t *TransactionXapp) GetSubId() uint32 {
t.mutex.Lock()
defer t.mutex.Unlock()
func (t *TransactionXapp) GetSubId() uint32 {
t.mutex.Lock()
defer t.mutex.Unlock()
- return t.
Sub
Id
+ return t.
RequestId.Instance
Id
}
func (t *TransactionXapp) Release() {
}
func (t *TransactionXapp) Release() {