public void deleteFile(final Path path) { getFile(path).delete(); }
@After public void tearDown() throws Exception { testFileSystem.tearDown(); }
@Test public void testCreate() throws Exception { final Path path = testFileSystem.createTempDirectory("/MyTestProject"); service.create(path, new POM()); ArgumentCaptor<org.uberfire.java.nio.file.Path> pathArgumentCaptor = ArgumentCaptor.forClass(org.uberfire.java.nio.file.Path.class); ArgumentCaptor<String> stringArgumentCaptor = ArgumentCaptor.forClass(String.class); verify(ioServiceSpy).write(pathArgumentCaptor.capture(), stringArgumentCaptor.capture()); assertEquals(pathArgumentCaptor.getValue().toUri().toString(), path.toURI() + "/pom.xml"); String pomXML = stringArgumentCaptor.getValue(); assertTrue(pomXML.contains("<id>guvnor-m2-repo</id>")); } }
@Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); pathToPom = testFileSystem.createTempFile("myModule/pom.xml"); kmoduleXMLPath = testFileSystem.createTempFile("mymodule/src/main/resources/META-INF/kmodule.xml"); importsPath = testFileSystem.createTempFile("myModule/project.imports"); repositoriesPath = testFileSystem.createTempFile("myModule/project.repositories"); packageNamesWhiteListPath = testFileSystem.createTempFile("myModule/package-name-white-list"); makeKieModule(); makeWorkspaceProject(); when(workspaceProjectService.resolveProject(pathToPom)).thenReturn(workspaceProject); when(moduleService.resolveModule(pathToPom)).thenReturn(kieModule); loader = new ProjectScreenModelLoader(moduleService, pomService, metadataService, kModuleService, projectImportsService, moduleRepositoriesService, whiteListService, workspaceProjectService); }
@Test public void testWhiteListNoMetadata() throws Exception { final WhiteList whiteList = new WhiteList(); testFileSystem.deleteFile(packageNamesWhiteListPath); when(whiteListService.load(packageNamesWhiteListPath)).thenReturn(whiteList); ProjectScreenModel model = loader.load(pathToPom); assertEquals(packageNamesWhiteListPath, model.getPathToWhiteList()); assertEquals(whiteList, model.getWhiteList()); assertNotNull(model.getWhiteListMetaData()); }
@After public void tearDown() throws Exception { testFileSystem.tearDown(); }
@Test public void testCreate() throws Exception { final Path path = testFileSystem.createTempDirectory("/MyTestProject"); service.create(path, new POM()); ArgumentCaptor<org.uberfire.java.nio.file.Path> pathArgumentCaptor = ArgumentCaptor.forClass(org.uberfire.java.nio.file.Path.class); ArgumentCaptor<String> stringArgumentCaptor = ArgumentCaptor.forClass(String.class); verify(ioServiceSpy).write(pathArgumentCaptor.capture(), stringArgumentCaptor.capture()); assertEquals(pathArgumentCaptor.getValue().toUri().toString(), path.toURI() + "/pom.xml"); String pomXML = stringArgumentCaptor.getValue(); assertTrue(pomXML.contains("<id>guvnor-m2-repo</id>")); } }
@After public void tearDown() throws Exception { testFileSystem.tearDown(); }
public void deleteFile(final Path path) { getFile(path).delete(); }
@Test public void testCreate() throws Exception { final Path path = testFileSystem.createTempDirectory("/MyTestProject"); service.create(path, "baseurl?", new POM()); ArgumentCaptor<org.uberfire.java.nio.file.Path> pathArgumentCaptor = ArgumentCaptor.forClass(org.uberfire.java.nio.file.Path.class); ArgumentCaptor<String> stringArgumentCaptor = ArgumentCaptor.forClass(String.class); verify(ioServiceSpy).write(pathArgumentCaptor.capture(), stringArgumentCaptor.capture()); assertEquals(pathArgumentCaptor.getValue().toUri().toString(), path.toURI() + "/pom.xml"); String pomXML = stringArgumentCaptor.getValue(); assertTrue(pomXML.contains("<id>guvnor-m2-repo</id>")); } }
@After public void tearDown() throws Exception { testFileSystem.tearDown(); }
public void deleteFile(final Path path) { getFile(path).delete(); }