Search in sources :

Example 16 with ServiceURL

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);
}
Also used : ServiceURL(ch.ethz.iks.slp.ServiceURL)

Example 17 with ServiceURL

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);
}
Also used : ServiceURL(ch.ethz.iks.slp.ServiceURL)

Example 18 with ServiceURL

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()));
}
Also used : ServiceURL(ch.ethz.iks.slp.ServiceURL)

Example 19 with ServiceURL

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);
}
Also used : ServiceURL(ch.ethz.iks.slp.ServiceURL)

Example 20 with ServiceURL

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()));
}
Also used : ServiceURL(ch.ethz.iks.slp.ServiceURL)

Aggregations

ServiceURL (ch.ethz.iks.slp.ServiceURL)23 ServiceLocationException (ch.ethz.iks.slp.ServiceLocationException)4 ArrayList (java.util.ArrayList)4 IServiceInfo (org.eclipse.ecf.discovery.IServiceInfo)3 IServiceTypeID (org.eclipse.ecf.discovery.identity.IServiceTypeID)3 JSLPServiceInfo (org.eclipse.ecf.provider.jslp.container.JSLPServiceInfo)3 ServiceType (ch.ethz.iks.slp.ServiceType)2 URI (java.net.URI)2 Iterator (java.util.Iterator)2 List (java.util.List)2 IServiceID (org.eclipse.ecf.discovery.identity.IServiceID)2 ServicePropertiesAdapter (org.eclipse.ecf.internal.provider.jslp.ServicePropertiesAdapter)2 ServiceURLAdapter (org.eclipse.ecf.internal.provider.jslp.ServiceURLAdapter)2 Hashtable (java.util.Hashtable)1 Entry (java.util.Map.Entry)1