/*
* 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 7003155
* @summary Unit test for java.nio.file.Path
*/
public class UriImportExport {
/**
* Test Path -> URI -> Path
*/
failures++;
}
}
/**
* Test Path -> (expected) URI -> Path
*/
failures++;
return;
}
failures++;
}
}
/**
* Test URI -> Path -> URI
*/
failures++;
}
}
/**
* Test URI -> Path fails with IllegalArgumentException
*/
try {
failures++;
} catch (IllegalArgumentException expected) {
}
}
testBadUri("file:foo");
testBadUri("file:/foo?q");
testBadUri("file:/foo#f");
testPath("C:\\doesnotexist");
testPath("C:doesnotexist");
testPath("\\\\server.nowhere.oracle.com\\share\\");
testPath("\\\\fe80--203-baff-fe5a-749ds1.ipv6-literal.net\\share\\missing",
} else {
testPath("doesnotexist");
testPath("/doesnotexist");
testPath("/does not exist");
testUri("file:///");
testUri("file:///foo/bar/doesnotexist");
testUri("file:/foo/bar/doesnotexist");
// invalid
testBadUri("file:foo");
testBadUri("file://server/foo");
testBadUri("file:///foo%00");
}
if (failures > 0)
}
}