This file contains hidden or 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
| public void test_include_singl_file() { | |
| try { | |
| PropertiesConfiguration config = new PropertiesConfiguration( | |
| "config.properties"); | |
| PropertiesConfiguration extConfig = (PropertiesConfiguration) config | |
| .interpolatedConfiguration(); | |
| Iterator<String> iter = extConfig.getKeys(); | |
| while (iter.hasNext()) { | |
| String key = iter.next(); |
This file contains hidden or 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
| user.name=Amanda Zhu | |
| user.password=8888 |
This file contains hidden or 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
| #config.properties | |
| user=amanda | |
| include=${user}.properties | |
| connection.string=${user.name}:${user.password} | |
| #amanda.properties | |
| user.name=Amanda Zhu | |
| user.password=8888 |
This file contains hidden or 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
| /* variable.properties | |
| user.name=steve | |
| user.password=pass | |
| credential.string=${user.name}:${user.password} | |
| */ | |
| public void test_variable_interpolation() { | |
| try { |
This file contains hidden or 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
| /* variable.properties | |
| user.name=steve | |
| user.password=pass | |
| credential.string=${user.name}:${user.password} | |
| */ | |
| public void test_variable_interpolation() { | |
| try { |
This file contains hidden or 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
| import groovy.json.JsonSlurper | |
| def urlRoot = "https://example.com" | |
| def issueId = "" | |
| def userName = "" | |
| def password = "" | |
| def addr = "${urlRoot}/rest/api/2/issue/${issueId}/comment" | |
| def authString = "${userName}:${password}".getBytes().encodeBase64().toString() | |
| def comment = "added by groovy" |
This file contains hidden or 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
| import groovy.json.JsonSlurper | |
| /* | |
| def urlRoot = "https://example.com" | |
| def issueId = "" | |
| def userName = "" | |
| def password = "" | |
| def addr = "${urlRoot}/rest/api/2/issue/${issueId}" | |
| def authString = "${userName}:${password}".getBytes().encodeBase64().toString() | |
| */ |
This file contains hidden or 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
| import groovy.json.JsonSlurper | |
| /* | |
| def urlRoot = "https://example.com" | |
| def issueId = "" | |
| def userName = "" | |
| def password = "" | |
| def addr = "${urlRoot}/rest/api/2/issue/${issueId}" | |
| def authString = "${userName}:${password}".getBytes().encodeBase64().toString() | |
| */ |
This file contains hidden or 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
| def lib_folder = "libs"; | |
| def jarFiles = [] | |
| new File(lib_folder).eachFile { file -> | |
| jarFiles << file.name | |
| } | |
| builder = new groovy.xml.StreamingMarkupBuilder() | |
| builder.encoding = "UTF-8" |
This file contains hidden or 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
| new XmlNodePrinter().print(classpath) |