view tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/NonWindowsLockedFile.java @ 1501:fd84d9b293df

Fixed LockedFile for readonly on windows * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: made isUnix deprecated * netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java: creating file (for windows) only if not readonly * tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/NonWindowsLockedFile.java: tests for os set to no windows * tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/WindowsLockedFileTest.java: tests for os set to windows
author Jiri Vanek <jvanek@redhat.com>
date Fri, 23 Nov 2018 15:33:04 +0100
parents
children
line wrap: on
line source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package net.sourceforge.jnlp.util.lockingfile;

import org.junit.AfterClass;
import org.junit.BeforeClass;

/**
 *
 * @author jvanek
 */
public class NonWindowsLockedFile extends WindowsLockedFileTest {

    private static String os;

    @BeforeClass
    public static void smuggleOs() {
        os = System.getProperty("os.name");
        System.setProperty("os.name", "No Windows for itw");
    }

    @AfterClass
    public static void restoreOs() {
        System.setProperty("os.name", os);
    }

}