ResourceUtils { public static URL getResourceWithAbsolutePackagePath(String absolutePackagePath, String resourceName) { return getResourceWithAbsolutePackagePath(ResourceUtils.class, absolutePackagePath, resourceName); }  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(expected = IllegalArgumentException.class) public void testResourceLoading_failed() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath(System.class, "org/reficio/ws/common/test", "soapEncoding.xsd123123"); }
@Test public void testResourceLoading_whiteSpaces() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath(System.class, " /org/reficio/ws/common/test ", "soapEncoding.xsd"); Assert.assertNotNull(url); }
@Test public void testResourceLoading_multipleInner() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath(System.class, "/org Assert.assertNotNull(url); }
@Test public void testResourceLoading_multipleTrailing() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath(System.class, "org/reficio/ws/common/test Assert.assertNotNull(url); }
@Test public void testResourceLoading_notNormalized() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath(System.class, "org/../org/reficio/../reficio/ws/common/test/", "soapEncoding.xsd"); Assert.assertNotNull(url); }
@Test public void testResourceLoadingNotNormalizedNoClass() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath("org/../org/reficio/../reficio/ws/common/test/", "soapEncoding.xsd"); Assert.assertNotNull(url); }
@Test public void testResourceLoading_noLeadingTrailing() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath(System.class, "org/reficio/ws/common/test", "soapEncoding.xsd"); Assert.assertNotNull(url); }
@Test public void testResourceLoadingSpaceInTheResource() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath("my folder", "resource.txt"); Assert.assertNotNull(url); }
@Test public void testResourceLoading_noLeading() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath(System.class, "org/reficio/ws/common/test/", "soapEncoding.xsd"); Assert.assertNotNull(url); }
@Test public void testResourceLoading_multipleLeading() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath(System.class, " Assert.assertNotNull(url); }
@Test public void testResourceLoadingNoTrailing() { URL url = ResourceUtils.getResourceWithAbsolutePackagePath(System.class, "/org/reficio/ws/common/test", "soapEncoding.xsd"); Assert.assertNotNull(url); }