1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00
JSON-java/tests/TestJSONException.java
2012-01-30 10:15:05 -05:00

35 lines
No EOL
785 B
Java

/*
* File: TestJSONException.java Author: JSON.org
*/
package org.json.tests;
import org.json.JSONException;
import junit.framework.TestCase;
/**
* The Class TestJSONException.
*/
public class TestJSONException extends TestCase {
/** The jsonexception. */
JSONException jsonexception;
/**
* Tests the constructor method using string.
*/
public void testConstructor_String() {
jsonexception = new JSONException("test String");
assertEquals("test String", jsonexception.getMessage());
}
/**
* Tests the constructor method using exception.
*/
public void testConstructor_Exception() {
Exception e = new Exception();
jsonexception = new JSONException(e);
assertEquals(e, jsonexception.getCause());
}
}