private FileSystem mockFileSystem() { return fileSystemTestingUtils.getFileSystem(); }
private FileSystem mockFileSystem() { return fileSystemTestingUtils.getFileSystem(); }
private FileSystem mockFileSystem() { return fileSystemTestingUtils.getFileSystem(); }
private FileSystem mockFileSystem() { return fileSystemTestingUtils.getFileSystem(); }
private FileSystem mockFileSystem() { return fileSystemTestingUtils.getFileSystem(); }
private FileSystem mockFileSystem() { return fileSystemTestingUtils.getFileSystem(); }
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; } }
@Before public void setup() throws IOException { fileSystemTestingUtils.setup(); ioService = spy(fileSystemTestingUtils.getIoService()); fileSystem = fileSystemTestingUtils.getFileSystem(); baseAppSetup = spy(new BaseAppSetup(ioService, repositoryService, organizationalUnitService, moduleService, configurationService, configurationFactory) { }); mockConfigurations(); mockRepository(); mockOrganizationalUnitService(); mockIoService(); }
@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 IOException { fileSystemTestingUtils.setup(); when(systemRepository.getUri()).thenReturn("git://amend-repo-test"); marshaller = new ConfigGroupMarshaller(); configurationFactory = new ConfigurationFactoryImpl(new DefaultPasswordServiceImpl()); ioService = mockIoService(); configurationService = new ConfigurationServiceImpl(systemRepository, marshaller, identity, ioService, repoChangedEvent, spaceChangedEvent, changedEvent, fileSystemTestingUtils.getFileSystem()); }
@Before public void setup() throws IOException { fileSystemTestingUtils.setup(); when(systemRepository.getUri()).thenReturn("git://amend-repo-test"); marshaller = new ConfigGroupMarshaller(); configurationFactory = new MigrationConfigurationFactoryImpl(new DefaultPasswordServiceImpl()); ioService = mockIoService(); configurationService = new MigrationConfigurationServiceImpl(systemRepository, marshaller, identity, ioService, repoChangedEvent, spaceChangedEvent, changedEvent, fileSystemTestingUtils.getFileSystem()); }
@Before public void init() throws IOException { MappingContextSingleton.get(); fileSystemTestingUtils.setup(); sessionInfo = new SessionInfoMock(USER_NAME); fileSystem = fileSystemTestingUtils.getFileSystem(); ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); defRegistry = new ExperimentalFeatureDefRegistryImpl(); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_1, true, "", GLOBAL_FEATURE_1, GLOBAL_FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_2, true, "", GLOBAL_FEATURE_2, GLOBAL_FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_3, true, "", GLOBAL_FEATURE_3, GLOBAL_FEATURE_3)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_1, false, "", FEATURE_1, FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_2, false, "", FEATURE_2, FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_3, false, "", FEATURE_3, FEATURE_3)); globalStorage = spy(new GlobalExperimentalFeaturesStorageImpl(sessionInfo, spaces, ioService, defRegistry, event)); userStorage = spy(new UserExperimentalFeaturesStorageImpl(sessionInfo, spaces, ioService, defRegistry)); }
@Before public void init() throws IOException { MappingContextSingleton.get(); fileSystemTestingUtils.setup(); sessionInfo = new SessionInfoMock(USER_NAME); fileSystem = fileSystemTestingUtils.getFileSystem(); ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); defRegistry = new ExperimentalFeatureDefRegistryImpl(); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_1, true, "", GLOBAL_FEATURE_1, GLOBAL_FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_2, true, "", GLOBAL_FEATURE_2, GLOBAL_FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_3, true, "", GLOBAL_FEATURE_3, GLOBAL_FEATURE_3)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_1, false, "", FEATURE_1, FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_2, false, "", FEATURE_2, FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_3, false, "", FEATURE_3, FEATURE_3)); globalStorage = spy(new GlobalExperimentalFeaturesStorageImpl(sessionInfo, spaces, ioService, defRegistry, event)); userStorage = spy(new UserExperimentalFeaturesStorageImpl(sessionInfo, spaces, ioService, defRegistry)); }
@Before public void setup() throws IOException { fileSystemTestingUtils.setup(); when(systemRepository.getUri()).thenReturn("git://amend-repo-test"); marshaller = new ConfigGroupMarshaller(); configurationFactory = new ConfigurationFactoryImpl(new DefaultPasswordServiceImpl()); ioService = mockIoService(); configurationService = new ConfigurationServiceImpl(systemRepository, marshaller, identity, ioService, repoChangedEvent, spaceChangedEvent, changedEvent, fileSystemTestingUtils.getFileSystem()); }
@Test public void withExistingBranch() throws Exception { final org.uberfire.java.nio.file.Path nioFrom = fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from")); final Path from = Paths.convert(nioFrom); fileSystemTestingUtils.getIoService().createDirectory(fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from/sub1"))); fileSystemTestingUtils.getIoService().createDirectory(fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from/sub2"))); fileSystemTestingUtils.getIoService().createFile(fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from/sub1/file1.txt"))); fileSystemTestingUtils.getIoService().createFile(fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from/sub1/file2.txt"))); fileSystemTestingUtils.getIoService().createFile(fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from/sub2/file3.txt"))); final org.uberfire.java.nio.file.Path nioTo = fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "to")); final Path to = Paths.convert(nioTo); fileSystemTestingUtils.getIoService().createDirectory(nioTo); doReturn(mock(Repository.class)).when(repositoryService).getRepository(to); copier.copy(from, to); verify(ioService).startBatch(fileSystemTestingUtils.getFileSystem()); verify(ioService).endBatch(); verify(newBranchEventEvent, never()).fire(any(NewBranchEvent.class)); } }
@Test public void withExistingBranch() throws Exception { final org.uberfire.java.nio.file.Path nioFrom = fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from")); final Path from = Paths.convert(nioFrom); fileSystemTestingUtils.getIoService().createDirectory(fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from/sub1"))); fileSystemTestingUtils.getIoService().createDirectory(fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from/sub2"))); fileSystemTestingUtils.getIoService().createFile(fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from/sub1/file1.txt"))); fileSystemTestingUtils.getIoService().createFile(fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from/sub1/file2.txt"))); fileSystemTestingUtils.getIoService().createFile(fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "from/sub2/file3.txt"))); final org.uberfire.java.nio.file.Path nioTo = fileSystemTestingUtils.getIoService().get(URI.create(PATH_PREFIX + "to")); final Path to = Paths.convert(nioTo); fileSystemTestingUtils.getIoService().createDirectory(nioTo); doReturn(mock(Repository.class)).when(repositoryService).getRepository(to); copier.copy(from, to); verify(ioService).startBatch(fileSystemTestingUtils.getFileSystem()); verify(ioService).endBatch(); verify(newBranchEventEvent, never()).fire(any(NewBranchEvent.class)); } }
@Before public void init() throws IOException { MappingContextSingleton.get(); fileSystemTestingUtils.setup(); sessionInfo = new SessionInfoMock(USER_NAME); fileSystem = fileSystemTestingUtils.getFileSystem(); ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); defRegistry = new ExperimentalFeatureDefRegistryImpl(); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_1, true, "", GLOBAL_FEATURE_1, GLOBAL_FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_2, true, "", GLOBAL_FEATURE_2, GLOBAL_FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_3, true, "", GLOBAL_FEATURE_3, GLOBAL_FEATURE_3)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_1, false, "", FEATURE_1, FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_2, false, "", FEATURE_2, FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_3, false, "", FEATURE_3, FEATURE_3)); storage = getStorageInstance(); }