コード例 #1
0
  @Test
  public void testNameWithDefinedPortOneElementServiceWithoutRoot() throws FileSystemException {
    fileName = parseURI("paprmi://hostname.com:1234/serviceAddress?proactive_vfs_provider_path=");

    assertEquals("paprmi", fileName.getScheme());
    assertNull(fileName.getUserName());
    assertNull(fileName.getPassword());
    assertEquals(1234, fileName.getPort());
    //        assertEquals(rmiDefaultPort, fileName.getDefaultPort());
    assertEquals("hostname.com", fileName.getHostName());
    assertEquals("/serviceAddress", fileName.getServicePath());
    assertEquals("/", fileName.getPath());
    assertEquals(
        "paprmi://hostname.com:1234/serviceAddress?proactive_vfs_provider_path=/",
        fileName.getRootURI());
    assertEquals(
        "paprmi://hostname.com:1234/serviceAddress?proactive_vfs_provider_path=/",
        fileName.getURI());
    assertEquals("rmi://hostname.com:1234/serviceAddress", fileName.getServerURL());
  }
コード例 #2
0
  @Test
  public void testNameUnnormalizedServicePathUnnormalizedFilePath() throws FileSystemException {
    fileName =
        parseURI(
            "paprmi://hostname.com:3232/service/../anotherService?proactive_vfs_provider_path=/dir/subdir/../anotherSubDir");

    assertEquals("paprmi", fileName.getScheme());
    assertNull(fileName.getUserName());
    assertNull(fileName.getPassword());
    assertEquals(3232, fileName.getPort());
    //        assertEquals(rmiDefaultPort, fileName.getDefaultPort());
    assertEquals("hostname.com", fileName.getHostName());
    assertEquals("/service/../anotherService", fileName.getServicePath());
    assertEquals("/dir/anotherSubDir", fileName.getPath());
    assertEquals(
        "paprmi://hostname.com:3232/service/../anotherService?proactive_vfs_provider_path=/",
        fileName.getRootURI());
    assertEquals(
        "paprmi://hostname.com:3232/service/../anotherService?proactive_vfs_provider_path=/dir/anotherSubDir",
        fileName.getURI());
    assertEquals("rmi://hostname.com:3232/service/../anotherService", fileName.getServerURL());
  }
コード例 #3
0
  @Test
  public void testSimpleName() throws FileSystemException {
    fileName =
        parseURI(
            "paprmi://hostname.com:3232/service/address?proactive_vfs_provider_path=/dir/file.txt");

    assertEquals("paprmi", fileName.getScheme());
    assertNull(fileName.getUserName());
    assertNull(fileName.getPassword());
    assertEquals(3232, fileName.getPort());
    //        assertEquals(3232, fileName.getDefaultPort());
    assertEquals("hostname.com", fileName.getHostName());
    assertEquals("/service/address", fileName.getServicePath());
    assertEquals("/dir/file.txt", fileName.getPath());
    assertEquals(
        "paprmi://hostname.com:3232/service/address?proactive_vfs_provider_path=/",
        fileName.getRootURI());
    assertEquals(
        "paprmi://hostname.com:3232/service/address?proactive_vfs_provider_path=/dir/file.txt",
        fileName.getURI());
    assertEquals("rmi://hostname.com:3232/service/address", fileName.getServerURL());
  }
コード例 #4
0
  @Test
  public void testNameWithServiceIncludingQueryWithoutServiceAndFilePathSeparators()
      throws FileSystemException {
    fileName = parseURI("paprmi://hostname.com:3232/serviceAddress?someServiceQuery=xxx");

    assertEquals("paprmi", fileName.getScheme());
    assertNull(fileName.getUserName());
    assertNull(fileName.getPassword());
    assertEquals(3232, fileName.getPort());
    //        assertEquals(rmiDefaultPort, fileName.getDefaultPort());
    assertEquals("hostname.com", fileName.getHostName());
    assertEquals("/serviceAddress?someServiceQuery=xxx", fileName.getServicePath());
    assertEquals("/", fileName.getPath());
    assertEquals(
        "paprmi://hostname.com:3232/serviceAddress?someServiceQuery=xxx?proactive_vfs_provider_path=/",
        fileName.getRootURI());
    assertEquals(
        "paprmi://hostname.com:3232/serviceAddress?someServiceQuery=xxx?proactive_vfs_provider_path=/",
        fileName.getURI());
    assertEquals(
        "rmi://hostname.com:3232/serviceAddress?someServiceQuery=xxx", fileName.getServerURL());
  }