testMultiFileUploadInMixedModeNoName() — netty Function Reference
Architecture documentation for the testMultiFileUploadInMixedModeNoName() function in HttpPostRequestEncoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 6a61d4d1_c39d_1068_6161_f5ae99870b11["testMultiFileUploadInMixedModeNoName()"] 3af766b2_b7f3_8257_aeb8_621a4404fee6["HttpPostRequestEncoderTest"] 6a61d4d1_c39d_1068_6161_f5ae99870b11 -->|defined in| 3af766b2_b7f3_8257_aeb8_621a4404fee6 style 6a61d4d1_c39d_1068_6161_f5ae99870b11 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoderTest.java lines 202–250
@Test
public void testMultiFileUploadInMixedModeNoName() throws Exception {
DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1,
HttpMethod.POST, "http://localhost");
HttpPostRequestEncoder encoder = new HttpPostRequestEncoder(request, true);
File file1 = new File(getClass().getResource("/file-01.txt").toURI());
File file2 = new File(getClass().getResource("/file-02.txt").toURI());
encoder.addBodyAttribute("foo", "bar");
encoder.addBodyFileUpload("quux", "", file1, "text/plain", false);
encoder.addBodyFileUpload("quux", "", file2, "text/plain", false);
// We have to query the value of these two fields before finalizing
// the request, which unsets one of them.
String multipartDataBoundary = encoder.multipartDataBoundary;
String multipartMixedBoundary = encoder.multipartMixedBoundary;
String content = getRequestBody(encoder);
String expected = "--" + multipartDataBoundary + "\r\n" +
CONTENT_DISPOSITION + ": form-data; name=\"foo\"" + "\r\n" +
CONTENT_LENGTH + ": 3" + "\r\n" +
CONTENT_TYPE + ": text/plain; charset=UTF-8" + "\r\n" +
"\r\n" +
"bar" + "\r\n" +
"--" + multipartDataBoundary + "\r\n" +
CONTENT_DISPOSITION + ": form-data; name=\"quux\"" + "\r\n" +
CONTENT_TYPE + ": multipart/mixed; boundary=" + multipartMixedBoundary + "\r\n" +
"\r\n" +
"--" + multipartMixedBoundary + "\r\n" +
CONTENT_DISPOSITION + ": attachment\r\n" +
CONTENT_LENGTH + ": " + file1.length() + "\r\n" +
CONTENT_TYPE + ": text/plain" + "\r\n" +
CONTENT_TRANSFER_ENCODING + ": binary" + "\r\n" +
"\r\n" +
"File 01" + StringUtil.NEWLINE +
"\r\n" +
"--" + multipartMixedBoundary + "\r\n" +
CONTENT_DISPOSITION + ": attachment\r\n" +
CONTENT_LENGTH + ": " + file2.length() + "\r\n" +
CONTENT_TYPE + ": text/plain" + "\r\n" +
CONTENT_TRANSFER_ENCODING + ": binary" + "\r\n" +
"\r\n" +
"File 02" + StringUtil.NEWLINE +
"\r\n" +
"--" + multipartMixedBoundary + "--" + "\r\n" +
"--" + multipartDataBoundary + "--" + "\r\n";
assertEquals(expected, content);
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does testMultiFileUploadInMixedModeNoName() do?
testMultiFileUploadInMixedModeNoName() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoderTest.java.
Where is testMultiFileUploadInMixedModeNoName() defined?
testMultiFileUploadInMixedModeNoName() is defined in codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoderTest.java at line 202.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free