diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/core/assembler/DatasetAssembler.java b/jena-arq/src/main/java/org/apache/jena/sparql/core/assembler/DatasetAssembler.java index db281ec028d..6b35c3e0c1b 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/core/assembler/DatasetAssembler.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/core/assembler/DatasetAssembler.java @@ -32,6 +32,10 @@ public abstract class DatasetAssembler extends AssemblerBase implements Assembler { + /** @deprecated To be removed - use {@link #getGeneralType()} */ + @Deprecated + public static Resource getType() { return getGeneralType(); } + /** This is the superclass of all datasets assemblers */ public static Resource getGeneralType() { return DatasetAssemblerVocab.tDataset ; diff --git a/jena-arq/src/test/java/org/apache/jena/riot/TestSysRIOT.java b/jena-arq/src/test/java/org/apache/jena/riot/TestSysRIOT.java index 95118dc12b1..69593c84ecb 100644 --- a/jena-arq/src/test/java/org/apache/jena/riot/TestSysRIOT.java +++ b/jena-arq/src/test/java/org/apache/jena/riot/TestSysRIOT.java @@ -20,8 +20,6 @@ import static org.apache.jena.atlas.lib.Lib.lowercase; -import java.util.function.Predicate; - import org.apache.jena.atlas.io.IO; import org.apache.jena.base.Sys; import org.junit.Assert; @@ -43,7 +41,7 @@ public void chooseBaseIRI_2() { public void chooseBaseIRI_3() { if ( Sys.isWindows ) { if ( IO.exists("c:/") ) - testChooseBaseIRI("c:", s->lowercase(s).startsWith("file:///c:/")); + testChooseBaseIRI_windows("c:/", "file:///c:/"); } else testChooseBaseIRI("x:", "x:"); } @@ -52,14 +50,15 @@ public void chooseBaseIRI_3() { public void chooseBaseIRI_4() { if ( Sys.isWindows ) { if ( IO.exists("c:/") ) - testChooseBaseIRI("c:", s->lowercase(s).startsWith("file:///c:/")); + testChooseBaseIRI_windows("c:", "file:///c:"); } else testChooseBaseIRI("x:/", "x:/"); } @Test public void chooseBaseIRI_10() { - testChooseBaseIRI("foo", s->s.startsWith("file:///")); + String x = SysRIOT.chooseBaseIRI(null, "foo"); + Assert.assertTrue(x.startsWith("file:///")); } private void testChooseBaseIRI(String input, String expected) { @@ -67,8 +66,13 @@ private void testChooseBaseIRI(String input, String expected) { Assert.assertEquals(expected, x); } - private void testChooseBaseIRI(String input, Predicate test) { + private void testChooseBaseIRI_windows(String input, String prefix) { String x = SysRIOT.chooseBaseIRI(null, input); - Assert.assertTrue(test.test(x)); + String x1 = lowercase(x); + boolean b = x1.startsWith(prefix); + if ( ! b ) + System.out.printf("Input: %s => (prefix(%s) A:%s)=\n", input, prefix, x1); + // drive letters can be uppercase. + Assert.assertTrue(x1.startsWith(prefix)); } } diff --git a/jena-base/src/test/java/org/apache/jena/atlas/lib/TestFilenameProcessing.java b/jena-base/src/test/java/org/apache/jena/atlas/lib/TestFilenameProcessing.java index b83846c63d1..4476104ec19 100644 --- a/jena-base/src/test/java/org/apache/jena/atlas/lib/TestFilenameProcessing.java +++ b/jena-base/src/test/java/org/apache/jena/atlas/lib/TestFilenameProcessing.java @@ -26,6 +26,7 @@ import java.io.File ; import java.nio.file.Path; +import org.apache.jena.base.Sys; import org.junit.Test ; public class TestFilenameProcessing @@ -37,7 +38,7 @@ public class TestFilenameProcessing // ---- Main tests. // Portablility - static boolean isWindows = File.separatorChar != '/' ; + static boolean isWindows = Sys.isWindows; private static String cwd = Path.of(".").toAbsolutePath().normalize().toString() ; // Sort out cwd, not using the IRILib code. diff --git a/jena-base/src/test/java/org/apache/jena/atlas/lib/TestIRILib.java b/jena-base/src/test/java/org/apache/jena/atlas/lib/TestIRILib.java index ee72e46e51b..dc260cd9c62 100644 --- a/jena-base/src/test/java/org/apache/jena/atlas/lib/TestIRILib.java +++ b/jena-base/src/test/java/org/apache/jena/atlas/lib/TestIRILib.java @@ -22,6 +22,9 @@ import org.junit.Test; +/* + * @see TestFilenameProcessing + */ public class TestIRILib { @Test public void encodeDecode01() { encodeDecode("", ""); } diff --git a/jena-core/src/main/java/org/apache/jena/irix/IRIs.java b/jena-core/src/main/java/org/apache/jena/irix/IRIs.java index 38149142b3f..b9890e41da8 100644 --- a/jena-core/src/main/java/org/apache/jena/irix/IRIs.java +++ b/jena-core/src/main/java/org/apache/jena/irix/IRIs.java @@ -84,8 +84,10 @@ public static String toBase(String uriForBase) { String scheme = scheme(uriForBase); if ( Sys.isWindows ) { // Assume a scheme of one letter is a Windows drive letter. - if ( scheme != null && scheme.length() == 1 ) + if ( scheme != null && scheme.length() == 1 ) { scheme = "file"; + uriForBase = "file:/"+uriForBase; + } } if ( scheme == null ) { // Relative name: it the base is a file: URI, encode the relative