test/java/module/repository/LocalRepositoryTest.java

Print this page

        

*** 66,80 **** rc.mkdirs(); return rc; } public static void realMain(String[] args) throws Throwable { // Enables shadow file copies in the repository if we're running // on Windows. This is to prevent file locking in the // source location. ! if (System.getProperty("os.platform").equalsIgnoreCase("windows")) { System.setProperty("java.module.repository.shadowcopyfiles", "true"); } File srcDir = new File( --- 66,81 ---- rc.mkdirs(); return rc; } public static void realMain(String[] args) throws Throwable { + boolean onWindows = System.getProperty("os.platform").equalsIgnoreCase("windows"); // Enables shadow file copies in the repository if we're running // on Windows. This is to prevent file locking in the // source location. ! if (onWindows) { System.setProperty("java.module.repository.shadowcopyfiles", "true"); } File srcDir = new File(
*** 175,186 **** // Verify that we can reload from a read-only location boolean readOnlyChangeOK = (srcDir.setWritable(false) == true); repo.reload(); if (readOnlyChangeOK) { ! // check(repo.isReadOnly()); } // Check initial module is installed List<ModuleArchiveInfo> installed = repo.list(); println("=installed size " + installed.size()); check(installed.size() == 1); --- 176,191 ---- // Verify that we can reload from a read-only location boolean readOnlyChangeOK = (srcDir.setWritable(false) == true); repo.reload(); if (readOnlyChangeOK) { ! if (!onWindows) { ! // I/O APIs are not completely honest about writability of ! // directories on Windows; see 4939819 and 6728842. ! check(repo.isReadOnly()); } + } // Check initial module is installed List<ModuleArchiveInfo> installed = repo.list(); println("=installed size " + installed.size()); check(installed.size() == 1);