mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
Add more info about simulators in DB, adapt simulator testing
This commit is contained in:
parent
65cc819874
commit
22e83240e5
2 changed files with 18 additions and 18 deletions
|
@ -103,8 +103,8 @@ func DummyPopulateDB(test_db *gorm.DB) {
|
||||||
|
|
||||||
propertiesA := json.RawMessage(`{"name" : "TestNameA"}`)
|
propertiesA := json.RawMessage(`{"name" : "TestNameA"}`)
|
||||||
propertiesB := json.RawMessage(`{"name" : "TestNameB"}`)
|
propertiesB := json.RawMessage(`{"name" : "TestNameB"}`)
|
||||||
simr_A := Simulator{UUID: "1", Host: "Host_A", State: "running", Properties: postgres.Jsonb{propertiesA}, RawProperties: postgres.Jsonb{json.RawMessage(`{}`)}}
|
simr_A := Simulator{UUID: "4854af30-325f-44a5-ad59-b67b2597de68", Host: "Host_A", State: "running", Modeltype: "ModelTypeA", StateUpdateAt: "placeholder", Properties: postgres.Jsonb{propertiesA}, RawProperties: postgres.Jsonb{propertiesA}}
|
||||||
simr_B := Simulator{UUID: "2", Host: "Host_B", State: "idle", Properties: postgres.Jsonb{propertiesB}, RawProperties: postgres.Jsonb{json.RawMessage(`{}`)}}
|
simr_B := Simulator{UUID: "7be0322d-354e-431e-84bd-ae4c9633138b", Host: "Host_B", State: "idle", Modeltype: "ModelTypeB", StateUpdateAt: "placeholder", Properties: postgres.Jsonb{propertiesB}, RawProperties: postgres.Jsonb{propertiesB}}
|
||||||
checkErr(test_db.Create(&simr_A).Error)
|
checkErr(test_db.Create(&simr_A).Error)
|
||||||
checkErr(test_db.Create(&simr_B).Error)
|
checkErr(test_db.Create(&simr_B).Error)
|
||||||
|
|
||||||
|
|
|
@ -58,50 +58,50 @@ var msgModels = common.ResponseMsgSimulationModels{
|
||||||
|
|
||||||
var simulatorA = common.SimulatorResponse{
|
var simulatorA = common.SimulatorResponse{
|
||||||
ID: 1,
|
ID: 1,
|
||||||
UUID: "1",
|
UUID: "4854af30-325f-44a5-ad59-b67b2597de68",
|
||||||
Host: "Host_A",
|
Host: "Host_A",
|
||||||
ModelType: "",
|
ModelType: "ModelTypeA",
|
||||||
Uptime: 0,
|
Uptime: 0,
|
||||||
State: "running",
|
State: "running",
|
||||||
StateUpdateAt: "",
|
StateUpdateAt: "placeholder",
|
||||||
Properties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameA"}`)},
|
Properties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameA"}`)},
|
||||||
RawProperties: postgres.Jsonb{json.RawMessage(`{}`)},
|
RawProperties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameA"}`)},
|
||||||
}
|
}
|
||||||
|
|
||||||
var simulatorB = common.SimulatorResponse{
|
var simulatorB = common.SimulatorResponse{
|
||||||
ID: 2,
|
ID: 2,
|
||||||
UUID: "2",
|
UUID: "7be0322d-354e-431e-84bd-ae4c9633138b",
|
||||||
Host: "Host_B",
|
Host: "Host_B",
|
||||||
ModelType: "",
|
ModelType: "ModelTypeB",
|
||||||
Uptime: 0,
|
Uptime: 0,
|
||||||
State: "idle",
|
State: "idle",
|
||||||
StateUpdateAt: "",
|
StateUpdateAt: "placeholder",
|
||||||
Properties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameB"}`)},
|
Properties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameB"}`)},
|
||||||
RawProperties: postgres.Jsonb{json.RawMessage(`{}`)},
|
RawProperties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameB"}`)},
|
||||||
}
|
}
|
||||||
|
|
||||||
var simulatorC = common.Simulator{
|
var simulatorC = common.Simulator{
|
||||||
ID: 3,
|
ID: 3,
|
||||||
UUID: "3",
|
UUID: "6d9776bf-b693-45e8-97b6-4c13d151043f",
|
||||||
Host: "Host_C",
|
Host: "Host_C",
|
||||||
Modeltype: "",
|
Modeltype: "ModelTypeC",
|
||||||
Uptime: 0,
|
Uptime: 0,
|
||||||
State: "idle",
|
State: "idle",
|
||||||
StateUpdateAt: "",
|
StateUpdateAt: "placeholder",
|
||||||
Properties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameC"}`)},
|
Properties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameC"}`)},
|
||||||
RawProperties: postgres.Jsonb{json.RawMessage(`{}`)},
|
RawProperties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameC"}`)},
|
||||||
}
|
}
|
||||||
|
|
||||||
var simulatorCupdated = common.Simulator{
|
var simulatorCupdated = common.Simulator{
|
||||||
ID: 3,
|
ID: 3,
|
||||||
UUID: "3",
|
UUID: "6d9776bf-b693-45e8-97b6-4c13d151043f",
|
||||||
Host: "Host_Cupdated",
|
Host: "Host_Cupdated",
|
||||||
Modeltype: "",
|
Modeltype: "ModelTypeCUpdated",
|
||||||
Uptime: 0,
|
Uptime: 0,
|
||||||
State: "running",
|
State: "running",
|
||||||
StateUpdateAt: "",
|
StateUpdateAt: "placeholder",
|
||||||
Properties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameCupdate"}`)},
|
Properties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameCupdate"}`)},
|
||||||
RawProperties: postgres.Jsonb{json.RawMessage(`{}`)},
|
RawProperties: postgres.Jsonb{json.RawMessage(`{"name" : "TestNameCupdate"}`)},
|
||||||
}
|
}
|
||||||
|
|
||||||
var simulatorC_response = common.SimulatorResponse{
|
var simulatorC_response = common.SimulatorResponse{
|
||||||
|
|
Loading…
Add table
Reference in a new issue