749
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
3 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
4 |
SWING Research Group, Czech Technical University in Prague
|
|
5 |
|
|
6 |
Parts of the code written by Claus Gittinger are under following
|
|
7 |
license:
|
|
8 |
|
|
9 |
This software is furnished under a license and may be used
|
|
10 |
only in accordance with the terms of that license and with the
|
|
11 |
inclusion of the above copyright notice. This software may not
|
|
12 |
be provided or otherwise made available to, or used by, any
|
|
13 |
other person. No title to or ownership of the software is
|
|
14 |
hereby transferred.
|
|
15 |
|
|
16 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
17 |
|
|
18 |
Permission is hereby granted, free of charge, to any person
|
|
19 |
obtaining a copy of this software and associated documentation
|
|
20 |
files (the 'Software'), to deal in the Software without
|
|
21 |
restriction, including without limitation the rights to use,
|
|
22 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23 |
copies of the Software, and to permit persons to whom the
|
|
24 |
Software is furnished to do so, subject to the following
|
|
25 |
conditions:
|
|
26 |
|
|
27 |
The above copyright notice and this permission notice shall be
|
|
28 |
included in all copies or substantial portions of the Software.
|
|
29 |
|
|
30 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
31 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
32 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
33 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
34 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
35 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
36 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
37 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
38 |
|
|
39 |
[1] Code written at SWING Research Group contain a signature
|
|
40 |
of one of the above copright owners.
|
|
41 |
"
|
|
42 |
"{ Package: 'stx:libjava' }"
|
|
43 |
|
|
44 |
TestResource subclass:#JavaAntProjectResource
|
|
45 |
instanceVariableNames:''
|
|
46 |
classVariableNames:''
|
|
47 |
poolDictionaries:''
|
|
48 |
category:'Languages-Java-Tests'
|
|
49 |
!
|
|
50 |
|
|
51 |
JavaAntProjectResource class instanceVariableNames:'built'
|
|
52 |
|
|
53 |
"
|
|
54 |
The following class instance variables are inherited by this class:
|
|
55 |
|
|
56 |
TestResource - current
|
|
57 |
TestAsserter -
|
|
58 |
Object -
|
|
59 |
"
|
|
60 |
!
|
|
61 |
|
|
62 |
!JavaAntProjectResource class methodsFor:'documentation'!
|
|
63 |
|
|
64 |
copyright
|
|
65 |
"
|
|
66 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
67 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
68 |
SWING Research Group, Czech Technical University in Prague
|
|
69 |
|
|
70 |
Parts of the code written by Claus Gittinger are under following
|
|
71 |
license:
|
|
72 |
|
|
73 |
This software is furnished under a license and may be used
|
|
74 |
only in accordance with the terms of that license and with the
|
|
75 |
inclusion of the above copyright notice. This software may not
|
|
76 |
be provided or otherwise made available to, or used by, any
|
|
77 |
other person. No title to or ownership of the software is
|
|
78 |
hereby transferred.
|
|
79 |
|
|
80 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
81 |
|
|
82 |
Permission is hereby granted, free of charge, to any person
|
|
83 |
obtaining a copy of this software and associated documentation
|
|
84 |
files (the 'Software'), to deal in the Software without
|
|
85 |
restriction, including without limitation the rights to use,
|
|
86 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
87 |
copies of the Software, and to permit persons to whom the
|
|
88 |
Software is furnished to do so, subject to the following
|
|
89 |
conditions:
|
|
90 |
|
|
91 |
The above copyright notice and this permission notice shall be
|
|
92 |
included in all copies or substantial portions of the Software.
|
|
93 |
|
|
94 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
95 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
96 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
97 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
98 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
99 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
100 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
101 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
102 |
|
|
103 |
[1] Code written at SWING Research Group contain a signature
|
|
104 |
of one of the above copright owners.
|
|
105 |
|
|
106 |
"
|
|
107 |
! !
|
|
108 |
|
|
109 |
!JavaAntProjectResource class methodsFor:'accessing'!
|
|
110 |
|
|
111 |
antBuildDotXml
|
|
112 |
|
|
113 |
^self antProjectDir / 'build.xml'
|
|
114 |
|
|
115 |
"Created: / 18-07-2011 / 15:21:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
116 |
!
|
|
117 |
|
|
118 |
built
|
|
119 |
^ built == true
|
|
120 |
|
|
121 |
"Modified: / 18-07-2011 / 14:48:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
122 |
!
|
|
123 |
|
|
124 |
built:aBoolean
|
|
125 |
built := aBoolean.
|
|
126 |
!
|
|
127 |
|
|
128 |
classpath
|
|
129 |
|
|
130 |
^ Array with: (self antProjectDir / 'bin')
|
|
131 |
|
|
132 |
"Created: / 18-07-2011 / 15:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
133 |
! !
|
|
134 |
|
|
135 |
!JavaAntProjectResource class methodsFor:'accessing - ant project'!
|
|
136 |
|
|
137 |
antProjectDir
|
|
138 |
"raise an error: must be redefined in concrete subclass(es)"
|
|
139 |
|
|
140 |
^ self subclassResponsibility
|
|
141 |
! !
|
|
142 |
|
|
143 |
!JavaAntProjectResource class methodsFor:'running'!
|
|
144 |
|
|
145 |
build
|
|
146 |
"
|
|
147 |
JavaTestsResource build: true.
|
|
148 |
JavaTestsResource build: false.
|
|
149 |
"
|
|
150 |
|
|
151 |
built == true
|
|
152 |
ifFalse:
|
|
153 |
[ "Check for ant"
|
|
154 |
self assert:(OperatingSystem canExecuteCommand:'ant')
|
|
155 |
description:'Cannot execute ant'.
|
|
156 |
self assert:self antBuildDotXml exists
|
|
157 |
description:'No build.xml in ' , self antProjectDir asString.
|
|
158 |
"Launch ant"
|
|
159 |
Transcript
|
|
160 |
show:'Running ant in ';
|
|
161 |
showCR:self antProjectDir asString.
|
|
162 |
OperatingSystem
|
|
163 |
executeCommand:'ant -f build.xml'
|
|
164 |
inputFrom:nil
|
|
165 |
outputTo:Stdout
|
|
166 |
errorTo:Stderr
|
|
167 |
inDirectory:self antProjectDir
|
|
168 |
onError:
|
|
169 |
[:status |
|
|
170 |
Transcript showCR:'ANT FAILED!!!!!!'.
|
|
171 |
self error:'ant failed'.
|
|
172 |
^ self ].
|
|
173 |
Transcript showCR:'Ant finished'.
|
|
174 |
built := true. ].
|
|
175 |
^ built.
|
|
176 |
|
|
177 |
"Modified: / 16-03-2011 / 15:20:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
178 |
"Modified: / 04-06-2011 / 18:03:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
179 |
"Modified (format): / 18-07-2011 / 15:05:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
180 |
! !
|
|
181 |
|
|
182 |
!JavaAntProjectResource methodsFor:'running'!
|
|
183 |
|
|
184 |
setUp
|
|
185 |
self class build.
|
|
186 |
self class classpath do:[:each | Java addToClassPath:each ].
|
|
187 |
|
|
188 |
"
|
|
189 |
JavaTestsResource basicNew setUp
|
|
190 |
Java classPath
|
|
191 |
"
|
|
192 |
|
|
193 |
"Modified: / 07-05-2011 / 18:19:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
194 |
"Created: / 18-07-2011 / 15:04:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
195 |
! !
|
|
196 |
|
|
197 |
!JavaAntProjectResource methodsFor:'testing'!
|
|
198 |
|
|
199 |
isAvailable
|
|
200 |
|
|
201 |
^self class antProjectDir exists and:
|
|
202 |
[self class antBuildDotXml exists]
|
|
203 |
|
|
204 |
"Created: / 18-07-2011 / 15:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
205 |
! !
|
|
206 |
|
|
207 |
!JavaAntProjectResource class methodsFor:'documentation'!
|
|
208 |
|
|
209 |
version_SVN
|
|
210 |
^ '$Id$'
|
|
211 |
! ! |