diff --git a/testsrc/org/mozilla/javascript/tests/commonjs/module/provider/UrlModuleSourceProviderTest.java b/testsrc/org/mozilla/javascript/tests/commonjs/module/provider/UrlModuleSourceProviderTest.java index 4924b1afd8..70b8e6c6b1 100644 --- a/testsrc/org/mozilla/javascript/tests/commonjs/module/provider/UrlModuleSourceProviderTest.java +++ b/testsrc/org/mozilla/javascript/tests/commonjs/module/provider/UrlModuleSourceProviderTest.java @@ -4,8 +4,11 @@ package org.mozilla.javascript.tests.commonjs.module.provider; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import java.net.URI; import java.net.URISyntaxException; +import java.net.URLConnection; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.FileTime; @@ -67,6 +70,15 @@ public void testModuleModified() throws Exception { Assert.assertNotEquals("Modified", ModuleSourceProvider.NOT_MODIFIED, result); } + @Test + public void getCharacterEncodingCanBeModifiedInSubclass() throws NoSuchMethodException { + Method method = + UrlModuleSourceProvider.class.getDeclaredMethod( + "getCharacterEncoding", new Class[] {URLConnection.class}); + int mods = method.getModifiers(); + Assert.assertTrue(Modifier.isPublic(mods) || Modifier.isProtected(mods)); + } + private static URI getModuleURI(final Path filePath) throws URISyntaxException { final String uriString = filePath.toUri().toASCIIString(); return new URI(uriString.substring(0, uriString.lastIndexOf('.')));