本文整理了Java中org.apache.shindig.common.uri.UriBuilder.setAuthority()
方法的一些代码示例,展示了UriBuilder.setAuthority()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UriBuilder.setAuthority()
方法的具体详情如下:
包路径:org.apache.shindig.common.uri.UriBuilder
类名称:UriBuilder
方法名:setAuthority
暂无
代码示例来源:origin: org.apache.shindig/shindig-common
@Test
public void justAuthorityAndPath() {
UriBuilder builder = new UriBuilder()
.setAuthority("apache.org")
.setPath("/shindig");
assertEquals("//apache.org/shindig", builder.toString());
}
代码示例来源:origin: org.gatein.shindig/shindig-common
@Test
public void iterableQueryParameters() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.putQueryParameter("hello", Lists.newArrayList("world", "monde"))
.setFragment("foo");
assertEquals("http://apache.org/shindig?hello=world&hello=monde#foo", builder.toString());
}
代码示例来源:origin: com.lmco.shindig/shindig-common
@Test
public void iterableQueryParameters() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.putQueryParameter("hello", Lists.newArrayList("world", "monde"))
.setFragment("foo");
assertEquals("http://apache.org/shindig?hello=world&hello=monde#foo", builder.toString());
}
代码示例来源:origin: com.lmco.shindig/shindig-common
@Test
public void iterableFragmentParameters() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.putFragmentParameter("hello", Lists.newArrayList("world", "monde"))
.setQuery("foo");
assertEquals("http://apache.org/shindig?foo#hello=world&hello=monde", builder.toString());
}
代码示例来源:origin: org.apache.shindig/shindig-common
@Test
public void constructFromUriAndModify() {
Uri uri = Uri.parse("http://apache.org/foo/bar?foo=bar#foo");
UriBuilder builder = new UriBuilder(uri);
builder.setAuthority("example.org");
builder.addQueryParameter("bar", "foo");
assertEquals("http://example.org/foo/bar?foo=bar&bar=foo#foo", builder.toString());
}
代码示例来源:origin: org.apache.shindig/shindig-common
@Test
public void queryStringIsUnescaped() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.setQuery("hello+world=world%26bar");
assertEquals("world&bar", builder.getQueryParameter("hello world"));
}
代码示例来源:origin: org.gatein.shindig/shindig-common
@Test
public void noSchemeUsed() {
UriBuilder builder = new UriBuilder()
.setAuthority("apache.org")
.setPath("/shindig")
.setQuery("hello=world")
.setFragment("foo");
assertEquals("//apache.org/shindig?hello=world#foo", builder.toString());
}
代码示例来源:origin: org.gatein.shindig/shindig-common
@Test
public void noFragmentUsed() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.setQuery("hello=world");
assertEquals("http://apache.org/shindig?hello=world", builder.toString());
}
代码示例来源:origin: org.gatein.shindig/shindig-common
@Test
public void queryStringIsUnescaped() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.setQuery("hello+world=world%26bar");
assertEquals("world&bar", builder.getQueryParameter("hello world"));
}
代码示例来源:origin: org.gatein.shindig/shindig-common
@Test
public void fragmentStringIsUnescaped() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.setFragment("hello+world=world%26bar");
assertEquals("world&bar", builder.getFragmentParameter("hello world"));
}
代码示例来源:origin: org.apache.shindig/shindig-common
@Test
public void noPathUsed() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setQuery("hello=world")
.setFragment("foo");
assertEquals("http://apache.org?hello=world#foo", builder.toString());
}
代码示例来源:origin: org.apache.shindig/shindig-common
@Test
public void noQueryUsed() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.setFragment("foo");
assertEquals("http://apache.org/shindig#foo", builder.toString());
}
代码示例来源:origin: org.apache.shindig/shindig-common
@Test
public void noFragmentUsed() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.setQuery("hello=world");
assertEquals("http://apache.org/shindig?hello=world", builder.toString());
}
代码示例来源:origin: org.wso2.org.apache.shindig/shindig-common
@Test
public void fragmentStringIsUnescaped() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.setFragment("hello+world=world%26bar");
assertEquals("world&bar", builder.getFragmentParameter("hello world"));
}
代码示例来源:origin: org.apache.shindig/shindig-common
@Test
public void addIdenticalParameters() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.addQueryParameter("hello", "world")
.addQueryParameter("hello", "goodbye")
.setFragment("foo");
assertEquals("http://apache.org/shindig?hello=world&hello=goodbye#foo", builder.toString());
}
代码示例来源:origin: org.wso2.org.apache.shindig/shindig-common
@Test
public void addTwoFragmentParameters() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.addFragmentParameter("hello", "world")
.addFragmentParameter("foo", "bar")
.setQuery("foo");
assertEquals("http://apache.org/shindig?foo#hello=world&foo=bar", builder.toString());
}
代码示例来源:origin: org.apache.shindig/shindig-gadgets
@Test
public void mismatchedHostNonStrict() throws Exception {
String host = "host.com";
String path = "/proxy/path";
DefaultProxyUriManager manager = makeManager("foo" + host, path, null);
Uri testUri = new UriBuilder().setAuthority(host).setPath(path)
.addQueryParameter(Param.URL.getKey(), "http://foo.com")
.addQueryParameter(Param.CONTAINER.getKey(), CONTAINER).toUri();
manager.process(testUri);
}
代码示例来源:origin: org.gatein.shindig/shindig-common
@Test
public void queryParamsAreEscaped() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.addQueryParameter("hello world", "foo&bar")
.setFragment("foo");
assertEquals("http://apache.org/shindig?hello+world=foo%26bar#foo", builder.toString());
assertEquals("hello+world=foo%26bar", builder.getQuery());
}
代码示例来源:origin: org.apache.shindig/shindig-common
@Test
public void fragmentParamsAreEscaped() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.addFragmentParameter("hello world", "foo&bar")
.setQuery("foo");
assertEquals("http://apache.org/shindig?foo#hello+world=foo%26bar", builder.toString());
assertEquals("hello+world=foo%26bar", builder.getFragment());
}
代码示例来源:origin: com.lmco.shindig/shindig-common
@Test
public void queryParamsAreEscaped() {
UriBuilder builder = new UriBuilder()
.setScheme("http")
.setAuthority("apache.org")
.setPath("/shindig")
.addQueryParameter("hello world", "foo&bar")
.setFragment("foo");
assertEquals("http://apache.org/shindig?hello+world=foo%26bar#foo", builder.toString());
assertEquals("hello+world=foo%26bar", builder.getQuery());
}
内容来源于网络,如有侵权,请联系作者删除!