ResourceUtils { public static URL getResource(String resourcePath) { Path path = parsePath(resourcePath); return getResourceWithAbsolutePackagePath(path.packagePath, path.resourcePath); }  static URL getResourceWithAbsolutePackagePath(String absolutePackagePath, String resourceName); static URL getResource(String resourcePath); static URL getResource(Class<?> clazz, String resourcePath); static InputStream getResourceAsStream(String resourcePath); static InputStream getResourceAsStream(Class<?> clazz, String resourcePath); static URL getResourceWithAbsolutePackagePath(Class<?> clazz, String absolutePackagePath, String resourceName); static InputStream getResourceWithAbsolutePackagePathAsStream(String absolutePackagePath, String resourceName); static InputStream getResourceWithAbsolutePackagePathAsStream(Class<?> clazz, String absolutePackagePath, String resourceName);  }
@Test public void testResourceLoading_whiteSpaces_noPackage() { URL url = ResourceUtils.getResource(System.class, " /org/reficio/ws/common/test/soapEncoding.xsd"); Assert.assertNotNull(url); }
@Test public void testResourceLoading_multipleInner_noPackage() { URL url = ResourceUtils.getResource(System.class, "/org Assert.assertNotNull(url); }
@Test public void testResourceLoading_multipleTrailing_noPackage() { URL url = ResourceUtils.getResource(System.class, "org/reficio/ws/common/test Assert.assertNotNull(url); }
@Test public void testResourceLoading_notNormalized_noPackage() { URL url = ResourceUtils.getResource(System.class, "org/../org/reficio/../reficio/ws/common/test/soapEncoding.xsd"); Assert.assertNotNull(url); }
@Test(expected = IllegalArgumentException.class) public void testResourceLoading_failed_noPackage() { URL url = ResourceUtils.getResource(System.class, "asdasdasdasd.txt"); }
@Test public void testResourceLoadingNotNormalizedNoClass_noPackage() { URL url = ResourceUtils.getResource("org/../org/reficio/../reficio/ws/common/test/soapEncoding.xsd"); Assert.assertNotNull(url); }
@Test public void testResourceLoadingSpaceInTheResource_noPackage() { URL url = ResourceUtils.getResource("my folder/resource.txt"); Assert.assertNotNull(url); }
@Test public void testResourceLoading_noLeadingTrailing_noPackage() { URL url = ResourceUtils.getResource(System.class, "org/reficio/ws/common/test/soapEncoding.xsd"); Assert.assertNotNull(url); }
@Test public void testResourceLoading_noLeading_noPackage() { URL url = ResourceUtils.getResource(System.class, "org/reficio/ws/common/test/soapEncoding.xsd"); Assert.assertNotNull(url); }
@Test public void testResourceLoading_multipleLeading_noPackage() { URL url = ResourceUtils.getResource(System.class, " Assert.assertNotNull(url); }
@Test public void testResourceLoadingNoTrailing_noPackage() { URL url = ResourceUtils.getResource(System.class, "/org/reficio/ws/common/test/soapEncoding.xsd"); Assert.assertNotNull(url); }