use of com.liferay.faces.bridge.internal.BaseURLBridgeURIAdapterImpl in project liferay-faces-bridge-impl by liferay.
the class BridgeURITest method testXmlEscaping.
@Test
public void testXmlEscaping() throws UnsupportedEncodingException {
try {
BridgeURI bridgeURI = newBridgeURI("http://www.liferay.com/hello.world?a=1&b=2");
BaseURL nonEncodedURL = new BaseURLBridgeURIAdapterImpl(bridgeURI);
Writer stringWriter = new StringWriter();
nonEncodedURL.write(stringWriter, false);
Assert.assertTrue("http://www.liferay.com/hello.world?a=1&b=2".equals(stringWriter.toString()));
stringWriter = new StringWriter();
nonEncodedURL.write(stringWriter, true);
Assert.assertTrue("http://www.liferay.com/hello.world?a=1&b=2".equals(stringWriter.toString()));
} catch (IOException e) {
throw new AssertionError(e);
} catch (URISyntaxException e) {
throw new AssertionError(e);
}
}
Aggregations