Add a test for serializing WrongType exception

There's a bug report about this not working... it seems to work
here though.
This commit is contained in:
Havoc Pennington 2015-03-27 10:38:12 -04:00
parent a3c255e50a
commit a7240387e8

View File

@ -954,6 +954,17 @@ class PublicApiTest extends TestUtils {
assertTrue("origin null after deserialize", e.origin() == null) assertTrue("origin null after deserialize", e.origin() == null)
} }
@Test
def exceptionSerializableWithWrongType() {
val e = intercept[ConfigException.WrongType] {
ConfigValueFactory.fromAnyRef(Map("item" -> "uhoh, fail").asJava) match {
case o: ConfigObject => o.toConfig.getStringList("item")
}
}
val eCopy = checkSerializableNoMeaningfulEquals(e)
assertTrue("messages equal after deserialize", e.getMessage.equals(eCopy.getMessage))
}
@Test @Test
def invalidateCaches() { def invalidateCaches() {
val conf0 = ConfigFactory.load() val conf0 = ConfigFactory.load()