@@ -6,37 +6,37 @@ import (
66)
77
88func TestBatchController_PostBatchConvert (t * testing.T ) {
9- remoteFolder := "TestData/In"
10-
11- localBook1 := "Book1.xlsx"
12- remoteBook1 := "Book1.xlsx"
13- localMyDoc := "myDocument.xlsx"
14- remoteMyDoc := "myDocument.xlsx"
15-
16- localBook1Request := new (UploadFileRequest )
17- localBook1Request .UploadFiles = make (map [string ]string )
18- localBook1Request .UploadFiles [localBook1 ] = GetBaseTest ().localTestDataFolder + localBook1
19- localBook1Request .Path = remoteFolder + "/" + remoteBook1
20- localBook1Request .StorageName = ""
21- GetBaseTest ().CellsApi .UploadFile (localBook1Request )
22- localMyDocRequest := new (UploadFileRequest )
23- localMyDocRequest .UploadFiles = make (map [string ]string )
24- localMyDocRequest .UploadFiles [localMyDoc ] = GetBaseTest ().localTestDataFolder + localMyDoc
25- localMyDocRequest .Path = remoteFolder + "/" + remoteMyDoc
26- localMyDocRequest .StorageName = ""
27- GetBaseTest ().CellsApi .UploadFile (localMyDocRequest )
28-
29- var batchConvertRequestMatchCondition = new (MatchConditionRequest );
30- batchConvertRequestMatchCondition .RegexPattern = "(^Book)(.+)(xlsx$)" ;
31- var batchConvertRequest = new (BatchConvertRequest );
32- batchConvertRequest .SourceFolder = remoteFolder ;
33- batchConvertRequest .Format = "pdf" ;
34- batchConvertRequest .OutFolder = "TestResult" ;
35- batchConvertRequest .MatchCondition = batchConvertRequestMatchCondition ;
36-
37- request := new (PostBatchConvertRequest )
38- request .BatchConvertRequest = batchConvertRequest
39- _ , httpResponse , err := GetBaseTest ().CellsApi .PostBatchConvert (request )
9+ remoteFolder := "TestData/In"
10+
11+ localBook1 := "Book1.xlsx"
12+ remoteBook1 := "Book1.xlsx"
13+ localMyDoc := "myDocument.xlsx"
14+ remoteMyDoc := "myDocument.xlsx"
15+
16+ localBook1Request := new (UploadFileRequest )
17+ localBook1Request .UploadFiles = make (map [string ]string )
18+ localBook1Request .UploadFiles [localBook1 ] = GetBaseTest ().localTestDataFolder + localBook1
19+ localBook1Request .Path = remoteFolder + "/" + remoteBook1
20+ localBook1Request .StorageName = ""
21+ GetBaseTest ().CellsApi .UploadFile (localBook1Request )
22+ localMyDocRequest := new (UploadFileRequest )
23+ localMyDocRequest .UploadFiles = make (map [string ]string )
24+ localMyDocRequest .UploadFiles [localMyDoc ] = GetBaseTest ().localTestDataFolder + localMyDoc
25+ localMyDocRequest .Path = remoteFolder + "/" + remoteMyDoc
26+ localMyDocRequest .StorageName = ""
27+ GetBaseTest ().CellsApi .UploadFile (localMyDocRequest )
28+
29+ var batchConvertRequestMatchCondition = new (MatchConditionRequest )
30+ batchConvertRequestMatchCondition .RegexPattern = "(^Book)(.+)(xlsx$)"
31+ var batchConvertRequest = new (BatchConvertRequest )
32+ batchConvertRequest .SourceFolder = remoteFolder
33+ batchConvertRequest .Format = "pdf"
34+ batchConvertRequest .OutFolder = "TestResult"
35+ batchConvertRequest .MatchCondition = batchConvertRequestMatchCondition
36+
37+ request := new (PostBatchConvertRequest )
38+ request .BatchConvertRequest = batchConvertRequest
39+ _ , httpResponse , err := GetBaseTest ().CellsApi .PostBatchConvert (request )
4040 if err != nil {
4141 t .Error (err )
4242 } else if httpResponse .StatusCode < 200 || httpResponse .StatusCode > 299 {
@@ -46,3 +46,126 @@ func TestBatchController_PostBatchConvert(t *testing.T) {
4646 }
4747}
4848
49+ func TestBatchController_PostBatchProtect (t * testing.T ) {
50+ remoteFolder := "TestData/In"
51+
52+ localBook1 := "Book1.xlsx"
53+ remoteBook1 := "Book1.xlsx"
54+ localMyDoc := "myDocument.xlsx"
55+ remoteMyDoc := "myDocument.xlsx"
56+
57+ localBook1Request := new (UploadFileRequest )
58+ localBook1Request .UploadFiles = make (map [string ]string )
59+ localBook1Request .UploadFiles [localBook1 ] = GetBaseTest ().localTestDataFolder + localBook1
60+ localBook1Request .Path = remoteFolder + "/" + remoteBook1
61+ localBook1Request .StorageName = ""
62+ GetBaseTest ().CellsApi .UploadFile (localBook1Request )
63+ localMyDocRequest := new (UploadFileRequest )
64+ localMyDocRequest .UploadFiles = make (map [string ]string )
65+ localMyDocRequest .UploadFiles [localMyDoc ] = GetBaseTest ().localTestDataFolder + localMyDoc
66+ localMyDocRequest .Path = remoteFolder + "/" + remoteMyDoc
67+ localMyDocRequest .StorageName = ""
68+ GetBaseTest ().CellsApi .UploadFile (localMyDocRequest )
69+
70+ var batchProtectRequestMatchCondition = new (MatchConditionRequest )
71+ batchProtectRequestMatchCondition .RegexPattern = "(^Book)(.+)(xlsx$)"
72+ var batchProtectRequest = new (BatchProtectRequest )
73+ batchProtectRequest .SourceFolder = remoteFolder
74+ batchProtectRequest .ProtectionType = "All"
75+ batchProtectRequest .Password = "123456"
76+ batchProtectRequest .OutFolder = "TestResult"
77+ batchProtectRequest .MatchCondition = batchProtectRequestMatchCondition
78+
79+ request := new (PostBatchProtectRequest )
80+ request .BatchProtectRequest = batchProtectRequest
81+ _ , httpResponse , err := GetBaseTest ().CellsApi .PostBatchProtect (request )
82+ if err != nil {
83+ t .Error (err )
84+ } else if httpResponse .StatusCode < 200 || httpResponse .StatusCode > 299 {
85+ t .Fail ()
86+ } else {
87+ fmt .Printf ("%d\t TestBatchController_PostBatchProtect \n " , GetBaseTest ().GetTestNumber ())
88+ }
89+ }
90+
91+ func TestBatchController_PostBatchLock (t * testing.T ) {
92+ remoteFolder := "TestData/In"
93+
94+ localBook1 := "Book1.xlsx"
95+ remoteBook1 := "Book1.xlsx"
96+ localMyDoc := "myDocument.xlsx"
97+ remoteMyDoc := "myDocument.xlsx"
98+
99+ localBook1Request := new (UploadFileRequest )
100+ localBook1Request .UploadFiles = make (map [string ]string )
101+ localBook1Request .UploadFiles [localBook1 ] = GetBaseTest ().localTestDataFolder + localBook1
102+ localBook1Request .Path = remoteFolder + "/" + remoteBook1
103+ localBook1Request .StorageName = ""
104+ GetBaseTest ().CellsApi .UploadFile (localBook1Request )
105+ localMyDocRequest := new (UploadFileRequest )
106+ localMyDocRequest .UploadFiles = make (map [string ]string )
107+ localMyDocRequest .UploadFiles [localMyDoc ] = GetBaseTest ().localTestDataFolder + localMyDoc
108+ localMyDocRequest .Path = remoteFolder + "/" + remoteMyDoc
109+ localMyDocRequest .StorageName = ""
110+ GetBaseTest ().CellsApi .UploadFile (localMyDocRequest )
111+
112+ var batchLockRequestMatchCondition = new (MatchConditionRequest )
113+ batchLockRequestMatchCondition .RegexPattern = "(^Book)(.+)(xlsx$)"
114+ var batchLockRequest = new (BatchLockRequest )
115+ batchLockRequest .SourceFolder = remoteFolder
116+ batchLockRequest .Password = "123456"
117+ batchLockRequest .OutFolder = "TestResult"
118+ batchLockRequest .MatchCondition = batchLockRequestMatchCondition
119+
120+ request := new (PostBatchLockRequest )
121+ request .BatchLockRequest = batchLockRequest
122+ _ , httpResponse , err := GetBaseTest ().CellsApi .PostBatchLock (request )
123+ if err != nil {
124+ t .Error (err )
125+ } else if httpResponse .StatusCode < 200 || httpResponse .StatusCode > 299 {
126+ t .Fail ()
127+ } else {
128+ fmt .Printf ("%d\t TestBatchController_PostBatchLock \n " , GetBaseTest ().GetTestNumber ())
129+ }
130+ }
131+
132+ func TestBatchController_PostBatchUnlock (t * testing.T ) {
133+ remoteFolder := "TestData/In"
134+
135+ localBook1 := "Book1.xlsx"
136+ remoteBook1 := "Book1.xlsx"
137+ localMyDoc := "myDocument.xlsx"
138+ remoteMyDoc := "myDocument.xlsx"
139+
140+ localBook1Request := new (UploadFileRequest )
141+ localBook1Request .UploadFiles = make (map [string ]string )
142+ localBook1Request .UploadFiles [localBook1 ] = GetBaseTest ().localTestDataFolder + localBook1
143+ localBook1Request .Path = remoteFolder + "/" + remoteBook1
144+ localBook1Request .StorageName = ""
145+ GetBaseTest ().CellsApi .UploadFile (localBook1Request )
146+ localMyDocRequest := new (UploadFileRequest )
147+ localMyDocRequest .UploadFiles = make (map [string ]string )
148+ localMyDocRequest .UploadFiles [localMyDoc ] = GetBaseTest ().localTestDataFolder + localMyDoc
149+ localMyDocRequest .Path = remoteFolder + "/" + remoteMyDoc
150+ localMyDocRequest .StorageName = ""
151+ GetBaseTest ().CellsApi .UploadFile (localMyDocRequest )
152+
153+ var batchLockRequestMatchCondition = new (MatchConditionRequest )
154+ batchLockRequestMatchCondition .RegexPattern = "(^Book)(.+)(xlsx$)"
155+ var batchLockRequest = new (BatchLockRequest )
156+ batchLockRequest .SourceFolder = remoteFolder
157+ batchLockRequest .Password = "123456"
158+ batchLockRequest .OutFolder = "TestResult"
159+ batchLockRequest .MatchCondition = batchLockRequestMatchCondition
160+
161+ request := new (PostBatchUnlockRequest )
162+ request .BatchLockRequest = batchLockRequest
163+ _ , httpResponse , err := GetBaseTest ().CellsApi .PostBatchUnlock (request )
164+ if err != nil {
165+ t .Error (err )
166+ } else if httpResponse .StatusCode < 200 || httpResponse .StatusCode > 299 {
167+ t .Fail ()
168+ } else {
169+ fmt .Printf ("%d\t TestBatchController_PostBatchUnlock \n " , GetBaseTest ().GetTestNumber ())
170+ }
171+ }
0 commit comments