Created
October 17, 2014 13:00
-
-
Save vegaasen/d4eab723b494a1b7d239 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void misc() { | |
final SimpleDocumentBuilderHolder documentBuilderHolder = new SimpleDocumentBuilderHolder(); | |
ExecutorService exec = Executors.newFixedThreadPool(10); | |
for (int i = 0; i < ROUNDS; i++) { | |
exec.submit(new Runnable() { | |
public void run() { | |
try { | |
final DocumentBuilder builder = documentBuilderHolder.allocateDocumentBuilder(); | |
// synchronized (builder) { | |
try { | |
System.out.print("hehe"); | |
builder.parse(samlWheelOfFortune()); | |
} catch (final Throwable t) { | |
throw new AssertionHandlerException("Error parsing assertion", t); | |
} finally { | |
documentBuilderHolder.releaseDocumentBuilder(builder); | |
} | |
// } | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} | |
}); | |
} | |
exec.shutdown(); | |
while (!executor.isTerminated()) { | |
//waiting for termination to complete | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment