638
|
1 |
"
|
|
2 |
Copyright (c) 2007-2010 Jan Vrany
|
|
3 |
Copyright (c) 2009-2010 eXept Software AG
|
|
4 |
|
|
5 |
Permission is hereby granted, free of charge, to any person
|
|
6 |
obtaining a copy of this software and associated documentation
|
|
7 |
files (the 'Software'), to deal in the Software without
|
|
8 |
restriction, including without limitation the rights to use,
|
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10 |
copies of the Software, and to permit persons to whom the
|
|
11 |
Software is furnished to do so, subject to the following
|
|
12 |
conditions:
|
|
13 |
|
|
14 |
The above copyright notice and this permission notice shall be
|
|
15 |
included in all copies or substantial portions of the Software.
|
|
16 |
|
|
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
25 |
"
|
|
26 |
"{ Package: 'stx:libsvn' }"
|
|
27 |
|
|
28 |
"{ NameSpace: SVN }"
|
|
29 |
|
|
30 |
TestCase subclass:#ConfigurationTests
|
|
31 |
instanceVariableNames:''
|
|
32 |
classVariableNames:''
|
|
33 |
poolDictionaries:''
|
|
34 |
category:'SVN-Tests'
|
|
35 |
!
|
|
36 |
|
|
37 |
!ConfigurationTests class methodsFor:'documentation'!
|
|
38 |
|
|
39 |
copyright
|
|
40 |
"
|
|
41 |
Copyright (c) 2007-2010 Jan Vrany
|
|
42 |
Copyright (c) 2009-2010 eXept Software AG
|
|
43 |
|
|
44 |
Permission is hereby granted, free of charge, to any person
|
|
45 |
obtaining a copy of this software and associated documentation
|
|
46 |
files (the 'Software'), to deal in the Software without
|
|
47 |
restriction, including without limitation the rights to use,
|
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
49 |
copies of the Software, and to permit persons to whom the
|
|
50 |
Software is furnished to do so, subject to the following
|
|
51 |
conditions:
|
|
52 |
|
|
53 |
The above copyright notice and this permission notice shall be
|
|
54 |
included in all copies or substantial portions of the Software.
|
|
55 |
|
|
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
63 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
64 |
|
|
65 |
"
|
|
66 |
!
|
|
67 |
|
|
68 |
documentation
|
|
69 |
"
|
|
70 |
documentation to be added.
|
|
71 |
|
|
72 |
[author:]
|
|
73 |
jv (jv@WIN7)
|
|
74 |
|
|
75 |
[instance variables:]
|
|
76 |
|
|
77 |
[class variables:]
|
|
78 |
|
|
79 |
[see also:]
|
|
80 |
|
|
81 |
"
|
|
82 |
! !
|
|
83 |
|
|
84 |
!ConfigurationTests methodsFor:'initialize / release'!
|
|
85 |
|
|
86 |
setUp
|
|
87 |
"common setup - invoked before testing."
|
|
88 |
|
|
89 |
super setUp
|
|
90 |
!
|
|
91 |
|
|
92 |
tearDown
|
|
93 |
"common cleanup - invoked after testing."
|
|
94 |
|
|
95 |
super tearDown
|
|
96 |
! !
|
|
97 |
|
|
98 |
!ConfigurationTests methodsFor:'tests'!
|
|
99 |
|
|
100 |
test01
|
|
101 |
|
|
102 |
| c |
|
|
103 |
c := Configuration new name:'Test config'.
|
|
104 |
c repositories
|
|
105 |
add: (Configuration::Repository package: 'test:f/*' url: 'file:///svn/f/%p');
|
|
106 |
add: (Configuration::Repository package: 'test:p/*' url: 'file:///svn/p/%(PATH)');
|
|
107 |
add: (Configuration::Repository package: 'test:dp/*' url: 'file:///svn/dp/%(DOTTED_PATH)');
|
|
108 |
add: (Configuration::Repository package: 'test:md/*' url: 'file:///svn/md/%(MODULE)/%(DIRECTORY)').
|
|
109 |
|
|
110 |
self
|
|
111 |
assert:(c repositoryFor: #'test:f/m1/t1') url = 'file:///svn/f/test/f/m1/t1';
|
|
112 |
assert:(c repositoryFor: #'test:p/m1/t1') url = 'file:///svn/p/test/p/m1/t1';
|
|
113 |
assert:(c repositoryFor: #'test:dp/m1/t1') url = 'file:///svn/dp/test.dp.m1.t1';
|
|
114 |
assert:(c repositoryFor: #'test:md/m1/t1') url = 'file:///svn/md/test/md/m1/t1'
|
|
115 |
|
|
116 |
"Created: / 09-01-2010 / 12:48:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
117 |
"Modified: / 14-03-2011 / 10:29:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
118 |
!
|
|
119 |
|
|
120 |
test02
|
|
121 |
|
|
122 |
"Configuration::Repository literal array encoding/decoding"
|
|
123 |
|
|
124 |
| repo1 enc repo2 |
|
|
125 |
repo1 := Configuration::Repository
|
|
126 |
package:'stx:libsvn/test'
|
|
127 |
url: 'file:///var/svn/stx/libsvn/test'.
|
|
128 |
|
|
129 |
enc := repo1 literalArrayEncoding.
|
|
130 |
|
|
131 |
repo2 := enc decodeAsLiteralArray.
|
|
132 |
|
|
133 |
self
|
|
134 |
assert: (repo1 url = repo2 url);
|
|
135 |
assert: (repo1 package = repo2 package);
|
|
136 |
assert: (repo1 branch == nil);
|
|
137 |
assert: (repo2 branch == nil).
|
|
138 |
|
|
139 |
repo1 := Configuration::Repository
|
|
140 |
package:'stx:libsvn/test'
|
|
141 |
url: 'file:///var/svn/stx/libsvn/test'
|
|
142 |
branch: '/branches/jv'.
|
|
143 |
|
|
144 |
enc := repo1 literalArrayEncoding.
|
|
145 |
|
|
146 |
repo2 := enc decodeAsLiteralArray.
|
|
147 |
|
|
148 |
self
|
|
149 |
assert: (repo1 url = repo2 url);
|
|
150 |
assert: (repo1 package = repo2 package);
|
|
151 |
assert: (repo1 branch = repo2 branch)
|
|
152 |
|
|
153 |
"Created: / 09-01-2010 / 14:54:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
154 |
!
|
|
155 |
|
|
156 |
test03
|
|
157 |
|
|
158 |
"Configuration literal array encoding/decoding"
|
|
159 |
|
|
160 |
| config1 repo1_1 repo1_2 enc config2 |
|
|
161 |
repo1_1 := Configuration::Repository
|
|
162 |
package:'stx:libsvn/test'
|
|
163 |
url: 'file:///var/svn/stx/libsvn/test'.
|
|
164 |
repo1_2 := Configuration::Repository
|
|
165 |
package:'stx:libsvn/test2'
|
|
166 |
url: 'file:///var/svn/stx/libsvn/test2'
|
|
167 |
branch: 'branches/jv'.
|
|
168 |
config1 := Configuration new name: 'Test config'.
|
|
169 |
config1 repositories add: repo1_1; add: repo1_2.
|
|
170 |
|
|
171 |
enc := config1 literalArrayEncoding.
|
|
172 |
|
|
173 |
config2 := enc decodeAsLiteralArray.
|
|
174 |
|
|
175 |
self
|
|
176 |
assert: config1 name = config2 name;
|
|
177 |
assert: config2 repositories size = 2;
|
|
178 |
assert: config2 repositories first url = 'file:///var/svn/stx/libsvn/test';
|
|
179 |
assert: config2 repositories second branch = 'branches/jv'.
|
|
180 |
|
|
181 |
"Created: / 09-01-2010 / 15:17:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
182 |
!
|
|
183 |
|
|
184 |
test04
|
|
185 |
|
|
186 |
"
|
|
187 |
Tests URL creation for subpackages
|
|
188 |
"
|
|
189 |
|
|
190 |
| c |
|
|
191 |
c := Configuration new
|
|
192 |
name:'Test config';
|
|
193 |
package: 'test:a/b/*' url: 'file:///svn/a/b/%(BRANCH)/%(1)';
|
|
194 |
|
|
195 |
yourself.
|
|
196 |
|
|
197 |
|
|
198 |
self
|
|
199 |
assert:(c repositoryFor: #'test:a/b/c') url = 'file:///svn/a/b/%(BRANCH)/c';
|
|
200 |
assert:(c repositoryFor: #'test:a/b') url = 'file:///svn/a/b/%(BRANCH)/'.
|
|
201 |
|
|
202 |
"Created: / 11-03-2011 / 18:25:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
203 |
"Modified: / 13-03-2011 / 09:17:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
204 |
! !
|
|
205 |
|
|
206 |
!ConfigurationTests class methodsFor:'documentation'!
|
|
207 |
|
|
208 |
version
|
|
209 |
^ '$Header$'
|
|
210 |
!
|
|
211 |
|
|
212 |
version_CVS
|
|
213 |
^ '$Header$'
|
|
214 |
!
|
|
215 |
|
|
216 |
version_SVN
|
|
217 |
^ '§Id: SVN__ConfigurationTests.st 350 2011-07-07 18:42:56Z vranyj1 §'
|
|
218 |
! !
|