3892
|
1 |
"{ Package: 'stx:libtool' }"
|
|
2 |
|
|
3 |
TestCase subclass:#FileBrowserV2Tests
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Interface-Tools-File'
|
|
8 |
!
|
|
9 |
|
|
10 |
!FileBrowserV2Tests class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
documentation
|
|
13 |
"
|
|
14 |
documentation to be added.
|
|
15 |
|
|
16 |
[author:]
|
|
17 |
Christian Penk (penk@bierfix)
|
|
18 |
|
|
19 |
[instance variables:]
|
|
20 |
|
|
21 |
[class variables:]
|
|
22 |
|
|
23 |
[see also:]
|
|
24 |
|
|
25 |
"
|
|
26 |
!
|
|
27 |
|
|
28 |
history
|
|
29 |
"Created: / 31.7.2002 / 11:59:23 / penk"
|
|
30 |
! !
|
|
31 |
|
|
32 |
!FileBrowserV2Tests methodsFor:'initialize / release'!
|
|
33 |
|
|
34 |
setUp
|
|
35 |
"common setup - invoked before testing"
|
|
36 |
|
|
37 |
super setUp
|
|
38 |
!
|
|
39 |
|
|
40 |
tearDown
|
|
41 |
"common cleanup - invoked after testing"
|
|
42 |
|
|
43 |
super tearDown
|
|
44 |
! !
|
|
45 |
|
|
46 |
!FileBrowserV2Tests methodsFor:'tests'!
|
|
47 |
|
4344
|
48 |
createBigDirectory
|
|
49 |
|
|
50 |
(Filename homeDirectory construct:'Test') makeDirectory.
|
|
51 |
1 to:5 do:[: id1|
|
|
52 |
1 to:50 do:[: id2|
|
|
53 |
1 to:50 do:[: id3|
|
|
54 |
('/home/penk/Test' asFilename construct:('file', id1 asString, '.', id2 asString,'.', id3 asString)) writeStream
|
|
55 |
]
|
|
56 |
].
|
|
57 |
]
|
|
58 |
"
|
|
59 |
FileBrowserV2Tests new createBigDirectory
|
|
60 |
"
|
|
61 |
!
|
|
62 |
|
|
63 |
removeBigDirectory
|
|
64 |
|
|
65 |
(Filename homeDirectory construct:'Test') recursiveRemove.
|
|
66 |
|
|
67 |
"
|
|
68 |
FileBrowserV2Tests new removeBigDirectory
|
|
69 |
"
|
|
70 |
!
|
|
71 |
|
|
72 |
testBigDirectory
|
|
73 |
!
|
|
74 |
|
3953
|
75 |
testDirectoryHistory
|
|
76 |
"Just a demonstration testCase.
|
|
77 |
Double click on the TestCase class or open a TestRunner to see me checking...
|
|
78 |
- please add more methods like this..."
|
|
79 |
|
|
80 |
|history|
|
|
81 |
|
|
82 |
history := AbstractFileBrowser directoryHistoryClass new.
|
4025
|
83 |
history resetForwardBackward.
|
|
84 |
self shouldnt: (history canBack).
|
3953
|
85 |
history addToHistory:'1'.
|
4025
|
86 |
self shouldnt:(history canBack).
|
3953
|
87 |
self shouldnt:(history canForward).
|
|
88 |
history addToHistory:'2'.
|
4025
|
89 |
self should:(history canBack).
|
3953
|
90 |
history addToHistory:'3'.
|
4025
|
91 |
self should:(history canBack).
|
3953
|
92 |
self shouldnt: (history canForward).
|
4025
|
93 |
self should: ((history goBack) = '2').
|
|
94 |
self should: ((history goBack) = '1').
|
3953
|
95 |
self should: (history canForward).
|
3964
|
96 |
self should: ((history goForward) = '3').
|
4025
|
97 |
self should: (history canForward).
|
3953
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
"
|
|
102 |
self run:#testDirectoryHistory
|
|
103 |
"
|
|
104 |
!
|
|
105 |
|
3892
|
106 |
testFileItem
|
|
107 |
"Just a demonstration testCase.
|
|
108 |
Double click on the TestCase class or open a TestRunner to see me checking...
|
|
109 |
- please add more methods like this..."
|
|
110 |
|
|
111 |
| file item|
|
|
112 |
|
|
113 |
file := Filename homeDirectory construct:'work/stx/doc/online/english/index.html'.
|
|
114 |
file exists ifTrue:[
|
4025
|
115 |
item := DirectoryContentsBrowser itemClass fileName:file.
|
3892
|
116 |
self should:(item mimeType = 'text/html').
|
|
117 |
].
|
|
118 |
|
|
119 |
"
|
|
120 |
self run:#testFileItem
|
|
121 |
"
|
|
122 |
!
|
|
123 |
|
|
124 |
testHardLink
|
|
125 |
"Just a demonstration testCase.
|
|
126 |
Double click on the TestCase class or open a TestRunner to see me checking...
|
|
127 |
- please add more methods like this..."
|
|
128 |
|
|
129 |
|browser|
|
|
130 |
|
|
131 |
browser := FileBrowserV2 new.
|
|
132 |
|
|
133 |
self should: ( browser isKindOf:AbstractFileBrowser ).
|
|
134 |
self should: ( browser respondsTo:#newHardLink ).
|
|
135 |
|
|
136 |
"/ self should: [ o at:0 ] raise:Error.
|
|
137 |
|
|
138 |
"
|
|
139 |
self run:#testHardLink
|
|
140 |
"
|
|
141 |
! !
|
|
142 |
|
|
143 |
!FileBrowserV2Tests class methodsFor:'documentation'!
|
|
144 |
|
|
145 |
version
|
4344
|
146 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowserV2Tests.st,v 1.5 2002-12-04 09:36:13 penk Exp $'
|
3892
|
147 |
! !
|