author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 28 Aug 2013 12:52:38 +0100 | |
branch | jv |
changeset 13465 | 1f1e8b6710c8 |
parent 12650 | e0f607754b9a |
child 15950 | 23be8cf85415 |
permissions | -rw-r--r-- |
5142 | 1 |
" |
2 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
3892 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
14 |
TestCase subclass:#FileBrowserV2Tests |
|
15 |
instanceVariableNames:'' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Interface-Tools-File' |
|
19 |
! |
|
20 |
||
21 |
!FileBrowserV2Tests class methodsFor:'documentation'! |
|
22 |
||
5142 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
3892 | 37 |
documentation |
38 |
" |
|
39 |
documentation to be added. |
|
40 |
||
41 |
[author:] |
|
42 |
Christian Penk (penk@bierfix) |
|
43 |
||
44 |
[instance variables:] |
|
45 |
||
46 |
[class variables:] |
|
47 |
||
48 |
[see also:] |
|
49 |
||
50 |
" |
|
51 |
! ! |
|
52 |
||
53 |
!FileBrowserV2Tests methodsFor:'initialize / release'! |
|
54 |
||
55 |
setUp |
|
56 |
"common setup - invoked before testing" |
|
57 |
||
58 |
super setUp |
|
59 |
! |
|
60 |
||
61 |
tearDown |
|
62 |
"common cleanup - invoked after testing" |
|
63 |
||
64 |
super tearDown |
|
65 |
! ! |
|
66 |
||
67 |
!FileBrowserV2Tests methodsFor:'tests'! |
|
68 |
||
4344 | 69 |
createBigDirectory |
70 |
||
4623 | 71 |
| testDir | |
72 |
||
73 |
testDir := Filename homeDirectory construct:'Test'. |
|
4344 | 74 |
(Filename homeDirectory construct:'Test') makeDirectory. |
75 |
1 to:5 do:[: id1| |
|
76 |
1 to:50 do:[: id2| |
|
77 |
1 to:50 do:[: id3| |
|
4623 | 78 |
(testDir construct:('file', id1 asString, '.', id2 asString,'.', id3 asString)) writeStream |
4344 | 79 |
] |
80 |
]. |
|
81 |
] |
|
82 |
" |
|
83 |
FileBrowserV2Tests new createBigDirectory |
|
5228 | 84 |
Dialog requestFileName:'test' default:nil pattern:'*' fromDirectory:'/home/penk/Test' |
4344 | 85 |
" |
86 |
! |
|
87 |
||
88 |
removeBigDirectory |
|
89 |
||
90 |
(Filename homeDirectory construct:'Test') recursiveRemove. |
|
91 |
||
92 |
" |
|
93 |
FileBrowserV2Tests new removeBigDirectory |
|
94 |
" |
|
95 |
! |
|
96 |
||
97 |
testBigDirectory |
|
98 |
! |
|
99 |
||
3953 | 100 |
testDirectoryHistory |
101 |
"Just a demonstration testCase. |
|
102 |
Double click on the TestCase class or open a TestRunner to see me checking... |
|
103 |
- please add more methods like this..." |
|
104 |
||
105 |
|history| |
|
106 |
||
107 |
history := AbstractFileBrowser directoryHistoryClass new. |
|
4025 | 108 |
history resetForwardBackward. |
4348 | 109 |
self shouldnt: (history canBackward). |
3953 | 110 |
history addToHistory:'1'. |
4348 | 111 |
self shouldnt:(history canBackward). |
3953 | 112 |
self shouldnt:(history canForward). |
113 |
history addToHistory:'2'. |
|
4348 | 114 |
self should:(history canBackward). |
3953 | 115 |
history addToHistory:'3'. |
4348 | 116 |
self should:(history canBackward). |
3953 | 117 |
self shouldnt: (history canForward). |
4348 | 118 |
self should: ((history goBackward) = '2'). |
119 |
self should: ((history goBackward) = '1'). |
|
3953 | 120 |
self should: (history canForward). |
4348 | 121 |
self should: ((history goForward) = '2'). |
4025 | 122 |
self should: (history canForward). |
3953 | 123 |
|
124 |
||
125 |
||
126 |
" |
|
127 |
self run:#testDirectoryHistory |
|
128 |
" |
|
129 |
! |
|
130 |
||
4623 | 131 |
testDosFiles |
132 |
||
133 |
| file stream| |
|
134 |
||
135 |
file := Filename currentDirectory asAbsoluteFilename construct:'foobar~1'. |
|
136 |
stream := file writeStream. |
|
137 |
self should:file exists. |
|
138 |
stream close. |
|
139 |
file remove. |
|
140 |
||
141 |
" |
|
142 |
self new testDosFiles |
|
143 |
" |
|
144 |
! |
|
145 |
||
3892 | 146 |
testFileItem |
147 |
"Just a demonstration testCase. |
|
148 |
Double click on the TestCase class or open a TestRunner to see me checking... |
|
149 |
- please add more methods like this..." |
|
150 |
||
151 |
| file item| |
|
152 |
||
153 |
file := Filename homeDirectory construct:'work/stx/doc/online/english/index.html'. |
|
154 |
file exists ifTrue:[ |
|
4025 | 155 |
item := DirectoryContentsBrowser itemClass fileName:file. |
3892 | 156 |
self should:(item mimeType = 'text/html'). |
157 |
]. |
|
158 |
||
159 |
" |
|
160 |
self run:#testFileItem |
|
161 |
" |
|
162 |
! |
|
163 |
||
164 |
testHardLink |
|
165 |
"Just a demonstration testCase. |
|
166 |
Double click on the TestCase class or open a TestRunner to see me checking... |
|
167 |
- please add more methods like this..." |
|
168 |
||
169 |
|browser| |
|
170 |
||
171 |
browser := FileBrowserV2 new. |
|
172 |
||
173 |
self should: ( browser isKindOf:AbstractFileBrowser ). |
|
174 |
self should: ( browser respondsTo:#newHardLink ). |
|
175 |
||
176 |
"/ self should: [ o at:0 ] raise:Error. |
|
177 |
||
178 |
" |
|
179 |
self run:#testHardLink |
|
180 |
" |
|
181 |
! ! |
|
182 |
||
183 |
!FileBrowserV2Tests class methodsFor:'documentation'! |
|
184 |
||
185 |
version |
|
12125 | 186 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowserV2Tests.st,v 1.9 2003/10/02 12:22:11 penk Exp $' |
12650
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
187 |
! |
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
188 |
|
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
189 |
version_HG |
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
190 |
|
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
191 |
^ '$Changeset: <not expanded> $' |
12125 | 192 |
! ! |
12650
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
193 |