/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 4313887 6838333 7029979
* @summary Unit test for miscellenous java.nio.file.Path methods
* @library ..
*/
public class Misc {
static final boolean isWindows =
static boolean supportsLinks;
try {
// equals and hashCode methods
// toFile method
// toRealPath method
} finally {
}
}
/**
* Exercise equals and hashCode methods
*/
static void testEqualsAndHashCode() {
if (isWindows) {
// case insensitive
} else {
// case senstive
}
}
/**
* Exercise toFile method
*/
}
/**
* Exercise toRealPath method
*/
/**
* Test: totRealPath() will access same file as toRealPath(NOFOLLOW_LINKS)
*/
/**
* Test: toRealPath should fail if file does not exist
*/
try {
throw new RuntimeException("IOException expected");
} catch (IOException expected) {
}
try {
throw new RuntimeException("IOException expected");
} catch (IOException expected) {
}
/**
* Test: toRealPath() should resolve links
*/
if (supportsLinks) {
}
/**
* Test: toRealPath(NOFOLLOW_LINKS) should not resolve links
*/
if (supportsLinks) {
}
/**
* Test: toRealPath(NOFOLLOW_LINKS) with broken link
*/
if (supportsLinks) {
}
/**
* Test: toRealPath should eliminate "."
*/
/**
* Test: toRealPath should eliminate ".." when it doesn't follow a
* symbolic link
*/
// clean-up
}
if (!okay)
throw new RuntimeException("Assertion Failed");
}
}