Github user solomax commented on a diff in the pull request:
https://github.com/apache/wicket/pull/275#discussion_r182993206
--- Diff:
wicket-core/src/test/java/org/apache/wicket/protocol/http/request/WebClientInfoTest.java
---
@@ -59,9 +58,52 @@ public void before()
}
/**
- * Test IE 6.x user-agent strings
+ * Test check check all user agents
*/
@Test
+ public void testBrowsersAndVersionsOfUserAgents() {
+ // Internet Explorers
--- End diff --
Sorry for delay, here is the code works for me:
```
private static ThreadLocal<UserAgentAnalyzer> localAnalyzer = new
ThreadLocal<UserAgentAnalyzer>();
@Before
public void before()
{
requestCycleMock = mock(RequestCycle.class);
webRequest = mock(ServletWebRequest.class);
when(requestCycleMock.getRequest()).thenReturn(webRequest);
servletRequest = mock(HttpServletRequest.class);
when(webRequest.getContainerRequest()).thenReturn(servletRequest);
if (localAnalyzer.get() == null) {
WebClientInfo webClientInfo = new
WebClientInfo(requestCycleMock, "test");
webClientInfo.gatherExtendedInfo();
localAnalyzer.set(Application.get().getMetaData(WebClientInfo.UAA_META_DATA_KEY));
} else {
Application.get().setMetaData(WebClientInfo.UAA_META_DATA_KEY,
localAnalyzer.get());
}
}
@AfterClass
public static void staticAfter()
{
localAnalyzer.set(null);
}
```
Here are the measurment results:
```
Combined tests
real 0m24.123s
user 1m30.748s
sys 0m1.804s
Individual tests (after above changes were applied)
real 0m22.844s
user 1m23.948s
sys 0m1.832s
```
---