Search in sources :

Example 1 with TestFileSystem

use of org.guvnor.test.TestFileSystem in project kie-wb-common by kiegroup.

the class PackageNameWhiteListSaverTest method setUp.

@Before
public void setUp() throws Exception {
    testFileSystem = new TestFileSystem();
    saver = new PackageNameWhiteListSaver(ioService, metadataService, commentedOptionFactory);
}
Also used : TestFileSystem(org.guvnor.test.TestFileSystem) Before(org.junit.Before)

Example 2 with TestFileSystem

use of org.guvnor.test.TestFileSystem in project kie-wb-common by kiegroup.

the class DefaultGenericKieValidatorTest method setUp.

@Before
public void setUp() throws Exception {
    testFileSystem = new TestFileSystem();
    validator = testFileSystem.getReference(DefaultGenericKieValidator.class);
}
Also used : TestFileSystem(org.guvnor.test.TestFileSystem) Before(org.junit.Before)

Example 3 with TestFileSystem

use of org.guvnor.test.TestFileSystem in project kie-wb-common by kiegroup.

the class BuildHelperTest method setUp.

@Before
public void setUp() throws Exception {
    testFileSystem = new TestFileSystem();
    moduleService = testFileSystem.getReference(KieModuleService.class);
    pomService = testFileSystem.getReference(POMService.class);
    cache = testFileSystem.getReference(LRUBuilderCache.class);
    deploymentVerifier = new DeploymentVerifier(repositoryResolver, moduleRepositoriesService);
    buildHelper = spy(new BuildHelper(pomService, m2RepoService, moduleService, deploymentVerifier, cache, handlers, identity));
    when(identity.get()).thenReturn(user);
    when(user.getIdentifier()).thenReturn("test-user");
    URL rootUrl = this.getClass().getResource("/BuildHelperTest");
    rootPath = Paths.convert(testFileSystem.fileSystemProvider.getPath(rootUrl.toURI()));
    rootUrl = this.getClass().getResource("/BuildHelperTestSnapshot");
    snapshotRootPath = Paths.convert(testFileSystem.fileSystemProvider.getPath(rootUrl.toURI()));
    Iterator<PostBuildHandler> mockIterator = mock(Iterator.class);
    when(handlers.iterator()).thenReturn(mockIterator);
    when(mockIterator.hasNext()).thenReturn(false);
}
Also used : KieModuleService(org.kie.workbench.common.services.shared.project.KieModuleService) URL(java.net.URL) PostBuildHandler(org.guvnor.common.services.project.builder.service.PostBuildHandler) TestFileSystem(org.guvnor.test.TestFileSystem) POMService(org.guvnor.common.services.project.service.POMService) Before(org.junit.Before)

Example 4 with TestFileSystem

use of org.guvnor.test.TestFileSystem in project kie-wb-common by kiegroup.

the class BuilderBatchResourceChangesTest method setUp.

@Before
public void setUp() throws Exception {
    testFileSystem = new TestFileSystem();
    final Path root = testFileSystem.createTempDirectory("root");
    final Path pomFile = testFileSystem.createTempFile("root/pom.xml");
    module = new Module(root, pomFile, new POM(new GAV()));
    builder = new Builder(module, mock(IOService.class), mock(KieModuleService.class), mock(ProjectImportsService.class), new ArrayList<>(), mock(LRUModuleDependenciesClassLoaderCache.class), mock(LRUPomModelCache.class), mock(PackageNameAllowListService.class), mock(Predicate.class), kieBuilder, kieFileSystem);
}
Also used : Path(org.uberfire.backend.vfs.Path) InternalKieBuilder(org.kie.internal.builder.InternalKieBuilder) ArrayList(java.util.ArrayList) Module(org.guvnor.common.services.project.model.Module) GAV(org.guvnor.common.services.project.model.GAV) TestFileSystem(org.guvnor.test.TestFileSystem) POM(org.guvnor.common.services.project.model.POM) Before(org.junit.Before)

Example 5 with TestFileSystem

use of org.guvnor.test.TestFileSystem in project kie-wb-common by kiegroup.

the class PackageNameAllowListSaverTest method setUp.

@Before
public void setUp() throws Exception {
    testFileSystem = new TestFileSystem();
    saver = new PackageNameAllowListSaver(ioService, metadataService, commentedOptionFactory);
}
Also used : TestFileSystem(org.guvnor.test.TestFileSystem) Before(org.junit.Before)

Aggregations

TestFileSystem (org.guvnor.test.TestFileSystem)7 Before (org.junit.Before)7 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 PostBuildHandler (org.guvnor.common.services.project.builder.service.PostBuildHandler)1 GAV (org.guvnor.common.services.project.model.GAV)1 Module (org.guvnor.common.services.project.model.Module)1 POM (org.guvnor.common.services.project.model.POM)1 POMService (org.guvnor.common.services.project.service.POMService)1 InternalKieBuilder (org.kie.internal.builder.InternalKieBuilder)1 KieModuleService (org.kie.workbench.common.services.shared.project.KieModuleService)1 Path (org.uberfire.backend.vfs.Path)1