本文整理了Java中org.guvnor.structure.repositories.Branch.<init>()
方法的一些代码示例,展示了Branch.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Branch.<init>()
方法的具体详情如下:
包路径:org.guvnor.structure.repositories.Branch
类名称:Branch
方法名:<init>
暂无
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client
private Branch makeBranch(final String branchName,
final String repoName) {
final Path path = mock(Path.class);
doReturn("default://" + branchName + "@" + repoName + "/").when(path).toURI();
return new Branch(branchName, path);
}
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client
private Branch makeBranch(final String branchName,
final String repoName) {
final Path path = mock(Path.class);
doReturn("default://" + branchName + "@" + repoName + "/").when(path).toURI();
return new Branch(branchName, path);
}
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-backend
private Branch makeBranch(final String branchName,
final String repoName) {
final Path path = mock(Path.class);
doReturn("default://" + branchName + "@" + repoName + "/").when(path).toURI();
return new Branch(branchName,
path);
}
}
代码示例来源:origin: kiegroup/appformer
@Test
public void repositoryWithPublicUrisAndBranchesLoadTest() {
publicURIs.add(uri1);
publicURIs.add(uri2);
branches.add(new Branch("development",
mock(Path.class)));
branches.add(new Branch("release",
mock(Path.class)));
repositoryLoadTest(publicURIs,
branches);
}
代码示例来源:origin: kiegroup/appformer
@Test
public void repositoryWithNoPublicUrisAndBranchesLoadTest() {
branches.add(new Branch("development",
mock(Path.class)));
branches.add(new Branch("release",
mock(Path.class)));
repositoryLoadTest(publicURIs,
branches);
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-contributors-backend
private WorkspaceProject makeProject(final Repository repository,
final OrganizationalUnit organizationalUnit,
final String moduleName) throws IOException {
final Module module = mock(Module.class);
when(module.getModuleName()).thenReturn(moduleName);
return new WorkspaceProject(organizationalUnit,
repository,
new Branch("master",
PathFactory.newPath("testFile",
"file:///" + moduleName)),
module);
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-client
@Test
public void testOnArchiveActiveRepo() throws Exception {
final Path rootRepoPath = mock(Path.class);
final Repository repository = mock(Repository.class);
when(repository.getDefaultBranch()).thenReturn(Optional.of(new Branch("master", rootRepoPath)));
final WorkspaceProject project = mock(WorkspaceProject.class);
when(project.getRepository()).thenReturn(repository);
when(context.getActiveWorkspaceProject()).thenReturn(Optional.of(project));
menu.onArchiveActiveRepository();
verify(view).archive(rootRepoPath);
}
}
代码示例来源:origin: org.uberfire/uberfire-project-client
@Test
public void testGetActiveRepositoryRoot() throws Exception {
final Path devRoot = mock(Path.class);
context.setActiveWorkspaceProject(new WorkspaceProject(mock(OrganizationalUnit.class),
mock(Repository.class),
new Branch("dev",
devRoot),
mock(Module.class)));
assertEquals(Optional.of(devRoot),
context.getActiveRepositoryRoot());
}
代码示例来源:origin: kiegroup/appformer
@Test
public void testGetActiveRepositoryRoot() throws Exception {
final Path devRoot = mock(Path.class);
context.setActiveWorkspaceProject(new WorkspaceProject(mock(OrganizationalUnit.class),
mock(Repository.class),
new Branch("dev",
devRoot),
mock(Module.class)));
assertEquals(Optional.of(devRoot),
context.getActiveRepositoryRoot());
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-backend
@Test
public void thereIsAModuleInTheWorkbenchTest() {
Set<WorkspaceProject> projects = new HashSet<>();
projects.add(new WorkspaceProject(ou1,
repo1,
new Branch("master",
mock(Path.class)),
mock(Module.class)));
doReturn(projects).when(projectService).getAllWorkspaceProjects();
final Boolean thereIsAModuleInTheWorkbench = libraryService.thereIsAProjectInTheWorkbench();
assertTrue(thereIsAModuleInTheWorkbench);
verify(projectService,
times(1)).getAllWorkspaceProjects();
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client
@Test
public void goToNewProject() {
final WorkspaceProject project = new WorkspaceProject(activeOrganizationalUnit,
activeRepository,
activeBranch,
mock(Module.class));
final Branch lastOpenedBranch = new Branch("master", mock(Path.class));
doReturn(Optional.of(lastOpenedBranch)).when(libraryInternalPreferences).getLastBranchOpened(project);
doReturn(activeProject).when(projectService).resolveProject(activeSpace, lastOpenedBranch);
libraryPlaces.goToProject(project);
verify(libraryPlaces).goToProject(project, lastOpenedBranch);
verify(projectContextChangeEvent).fire(any(WorkspaceProjectContextChangeEvent.class));
verify(placeManager).closeAllPlaces();
}
代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend
@Test
public void testNewModuleCreationNonClashingGAV() throws URISyntaxException {
final Repository repository = mock(Repository.class);
final Path masterBranchRoot = mock(Path.class);
doReturn(Optional.of(new Branch("master", masterBranchRoot))).when(repository).getDefaultBranch();
final POM pom = new POM();
final KieModule expected = new KieModule();
when(saver.save(masterBranchRoot,
pom)).thenReturn(expected);
final Module project = moduleService.newModule(masterBranchRoot,
pom);
assertEquals(expected,
project);
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-examples-screen-backend
public static GitRepository makeGitRepository() {
final GitRepository repository = new GitRepository("guvnorng-playground",
new Space("space"));
final Map<String, Branch> branches = Collections.singletonMap("master",
new Branch("master",
mock(Path.class)));
repository.setBranches(branches);
return repository;
}
}
代码示例来源:origin: org.uberfire/uberfire-project-backend
@Test
public void pomIsInPathRoot() throws Exception {
final Path folderPath = ioService.get(this.getClass().getResource("/LegacyRepositoryStructure/Project1/").toURI());
final Set<Module> modules = finder.find(getResourceResolver(),
new Branch("master",
Paths.convert(folderPath)));
assertFalse(modules.isEmpty());
}
代码示例来源:origin: org.uberfire/uberfire-project-backend
@Test
public void modulesAreInFolders() throws Exception {
final Path folderPath = ioService.get(this.getClass().getResource("/LegacyRepositoryStructure/").toURI());
final Set<Module> modules = finder.find(getResourceResolver(),
new Branch("master",
Paths.convert(folderPath)));
assertEquals(2,
modules.size());
}
}
代码示例来源:origin: kiegroup/appformer
@Test
public void pomIsInPathRoot() throws Exception {
final Path folderPath = ioService.get(this.getClass().getResource("/LegacyRepositoryStructure/Project1/").toURI());
final Set<Module> modules = finder.find(getResourceResolver(),
new Branch("master",
Paths.convert(folderPath)));
assertFalse(modules.isEmpty());
}
代码示例来源:origin: kiegroup/appformer
@Test
public void modulesAreInFolders() throws Exception {
final Path folderPath = ioService.get(this.getClass().getResource("/LegacyRepositoryStructure/").toURI());
final Set<Module> modules = finder.find(getResourceResolver(),
new Branch("master",
Paths.convert(folderPath)));
assertEquals(2,
modules.size());
}
}
代码示例来源:origin: kiegroup/appformer
@Test
public void testNewRepository() throws Exception {
final GuvnorStructureContextChangeHandler handler = mock(GuvnorStructureContextChangeHandler.class);
context.addGuvnorStructureContextChangeHandler(handler);
final GitRepository newRepository = new GitRepository();
final HashMap<String, Branch> branches = new HashMap<>();
branches.put("master",
new Branch("master",
mock(Path.class)));
newRepository.setBranches(branches);
context.onNewRepository(new NewRepositoryEvent(newRepository));
verify(handler).onNewRepositoryAdded(newRepository);
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-backend
private GitRepository getGitRepository(final String alias) {
final GitRepository repository = new GitRepository(alias,
new Space("scheme"));
final HashMap<String, Branch> branches = new HashMap<>();
final Path path = PathFactory.newPath("/",
"file://master@module/");
branches.put("master",
new Branch("master",
path));
repository.setBranches(branches);
return repository;
}
}
代码示例来源:origin: kiegroup/appformer
private Repository createRepository(String alias,
String space) {
GitRepository repository = new GitRepository(alias,
new Space(space));
repository.addBranch(new Branch("master",
branchPath));
return repository;
}
}
内容来源于网络,如有侵权,请联系作者删除!