Package ch.ethz.iks.slp

Examples of ch.ethz.iks.slp.ServiceURL


        boolean fullurl = false;
        if (attreq.url.indexOf("//") == -1) {
          reqService = new ServiceType(attreq.url);
        } else {
          fullurl = true;
          reqService = new ServiceURL(attreq.url, 0);
        }

        // if spi is sent, the request must be for a full url and
        // the tag list has to be empty
        if (attreq.spi.equals("")
View Full Code Here


              Long nextActivity;
              while (!serviceDisposalQueue.isEmpty()
                  && (nextActivity = ((Long) serviceDisposalQueue
                      .firstKey())).longValue() <= System
                      .currentTimeMillis()) {
                ServiceURL service = (ServiceURL) serviceDisposalQueue
                    .get(nextActivity);

                ServiceDeregistration dereg = new ServiceDeregistration(
                    service, null, null,
                    SLPCore.DEFAULT_LOCALE);
View Full Code Here

    System.setProperty("net.slp.port", "10427");
  }
 
  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);
  }
View Full Code Here

    assertEquals(url.toString(), urlString);
  }

  public void testServiceURL2() throws Exception {
    String urlString = "service:test:myservice://localhost:80";
    ServiceURL url = new ServiceURL(urlString, 0);
    assertEquals("service:test:myservice", url.getServiceType().toString());
    assertEquals("localhost", url.getHost());
    assertEquals(80, url.getPort());
    assertEquals("", url.getURLPath());
    assertEquals("", url.getUserInfo());
    assertEquals(null, url.getProtocol());
    assertEquals(urlString, url.toString());
  }
View Full Code Here

    assertEquals(urlString, url.toString());
  }

  public void testServiceURL3() throws Exception {
    String urlString = "service:test:myservice://localhost:80/path";
    ServiceURL url = new ServiceURL(urlString, 0);
    assertEquals(url.getServiceType().toString(), "service:test:myservice");
    assertEquals(url.getHost(), "localhost");
    assertEquals(url.getPort(), 80);
    assertEquals(url.getURLPath(), "/path");
    assertEquals(url.getUserInfo(), "");
    assertEquals(url.getProtocol(), null);
    assertEquals(url.toString(), urlString);
  }
View Full Code Here

    assertEquals(url.toString(), urlString);
  }

  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);
  }
View Full Code Here

    assertEquals(url.toString(), urlString);
  }

  public void testServiceURL5() throws Exception {
    String urlString = "service:test:myservice://http://localhost:8080/my/path";
    ServiceURL url = new ServiceURL(urlString, 0);
    assertEquals(url.getServiceType().toString(), "service:test:myservice");
    assertEquals(url.getHost(), "localhost");
    assertEquals(url.getPort(), 8080);
    assertEquals(url.getURLPath(), "/my/path");
    assertEquals(url.getUserInfo(), "");
    assertEquals(url.getProtocol(), "http");
    assertEquals(url.toString(), urlString);
  }
View Full Code Here

    assertEquals(url.toString(), urlString);
  }

  public void testServiceURL6() 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);
  }
View Full Code Here

    assertEquals(url.toString(), urlString);
  }

  public void testServiceURLNamingAuthorityCustom() throws Exception {
    String urlString = "service:test.foo://http://localhost";
    ServiceURL url = new ServiceURL(urlString, 0);
    assertEquals(url.getServiceType().toString(), "service:test.foo");
    assertEquals(url.getHost(), "localhost");
    assertEquals(url.getPort(), 0);
    assertEquals(url.getURLPath(), "");
    assertEquals(url.getUserInfo(), "");
    assertEquals(url.getProtocol(), "http");
    assertEquals(url.toString(), urlString);
    assertTrue("foo".equals(url.getServiceType().getNamingAuthority()));
  }
View Full Code Here

    assertTrue("foo".equals(url.getServiceType().getNamingAuthority()));
  }
 
  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()));
  }
View Full Code Here

TOP

Related Classes of ch.ethz.iks.slp.ServiceURL

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.