String portParam,
String expected) throws Exception {
URLConverter converter = new TranscoderURLConverter(hostParam,
portParam);
XMLPipelineContext context = new XMLPipelineContextStub() {
URL baseURI;
public void pushBaseURI(String s) throws MalformedURLException {
baseURI = new URL(s);
}
public URL popBaseURI() {
return null;
}
public URL getCurrentBaseURI() {
return baseURI;
}
};
if (baseURL != null) {
context.pushBaseURI(baseURL);
} else {
context.pushBaseURI("http://myhost:1664/mypath");
}
String actual = converter.toURLC(context,
input,
serverURL);