SubversionProjectImporter implements ProjectImporter { @Override public void importSources(final FolderEntry baseFolder, final String location, final Map<String, String> parameters) throws IOException, ForbiddenException, ServerException, UnauthorizedException, ConflictException { importSources(baseFolder, location, parameters, LineConsumerFactory.NULL); } @Inject  SubversionProjectImporter(final CredentialsProvider credentialsProvider,
                                     final LocalPathResolver localPathResolver,
                                     final SubversionApi subversionApi); @Override String getId(); @Override boolean isInternal(); @Override String getDescription(); @Override ImporterCategory getCategory(); @Override void importSources(final FolderEntry baseFolder, final String location, final Map<String, String> parameters); @Override void importSources(final FolderEntry baseFolder, final String location,
                              final Map<String, String> parameters, final LineConsumerFactory outputPublisherFactory); static final String ID; }
@Test public void testInvalidImportSources() throws Exception { final FolderEntry project = new FolderEntry("plugin-svn-test", vfs.getMountPoint().getRoot().createFolder("project")); try { String fakeUrl = Paths.get(repoRoot.getAbsolutePath()).toUri() + "fake"; projectImporter.importSources(project, fakeUrl, null, new TestUtils.SystemOutLineConsumerFactory()); fail("The code above should had failed"); } catch (SubversionException e) { final String message = e.getMessage(); boolean assertBoolean = Pattern.matches("svn: (E[0-9]{6}: )?URL 'file: assertTrue(message, assertBoolean); } }
@Test public void testValidImportSources() throws Exception { final FolderEntry project = new FolderEntry("plugin-svn-test", vfs.getMountPoint().getRoot().createFolder("project")); String repoUrl = Paths.get(repoRoot.getAbsolutePath()).toUri().toString(); projectImporter.importSources(project, repoUrl, null, new TestUtils.SystemOutLineConsumerFactory()); assertTrue(project.getChild(".svn").isFolder()); assertTrue(project.getChild("A").isFolder()); assertTrue(project.getChild("iota").isFile()); }