From 2fcf6f429284019c24408c1cff0d325970311924 Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:41:33 -0700 Subject: [PATCH] more QuiltPathFactory.parse --- .../src/test/nextflow/quilt/QuiltSpecification.groovy | 2 +- .../src/test/nextflow/quilt/nio/QuiltNioTest.groovy | 10 +++------- .../src/test/nextflow/quilt/nio/QuiltPathTest.groovy | 8 ++------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy index 9ace8dcc..db46b46f 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy @@ -109,7 +109,7 @@ class QuiltSpecification extends Specification { Path makeObject(String url, String text) { assert url - Path path = Paths.get(new URI(url)) + Path path = QuiltPathFactory.parse(url) return makeObject(path, text) } diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy index 1a0978a9..1ffffd18 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy @@ -66,10 +66,9 @@ class QuiltNioTest extends QuiltSpecification { readObject(path).trim() == TEXT } - @IgnoreIf({ System.getProperty('os.name').contains('indows') }) void 'should read from a path'() { given: - QuiltPath path = Paths.get(new URI(READ_URL)) as QuiltPath + QuiltPath path = QuiltPathFactory.parse(READ_URL) path.pkg().install() when: @@ -80,15 +79,13 @@ class QuiltNioTest extends QuiltSpecification { text.startsWith('id') } - @IgnoreIf({ System.getProperty('os.name').contains('ux') }) - @IgnoreIf({ System.getProperty('os.name').contains('indows') }) void 'should read file attributes'() { given: final start = System.currentTimeMillis() final root = 'folder' final start_path = "${root}/${start}.txt" final start_url = packagePath(start_path) - Path path = Paths.get(new URI(start_url)) + Path path = QuiltPathFactory.parse(start_url) when: makeObject(path, TEXT) @@ -513,7 +510,6 @@ class QuiltNioTest extends QuiltSpecification { list == [ 'file4.txt' ] } - @IgnoreIf({ System.getProperty('os.name').contains('indows') }) void 'should check walkTree'() { given: makeObject(null_path('foo/file1.txt'), 'A') @@ -526,7 +522,7 @@ class QuiltNioTest extends QuiltSpecification { when: List dirs = [] Map files = [:] - Path base = Paths.get(new URI(NULL_URL)) + Path base = QuiltPathFactory.parse(NULL_URL) Files.walkFileTree(base, new SimpleFileVisitor() { @Override diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltPathTest.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltPathTest.groovy index e13e18f9..dade2a45 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltPathTest.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltPathTest.groovy @@ -6,13 +6,11 @@ import nextflow.quilt.jep.QuiltParser import nextflow.quilt.jep.QuiltPackage import java.nio.file.Path -import java.nio.file.Paths import groovy.util.logging.Slf4j import groovy.transform.CompileDynamic import spock.lang.Unroll import spock.lang.Ignore -import spock.lang.IgnoreIf /** * @@ -28,13 +26,12 @@ class QuiltPathTest extends QuiltSpecification { QuiltPath pathify(String path) { if (!path.contains(BKT)) { - URI uri = new URI(PKG_URL) - QuiltPath pkgPath = Paths.get(uri) + QuiltPath pkgPath = QuiltPathFactory.parse(PKG_URL) QuiltFileSystem qfs = pkgPath.getFileSystem() return qfs.getPath(path) } String url = QuiltParser.PREFIX + path - return Paths.get(new URI(url)) + return QuiltPathFactory.parse(url) } @Unroll @@ -240,7 +237,6 @@ class QuiltPathTest extends QuiltSpecification { } @Unroll - @IgnoreIf({ System.getProperty('os.name').contains('indows') }) void 'should validate relativize'() { expect: pathify(path).relativize(pathify(other)).toString() == pathify(expected).toString()