use of org.opensolaris.opengrok.configuration.Project in project OpenGrok by OpenGrok.
the class ProjectHelperTest method testGetAllGrouped.
/**
* Test of getAllGrouped method, of class ProjectHelper.
*/
@Test
public void testGetAllGrouped() {
Set<Project> result = helper.getAllGrouped();
Assert.assertEquals(8, result.size());
for (Project p : result) {
Assert.assertTrue(p.getName().startsWith("allowed_"));
}
}
use of org.opensolaris.opengrok.configuration.Project in project OpenGrok by OpenGrok.
the class ProjectHelperTest method testGetProjectsAllowedGroup.
/**
* Test of getProjects method, of class ProjectHelper.
*/
@Test
public void testGetProjectsAllowedGroup() {
for (Group g : RuntimeEnvironment.getInstance().getGroups()) {
if (g.getName().startsWith("allowed_group_0")) {
Set<Project> result = helper.getProjects(g);
Assert.assertEquals(2, result.size());
for (Project p : result) {
Assert.assertTrue(p.getName().startsWith("allowed_"));
}
}
}
}
use of org.opensolaris.opengrok.configuration.Project in project OpenGrok by OpenGrok.
the class ProjectHelperTest method testGetAllProjects.
/**
* Test of getAllProjects method, of class ProjectHelper.
*/
@Test
public void testGetAllProjects() {
Set<Project> result = helper.getAllProjects();
Assert.assertEquals(12, result.size());
for (Project p : result) {
Assert.assertTrue(p.getName().startsWith("allowed_"));
}
}
use of org.opensolaris.opengrok.configuration.Project in project OpenGrok by OpenGrok.
the class ProjectHelperTest method testGetUngroupedProjects.
/**
* Test of getUngroupedProjects method, of class ProjectHelper.
*/
@Test
public void testGetUngroupedProjects() {
Set<Project> result = helper.getUngroupedProjects();
Assert.assertEquals(2, result.size());
for (Project p : result) {
Assert.assertTrue(p.getName().startsWith("allowed_"));
}
}
use of org.opensolaris.opengrok.configuration.Project in project OpenGrok by OpenGrok.
the class ProjectHelperTestBase method createRepository.
protected static Project createRepository(int index, int number, int cnt, boolean grouped, boolean allowed, List<RepositoryInfo> rps, List<Project> prjs, Map<Project, List<RepositoryInfo>> map) {
Project p = createProject(index, number, grouped, allowed, true, rps, prjs, map);
for (int i = 0; i < cnt; i++) {
RepositoryInfo info = new RepoRepository();
info.setParent(p.getName() + "_" + i);
info.setDirectoryName(p.getPath());
rps.add(info);
List<RepositoryInfo> infos = map.get(p);
if (infos == null) {
infos = new ArrayList<>();
}
infos.add(info);
map.put(p, infos);
}
return p;
}
Aggregations