01: package org.jasig.portal.utils.uri;
02:
03: import java.net.URI;
04: import java.net.URISyntaxException;
05:
06: import junit.framework.TestCase;
07:
08: public class BlockedUriExceptionTest extends TestCase {
09:
10: /**
11: * Test one of the chaining constructors of BlockedUriException,
12: * demonstrating that it exposes the blocked URI and that it captures the
13: * provided cause.
14: * @throws URISyntaxException - if the testcase itself fails for bad URI syntax in setup.
15: */
16: public void testChaining() throws URISyntaxException {
17: Throwable cause = new Throwable();
18:
19: URI blockedUri = new URI("http://some.blocked.uri.com/");
20:
21: String reason = "Some good reason for blocking the URI.";
22:
23: BlockedUriException bue = new BlockedUriException(blockedUri,
24: reason, cause);
25:
26: assertSame(cause, bue.getCause());
27: assertEquals(blockedUri, bue.getBlockedUri());
28: assertEquals(reason, bue.getReasonBlocked());
29:
30: }
31:
32: }
|