private IOService mockIoService(final FileSystem fileSystem) { final IOService ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); return ioService; } }
private IOService mockIoService(final FileSystem fileSystem) { final IOService ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); return ioService; } }
private IOService mockIoService(final FileSystem fileSystem) { final IOService ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); return ioService; } }
private IOService mockIoService(final FileSystem fileSystem) { final IOService ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); return ioService; } }
private IOService mockIoService(final FileSystem fileSystem) { final IOService ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); return ioService; } }
private IOService mockIoService() { final IOService ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystemTestingUtils.getFileSystem()).when(ioService).newFileSystem(any(URI.class), anyMap()); return ioService; } }
private IOService mockIoService() { final IOService ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystemTestingUtils.getFileSystem()).when(ioService).newFileSystem(any(URI.class), anyMap()); return ioService; } }
private IOService mockIoService() { final IOService ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystemTestingUtils.getFileSystem()).when(ioService).newFileSystem(any(URI.class), anyMap()); return ioService; } }
@Test public void testValidateWhenTheresNoProject() throws Exception { final URI originRepo = URI.create("git://repo"); final FileSystem origin = fileSystemTestingUtils.getIoService().newFileSystem(originRepo, Collections.singletonMap("init", Boolean.TRUE)); Path path = Paths.convert(origin.getPath("/META-INF/beans.xml")); URL urlToValidate = this.getClass().getResource("/META-INF/beans.xml"); List<ValidationMessage> errors = validator.validate(path, Resources.toString(urlToValidate, Charsets.UTF_8)); assertTrue(errors.isEmpty()); }
@Before public void setUp() throws Exception { fileSystemTestingUtils.setup(); ioService = spy(fileSystemTestingUtils.getIoService()); copier = new RepositoryCopierImpl(ioService, newBranchEventEvent, configuredRepositories, repositoryService, sessionInfo); }
private Path createFile(String fileName) { final Path path = PathFactory.newPath(fileName, PATH_PREFIX + "parent/" + fileName); fileSystemTestingUtils.getIoService().write(Paths.convert(path), "content"); return path; }
private Path createFile(String fileName) { final Path path = PathFactory.newPath(fileName, PATH_PREFIX + "parent/" + fileName); fileSystemTestingUtils.getIoService().write(Paths.convert(path), "content"); return path; }
@Test public void fsUtilsSanityCheck() throws IOException, InterruptedException { IOService ioService = fileSystemTestingUtils.getIoService(); Path init = ioService.get(URI.create("git://amend-repo-test/init.file")); String expected = "setupFS!"; ioService.write(init, expected); assertEquals(expected, ioService.readAllString(init)); } }
@Before public void setup() throws IOException { fileSystemTestingUtils.setup(); templateStorage = new ServerTemplateVFSStorage(fileSystemTestingUtils.getIoService(), fileSystemTestingUtils.getFileSystem()); createServerTemplateWithContainer(); }
@Before public void setup() throws IOException { xstream = XStreamUtils.createTrustingXStream(); fileSystemTestingUtils.setup(); ioService = fileSystemTestingUtils.getIoService(); fileSystem = fileSystemTestingUtils.getFileSystem(); templateStorage = new ServerTemplateVFSStorage(ioService, fileSystem); }
@Before public void setUp() throws Exception { weldContainer = new Weld().initialize(); cdiWrapper = weldContainer.instance().select(MigrationServicesCDIWrapper.class).get(); fileSystemTestingUtils.setup(); ioService = fileSystemTestingUtils.getIoService(); editor = new PomMigrationEditor(); }
private String targetFileName(final String originalFileName, final String newFileName) { final Path path = PathFactory.newPath(originalFileName, PATH_PREFIX + originalFileName); fileSystemTestingUtils.getIoService().write(Paths.convert(path), "content"); return pathNamingService.buildTargetPath(path, newFileName).getFileName(); }
private String targetFileName(final String originalFileName, final String newFileName) { final Path path = PathFactory.newPath(originalFileName, PATH_PREFIX + originalFileName); fileSystemTestingUtils.getIoService().write(Paths.convert(path), "content"); return pathNamingService.buildTargetPath(path, newFileName).getFileName(); }
private String targetFolderName(final String originalFolderName, final String newFolderName) { final Path path = PathFactory.newPath("file", PATH_PREFIX + originalFolderName + "/file"); fileSystemTestingUtils.getIoService().write(Paths.convert(path), "content"); return pathNamingService.buildTargetPath(Paths.convert(Paths.convert(path).getParent()), newFolderName).getFileName(); }
private String targetFolderName(final String originalFolderName, final String newFolderName) { final Path path = PathFactory.newPath("file", PATH_PREFIX + originalFolderName + "/file"); fileSystemTestingUtils.getIoService().write(Paths.convert(path), "content"); return pathNamingService.buildTargetPath(Paths.convert(Paths.convert(path).getParent()), newFolderName).getFileName(); }