Package com.google.common.jimfs.PathType

Examples of com.google.common.jimfs.PathType.ParseResult.names()


  static void assertUriRoundTripsCorrectly(PathType type, String path) {
    ParseResult result = type.parsePath(path);
    URI uri = type.toUri(fileSystemUri, result.root(), result.names());
    ParseResult parsedUri = type.fromUri(uri);
    assertThat(parsedUri.root()).isEqualTo(result.root());
    assertThat(parsedUri.names()).containsExactlyElementsIn(result.names()).inOrder();
  }

  /**
   * Arbitrary path type with $ as the root, / as the separator and \ as an alternate separator.
   */
 
View Full Code Here


  }

  @Test
  public void testToString() {
    ParseResult path = type.parsePath("foo/bar\\baz");
    assertThat(type.toString(path.root(), path.names())).isEqualTo("foo/bar/baz");

    ParseResult path2 = type.parsePath("$/foo/bar");
    assertThat(type.toString(path2.root(), path2.names())).isEqualTo("$foo/bar");
  }
View Full Code Here

  public void testToString() {
    ParseResult path = type.parsePath("foo/bar\\baz");
    assertThat(type.toString(path.root(), path.names())).isEqualTo("foo/bar/baz");

    ParseResult path2 = type.parsePath("$/foo/bar");
    assertThat(type.toString(path2.root(), path2.names())).isEqualTo("$foo/bar");
  }

  @Test
  public void testToUri() {
    URI fileUri = type.toUri(fileSystemUri, "$", ImmutableList.of("foo", "bar"));
View Full Code Here

    assertThat(result.names()).containsExactly((Object[]) names).inOrder();
  }

  static void assertUriRoundTripsCorrectly(PathType type, String path) {
    ParseResult result = type.parsePath(path);
    URI uri = type.toUri(fileSystemUri, result.root(), result.names());
    ParseResult parsedUri = type.fromUri(uri);
    assertThat(parsedUri.root()).isEqualTo(result.root());
    assertThat(parsedUri.names()).containsExactlyElementsIn(result.names()).inOrder();
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.