7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /* @test
25 * @bug 8147615
26 * @summary Test whether an unreferenced FileChannel is actually cleaned
27 * @requires (os.family == "linux") | (os.family == "mac") | (os.family == "solaris") | (os.family == "aix")
28 * @library /test/lib
29 * @build jdk.test.lib.util.FileUtils CleanerTest
30 * @modules java.management java.base/sun.nio.ch:+open
31 * @run main/othervm CleanerTest
32 */
33
34 import com.sun.management.UnixOperatingSystemMXBean;
35 import java.lang.management.ManagementFactory;
36 import java.lang.management.OperatingSystemMXBean;
37 import java.lang.ref.PhantomReference;
38 import java.lang.ref.Reference;
39 import java.lang.ref.ReferenceQueue;
40 import java.lang.ref.PhantomReference;
41 import java.lang.ref.WeakReference;
42 import java.lang.reflect.Field;
43 import java.nio.channels.FileChannel;
44 import java.nio.file.Files;
45 import java.nio.file.Path;
46 import java.nio.file.Paths;
47 import java.nio.file.StandardOpenOption;
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /* @test
25 * @bug 8147615
26 * @summary Test whether an unreferenced FileChannel is actually cleaned
27 * @requires (os.family == "linux") | (os.family == "mac") | (os.family == "aix")
28 * @library /test/lib
29 * @build jdk.test.lib.util.FileUtils CleanerTest
30 * @modules java.management java.base/sun.nio.ch:+open
31 * @run main/othervm CleanerTest
32 */
33
34 import com.sun.management.UnixOperatingSystemMXBean;
35 import java.lang.management.ManagementFactory;
36 import java.lang.management.OperatingSystemMXBean;
37 import java.lang.ref.PhantomReference;
38 import java.lang.ref.Reference;
39 import java.lang.ref.ReferenceQueue;
40 import java.lang.ref.PhantomReference;
41 import java.lang.ref.WeakReference;
42 import java.lang.reflect.Field;
43 import java.nio.channels.FileChannel;
44 import java.nio.file.Files;
45 import java.nio.file.Path;
46 import java.nio.file.Paths;
47 import java.nio.file.StandardOpenOption;
|