@Test
@Ignore
public void performance() throws Exception
{
final String soap = createKeySoapString("soap-keys-example.xml");
AuthenticationRequest authRequest = null;
// warm up
for (int i = 0; i < 50000; i++)
{
authRequest = extractor.extractSecurityInfo(soap);
}
final int iterations = 1000000;
final long start = System.nanoTime();
for (int i = 0; i < iterations; i++)
{
authRequest = extractor.extractSecurityInfo(soap);
}
final long duration = System.nanoTime() - start;
System.out.println(iterations + " took : " + NANOSECONDS.toSeconds(duration) + "s");
assertNotNull(authRequest);
assertTrue( authRequest.getCredentials().size() > 0 );
Object cert = authRequest.getCredentials().iterator().next();
assertTrue( cert instanceof java.security.cert.X509Certificate);
}