Package: CucDevice
CucDevice
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CucDevice() |
|
|
|
|
|
||||||||||||||||||||
getAcceptEncoding() |
|
|
|
|
|
||||||||||||||||||||
getApplicationFrameworkVersion() |
|
|
|
|
|
||||||||||||||||||||
getApplicationIdentifiers() |
|
|
|
|
|
||||||||||||||||||||
getBiosVersion() |
|
|
|
|
|
||||||||||||||||||||
getClientId() |
|
|
|
|
|
||||||||||||||||||||
getConnectionId() |
|
|
|
|
|
||||||||||||||||||||
getDisplayName() |
|
|
|
|
|
||||||||||||||||||||
getFirmwareVersion() |
|
|
|
|
|
||||||||||||||||||||
getGroupId() |
|
|
|
|
|
||||||||||||||||||||
getIccid() |
|
|
|
|
|
||||||||||||||||||||
getImei() |
|
|
|
|
|
||||||||||||||||||||
getImsi() |
|
|
|
|
|
||||||||||||||||||||
getJvmVersion() |
|
|
|
|
|
||||||||||||||||||||
getModelId() |
|
|
|
|
|
||||||||||||||||||||
getOsVersion() |
|
|
|
|
|
||||||||||||||||||||
getOsgiFrameworkVersion() |
|
|
|
|
|
||||||||||||||||||||
getPreferredUserId() |
|
|
|
|
|
||||||||||||||||||||
getScopeId() |
|
|
|
|
|
||||||||||||||||||||
getSerialNumber() |
|
|
|
|
|
||||||||||||||||||||
getStatus() |
|
|
|
|
|
||||||||||||||||||||
parse() |
|
|
|
|
|
||||||||||||||||||||
setAcceptEncoding(String) |
|
|
|
|
|
||||||||||||||||||||
setApplicationFrameworkVersion(String) |
|
|
|
|
|
||||||||||||||||||||
setApplicationIdentifiers(String) |
|
|
|
|
|
||||||||||||||||||||
setBiosVersion(String) |
|
|
|
|
|
||||||||||||||||||||
setClientId(String) |
|
|
|
|
|
||||||||||||||||||||
setConnectionId(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
setDisplayName(String) |
|
|
|
|
|
||||||||||||||||||||
setFirmwareVersion(String) |
|
|
|
|
|
||||||||||||||||||||
setGroupId(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
setIccid(String) |
|
|
|
|
|
||||||||||||||||||||
setImei(String) |
|
|
|
|
|
||||||||||||||||||||
setImsi(String) |
|
|
|
|
|
||||||||||||||||||||
setJvmVersion(String) |
|
|
|
|
|
||||||||||||||||||||
setModelId(String) |
|
|
|
|
|
||||||||||||||||||||
setOsVersion(String) |
|
|
|
|
|
||||||||||||||||||||
setOsgiFrameworkVersion(String) |
|
|
|
|
|
||||||||||||||||||||
setPreferredUserId(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
setScopeId(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
setSerialNumber(String) |
|
|
|
|
|
||||||||||||||||||||
setStatus(DeviceStatus) |
|
|
|
|
|
Coverage
1: /*******************************************************************************
2: * Copyright (c) 2017, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech
12: *******************************************************************************/
13: package org.eclipse.kapua.qa.common.cucumber;
14:
15: import java.math.BigInteger;
16:
17: import org.eclipse.kapua.commons.model.id.KapuaEid;
18: import org.eclipse.kapua.model.id.KapuaId;
19: import org.eclipse.kapua.service.device.registry.DeviceStatus;
20:
21: /**
22: * Data object used in Gherkin to input Device parameters.
23: * The data setters intentionally use only cucumber-friendly data types and
24: * generate the resulting Kapua types internally.
25: */
26: public class CucDevice {
27:
28: Integer scopeId;
29: KapuaId kScopeId;
30: Integer groupId;
31: KapuaId kGroupId;
32: Integer connectionId;
33: KapuaId kConnectionId;
34: Integer preferredUserId;
35: KapuaId kPreferredUserId;
36: String clientId;
37: String displayName;
38: String status;
39: DeviceStatus kStatus;
40: String modelId;
41: String serialNumber;
42: String imei;
43: String imsi;
44: String iccid;
45: String biosVersion;
46: String firmwareVersion;
47: String osVersion;
48: String jvmVersion;
49: String osgiFrameworkVersion;
50: String applicationFrameworkVersion;
51: String applicationIdentifiers;
52: String acceptEncoding;
53:
54: public void parse() {
55:• if (scopeId != null) {
56: kScopeId = new KapuaEid(BigInteger.valueOf(scopeId));
57: }
58:
59:• if (groupId != null) {
60: kGroupId = new KapuaEid(BigInteger.valueOf(groupId));
61: }
62:
63:• if (connectionId != null) {
64: kConnectionId = new KapuaEid(BigInteger.valueOf(connectionId));
65: }
66:
67:• if (preferredUserId != null) {
68: kPreferredUserId = new KapuaEid(BigInteger.valueOf(preferredUserId));
69: }
70:
71:• if (status != null) {
72:• switch (status.trim().toUpperCase()) {
73: case "DISABLED":
74: kStatus = DeviceStatus.DISABLED;
75: break;
76: case "ENABLED":
77: kStatus = DeviceStatus.ENABLED;
78: break;
79: default:
80: kStatus = null;
81: break;
82: }
83: }
84: }
85:
86: public KapuaId getScopeId() {
87: return kScopeId;
88: }
89:
90: public void setScopeId(KapuaId scopeId) {
91: kScopeId = scopeId;
92: }
93:
94: public KapuaId getGroupId() {
95: return kGroupId;
96: }
97:
98: public void setGroupId(KapuaId groupId) {
99: kGroupId = groupId;
100: }
101:
102: public String getClientId() {
103: return clientId;
104: }
105:
106: public void setClientId(String clientId) {
107: this.clientId = clientId;
108: }
109:
110: public KapuaId getConnectionId() {
111: return kConnectionId;
112: }
113:
114: public void setConnectionId(KapuaId connectionId) {
115: kConnectionId = connectionId;
116: }
117:
118: public KapuaId getPreferredUserId() {
119: return kPreferredUserId;
120: }
121:
122: public void setPreferredUserId(KapuaId preferredUserId) {
123: kPreferredUserId = preferredUserId;
124: }
125:
126: public String getDisplayName() {
127: return displayName;
128: }
129:
130: public void setDisplayName(String displayName) {
131: this.displayName = displayName;
132: }
133:
134: public DeviceStatus getStatus() {
135: return kStatus;
136: }
137:
138: public void setStatus(DeviceStatus status) {
139: this.kStatus = status;
140: }
141:
142: public String getModelId() {
143: return modelId;
144: }
145:
146: public void setModelId(String modelId) {
147: this.modelId = modelId;
148: }
149:
150: public String getSerialNumber() {
151: return serialNumber;
152: }
153:
154: public void setSerialNumber(String serialNumber) {
155: this.serialNumber = serialNumber;
156: }
157:
158: public String getImei() {
159: return imei;
160: }
161:
162: public void setImei(String imei) {
163: this.imei = imei;
164: }
165:
166: public String getImsi() {
167: return imsi;
168: }
169:
170: public void setImsi(String imsi) {
171: this.imsi = imsi;
172: }
173:
174: public String getIccid() {
175: return iccid;
176: }
177:
178: public void setIccid(String iccid) {
179: this.iccid = iccid;
180: }
181:
182: public String getBiosVersion() {
183: return biosVersion;
184: }
185:
186: public void setBiosVersion(String biosVersion) {
187: this.biosVersion = biosVersion;
188: }
189:
190: public String getFirmwareVersion() {
191: return firmwareVersion;
192: }
193:
194: public void setFirmwareVersion(String firmwareVersion) {
195: this.firmwareVersion = firmwareVersion;
196: }
197:
198: public String getOsVersion() {
199: return osVersion;
200: }
201:
202: public void setOsVersion(String osVersion) {
203: this.osVersion = osVersion;
204: }
205:
206: public String getJvmVersion() {
207: return jvmVersion;
208: }
209:
210: public void setJvmVersion(String jvmVersion) {
211: this.jvmVersion = jvmVersion;
212: }
213:
214: public String getOsgiFrameworkVersion() {
215: return osgiFrameworkVersion;
216: }
217:
218: public void setOsgiFrameworkVersion(String osgiFrameworkVersion) {
219: this.osgiFrameworkVersion = osgiFrameworkVersion;
220: }
221:
222: public String getApplicationFrameworkVersion() {
223: return applicationFrameworkVersion;
224: }
225:
226: public void setApplicationFrameworkVersion(String applicationFrameworkVersion) {
227: this.applicationFrameworkVersion = applicationFrameworkVersion;
228: }
229:
230: public String getApplicationIdentifiers() {
231: return applicationIdentifiers;
232: }
233:
234: public void setApplicationIdentifiers(String applicationIdentifiers) {
235: this.applicationIdentifiers = applicationIdentifiers;
236: }
237:
238: public String getAcceptEncoding() {
239: return acceptEncoding;
240: }
241:
242: public void setAcceptEncoding(String acceptEncoding) {
243: this.acceptEncoding = acceptEncoding;
244: }
245: }