DefaultExportExecutor implements ExportExecutor { public void setArchiveFileCharset(final String archiveFileCharset) { try { this.archiveFileCharset = Charset.forName(archiveFileCharset); } catch (IllegalArgumentException iae) { this.archiveFileCharset = Charset.forName(FALLBACK_CHARSET); } } DefaultExportExecutor(final ConfigDirectory configDirectory); @Override UUID submit(final MultipleEntriesCommand command, final SVNConnection connection, final long pegRevision); @Override int getProgress(final UUID uuid); @Override void delete(final UUID uuid); @Override void downloadByUUID(final UUID uuid, final HttpServletRequest request, final HttpServletResponse response); @Autowired void setRepositoryService(final RepositoryService repositoryService); void setArchiveFileCharset(final String archiveFileCharset); static final String FALLBACK_CHARSET; }
@Test public void testSetArchiveFileCharset() throws Exception { final ConfigDirectory configDirectoryMock = EasyMock.createMock(ConfigDirectory.class); expect(configDirectoryMock.getExportDirectory()).andStubReturn(new File(".")); replay(configDirectoryMock); final DefaultExportExecutor executor = new DefaultExportExecutor(configDirectoryMock); assertEquals(DefaultExportExecutor.FALLBACK_CHARSET, executor.getArchiveFileCharset().toString()); executor.setArchiveFileCharset(null); assertEquals(DefaultExportExecutor.FALLBACK_CHARSET, executor.getArchiveFileCharset().toString()); executor.setArchiveFileCharset("UTF-8"); assertEquals("UTF-8", executor.getArchiveFileCharset().toString()); verify(configDirectoryMock); }