Search in sources :

Example 36 with Project

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_"));
    }
}
Also used : Project(org.opensolaris.opengrok.configuration.Project) Test(org.junit.Test)

Example 37 with Project

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_"));
            }
        }
    }
}
Also used : Group(org.opensolaris.opengrok.configuration.Group) Project(org.opensolaris.opengrok.configuration.Project) Test(org.junit.Test)

Example 38 with Project

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_"));
    }
}
Also used : Project(org.opensolaris.opengrok.configuration.Project) Test(org.junit.Test)

Example 39 with Project

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_"));
    }
}
Also used : Project(org.opensolaris.opengrok.configuration.Project) Test(org.junit.Test)

Example 40 with Project

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;
}
Also used : Project(org.opensolaris.opengrok.configuration.Project) RepositoryInfo(org.opensolaris.opengrok.history.RepositoryInfo) RepoRepository(org.opensolaris.opengrok.history.RepoRepository)

Aggregations

Project (org.opensolaris.opengrok.configuration.Project)44 Test (org.junit.Test)22 RuntimeEnvironment (org.opensolaris.opengrok.configuration.RuntimeEnvironment)12 Group (org.opensolaris.opengrok.configuration.Group)9 ArrayList (java.util.ArrayList)8 RepositoryInfo (org.opensolaris.opengrok.history.RepositoryInfo)6 File (java.io.File)4 TreeSet (java.util.TreeSet)4 IOException (java.io.IOException)3 HistoryException (org.opensolaris.opengrok.history.HistoryException)3 FileNotFoundException (java.io.FileNotFoundException)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 Document (org.apache.lucene.document.Document)2 Genre (org.opensolaris.opengrok.analysis.FileAnalyzer.Genre)2 RepoRepository (org.opensolaris.opengrok.history.RepoRepository)2 DummyHttpServletRequest (org.opensolaris.opengrok.web.DummyHttpServletRequest)2 BufferedReader (java.io.BufferedReader)1 FileReader (java.io.FileReader)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1