This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit fc0c75c6bed1d38776ec6fef55eef23ba04d760c Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Sep 16 18:03:51 2020 +0100 Fix spellings in unit tests Based on a PR provided by John Bampton --- test/jakarta/el/TestArrayELResolver.java | 2 +- .../el/TestImportHandlerStandardPackages.java | 2 +- test/jakarta/servlet/http/TestHttpServlet.java | 2 +- .../jaspic/TestAuthConfigFactoryImpl.java | 8 ++--- .../org/apache/catalina/connector/TestRequest.java | 6 ++-- .../apache/catalina/core/TestAsyncContextImpl.java | 2 +- .../catalina/startup/TestMultipartConfig.java | 2 +- .../catalina/startup/TestTomcatNoServer.java | 4 +-- .../util/TestContextNameExtractFromPath.java | 2 +- .../apache/catalina/valves/TestRemoteIpValve.java | 6 ++-- test/org/apache/coyote/TestRequest.java | 16 +++++----- test/org/apache/coyote/http2/TestAsyncFlush.java | 2 +- test/org/apache/juli/TestFileHandler.java | 36 +++++++++++----------- test/org/apache/naming/TesterInjectionServlet.java | 2 +- .../websocket/pojo/TestEncodingDecoding.java | 6 ++-- 15 files changed, 49 insertions(+), 49 deletions(-) diff --git a/test/jakarta/el/TestArrayELResolver.java b/test/jakarta/el/TestArrayELResolver.java index 80aaf43..c7dd96c 100644 --- a/test/jakarta/el/TestArrayELResolver.java +++ b/test/jakarta/el/TestArrayELResolver.java @@ -520,7 +520,7 @@ public class TestArrayELResolver { @Test - public void testGetFeatureDescriptiors() { + public void testGetFeatureDescriptors() { // Should always return null ArrayELResolver resolver = new ArrayELResolver(); Assert.assertNull(resolver.getFeatureDescriptors(null, null)); diff --git a/test/jakarta/el/TestImportHandlerStandardPackages.java b/test/jakarta/el/TestImportHandlerStandardPackages.java index b8e1aee..f7f1341 100644 --- a/test/jakarta/el/TestImportHandlerStandardPackages.java +++ b/test/jakarta/el/TestImportHandlerStandardPackages.java @@ -105,7 +105,7 @@ public class TestImportHandlerStandardPackages { Assert.assertNotNull(files); for (String file : files) { if (!file.endsWith(".class")) { - // Skip non-class resoucres + // Skip non-class resources continue; } if (file.startsWith("Test")) { diff --git a/test/jakarta/servlet/http/TestHttpServlet.java b/test/jakarta/servlet/http/TestHttpServlet.java index f1ae25b..b8760c6 100644 --- a/test/jakarta/servlet/http/TestHttpServlet.java +++ b/test/jakarta/servlet/http/TestHttpServlet.java @@ -213,7 +213,7 @@ public class TestHttpServlet extends TomcatBaseTest { /* - * See org.aoache.coyote.http2.TestHttpServlet for the HTTP/2 version of + * See org.apache.coyote.http2.TestHttpServlet for the HTTP/2 version of * this test. It was placed in that package because it needed access to * package private classes. */ diff --git a/test/org/apache/catalina/authenticator/jaspic/TestAuthConfigFactoryImpl.java b/test/org/apache/catalina/authenticator/jaspic/TestAuthConfigFactoryImpl.java index c230b9e..9057401 100644 --- a/test/org/apache/catalina/authenticator/jaspic/TestAuthConfigFactoryImpl.java +++ b/test/org/apache/catalina/authenticator/jaspic/TestAuthConfigFactoryImpl.java @@ -41,19 +41,19 @@ public class TestAuthConfigFactoryImpl { @Test public void testRegistrationNullLayer() { - doTestResistration(null, "AC_1", ":AC_1"); + doTestRegistration(null, "AC_1", ":AC_1"); } @Test public void testRegistrationNullAppContext() { - doTestResistration("L_1", null, "L_1:"); + doTestRegistration("L_1", null, "L_1:"); } @Test public void testRegistrationNullLayerAndNullAppContext() { - doTestResistration(null, null, ":"); + doTestRegistration(null, null, ":"); } @@ -151,7 +151,7 @@ public class TestAuthConfigFactoryImpl { } - private void doTestResistration(String layer, String appContext, String expectedRegId) { + private void doTestRegistration(String layer, String appContext, String expectedRegId) { AuthConfigFactory factory = new AuthConfigFactoryImpl(); AuthConfigProvider acp1 = new SimpleAuthConfigProvider(null, null); SimpleRegistrationListener listener = new SimpleRegistrationListener(layer, appContext); diff --git a/test/org/apache/catalina/connector/TestRequest.java b/test/org/apache/catalina/connector/TestRequest.java index ad99d50..be1a7f8 100644 --- a/test/org/apache/catalina/connector/TestRequest.java +++ b/test/org/apache/catalina/connector/TestRequest.java @@ -921,7 +921,7 @@ public class TestRequest extends TomcatBaseTest { } - private void doTestGetReader(String userAgentCharaceterEncoding, boolean expect200) + private void doTestGetReader(String userAgentCharacterEncoding, boolean expect200) throws Exception { // Setup Tomcat instance @@ -937,7 +937,7 @@ public class TestRequest extends TomcatBaseTest { Charset charset = StandardCharsets.ISO_8859_1; try { - charset = Charset.forName(userAgentCharaceterEncoding); + charset = Charset.forName(userAgentCharacterEncoding); } catch (UnsupportedCharsetException e) { // Ignore - use default set above } @@ -945,7 +945,7 @@ public class TestRequest extends TomcatBaseTest { ByteChunk bc = new ByteChunk(); Map<String,List<String>> reqHeaders = new HashMap<>(); reqHeaders.put("Content-Type", - Arrays.asList(new String[] {"text/plain;charset=" + userAgentCharaceterEncoding})); + Arrays.asList(new String[] {"text/plain;charset=" + userAgentCharacterEncoding})); int rc = postUrl(body, "http://localhost:" + getPort() + "/", bc, reqHeaders, null); diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java b/test/org/apache/catalina/core/TestAsyncContextImpl.java index b320100..ff87347 100644 --- a/test/org/apache/catalina/core/TestAsyncContextImpl.java +++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java @@ -2837,7 +2837,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest { public void doOnWritePossible() { - // Hack to avoid ISE if we try gettign the request after complete/dispatch + // Hack to avoid ISE if we try getting the request after complete/dispatch ServletRequest req = ac.getRequest(); if (useComplete) { ac.complete(); diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java b/test/org/apache/catalina/startup/TestMultipartConfig.java index 986edb4..5923bd4 100644 --- a/test/org/apache/catalina/startup/TestMultipartConfig.java +++ b/test/org/apache/catalina/startup/TestMultipartConfig.java @@ -77,7 +77,7 @@ public class TestMultipartConfig { } @Test - public void testPartialMultipartConfigMaxReqeustSize() throws Exception { + public void testPartialMultipartConfigMaxRequestSize() throws Exception { MultipartDef multipartDef = new MultipartDef(); multipartDef.setMaxRequestSize("10240"); diff --git a/test/org/apache/catalina/startup/TestTomcatNoServer.java b/test/org/apache/catalina/startup/TestTomcatNoServer.java index 6ffb1e5..882bd4a 100644 --- a/test/org/apache/catalina/startup/TestTomcatNoServer.java +++ b/test/org/apache/catalina/startup/TestTomcatNoServer.java @@ -72,7 +72,7 @@ public class TestTomcatNoServer { System.out.println("Missing in embedded: [" + missingExtension + "]-[" + webXmlMimeMappings.get(missingExtension) + "]"); } - Assert.fail("Embedded is missing [" + missingInEmbedded.size() + "] entires compared to conf/web.xml"); + Assert.fail("Embedded is missing [" + missingInEmbedded.size() + "] entries compared to conf/web.xml"); } // Find entries present in embedded that are missing in conf/web.xml @@ -83,7 +83,7 @@ public class TestTomcatNoServer { System.out.println("Missing in embedded: [" + missingExtension + "]-[" + ctx.findMimeMapping(missingExtension) + "]"); } - Assert.fail("Embedded is missing [" + missingInWebXml.size() + "] entires compared to conf/web.xml"); + Assert.fail("Embedded is missing [" + missingInWebXml.size() + "] entries compared to conf/web.xml"); } } } diff --git a/test/org/apache/catalina/util/TestContextNameExtractFromPath.java b/test/org/apache/catalina/util/TestContextNameExtractFromPath.java index af4ef3c..5adb621 100644 --- a/test/org/apache/catalina/util/TestContextNameExtractFromPath.java +++ b/test/org/apache/catalina/util/TestContextNameExtractFromPath.java @@ -62,7 +62,7 @@ public class TestContextNameExtractFromPath { @Test - public void testConextNameExtractFromPath() throws Exception { + public void testContextNameExtractFromPath() throws Exception { ContextName cn = ContextName.extractFromPath(path); Assert.assertEquals(expectedPath, cn.getPath()); Assert.assertEquals(expectedVersion, cn.getVersion()); diff --git a/test/org/apache/catalina/valves/TestRemoteIpValve.java b/test/org/apache/catalina/valves/TestRemoteIpValve.java index 036cf1a..286a18c 100644 --- a/test/org/apache/catalina/valves/TestRemoteIpValve.java +++ b/test/org/apache/catalina/valves/TestRemoteIpValve.java @@ -726,7 +726,7 @@ public class TestRemoteIpValve { // PREPARE String incomingScheme = arrivesAsSecure ? "https" : "http"; String expectedScheme = shouldBeSecure ? "https" : "http"; - int incommingServerPort = arrivesAsSecure ? 8443 : 8080; + int incomingServerPort = arrivesAsSecure ? 8443 : 8080; int expectedServerPort = shouldBeSecure ? 443 : 80; RemoteIpValve remoteIpValve = new RemoteIpValve(); remoteIpValve.setRemoteIpHeader("x-forwarded-for"); @@ -743,7 +743,7 @@ public class TestRemoteIpValve { // protocol request.getCoyoteRequest().getMimeHeaders().addValue("x-forwarded-proto").setString(incomingHeaderValue); request.setSecure(arrivesAsSecure); - request.setServerPort(incommingServerPort); + request.setServerPort(incomingServerPort); request.getCoyoteRequest().scheme().setString(incomingScheme); // TEST @@ -785,7 +785,7 @@ public class TestRemoteIpValve { Boolean.valueOf(arrivesAsSecure), Boolean.valueOf(actualPostInvokeSecure)); int actualPostInvokeServerPort = request.getServerPort(); - Assert.assertEquals("postInvoke serverPort", incommingServerPort, actualPostInvokeServerPort); + Assert.assertEquals("postInvoke serverPort", incomingServerPort, actualPostInvokeServerPort); String actualPostInvokeScheme = request.getScheme(); Assert.assertEquals("postInvoke scheme", incomingScheme, actualPostInvokeScheme); diff --git a/test/org/apache/coyote/TestRequest.java b/test/org/apache/coyote/TestRequest.java index 8ccdf55..018a8ee 100644 --- a/test/org/apache/coyote/TestRequest.java +++ b/test/org/apache/coyote/TestRequest.java @@ -57,7 +57,7 @@ public class TestRequest { request.setExpectation(true); // Configure the mock to verify that a network write is made. - configureMockForOneAckowledgementWrite(socketWrapper); + configureMockForOneAcknowledgementWrite(socketWrapper); protocol.setContinueResponseTiming(ContinueResponseTiming.IMMEDIATELY.toString()); response.action(ActionCode.ACK, ContinueResponseTiming.IMMEDIATELY); @@ -66,7 +66,7 @@ public class TestRequest { EasyMock.verify(socketWrapper); // Configure the mock to verify that no network write is made. - configureMockForNoAckowledgementWrite(socketWrapper); + configureMockForNoAcknowledgementWrite(socketWrapper); request.doRead(new DoNothingApplicationBufferHandler()); @@ -83,7 +83,7 @@ public class TestRequest { request.setExpectation(true); // Configure the mock to verify that no network write is made. - configureMockForNoAckowledgementWrite(socketWrapper); + configureMockForNoAcknowledgementWrite(socketWrapper); protocol.setContinueResponseTiming(ContinueResponseTiming.ON_REQUEST_BODY_READ.toString()); response.action(ActionCode.ACK, ContinueResponseTiming.IMMEDIATELY); @@ -92,7 +92,7 @@ public class TestRequest { EasyMock.verify(socketWrapper); // Configure the mock to verify that a network write is made. - configureMockForOneAckowledgementWrite(socketWrapper); + configureMockForOneAcknowledgementWrite(socketWrapper); request.doRead(new DoNothingApplicationBufferHandler()); @@ -108,7 +108,7 @@ public class TestRequest { request.setExpectation(false); // Configure the mock to verify that no network write is made. - configureMockForNoAckowledgementWrite(socketWrapper); + configureMockForNoAcknowledgementWrite(socketWrapper); protocol.setContinueResponseTiming(ContinueResponseTiming.ON_REQUEST_BODY_READ.toString()); request.doRead(new DoNothingApplicationBufferHandler()); @@ -125,7 +125,7 @@ public class TestRequest { request.setExpectation(false); // Configure the mock to verify that no network write is made. - configureMockForNoAckowledgementWrite(socketWrapper); + configureMockForNoAcknowledgementWrite(socketWrapper); protocol.setContinueResponseTiming(ContinueResponseTiming.IMMEDIATELY.toString()); response.action(ActionCode.ACK, ContinueResponseTiming.IMMEDIATELY); @@ -153,7 +153,7 @@ public class TestRequest { } - private void configureMockForOneAckowledgementWrite(SocketWrapperBase<?> socketWrapper) throws IOException { + private void configureMockForOneAcknowledgementWrite(SocketWrapperBase<?> socketWrapper) throws IOException { EasyMock.reset(socketWrapper); socketWrapper.write(true, Constants.ACK_BYTES, 0, Constants.ACK_BYTES.length); EasyMock.expectLastCall().once(); @@ -161,7 +161,7 @@ public class TestRequest { } - private void configureMockForNoAckowledgementWrite(SocketWrapperBase<?> socketWrapper) { + private void configureMockForNoAcknowledgementWrite(SocketWrapperBase<?> socketWrapper) { EasyMock.reset(socketWrapper); EasyMock.replay(socketWrapper); } diff --git a/test/org/apache/coyote/http2/TestAsyncFlush.java b/test/org/apache/coyote/http2/TestAsyncFlush.java index 527f88d..5d49c33 100644 --- a/test/org/apache/coyote/http2/TestAsyncFlush.java +++ b/test/org/apache/coyote/http2/TestAsyncFlush.java @@ -75,7 +75,7 @@ public class TestAsyncFlush extends Http2TestBase { sendClientPreface(); validateHttp2InitialResponse(); - // Reset connection window size after intial response + // Reset connection window size after initial response sendWindowUpdate(0, SimpleServlet.CONTENT_LENGTH); // Send request diff --git a/test/org/apache/juli/TestFileHandler.java b/test/org/apache/juli/TestFileHandler.java index d8840f9..d946ecc 100644 --- a/test/org/apache/juli/TestFileHandler.java +++ b/test/org/apache/juli/TestFileHandler.java @@ -36,8 +36,8 @@ public class TestFileHandler { private static final String PREFIX_2 = "test."; private static final String PREFIX_3 = ""; private static final String PREFIX_4 = "localhost1"; - private static final String SUFIX_1 = ".log"; - private static final String SUFIX_2 = ".txt"; + private static final String SUFFIX_1 = ".log"; + private static final String SUFFIX_2 = ".txt"; private File logsDir; @@ -50,13 +50,13 @@ public class TestFileHandler { Path logsBasePath = FileSystems.getDefault().getPath(logsBase.getAbsolutePath()); logsDir = Files.createTempDirectory(logsBasePath, "test").toFile(); - generateLogFiles(logsDir, PREFIX_1, SUFIX_2, 3); - generateLogFiles(logsDir, PREFIX_2, SUFIX_1, 3); - generateLogFiles(logsDir, PREFIX_3, SUFIX_1, 3); - generateLogFiles(logsDir, PREFIX_4, SUFIX_1, 3); + generateLogFiles(logsDir, PREFIX_1, SUFFIX_2, 3); + generateLogFiles(logsDir, PREFIX_2, SUFFIX_1, 3); + generateLogFiles(logsDir, PREFIX_3, SUFFIX_1, 3); + generateLogFiles(logsDir, PREFIX_4, SUFFIX_1, 3); String date = LocalDateTime.now().minusDays(3).toString().replaceAll(":", "-"); - File file = new File(logsDir, PREFIX_1 + date + SUFIX_1); + File file = new File(logsDir, PREFIX_1 + date + SUFFIX_1); if (!file.createNewFile()) { Assert.fail("Unable to create " + file.getAbsolutePath()); } @@ -75,9 +75,9 @@ public class TestFileHandler { @Test public void testCleanOnInitOneHandler() throws Exception { - generateLogFiles(logsDir, PREFIX_1, SUFIX_1, 3); + generateLogFiles(logsDir, PREFIX_1, SUFFIX_1, 3); - FileHandler fh1 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_1, Integer.valueOf(2)); + FileHandler fh1 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFFIX_1, Integer.valueOf(2)); fh1.open(); Thread.sleep(1000); @@ -89,12 +89,12 @@ public class TestFileHandler { @Test public void testCleanOnInitMultipleHandlers() throws Exception { - generateLogFiles(logsDir, PREFIX_1, SUFIX_1, 3); + generateLogFiles(logsDir, PREFIX_1, SUFFIX_1, 3); - FileHandler fh1 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_1, Integer.valueOf(2)); - FileHandler fh2 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_2, Integer.valueOf(2)); - FileHandler fh3 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_2, SUFIX_1, Integer.valueOf(2)); - FileHandler fh4 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_3, SUFIX_1, Integer.valueOf(2)); + FileHandler fh1 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFFIX_1, Integer.valueOf(2)); + FileHandler fh2 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFFIX_2, Integer.valueOf(2)); + FileHandler fh3 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_2, SUFFIX_1, Integer.valueOf(2)); + FileHandler fh4 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_3, SUFFIX_1, Integer.valueOf(2)); fh1.open(); fh2.open(); fh3.open(); @@ -112,9 +112,9 @@ public class TestFileHandler { @Test public void testCleanDisabled() throws Exception { - generateLogFiles(logsDir, PREFIX_1, SUFIX_1, 3); + generateLogFiles(logsDir, PREFIX_1, SUFFIX_1, 3); - FileHandler fh1 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFIX_1, null); + FileHandler fh1 = new FileHandler(logsDir.getAbsolutePath(), PREFIX_1, SUFFIX_1, null); fh1.open(); Thread.sleep(1000); @@ -124,11 +124,11 @@ public class TestFileHandler { fh1.close(); } - private void generateLogFiles(File dir, String prefix, String sufix, int amount) + private void generateLogFiles(File dir, String prefix, String suffix, int amount) throws IOException { for (int i = 0; i < amount; i++) { String date = LocalDate.now().minusDays(i + 1).toString().substring(0, 10); - File file = new File(dir, prefix + date + sufix); + File file = new File(dir, prefix + date + suffix); if (!file.createNewFile()) { Assert.fail("Unable to create " + file.getAbsolutePath()); } diff --git a/test/org/apache/naming/TesterInjectionServlet.java b/test/org/apache/naming/TesterInjectionServlet.java index e45a978..b7ec3f0 100644 --- a/test/org/apache/naming/TesterInjectionServlet.java +++ b/test/org/apache/naming/TesterInjectionServlet.java @@ -58,7 +58,7 @@ public class TesterInjectionServlet extends HttpServlet { PrintWriter pw = resp.getWriter(); pw.print(IntrospectionUtils.getProperty(this, injectionName)); - // The property should tyake precedence over the field and this should + // The property should take precedence over the field and this should // be null if (getProperty2a() != null) { pw.println(); diff --git a/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java b/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java index bf1c233..d69ad16 100644 --- a/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java +++ b/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java @@ -78,7 +78,7 @@ public class TestEncodingDecoding extends TomcatBaseTest { Tomcat tomcat = getTomcatInstance(); // No file system docBase required Context ctx = tomcat.addContext("", null); - ctx.addApplicationListener(ProgramaticServerEndpointConfig.class.getName()); + ctx.addApplicationListener(ProgrammaticServerEndpointConfig.class.getName()); Tomcat.addServlet(ctx, "default", new DefaultServlet()); ctx.addServletMappingDecoded("/", "default"); @@ -698,7 +698,7 @@ public class TestEncodingDecoding extends TomcatBaseTest { } - public static class ProgramaticServerEndpointConfig extends WsContextListener { + public static class ProgrammaticServerEndpointConfig extends WsContextListener { @Override public void contextInitialized(ServletContextEvent sce) { @@ -761,7 +761,7 @@ public class TestEncodingDecoding extends TomcatBaseTest { Tomcat tomcat = getTomcatInstance(); // No file system docBase required Context ctx = tomcat.addContext("", null); - ctx.addApplicationListener(ProgramaticServerEndpointConfig.class.getName()); + ctx.addApplicationListener(ProgrammaticServerEndpointConfig.class.getName()); Tomcat.addServlet(ctx, "default", new DefaultServlet()); ctx.addServletMappingDecoded("/", "default"); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org