Skip to content

Commit 04168c3

Browse files
Merge pull request #26 from ThalesGroup/dev-issue25
Fix tests time issue #25 and tests setup refactoring
2 parents 4b989b0 + c3c5274 commit 04168c3

File tree

4 files changed

+48
-25
lines changed

4 files changed

+48
-25
lines changed

.smalltalkci.default.ston

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ SmalltalkCISpec {
77
}
88
],
99
#testing : {
10-
#include : {
11-
#packages : [ 'OWS*-Tests' ]
12-
}
10+
#packages : [ 'OWS-Tests' ]
1311
}
1412
}

src/OWS-Tests/OWSServiceWMSTest.class.st

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,24 @@ Class {
66
#superclass : #TestCase,
77
#traits : 'TTestTools',
88
#classTraits : 'TTestTools classTrait',
9+
#instVars : [
10+
'wms'
11+
],
912
#category : #'OWS-Tests'
1013
}
1114

15+
{ #category : #running }
16+
OWSServiceWMSTest >> setUp [
17+
18+
super setUp.
19+
20+
wms := OWSServiceWMS new
21+
]
22+
1223
{ #category : #testsGetCapabilities }
1324
OWSServiceWMSTest >> testDocument [
1425

15-
| wms doc |
16-
wms := OWSServiceWMS new.
26+
| doc |
1727
wms url: 'https://data.geopf.fr/wms-r'.
1828
doc := wms capabilities.
1929
self assert: doc root name equals: 'WMS_Capabilities'
@@ -22,8 +32,7 @@ OWSServiceWMSTest >> testDocument [
2232
{ #category : #testsGetMap }
2333
OWSServiceWMSTest >> testInvalidLayer [
2434

25-
| wms map size |
26-
wms := OWSServiceWMS new.
35+
| map size |
2736
size := 800 @ 600.
2837
wms url: 'https://data.geopf.fr/wms-r'.
2938

@@ -40,8 +49,7 @@ OWSServiceWMSTest >> testInvalidLayer [
4049
{ #category : #testsGetCapabilities }
4150
OWSServiceWMSTest >> testLayers [
4251

43-
| wms layers ok |
44-
wms := OWSServiceWMS new.
52+
| layers ok |
4553
wms url: 'https://data.geopf.fr/wms-r'.
4654
layers := wms layers.
4755
self assert: layers isNotEmpty.
@@ -58,8 +66,9 @@ OWSServiceWMSTest >> testLayers [
5866
{ #category : #testsGetMap }
5967
OWSServiceWMSTest >> testOneLayer [
6068

61-
| wms map size |
62-
wms := OWSServiceWMS new.
69+
| map size |
70+
self timeLimit: 10 seconds.
71+
6372
wms url: 'https://data.geopf.fr/wms-r'.
6473

6574
size := 800 @ 600.
@@ -79,8 +88,7 @@ OWSServiceWMSTest >> testOneLayer [
7988
{ #category : #testsGetCapabilities }
8089
OWSServiceWMSTest >> testOperations [
8190

82-
| wms requests ok x |
83-
wms := OWSServiceWMS new.
91+
| requests ok x |
8492
wms url: 'https://data.geopf.fr/wms-r'.
8593
requests := wms operations.
8694
self assert: requests isNotEmpty.
@@ -106,8 +114,9 @@ OWSServiceWMSTest >> testOperations [
106114
{ #category : #testsGetMap }
107115
OWSServiceWMSTest >> testSeveralLayers [
108116

109-
| wms map size |
110-
wms := OWSServiceWMS new.
117+
| map size |
118+
self timeLimit: 10 seconds.
119+
111120
size := 800 @ 600.
112121
wms url: 'https://data.geopf.fr/wms-r'.
113122
map := wms
@@ -126,8 +135,7 @@ OWSServiceWMSTest >> testSeveralLayers [
126135
{ #category : #testsGetCapabilities }
127136
OWSServiceWMSTest >> testVersion [
128137

129-
| wms version |
130-
wms := OWSServiceWMS new.
138+
| version |
131139
wms url: 'https://data.geopf.fr/wms-r'.
132140

133141
version := wms version.

src/OWS-Tests/OWSServiceWMTSTest.class.st

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,23 @@ Class {
33
#superclass : #TestCase,
44
#traits : 'TTestTools',
55
#classTraits : 'TTestTools classTrait',
6+
#instVars : [
7+
'wmts'
8+
],
69
#category : #'OWS-Tests'
710
}
811

12+
{ #category : #running }
13+
OWSServiceWMTSTest >> setUp [
14+
super setUp.
15+
16+
wmts := OWSServiceWMTS new
17+
]
18+
919
{ #category : #testsGetTile }
1020
OWSServiceWMTSTest >> testGetTile [
1121

12-
| wmts tile |
13-
wmts := OWSServiceWMTS new.
22+
| tile |
1423
wmts url: 'https://data.geopf.fr/wmts'.
1524

1625
tile := wmts
@@ -32,8 +41,7 @@ OWSServiceWMTSTest >> testGetTile [
3241
{ #category : #testsGetCapabilities }
3342
OWSServiceWMTSTest >> testOperations [
3443

35-
| wmts requests gettile |
36-
wmts := OWSServiceWMTS new.
44+
| requests gettile |
3745
wmts url: 'https://data.geopf.fr/wmts'.
3846
requests := wmts operations.
3947
self assert: requests size equals: 3.
@@ -45,8 +53,7 @@ OWSServiceWMTSTest >> testOperations [
4553
{ #category : #testsGetCapabilities }
4654
OWSServiceWMTSTest >> testVersion [
4755

48-
| wmts version |
49-
wmts := OWSServiceWMTS new.
56+
| version |
5057
wmts url: 'https://data.geopf.fr/wmts'.
5158

5259
version := wmts version.

src/OWS-Tests/OWSTMSTest.class.st

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
Class {
22
#name : #OWSTMSTest,
33
#superclass : #TestCase,
4+
#instVars : [
5+
'tms'
6+
],
47
#category : #'OWS-Tests'
58
}
69

10+
{ #category : #running }
11+
OWSTMSTest >> setUp [
12+
13+
super setUp.
14+
15+
tms := OWSTMS new
16+
]
17+
718
{ #category : #tests }
819
OWSTMSTest >> testTile [
920

10-
| tms tile |
11-
tms := OWSTMS new.
21+
| tile |
1222
tms url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'.
1323

1424
tile := tms tile: 0 y: 0 z: 0.

0 commit comments

Comments
 (0)