re base code
[sdc.git] / common-app-api / src / test / java / org / openecomp / sdc / common / test / config / TestConfiguration.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.common.test.config;
22
23 import org.openecomp.sdc.common.api.BasicConfiguration;
24
25 import java.util.Date;
26 import java.util.List;
27 import java.util.Map;
28
29 import static java.lang.String.format;
30
31 public class TestConfiguration extends BasicConfiguration {
32
33         /**
34          * backend host
35          */
36         private String beHost;
37         /**
38          * backend http port
39          */
40         private Integer beHttpPort;
41         /**
42          * backend http secured port
43          */
44         private Integer beSslPort;
45         /**
46          * be http context
47          */
48         private String beContext;
49         /**
50          * backend protocol. http | https
51          */
52         private String beProtocol = "http";
53
54         private Date released;
55         private String version = "1111";
56         private TestConnection connection;
57         private List<String> protocols;
58         private Map<String, String> users;
59
60         public Date getReleased() {
61                 return released;
62         }
63
64         public String getVersion() {
65                 return version;
66         }
67
68         public void setReleased(Date released) {
69                 this.released = released;
70         }
71
72         public void setVersion(String version) {
73                 this.version = version;
74         }
75
76         public TestConnection getConnection() {
77                 return connection;
78         }
79
80         public void setConnection(TestConnection connection) {
81                 this.connection = connection;
82         }
83
84         public List<String> getProtocols() {
85                 return protocols;
86         }
87
88         public void setProtocols(List<String> protocols) {
89                 this.protocols = protocols;
90         }
91
92         public Map<String, String> getUsers() {
93                 return users;
94         }
95
96         public void setUsers(Map<String, String> users) {
97                 this.users = users;
98         }
99
100         public String getBeHost() {
101                 return beHost;
102         }
103
104         public void setBeHost(String beHost) {
105                 this.beHost = beHost;
106         }
107
108         public Integer getBeHttpPort() {
109                 return beHttpPort;
110         }
111
112         public void setBeHttpPort(Integer beHttpPort) {
113                 this.beHttpPort = beHttpPort;
114         }
115
116         public Integer getBeSslPort() {
117                 return beSslPort;
118         }
119
120         public void setBeSslPort(Integer beSslPort) {
121                 this.beSslPort = beSslPort;
122         }
123
124         public String getBeContext() {
125                 return beContext;
126         }
127
128         public void setBeContext(String beContext) {
129                 this.beContext = beContext;
130         }
131
132         public String getBeProtocol() {
133                 return beProtocol;
134         }
135
136         public void setBeProtocol(String beProtocol) {
137                 this.beProtocol = beProtocol;
138         }
139
140         @Override
141         public String toString() {
142                 return new StringBuilder().append(format("backend host: %s\n", beHost))
143                                 .append(format("backend http port: %s\n", beHttpPort))
144                                 .append(format("backend ssl port: %s\n", beSslPort)).append(format("backend context: %s\n", beContext))
145                                 .append(format("backend protocol: %s\n", beProtocol)).append(format("Version: %s\n", version))
146                                 .append(format("Released: %s\n", released)).append(format("Connecting to database: %s\n", connection))
147                                 .append(format("Supported protocols: %s\n", protocols)).append(format("Users: %s\n", users)).toString();
148         }
149 }