diff options
author | Victor Chang <vichang@google.com> | 2022-05-04 17:45:46 +0100 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2022-05-10 11:30:15 +0000 |
commit | 8fb5c96082bbc9d37a2d1c463cc77fc0ad27fc7d (patch) | |
tree | 5d94586b9f5ef2369a7168393055c9e5d8638255 | |
parent | a3e02c43fd1d59be1c65ec5ef8e6e1ac0d4bb709 (diff) | |
download | libcore-8fb5c96082bbc9d37a2d1c463cc77fc0ad27fc7d.tar.gz |
Add more test for MalformedURLException
Bug: 119393918
Bug: 182166637
Test: atest
CtsLibcoreTestCases: libcore.java.net.MalformedURLExceptionTest
Change-Id: I0468bca33e2e09c6cea4ecb1d0c14d9b30273329
(cherry picked from commit ffd7713ba77f27a0ae9d736cf50cbdda1756d26c)
Merged-In: I0468bca33e2e09c6cea4ecb1d0c14d9b30273329
-rw-r--r-- | luni/src/test/java/libcore/java/net/MalformedURLExceptionTest.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/luni/src/test/java/libcore/java/net/MalformedURLExceptionTest.java b/luni/src/test/java/libcore/java/net/MalformedURLExceptionTest.java index b9998da9a40..b60b7b8b9aa 100644 --- a/luni/src/test/java/libcore/java/net/MalformedURLExceptionTest.java +++ b/luni/src/test/java/libcore/java/net/MalformedURLExceptionTest.java @@ -17,6 +17,7 @@ package libcore.java.net; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import java.net.MalformedURLException; @@ -28,8 +29,12 @@ import org.junit.runners.JUnit4; public class MalformedURLExceptionTest { @Test - public void testEmptyConstructor() { + public void testConstructor() { MalformedURLException e = new MalformedURLException(); assertNull(e.getMessage()); + + String msg = "x:yyy is not valid URL"; + e = new MalformedURLException(msg); + assertEquals(msg, e.getMessage()); } } |