mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
Add method comments so JavaDoc will pick them up.
This commit is contained in:
parent
ccbec8127c
commit
8f71e01ae3
1 changed files with 20 additions and 3 deletions
|
@ -9,26 +9,35 @@ import org.junit.Test;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for JSON-Java Property.java
|
* Tests for JSON-Java Property
|
||||||
*/
|
*/
|
||||||
public class PropertyTest {
|
public class PropertyTest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSONObject from null properties object should
|
||||||
|
* result in an empty JSONObject.
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void shouldHandleNullProperties() {
|
public void shouldHandleNullProperties() {
|
||||||
|
|
||||||
Properties properties = null;
|
Properties properties = null;
|
||||||
JSONObject jsonObject = Property.toJSONObject(properties);
|
JSONObject jsonObject = Property.toJSONObject(properties);
|
||||||
assertTrue("jsonObject should be empty", jsonObject.length() == 0);
|
assertTrue("jsonObject should be empty", jsonObject.length() == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSONObject from empty properties object should
|
||||||
|
* result in an empty JSONObject.
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void shouldHandleEmptyProperties() {
|
public void shouldHandleEmptyProperties() {
|
||||||
|
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
JSONObject jsonObject = Property.toJSONObject(properties);
|
JSONObject jsonObject = Property.toJSONObject(properties);
|
||||||
assertTrue("jsonObject should be empty", jsonObject.length() == 0);
|
assertTrue("jsonObject should be empty", jsonObject.length() == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSONObject from simple properties object.
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void shouldHandleProperties() {
|
public void shouldHandleProperties() {
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
|
@ -54,6 +63,10 @@ public class PropertyTest {
|
||||||
"Indianapolis".equals(jsonObject.get("Indiana")));
|
"Indianapolis".equals(jsonObject.get("Indiana")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Null JSONObject toProperties() should result in an empty
|
||||||
|
* Properties object.
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void shouldHandleNullJSONProperty() {
|
public void shouldHandleNullJSONProperty() {
|
||||||
JSONObject jsonObject= null;
|
JSONObject jsonObject= null;
|
||||||
|
@ -62,6 +75,10 @@ public class PropertyTest {
|
||||||
properties.size() == 0);
|
properties.size() == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Properties should convert to JSONObject, and back to
|
||||||
|
* Properties without changing.
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void shouldHandleJSONProperty() {
|
public void shouldHandleJSONProperty() {
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue