private void _testEntity(int chunkSize, boolean checkValues, String spaces) throws Exception
{
final String XML = spaces + "<root>&entity1;Some text&entity2;!<leaf>...&leafEntity;</leaf>&last;</root>";
AsyncXMLInputFactory f = new InputFactoryImpl();
// important must not require expansion of general entities
f.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
AsyncXMLStreamReader sr = f.createAsyncXMLStreamReader();
AsyncReaderWrapper reader = new AsyncReaderWrapper(sr, chunkSize, XML);
// should start with START_DOCUMENT, but for now skip
int t = verifyStart(reader);
assertTokenType(START_ELEMENT, t);