Package models

Examples of models.Project


public class RepositoryServiceTest {

    @Test
    public void testGetRepositoryWhenProjectIsNull() throws UnsupportedOperationException, IOException, ServletException {
        Project project = null;
        PlayRepository repository = RepositoryService.getRepository(project);
        assertThat(repository).isNull();
    }
View Full Code Here


        assertThat(repository).isNull();
    }

    @Test
    public void testGetSVNRepository() throws UnsupportedOperationException, IOException, ServletException {
        Project project = createProject("wansoon", "testProject", RepositoryService.VCS_GIT);
        PlayRepository repository = RepositoryService.getRepository(project);

        assertThat(repository).isNotNull();
    }
View Full Code Here

        assertThat(repository).isNotNull();
    }

    @Test
    public void testGetGitRepository() throws UnsupportedOperationException, IOException, ServletException {
        Project project = createProject("wansoon", "testProject", RepositoryService.VCS_SUBVERSION);
        PlayRepository repository = RepositoryService.getRepository(project);

        assertThat(repository).isNotNull();
    }
View Full Code Here

        assertThat(repository).isNotNull();
    }

    @Test(expected = UnsupportedOperationException.class)
    public void testGetRepositoryThrowUnsupportedOperationException() throws UnsupportedOperationException, IOException, ServletException {
        Project project = createProject("wansoon", "testProject", "Mercurial");

        PlayRepository repository = RepositoryService.getRepository(project);

        assertThat(repository).isNull();
    }
View Full Code Here

        assertThat(repository).isNull();
    }

    private Project createProject(String owner, String name, String vcs) {
        Project project = new Project();
        project.owner = owner;
        project.name = name;
        project.vcs = vcs;
        return project;
    }
View Full Code Here

        Long userId = 1l;
        Long projectId = 1l;
        String eventTypeValue = "NEW_ISSUE";

        User user = User.find.byId(userId);
        Project project = Project.find.byId(projectId);
        EventType eventType = EventType.valueOf(eventTypeValue);

        Watch.watch(user, project.asResource());
        assertThat(user.getWatchingProjects().contains(project)).isTrue();
        assertThat(UserProjectNotification.isEnabledNotiType(user, project, eventType)).isTrue();

        FakeRequest request = fakeRequest("POST", "/noti/toggle/" + projectId + "/" + eventTypeValue)
                .withSession(UserApp.SESSION_USERID, String.valueOf(userId));
View Full Code Here

        Long userId = 1l;
        Long projectId = 2l;
        String eventTypeValue = "NEW_ISSUE";

        User user = User.find.byId(userId);
        Project project = Project.find.byId(projectId);

        assertThat(user.getWatchingProjects().contains(project)).isFalse();

        FakeRequest request = fakeRequest("POST", "/noti/toggle/" + projectId + "/" + eventTypeValue)
                .withSession(UserApp.SESSION_USERID, String.valueOf(userId));
View Full Code Here

        // given
        Long userId = 2l;
        Long projectId = 3l; // The project should be private.
        String eventTypeValue = "NEW_ISSUE";

        Project project = Project.find.byId(projectId);
        assertThat(project.projectScope).isEqualTo(ProjectScope.PRIVATE);

        FakeRequest request = fakeRequest("POST", "/noti/toggle/" + projectId + "/" + eventTypeValue)
                .withSession(UserApp.SESSION_USERID, String.valueOf(userId));
View Full Code Here

            ServletException {
        if (!isSupportedService(service)) {
            return forbidden(String.format("Unsupported service: '%s'", service));
        }

        Project project = Project.findByOwnerAndProjectName(ownerName, projectName);

        if (project == null) {
            return notFound();
        }
View Full Code Here

@With(AnonymousCheckAction.class)
public class WatchProjectApp extends Controller {

    @IsAllowed(Operation.READ)
    public static Result watch(String userName, String projectName) {
        Project project = Project.findByOwnerAndProjectName(userName, projectName);
        Watch.watch(project.asResource());
        return ok();
    }
View Full Code Here

TOP

Related Classes of models.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.