Package: CucDomain
CucDomain
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CucDomain(String, String, String) |
|
|
|
|
|
||||||||||||||||||||
doParse() |
|
|
|
|
|
||||||||||||||||||||
getActionSet() |
|
|
|
|
|
||||||||||||||||||||
getActions() |
|
|
|
|
|
||||||||||||||||||||
getName() |
|
|
|
|
|
||||||||||||||||||||
getServiceName() |
|
|
|
|
|
||||||||||||||||||||
setActionSet(Set) |
|
|
|
|
|
||||||||||||||||||||
setActions(String) |
|
|
|
|
|
||||||||||||||||||||
setName(String) |
|
|
|
|
|
||||||||||||||||||||
setServiceName(String) |
|
|
|
|
|
Coverage
1: /*******************************************************************************
2: * Copyright (c) 2016, 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 - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.qa.common.cucumber;
14:
15: import org.eclipse.kapua.model.domain.Actions;
16:
17: import java.util.HashSet;
18: import java.util.Set;
19:
20: public class CucDomain {
21:
22: private String name;
23: private String serviceName;
24: private String actions;
25: private Set<Actions> actionSet;
26:
27: public CucDomain(String name, String serviceName, String actions) {
28: this.name = name;
29: this.serviceName = serviceName;
30:• if (this.serviceName == null) {
31: this.serviceName= "test";
32: }
33: this.actions = actions;
34: }
35:
36: public void doParse() {
37:• if (this.actions != null) {
38: String[] tmpList = this.actions.split(",");
39: this.actionSet = new HashSet<>();
40:
41:• for (String tmpS : tmpList) {
42:• switch (tmpS.trim().toLowerCase()) {
43: case "read":
44: this.actionSet.add(Actions.read);
45: break;
46: case "write":
47: this.actionSet.add(Actions.write);
48: break;
49: case "delete":
50: this.actionSet.add(Actions.delete);
51: break;
52: case "connect":
53: this.actionSet.add(Actions.connect);
54: break;
55: case "execute":
56: this.actionSet.add(Actions.execute);
57: break;
58: }
59: }
60: }
61: }
62:
63: public String getName() {
64: return name;
65: }
66:
67: public void setName(String name) {
68: this.name = name;
69: }
70:
71: public String getServiceName() {
72: return serviceName;
73: }
74:
75: public void setServiceName(String serviceName) {
76: this.serviceName = serviceName;
77: }
78:
79: public void setActionSet(Set<Actions> actionSet) {
80: this.actionSet = actionSet;
81: }
82:
83: public String getActions() {
84: return this.actions;
85: }
86:
87: public void setActions(String actions) {
88: this.actions = actions;
89: }
90:
91: public Set<Actions> getActionSet() {
92: return actionSet;
93: }
94: }