jetty.project/tests/test-webapps
Greg Wilkins c41b6b7aab
Merge pull request #2332 from eclipse/jetty-9.4.x-1027-Multipart
## SearchPattern
New class which does a fast search for patterns within strings and arrays of bytes using an implementation of the Boyer–Moore–Horspool algorithm. This was written to be used in the new MultiPartParser class to search for delimeter boundaries.

## MultiPartParser
New class which uses the SearchPattern to parse a MultiPart Mime given a ByteBuffer. Written in a non-blocking style so can be used asynchronously (although not currently be being used this way).

## MultiPartFormInputStream
New class which uses the MultiPartParser to parse a MultiPart Mime input stream into a Collection of Parts. This class is in org/eclipse/jetty/http and is designed to replace org/eclipse/jetty/util/MultiPartInputStreamParser.

## MultiPartInputStreamParser and Non Compliances
This class has been deprecated and replaced by org.eclipse.jetty.http.MultiPartFormInputStream. It accepts formats non compliant with the RFC that the new MultiPartFormInputStream does not accept. When this occurs violations are recorded by the method getNonComplianceWarnings().

## MultiParts
New interface to allow switching between the different implementations. This allows MultiParts to function in two different modes. The LEGACY implementation using the UTIL parser which may parse forms containing non compliances with the RFC, and the RFC7578 implementation using the new and faster HTTP parser. This file contains the implementations of MultiParts for HTTP and UTIL parsers as nested classes which are used by Request.

## Request
Changed to use the new MultiParts interface instead of the MultiPartInputStreamParser class. with a method called newMultiParts which will construct a MultiPart using one of the HTTP or UTIL implementations depending on what compliance mode is set.

## Jetty Test Webapp Dump Servlet
Code added to display parts while running the dump test webapp if MuliPart form is submitted.

## MultiPartBenchMark
JMH Benchmark of the HTTP multipart parser vs the UTIL multipart parser.

testLargeGenerated parses a 10MB file of random binary data.
testParser parses a series of small multipart forms captured by a browser.
```
# Run complete. Total time: 00:02:09

Benchmark                              (parserType)  Mode  Cnt  Score   Error  Units
MultiPartBenchmark.testLargeGenerated          UTIL  avgt   10  0.252 ± 0.025   s/op
MultiPartBenchmark.testLargeGenerated          HTTP  avgt   10  0.035 ± 0.004   s/op
MultiPartBenchmark.testParser                  UTIL  avgt   10  0.028 ± 0.005   s/op
MultiPartBenchmark.testParser                  HTTP  avgt   10  0.015 ± 0.006   s/op
```
2018-04-04 17:30:36 +10:00
..
test-dispatch-webapp Issue #2108 - Updating license headers for year 2018 2018-01-09 08:39:37 -06:00
test-http2-webapp Updating to version 9.4.10-SNAPSHOT 2018-03-20 08:25:59 -05:00
test-jaas-webapp Updating to version 9.4.10-SNAPSHOT 2018-03-20 08:25:59 -05:00
test-jetty-webapp fixed path of MultiPartFormDataCompliance in jetty.xml 2018-04-04 11:18:57 +10:00
test-jndi-webapp Updating to version 9.4.10-SNAPSHOT 2018-03-20 08:25:59 -05:00
test-mock-resources Updating to version 9.4.10-SNAPSHOT 2018-03-20 08:25:59 -05:00
test-proxy-webapp Updating to version 9.4.10-SNAPSHOT 2018-03-20 08:25:59 -05:00
test-servlet-spec Issue #2109 remove warnings for unused imports and exports (#2390) 2018-04-04 12:06:43 +10:00
test-webapp-rfc2616 Updating to version 9.4.10-SNAPSHOT 2018-03-20 08:25:59 -05:00
.gitignore 271535 Adding integration tests, and enabling RFC2616 tests. 2009-07-08 19:28:16 +00:00
pom.xml Updating to version 9.4.10-SNAPSHOT 2018-03-20 08:25:59 -05:00