Search in sources :

Example 71 with Project

use of org.opensolaris.opengrok.configuration.Project in project OpenGrok by OpenGrok.

the class ProjectHelperTest method testGetAllowedProjects.

/**
 * Test of getProjects method, of class ProjectHelper.
 */
@Test
public void testGetAllowedProjects() {
    Set<Project> result = helper.getProjects();
    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 72 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 73 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 74 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 75 with Project

use of org.opensolaris.opengrok.configuration.Project in project OpenGrok by OpenGrok.

the class ProjectHelperTest method testGetGroupedProjects.

/**
 * Test of getGroupedProjects method, of class ProjectHelper.
 */
@Test
public void testGetGroupedProjects() {
    Set<Project> result = helper.getGroupedProjects();
    Assert.assertEquals(4, result.size());
    for (Project p : result) {
        Assert.assertTrue(p.getName().startsWith("allowed_"));
    }
}
Also used : Project(org.opensolaris.opengrok.configuration.Project) Test(org.junit.Test)

Aggregations

Project (org.opensolaris.opengrok.configuration.Project)79 Test (org.junit.Test)40 RuntimeEnvironment (org.opensolaris.opengrok.configuration.RuntimeEnvironment)31 File (java.io.File)20 ArrayList (java.util.ArrayList)20 Group (org.opensolaris.opengrok.configuration.Group)17 RepositoryInfo (org.opensolaris.opengrok.history.RepositoryInfo)14 IOException (java.io.IOException)12 TreeSet (java.util.TreeSet)12 HistoryException (org.opensolaris.opengrok.history.HistoryException)8 List (java.util.List)6 ParseException (java.text.ParseException)5 HashMap (java.util.HashMap)5 Map (java.util.Map)5 Set (java.util.Set)5 Collectors (java.util.stream.Collectors)5 HttpServletRequest (javax.servlet.http.HttpServletRequest)5 Repository (org.opensolaris.opengrok.history.Repository)5 TestRepository (org.opensolaris.opengrok.util.TestRepository)5 ConnectException (java.net.ConnectException)4