testGetTargetContentEncoding() — netty Function Reference
Architecture documentation for the testGetTargetContentEncoding() function in HttpContentCompressorTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 4093323e_4625_f1a9_f77a_e73c7f67c319["testGetTargetContentEncoding()"] 32ab04b0_6c83_d4f7_6483_fd304f908331["HttpContentCompressorTest"] 4093323e_4625_f1a9_f77a_e73c7f67c319 -->|defined in| 32ab04b0_6c83_d4f7_6483_fd304f908331 style 4093323e_4625_f1a9_f77a_e73c7f67c319 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http/src/test/java/io/netty/handler/codec/http/HttpContentCompressorTest.java lines 70–105
@Test
public void testGetTargetContentEncoding() throws Exception {
HttpContentCompressor compressor = new HttpContentCompressor();
String[] tests = {
// Accept-Encoding -> Content-Encoding
"", null,
"*", "gzip",
"*;q=0.0", null,
"gzip", "gzip",
"compress, gzip;q=0.5", "gzip",
"gzip; q=0.5, identity", "gzip",
"gzip ; q=0.1", "gzip",
"gzip; q=0, deflate", "deflate",
" deflate ; q=0 , *;q=0.5", "gzip",
};
for (int i = 0; i < tests.length; i += 2) {
String acceptEncoding = tests[i];
String contentEncoding = tests[i + 1];
ZlibWrapper targetWrapper = compressor.determineWrapper(acceptEncoding);
String targetEncoding = null;
if (targetWrapper != null) {
switch (targetWrapper) {
case GZIP:
targetEncoding = "gzip";
break;
case ZLIB:
targetEncoding = "deflate";
break;
default:
fail();
}
}
assertEquals(contentEncoding, targetEncoding);
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testGetTargetContentEncoding() do?
testGetTargetContentEncoding() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentCompressorTest.java.
Where is testGetTargetContentEncoding() defined?
testGetTargetContentEncoding() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentCompressorTest.java at line 70.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free