-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.ps1
42 lines (32 loc) · 1.93 KB
/
test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# OS-Check
$runScriptName = "app"
if ($IsWindows) {
$runScriptName = "app.bat"
}
$runScriptPath = "./canopy/app/build/distributions/"
$runScriptName = $runScriptPath + "app/bin/" + $runScriptName
$testXml = "<ObjectNode><row><name>John</name><age>30</age></row></ObjectNode>"
$testJson = '{"name":"John","age":30}'
$testYaml = "name: John`nage: 30"
Set-Location ./canopy
./gradlew.bat distzip
Set-Location ..
Expand-Archive ($runScriptPath + "app.zip") $runScriptPath -Force
$testJson | &$runScriptName LoadJson StoreJson
$testXml | &$runScriptName LoadXml StoreJson
$testYaml | &$runScriptName LoadYaml StoreJson
&$runScriptName LoadJson:"https://tools.learningcontainer.com/sample-json.json" StoreJson
&$runScriptName LoadJson:"https://tools.learningcontainer.com/sample-json.json" StoreXml
&$runScriptName LoadJson:"https://tools.learningcontainer.com/sample-json.json" StoreYaml
&$runScriptName LoadJson:"https://tools.learningcontainer.com/sample-json.json" StoreJson:"output.json"
&$runScriptName LoadJson:"https://tools.learningcontainer.com/sample-json.json" StoreXml:output.xml
&$runScriptName LoadJson:"https://tools.learningcontainer.com/sample-json.json" StoreYaml:output.yaml
&$runScriptName LoadJson:"https://tools.learningcontainer.com/sample-json.json" StoreJson:"output.json" StoreXml:output.xml StoreYaml:output.yaml
&$runScriptName LoadJson:"https://tools.learningcontainer.com/sample-json.json" LoadJson:"https://tools.learningcontainer.com/sample-json.json" StoreXml:output.xml StoreYaml:output.yaml
&$runScriptName LoadJson:"https://tools.learningcontainer.com/sample-json.json" StoreJson:"output.json" LoadJson:"https://tools.learningcontainer.com/sample-json.json" LoadJson:"https://tools.learningcontainer.com/sample-json.json" StoreYaml:output.yaml
&$runScriptName LoadJson:"doesnotexist.bla" StoreJson:"output.json"
Get-Content ./output.json
Get-Content ./output.xml
Get-Content ./output.yaml
# Cleanup
Remove-Item ./output* -Force