From: 이동엽/Service Innovation Lab(SR)/Engineer/삼성전자 Date: Fri, 29 Mar 2019 00:33:00 +0000 (+0900) Subject: Merge pull request #21 from RS7-EdgeComputing/EDGE-254 X-Git-Tag: submit/tizen/20190409.085658~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6bb8ce28ef602f1afcdbbb7ebd92ea76c3ae7b67;p=platform%2Fcore%2Fsystem%2Fedge-orchestration.git Merge pull request #21 from RS7-EdgeComputing/EDGE-254 Add servicemgr interface --- 6bb8ce28ef602f1afcdbbb7ebd92ea76c3ae7b67 diff --cc src/restapi/v1/restapi_test.go index 595fc25,a3d12ab..021e65d --- a/src/restapi/v1/restapi_test.go +++ b/src/restapi/v1/restapi_test.go @@@ -29,10 -26,10 +27,11 @@@ const ConstDeviceResourceUsageNetworkGet = "/api/v1/device/resource/usage/network" // @TODO discovery mgr URI + ConstDiscoverymgrDevices = "/api/v1/discoverymgr/devices" // Service mgr URI - ConstServicemgrServices = "/api/v1/servicemgr/services" + ConstServicemgrServices = "/api/v1/servicemgr/services" + ConstServicemgrServicesNoti = "/api/v1/servicemgr/services/notification/" ConstAppName = "AppName" ConstServiceName = "ls" @@@ -242,54 -218,20 +221,25 @@@ func TestAPIV1DeviceResourceUsageNetwor testGet(t, targetURI, http.StatusOK) } +func TestAPIV1DiscoverymgrDevicesGet(t *testing.T) { + targetURI := ConstDiscoverymgrDevices + testGet(t, targetURI, http.StatusOK) +} + func TestAPIV1ServicemgrServicesPost(t *testing.T) { - registerService(t) + executeService(t) } - func TestAPIV1ServicemgrServicesGet(t *testing.T) { - registerService(t) + func TestAPIV1ServicemgrServicesNotificationServiceIDPost(t *testing.T) { + statusNotificationRequest := make(map[string]interface{}) + statusNotificationRequest["ServiceID"] = 1 + statusNotificationRequest["Status"] = "Failed" - targetURI := ConstServicemgrServices - testGet(t, targetURI, http.StatusOK) - } + snbytes, _ := json.Marshal(statusNotificationRequest) - func TestAPIV1ServicemgrServicesGetByAppName(t *testing.T) { - // @TODO add register service - registerService(t) + targetURI := ConstServicemgrServicesNoti - targetURI := ConstServicemgrServices + "/" + ConstAppName - testGet(t, targetURI, http.StatusOK) - } - - func TestAPIV1ServicemgrServicesGetByServiceID(t *testing.T) { - // @TODO add register service - createResponse := registerService(t) - - targetURI := ConstServicemgrServices + "/" + strconv.FormatUint(createResponse.ServiceList[0].ID, 10) - testGet(t, targetURI, http.StatusOK) - } - - func TestAPIV1ServicemgrServicesServiceIDPost(t *testing.T) { - createResponse := registerService(t) - executeService(t, createResponse.ServiceList[0].ID) - - time.Sleep(time.Second * 2) - } - - func TestAPIV1ServicemgrServicesServiceIDDeleteNotFoundService(t *testing.T) { - // createResponse := registerService(t) - // executeService(t, createResponse.ServiceList[0].ID) - - // time.Sleep(time.Second * 1) - // targetURI := ConstServicemgrServices + "/" + strconv.FormatUint(createResponse.ServiceList[0].ID, 10) - - targetURI := ConstServicemgrServices + "/6" - res, err := DoDelete(testURL + targetURI) + res, err := DoPost(testURL+targetURI+"1", snbytes) if err != nil { t.Log(err.Error()) t.Error()