### Question:
RepositoryExportSaxParser extends DefaultHandler2 { public void parse( RepositoryElementReadListener repositoryElementReadListener ) throws Exception { this.repositoryElementReadListener = repositoryElementReadListener; SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); this.saxParser = factory.newSAXParser(); this.saxParser.parse( new File( filename ), this ); } RepositoryExportSaxParser( String filename, RepositoryImportFeedbackInterface feedback ); void parse( RepositoryElementReadListener repositoryElementReadListener ); void startElement( String uri, String localName, String qName, Attributes attributes ); void endElement( String uri, String localName, String qName ); void startCDATA(); void endCDATA(); void characters( char[] ch, int start, int length ); @Override void fatalError( SAXParseException e ); static final String STRING_REPOSITORY; static final String STRING_TRANSFORMATIONS; static final String STRING_TRANSFORMATION; static final String STRING_JOBS; static final String STRING_JOB; }### Answer:
@Test public void testNoExceptionOccurs_WhenNameContainsJapaneseCharacters() throws Exception { repExpSAXParser = new RepositoryExportSaxParser( getRepositoryFile().getCanonicalPath(), repImpPgDlg ); try { repExpSAXParser.parse( repImpMock ); } catch ( Exception e ) { Assert.fail( "No exception is expected But occured: " + e ); } }
@Test( expected = SAXParseException.class ) public void exceptionIsThrownWhenParsingXmlWithBigAmountOfExternalEntities() throws Exception { File file = createTmpFile( XXEUtils.MALICIOUS_XML ); repExpSAXParser = new RepositoryExportSaxParser( file.getAbsolutePath(), null ); repExpSAXParser.parse( repImpMock ); }