99
1010
1111/**
12- * Tests for JSON-Java Property.java
12+ * Tests for JSON-Java Property
1313 */
1414public class PropertyTest {
1515
16+ /**
17+ * JSONObject from null properties object should
18+ * result in an empty JSONObject.
19+ */
1620 @ Test
1721 public void shouldHandleNullProperties () {
18-
1922 Properties properties = null ;
2023 JSONObject jsonObject = Property .toJSONObject (properties );
2124 assertTrue ("jsonObject should be empty" , jsonObject .length () == 0 );
2225 }
2326
27+ /**
28+ * JSONObject from empty properties object should
29+ * result in an empty JSONObject.
30+ */
2431 @ Test
2532 public void shouldHandleEmptyProperties () {
26-
2733 Properties properties = new Properties ();
2834 JSONObject jsonObject = Property .toJSONObject (properties );
2935 assertTrue ("jsonObject should be empty" , jsonObject .length () == 0 );
3036 }
3137
38+ /**
39+ * JSONObject from simple properties object.
40+ */
3241 @ Test
3342 public void shouldHandleProperties () {
3443 Properties properties = new Properties ();
@@ -54,6 +63,10 @@ public void shouldHandleProperties() {
5463 "Indianapolis" .equals (jsonObject .get ("Indiana" )));
5564 }
5665
66+ /**
67+ * Null JSONObject toProperties() should result in an empty
68+ * Properties object.
69+ */
5770 @ Test
5871 public void shouldHandleNullJSONProperty () {
5972 JSONObject jsonObject = null ;
@@ -62,6 +75,10 @@ public void shouldHandleNullJSONProperty() {
6275 properties .size () == 0 );
6376 }
6477
78+ /**
79+ * Properties should convert to JSONObject, and back to
80+ * Properties without changing.
81+ */
6582 @ Test
6683 public void shouldHandleJSONProperty () {
6784 Properties properties = new Properties ();
0 commit comments