9
9
10
10
11
11
/**
12
- * Tests for JSON-Java Property.java
12
+ * Tests for JSON-Java Property
13
13
*/
14
14
public class PropertyTest {
15
15
16
+ /**
17
+ * JSONObject from null properties object should
18
+ * result in an empty JSONObject.
19
+ */
16
20
@ Test
17
21
public void shouldHandleNullProperties () {
18
-
19
22
Properties properties = null ;
20
23
JSONObject jsonObject = Property .toJSONObject (properties );
21
24
assertTrue ("jsonObject should be empty" , jsonObject .length () == 0 );
22
25
}
23
26
27
+ /**
28
+ * JSONObject from empty properties object should
29
+ * result in an empty JSONObject.
30
+ */
24
31
@ Test
25
32
public void shouldHandleEmptyProperties () {
26
-
27
33
Properties properties = new Properties ();
28
34
JSONObject jsonObject = Property .toJSONObject (properties );
29
35
assertTrue ("jsonObject should be empty" , jsonObject .length () == 0 );
30
36
}
31
37
38
+ /**
39
+ * JSONObject from simple properties object.
40
+ */
32
41
@ Test
33
42
public void shouldHandleProperties () {
34
43
Properties properties = new Properties ();
@@ -54,6 +63,10 @@ public void shouldHandleProperties() {
54
63
"Indianapolis" .equals (jsonObject .get ("Indiana" )));
55
64
}
56
65
66
+ /**
67
+ * Null JSONObject toProperties() should result in an empty
68
+ * Properties object.
69
+ */
57
70
@ Test
58
71
public void shouldHandleNullJSONProperty () {
59
72
JSONObject jsonObject = null ;
@@ -62,6 +75,10 @@ public void shouldHandleNullJSONProperty() {
62
75
properties .size () == 0 );
63
76
}
64
77
78
+ /**
79
+ * Properties should convert to JSONObject, and back to
80
+ * Properties without changing.
81
+ */
65
82
@ Test
66
83
public void shouldHandleJSONProperty () {
67
84
Properties properties = new Properties ();
0 commit comments