public void testMediaLocator() throws MalformedURLException
{
try
{
new MediaLocator((String) null);
assertTrue(false);
}
catch (NullPointerException e)
{
}
assertEquals(new MediaLocator(new URL("http://www.yahoo.com")).toExternalForm(), "http://www.yahoo.com");
assertEquals(new MediaLocator(new URL("http://www.yahoo.com")).getURL().toExternalForm(), "http://www.yahoo.com");
assertEquals(new MediaLocator("http://www.yahoo.com").getURL().toExternalForm(), "http://www.yahoo.com");
assertFalse(new MediaLocator("").equals(new MediaLocator(""))); // does not override equals
assertEquals(new MediaLocator("").getProtocol(), "");
assertEquals(new MediaLocator("").getRemainder(), "");
assertEquals(new MediaLocator(":").getProtocol(), "");
assertEquals(new MediaLocator(":").getRemainder(), "");
assertEquals(new MediaLocator("abcxyz").getProtocol(), "");
assertEquals(new MediaLocator("abcxyz").getRemainder(), "");
assertEquals(new MediaLocator("").toString(), "");
assertEquals(new MediaLocator("abc").toString(), "abc");
assertEquals(new MediaLocator("abc:xyz").toString(), "abc:xyz");
assertEquals(new MediaLocator("abc:xyz").getProtocol(), "abc");
assertEquals(new MediaLocator("abc:xyz").getRemainder(), "xyz");
assertEquals(new MediaLocator("abc:xyz").toExternalForm(), "abc:xyz");
assertEquals(new MediaLocator("abc").toExternalForm(), "abc");
assertEquals(new MediaLocator("").toExternalForm(), "");
assertEquals(new MediaLocator(":").toExternalForm(), ":");
}