use of ch.ethz.iks.slp.ServiceURL in project ecf by eclipse.
the class ServiceURLTest method testServiceURL258252b.
public void testServiceURL258252b() throws Exception {
String urlString = "service:test:myservice://localhost/my:path";
ServiceURL url = new ServiceURL(urlString, 0);
assertEquals(url.getServiceType().toString(), "service:test:myservice");
assertEquals(url.getHost(), "localhost");
assertEquals(url.getPort(), 0);
assertEquals(url.getURLPath(), "/my:path");
assertEquals(url.getUserInfo(), "");
assertEquals(url.getProtocol(), null);
assertEquals(url.toString(), urlString);
}
use of ch.ethz.iks.slp.ServiceURL in project ecf by eclipse.
the class ServiceURLTest method testServiceURL1.
public void testServiceURL1() throws Exception {
String urlString = "service:test:myservice://localhost";
ServiceURL url = new ServiceURL(urlString, 0);
assertEquals(url.getServiceType().toString(), "service:test:myservice");
assertEquals(url.getHost(), "localhost");
assertEquals(url.getPort(), 0);
assertEquals(url.getURLPath(), "");
assertEquals(url.getUserInfo(), "");
assertEquals(url.getProtocol(), null);
assertEquals(url.toString(), urlString);
}
use of ch.ethz.iks.slp.ServiceURL in project ecf by eclipse.
the class ServiceURLTest method testServiceURLUserInfo.
public void testServiceURLUserInfo() throws Exception {
String urlString = "service:test.iana://http://foobar@localhost";
ServiceURL url = new ServiceURL(urlString, 0);
assertEquals(url.getServiceType().toString(), "service:test");
assertEquals(url.getHost(), "localhost");
assertEquals(url.getPort(), 0);
assertEquals(url.getURLPath(), "");
assertEquals(url.getProtocol(), "http");
assertEquals(url.toString(), "service:test://http://foobar@localhost");
assertEquals(url.getUserInfo(), "foobar");
assertTrue("".equals(url.getServiceType().getNamingAuthority()));
}
use of ch.ethz.iks.slp.ServiceURL in project ecf by eclipse.
the class ServiceURLTest method testServiceURL4.
public void testServiceURL4() throws Exception {
String urlString = "service:test:myservice://localhost/my/path";
ServiceURL url = new ServiceURL(urlString, 0);
assertEquals(url.getServiceType().toString(), "service:test:myservice");
assertEquals(url.getHost(), "localhost");
assertEquals(url.getPort(), 0);
assertEquals(url.getURLPath(), "/my/path");
assertEquals(url.getUserInfo(), "");
assertEquals(url.getProtocol(), null);
assertEquals(url.toString(), urlString);
}
use of ch.ethz.iks.slp.ServiceURL in project ecf by eclipse.
the class ServiceURLTest method testServiceURLNamingAuthorityDefault.
public void testServiceURLNamingAuthorityDefault() throws Exception {
String urlString = "service:test://http://localhost";
ServiceURL url = new ServiceURL(urlString, 0);
assertEquals(url.getServiceType().toString(), "service:test");
assertEquals(url.getHost(), "localhost");
assertEquals(url.getPort(), 0);
assertEquals(url.getURLPath(), "");
assertEquals(url.getUserInfo(), "");
assertEquals(url.getProtocol(), "http");
assertEquals(url.toString(), urlString);
assertTrue("".equals(url.getServiceType().getNamingAuthority()));
}
Aggregations