(t *testing.T)
| 54 | } |
| 55 | |
| 56 | func TestRuntimeInfo(t *testing.T) { |
| 57 | rtParams := &NewRuntimeParameters{ |
| 58 | RuntimeID: "aa", |
| 59 | ConcurrentMode: false, |
| 60 | StreamMode: false, |
| 61 | WaitRuntimeAliveTimeout: 3, |
| 62 | Resource: &api.Resource{}, |
| 63 | } |
| 64 | rtInfo := NewRuntimeInfo(rtParams) |
| 65 | if rtInfo.RuntimeID != "aa" || rtInfo.State != RuntimeStateClosed { |
| 66 | t.Errorf("runtime mismatch id = %s, status = %s", rtInfo.RuntimeID, rtInfo.State) |
| 67 | } |
| 68 | rtInfo.SetInitTime(1, 2) |
| 69 | rtInfo.SetLoadTime(3, 4) |
| 70 | if rtInfo.PreInitTimeMS != 1 || |
| 71 | rtInfo.PostInitTimeMS != 2 || |
| 72 | rtInfo.PreLoadTimeMS != 3 || |
| 73 | rtInfo.PostLoadTimeMS != 4 { |
| 74 | t.Errorf("runtime time mismatch. init[%d-%d], load[%d-%d]", |
| 75 | rtInfo.PreInitTimeMS, rtInfo.PostInitTimeMS, |
| 76 | rtInfo.PreLoadTimeMS, rtInfo.PostLoadTimeMS) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | func TestHandleRuntimeInit(t *testing.T) { |
| 81 | rtParams := &NewRuntimeParameters{ |
nothing calls this directly
no test coverage detected