DSCCommentBeginDocument beginDocument;
beginDocument = (DSCCommentBeginDocument)gotoDSCComment(
parser, DSCConstants.BEGIN_DOCUMENT);
assertEquals("test/resources/images/barcode.eps",
beginDocument.getResource().getName());
DSCListener listener = new DefaultNestedDocumentHandler(null);
listener.processEvent(beginDocument, parser);
//And again (the barcode is generated twice)
beginDocument = (DSCCommentBeginDocument)gotoDSCComment(
parser, DSCConstants.BEGIN_DOCUMENT);
assertEquals("test/resources/images/barcode.eps",
beginDocument.getResource().getName());
listener.processEvent(beginDocument, parser);
assertNotNull(gotoDSCComment(parser, DSCConstants.PAGE_TRAILER));
pageResources = (AbstractResourcesDSCComment)gotoDSCComment(
parser, DSCConstants.PAGE_RESOURCES);
resources = pageResources.getResources();