FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JSON-java/tests/TestCookieList.java at master · Noboru/JSON-java · GitHub
Noboru
/
JSON-java
Public
forked from
stleary/JSON-java
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JSON-java
/
tests
/
TestCookieList.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
68 lines (59 loc) · 1.68 KB
Breadcrumbs
JSON-java
/
tests
/
TestCookieList.java
Copy path
File metadata and controls
68 lines (59 loc) · 1.68 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
/*
* File: TestCookieList.java Author: JSON.org
*/
package
org
.
json
.
tests
;
import
org
.
json
.
CookieList
;
import
org
.
json
.
JSONException
;
import
org
.
json
.
JSONObject
;
import
junit
.
framework
.
TestCase
;
/**
* The Class TestCookieList.
*/
public
class
TestCookieList
extends
TestCase
{
/** The jsonobject. */
JSONObject
jsonobject
=
new
JSONObject
();
/**
* Tests the toJsonObject method using random cookie list.
*/
public
void
testToJsonObject_RandomCookieList
()
{
try
{
jsonobject
=
CookieList
.
toJSONObject
(
" f%oo = b+l=ah ; o;n%40e = t.wo "
);
assertEquals
(
"{
\n
\"
o;n@e
\"
:
\"
t.wo
\"
,
\n
\"
f%oo
\"
:
\"
b l=ah
\"
\n
}"
,
jsonobject
.
toString
(
2
));
assertEquals
(
"o%3bn@e=t.wo;f%25oo=b l%3dah"
,
CookieList
.
toString
(
jsonobject
));
}
catch
(
JSONException
e
)
{
fail
(
e
.
getMessage
());
}
}
/**
* Tests the toJsonObject method using null key.
*/
public
void
testToJsonObject_NullKey
()
{
try
{
jsonobject
=
CookieList
.
toJSONObject
(
" f%oo = b+l=ah ; o;n%40e = t.wo "
);
jsonobject
.
put
(
"abc"
,
JSONObject
.
NULL
);
assertEquals
(
"o%3bn@e=t.wo;f%25oo=b l%3dah"
,
CookieList
.
toString
(
jsonobject
));
}
catch
(
JSONException
e
)
{
fail
(
e
.
getMessage
());
}
}
/**
* Tests the constructor method.
*/
public
static
void
testConstructor
()
{
CookieList
cookielist
=
new
CookieList
();
assertEquals
(
"CookieList"
,
cookielist
.
getClass
().
getSimpleName
());
}
}
Back
|
FazBrowse Home
|
New Git URL