ExtensionConfig { public static ExtensionConfig parse(String parameterizedName) { return new ExtensionConfig(parameterizedName); } ExtensionConfig(ExtensionConfig copy);  ExtensionConfig(String parameterizedName); static ExtensionConfig parse(String parameterizedName); static List<ExtensionConfig> parseEnum(Enumeration<String> valuesEnum); static List<ExtensionConfig> parseList(List<String> rawSecWebSocketExtensions); static String toHeaderValue(List<ExtensionConfig> configs); String getName(); final int getParameter(String key, int defValue); final String getParameter(String key, String defValue); final String getParameterizedName(); final Set<String> getParameterKeys(); final Map<String, String> getParameters(); final void init(ExtensionConfig other); final void setParameter(String key); final void setParameter(String key, int value); final void setParameter(String key, String value); @Override String toString();  }
@Test public void testParseMuxExample() { ExtensionConfig cfg = ExtensionConfig.parse("mux; max-channels=4; flow-control"); Map<String, String> expectedParams = new HashMap<>(); expectedParams.put("max-channels", "4"); expectedParams.put("flow-control", null); assertConfig(cfg, "mux", expectedParams); }
@Test public void testParsePerMessageCompressExample1() { ExtensionConfig cfg = ExtensionConfig.parse("permessage-compress; method=foo"); Map<String, String> expectedParams = new HashMap<>(); expectedParams.put("method", "foo"); assertConfig(cfg, "permessage-compress", expectedParams); }
@Test public void testParsePerMessageCompressExample2() { ExtensionConfig cfg = ExtensionConfig.parse("permessage-compress; method=\"foo; x=10\""); Map<String, String> expectedParams = new HashMap<>(); expectedParams.put("method", "foo; x=10"); assertConfig(cfg, "permessage-compress", expectedParams); }
@Test public void testParsePerMessageCompressExample3() { ExtensionConfig cfg = ExtensionConfig.parse("permessage-compress; method=\"foo, bar\""); Map<String, String> expectedParams = new HashMap<>(); expectedParams.put("method", "foo, bar"); assertConfig(cfg, "permessage-compress", expectedParams); }
@Test public void testParsePerMessageCompressExample4() { ExtensionConfig cfg = ExtensionConfig.parse("permessage-compress; method=\"foo; use_x, foo\""); Map<String, String> expectedParams = new HashMap<>(); expectedParams.put("method", "foo; use_x, foo"); assertConfig(cfg, "permessage-compress", expectedParams); }
@Test public void testParsePerMessageCompressExample5() { ExtensionConfig cfg = ExtensionConfig.parse("permessage-compress; method=\"foo; x=\\\"Hello World\\\", bar\""); Map<String, String> expectedParams = new HashMap<>(); expectedParams.put("method", "foo; x=\"Hello World\", bar"); assertConfig(cfg, "permessage-compress", expectedParams); }
@Test public void testParseSimpleBasicParameters() { ExtensionConfig cfg = ExtensionConfig.parse("bar; baz=2"); Map<String, String> expectedParams = new HashMap<>(); expectedParams.put("baz", "2"); assertConfig(cfg, "bar", expectedParams); }
@Test public void testParseSimpleNoParameters() { ExtensionConfig cfg = ExtensionConfig.parse("foo"); Map<String, String> expectedParams = new HashMap<>(); assertConfig(cfg, "foo", expectedParams); }