5516N/A/*
5516N/A * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
5516N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5516N/A *
5516N/A * This code is free software; you can redistribute it and/or modify it
5516N/A * under the terms of the GNU General Public License version 2 only, as
5516N/A * published by the Free Software Foundation.
5516N/A *
5516N/A * This code is distributed in the hope that it will be useful, but WITHOUT
5516N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5516N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5516N/A * version 2 for more details (a copy is included in the LICENSE file that
5516N/A * accompanied this code).
5516N/A *
5516N/A * You should have received a copy of the GNU General Public License version
5516N/A * 2 along with this work; if not, write to the Free Software Foundation,
5516N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5516N/A *
5516N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5516N/A * or visit www.oracle.com if you need additional information or have any
5516N/A * questions.
5516N/A */
5516N/A
5516N/A/*
5516N/A * Portions Copyright (c) 2012 IBM Corporation
5516N/A */
5516N/A
5516N/A/* @test
5516N/A * @bug 6610897
5516N/A * @summary New constructor in sun.tools.java.ClassPath builds a path using
5516N/A * File.separator instead of File.pathSeparator
5516N/A * @run main RMICClassPathTest
5516N/A */
5516N/A
5516N/Aimport java.io.File;
5516N/A
5516N/Aimport sun.rmi.rmic.BatchEnvironment;
5516N/A
5516N/Apublic class RMICClassPathTest {
5516N/A public static void main(String[] args) throws Exception {
5516N/A String sysPath = "/home/~user/jdk/jre/lib/rt.jar";
5516N/A String extDir = "";
5516N/A String clPath = "/home/~user/user.jar" + File.pathSeparator +
5516N/A "/home/~user/user2.jar" + File.pathSeparator +
5516N/A "/home/~user/user3.jar";
5516N/A
5516N/A String cpStr = BatchEnvironment.createClassPath(clPath, sysPath, extDir).toString();
5516N/A
5516N/A String[] paths = cpStr.split(File.pathSeparator);
5516N/A
5516N/A if (paths.length != 4) {
5516N/A throw new Exception("ClassPath length is not correct: the expected length is 4 and the actual length is " + paths.length);
5516N/A }
5516N/A }
5516N/A}