forked from wso2/carbon-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the environment variable naming for namespaces. wso2#66
- Loading branch information
1 parent
882687a
commit 6d34c4d
Showing
5 changed files
with
159 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...ig/src/test/java/org/wso2/carbon/config/configprovider/ComplexNameSpaceConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 Inc. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
*/ | ||
package org.wso2.carbon.config.configprovider; | ||
|
||
import org.wso2.carbon.config.annotation.Configuration; | ||
|
||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
/** | ||
* Sample configuration class for testing purposes. | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
@XmlRootElement(name = "testconfiguration") | ||
@Configuration(namespace = "wso2.test.config", description = "Test Configurations Bean") | ||
public class ComplexNameSpaceConfiguration { | ||
|
||
private String tenant = "default"; | ||
private Transports transports = new Transports(); | ||
|
||
@XmlElement | ||
public void setTenant(String tenant) { | ||
this.tenant = tenant; | ||
} | ||
|
||
public String getTenant() { | ||
return tenant; | ||
} | ||
|
||
@XmlElement | ||
public void setTransports(Transports transports) { | ||
this.transports = transports; | ||
} | ||
|
||
public Transports getTransports() { | ||
return transports; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
components/org.wso2.carbon.config/src/test/resources/conf/complexnamespaceconfig.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
wso2.test.config: | ||
tenant: tenant | ||
transports: | ||
transport: #Transport with direct values | ||
- name: abc | ||
port: 8000 | ||
secure: false | ||
desc: This transport will use 8000 as its port | ||
password: ${sec:conn.auth.password} | ||
- name: pqr | ||
port: ${env:pqr.http.port} | ||
secure: ${sys:pqr.secure} | ||
desc: This transport will use ${env:pqr.http.port} as its port. Secure - ${sys:pqr.secure} | ||
- name: xyz | ||
port: ${env:xyz.http.port,9000} | ||
secure: ${sys:xyz.secure,true} | ||
desc: This transport will use ${env:xyz.http.port,8888} as its port | ||
|
||
# TESTCONFIGURATION_TENANT="tenant" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_0_NAME="abc" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_0_PORT="8000" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_0_SECURE="false" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_0_DESC="This transport will use 8000 as its port" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_0_PASSWORD="${sec:conn.auth.password}" | ||
|
||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_1_NAME="pqr" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_1_PORT="${env:pqr.http.port}" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_1_SECURE="${sys:pqr.secure}" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_1_DESC="This transport will use ${env:pqr.http.port} as its port. Secure - ${sys:pqr.secure}" | ||
|
||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_2_NAME="xyz" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_2_PORT="${env:xyz.http.port,9000}" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_2_SECURE="${sys:xyz.secure,true}" | ||
# TESTCONFIGURATION_TRANSPORTS_TRANSPORT_2_DESC="This transport will use ${env:xyz.http.port,8888} as its port" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters