FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
mapserver/mapscript/java/examples/WxSTest.java at master · dufop/mapserver · GitHub
dufop
/
mapserver
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
mapserver
/
mapscript
/
java
/
examples
/
WxSTest.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
83 lines (64 loc) · 2.48 KB
Breadcrumbs
mapserver
/
mapscript
/
java
/
examples
/
WxSTest.java
Copy path
File metadata and controls
83 lines (64 loc) · 2.48 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import
edu
.
umn
.
gis
.
mapscript
.
mapObj
;
import
edu
.
umn
.
gis
.
mapscript
.
OWSRequest
;
import
edu
.
umn
.
gis
.
mapscript
.
mapscript
;
import
java
.
io
.*;
class
WxSTest_thread
extends
Thread
{
public
String
mapName
;
public
byte
[]
resultBytes
;
public
void
run
() {
mapObj
map
=
new
mapObj
(
mapName
);
map
.
setMetaData
(
"ows_onlineresource"
,
"http://dummy.org/"
);
OWSRequest
req
=
new
OWSRequest
();
req
.
setParameter
(
"SERVICE"
,
"WMS"
);
req
.
setParameter
(
"VERSION"
,
"1.1.0"
);
req
.
setParameter
(
"REQUEST"
,
"GetCapabilities"
);
mapscript
.
msIO_installStdoutToBuffer
();
int
owsResult
=
map
.
OWSDispatch
(
req
);
if
(
owsResult
!=
0
)
System
.
out
.
println
(
"OWSDispatch Result (expect 0): "
+
owsResult
);
// System.out.println( "Document:" );
// System.out.println( mapscript.msIO_getStdoutBufferString() );
resultBytes
=
mapscript
.
msIO_getStdoutBufferBytes
();
mapscript
.
msIO_resetHandlers
();
}
}
public
class
WxSTest
{
public
static
void
main
(
String
[]
args
) {
try
{
WxSTest_thread
tt
[] =
new
WxSTest_thread
[
100
];
int
i
;
int
expectedLength
=
0
,
success
=
0
,
failure
=
0
;
for
(
i
=
0
;
i
<
tt
.
length
;
i
++ )
{
tt
[
i
] =
new
WxSTest_thread
();
tt
[
i
].
mapName
=
args
[
0
];
}
for
(
i
=
0
;
i
<
tt
.
length
;
i
++ )
tt
[
i
].
start
();
for
(
i
=
0
;
i
<
tt
.
length
;
i
++ )
{
tt
[
i
].
join
();
if
(
i
==
0
)
{
expectedLength
=
tt
[
i
].
resultBytes
.
length
;
System
.
out
.
println
(
"["
+
i
+
"] Document Length: "
+
expectedLength
+
", expecting somewhere around 10000 or more."
);
}
else
if
(
expectedLength
!=
tt
[
i
].
resultBytes
.
length
)
{
System
.
out
.
println
(
"["
+
i
+
"] Document Length:"
+
tt
[
i
].
resultBytes
.
length
+
" Expected:"
+
expectedLength
);
failure
++;
}
else
success
++;
// dump test results to fs for post-mortem inspection
FileOutputStream
fos
=
new
FileOutputStream
(
"/tmp/wxs_test_"
+
i
);
fos
.
write
(
tt
[
i
].
resultBytes
);
fos
.
close
();
}
System
.
out
.
println
(
"Successes: "
+
success
);
System
.
out
.
println
(
"Failures: "
+
failure
);
}
catch
(
Exception
e
) {
e
.
printStackTrace
();
}
}
}
Back
|
FazBrowse Home
|
New Git URL