mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-06 02:35:33 +08:00
Add method comments so JavaDoc will pick them up.
This commit is contained in:
@@ -9,26 +9,35 @@ import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Tests for JSON-Java Property.java
|
||||
* Tests for JSON-Java Property
|
||||
*/
|
||||
public class PropertyTest {
|
||||
|
||||
/**
|
||||
* JSONObject from null properties object should
|
||||
* result in an empty JSONObject.
|
||||
*/
|
||||
@Test
|
||||
public void shouldHandleNullProperties() {
|
||||
|
||||
Properties properties = null;
|
||||
JSONObject jsonObject = Property.toJSONObject(properties);
|
||||
assertTrue("jsonObject should be empty", jsonObject.length() == 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* JSONObject from empty properties object should
|
||||
* result in an empty JSONObject.
|
||||
*/
|
||||
@Test
|
||||
public void shouldHandleEmptyProperties() {
|
||||
|
||||
Properties properties = new Properties();
|
||||
JSONObject jsonObject = Property.toJSONObject(properties);
|
||||
assertTrue("jsonObject should be empty", jsonObject.length() == 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* JSONObject from simple properties object.
|
||||
*/
|
||||
@Test
|
||||
public void shouldHandleProperties() {
|
||||
Properties properties = new Properties();
|
||||
@@ -54,6 +63,10 @@ public class PropertyTest {
|
||||
"Indianapolis".equals(jsonObject.get("Indiana")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Null JSONObject toProperties() should result in an empty
|
||||
* Properties object.
|
||||
*/
|
||||
@Test
|
||||
public void shouldHandleNullJSONProperty() {
|
||||
JSONObject jsonObject= null;
|
||||
@@ -62,6 +75,10 @@ public class PropertyTest {
|
||||
properties.size() == 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties should convert to JSONObject, and back to
|
||||
* Properties without changing.
|
||||
*/
|
||||
@Test
|
||||
public void shouldHandleJSONProperty() {
|
||||
Properties properties = new Properties();
|
||||
|
Reference in New Issue
Block a user