import org.apache.axiom.testutils.concurrent.ConcurrentTestUtils;
public class CreateXMLStreamReaderThreadSafetyTestCase extends DialectTestCase {
protected void runTest() throws Throwable {
final XMLInputFactory factory = getDialect().makeThreadSafe(newNormalizedXMLInputFactory());
ConcurrentTestUtils.testThreadSafety(new Action() {
public void execute() throws Exception {
String text = String.valueOf((int)(Math.random() * 10000));
String xml = "<root>" + text + "</root>";
XMLStreamReader reader = factory.createXMLStreamReader(new StringReader(xml));
assertEquals(XMLStreamReader.START_DOCUMENT, reader.getEventType());