/*
* 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
* @summary Unit test for java.nio.file.attribute.UserDefinedFileAttributeView
* @library ../..
*/
public class Basic {
static interface Task {
}
boolean caught = false;
try {
} catch (Throwable x) {
caught = true;
} else {
throw new RuntimeException(x);
}
}
if (!caught)
}
}
throws IOException
{
return true;
}
return false;
}
final UserDefinedFileAttributeView view =
// Test: write
throw new RuntimeException("Unexpected number of bytes written");
// Test: size
throw new RuntimeException("Unexpected size");
// Test: read
throw new RuntimeException("Unexpected number of bytes read");
throw new RuntimeException("Unexpected attribute value");
// Test: read with insufficient space
public void run() throws IOException {
}});
// Test: replace value
throw new RuntimeException("Unexpected size");
// Test: list
throw new RuntimeException("Attribute name not in list");
// Test: delete
throw new RuntimeException("Attribute name in list");
// Test: dynamic access
throw new RuntimeException("Unexpected attribute value");
throw new RuntimeException("Unexpected attribute value");
throw new RuntimeException("Unexpected attribute value");
}
final UserDefinedFileAttributeView view =
// NullPointerException
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
expectNullPointerException(new Task() {
public void run() throws IOException {
}});
// Read-only buffer
public void run() throws IOException {
}});
// Zero bytes remaining
public void run() throws IOException {
}});
}
// create temporary directory to run tests
try {
return;
}
// test access to user defined attributes of regular file
try {
} finally {
}
// test access to user defined attributes of directory
try {
} finally {
}
// test access to user defined attributes of sym link
try {
} catch (IOException x) {
// access to attributes of sym link may not be supported
} finally {
}
}
// misc. tests
try {
} finally {
}
} finally {
}
}
}