Package com.peusoft.ptcollect.core.persistance.domain

Examples of com.peusoft.ptcollect.core.persistance.domain.User


        ArrayList<AbstractDomainObject<?>> new_objs = new ArrayList<AbstractDomainObject<?>>();
        Stack<AbstractDomainObject<?>> del_objs = new Stack<AbstractDomainObject<?>>();

        // create test static data
        User user = UserServiceExampleData.getUser1();
        new_objs.add(user);
        del_objs.push(user);

        Project p = new Project();
        p.setProjectState(ProjectState.OPENED);
View Full Code Here


    /**
     * Create "user1" and empty password.
     * @return new user with uid "user1"
     */
    public static User getUser1() {
        User user = new User();
        user.setUid("user1");
        user.setPassword("");
        user.setName("1");
        user.setSurName("Userman");
        Address addr = new Address();
        addr.setStreet("Street1");
        addr.setZip("00000");
        addr.setCity("City1");
        addr.setCountry("Country1");
        user.setAddress(addr);
        return user;
    }
View Full Code Here

    @Test
    public final void persistChanges() {
        LOGGER.info("persistChanges startet");

        User user = configSrv.getUser();

        // create data
        List<AbstractDomainObject> to_delete = new ArrayList<AbstractDomainObject>();
        List<AbstractDomainObject> objects = new ArrayList<AbstractDomainObject>();
        Project p = new Project();
View Full Code Here

     */
    @Test
    public final void testLogInUser() {
        LOGGER.info("testLogInUser startet");

        User user = usrSrv.logInUser("test", "testpwd");
        assertNotNull("User is null.", user);

        try {
            usrSrv.logInUser("qretwert", "testpwd");
            fail("User should't already exist.");
View Full Code Here

     */
    @Test
    public final void testLogOutUser() {
        LOGGER.info("testLogOutUser startet");

        User user = usrSrv.logInUser("test", "testpwd");
        assertNotNull("User is null.", user);
        usrSrv.logOutUser(user.getUid());

        LOGGER.info("testLogOutUser finished");
    }
View Full Code Here

     */
    @Test
    public final void testChangePassword() throws Exception {
        LOGGER.info("testChangePassword startet");

        User user = UserServiceExampleData.getUser1();
        try {
            usrSrv.createUser(user);
            user = usrSrv.logInUser(user.getUid(), user.getPassword());
            assertNotNull("User is null.", user);
            usrSrv.changePassword(user, "pwd");
            user = usrSrv.logInUser(user.getUid(), user.getPassword());
            assertNotNull("User is null.", user);
            assertEquals("Wrong password.", "pwd", user.getPassword());
        } catch (Exception e) {
            throw e;
        } finally {
            usrSrv.dropUser(user);
        }
View Full Code Here

     */
    @Test
    public final void testCreateUser() throws Exception {
        LOGGER.info("testCreateUser startet");

        User user = UserServiceExampleData.getUser1();
        try {
            usrSrv.createUser(user);
            user = usrSrv.logInUser(user.getUid(), user.getPassword());
            assertNotNull("User is null.", user);

            try {
                usrSrv.createUser(user);
                fail("User must already exist.");
View Full Code Here

     */
    @Test
    public final void testDropUser() throws Exception {
        LOGGER.info("testDropUser startet");

        User user = UserServiceExampleData.getUser1();
        try {
            usrSrv.createUser(user);
            user = usrSrv.logInUser(user.getUid(), user.getPassword());
            assertNotNull("User is null.", user);

            try {
                usrSrv.createUser(user);
                fail("User must already exist.");
            } catch (PTExceptionWrongUser e) {
                // ok
            }

            usrSrv.dropUser(user);
            try {
                usrSrv.logInUser(user.getUid(), user.getPassword());
                fail("User schuldn't exist.");
            } catch (PTExceptionWrongUser e) {
                // ok
            }
            user = null;
View Full Code Here

     */
    @Test
    public final void testGetRegistratedUsers() {
        LOGGER.info("testGetRegistratedUsers startet");

        User user = UserServiceExampleData.getUser1();
        try {
            usrSrv.createUser(user);
            user = usrSrv.logInUser(user.getUid(), user.getPassword());
            assertNotNull("User is null.", user);

            Collection<User> users = usrSrv.getRegistratedUsers();
            assertEquals("Wrong number of users.", 2, users.size());

View Full Code Here

    /**
     * Test method for {@link IConfigurationClientService#getUser()}.
     */
    @Test
    public void testGetUser() {
        User user = configSrv.getUser();
        assertNotNull("User is null.", user);
    }
View Full Code Here

TOP

Related Classes of com.peusoft.ptcollect.core.persistance.domain.User

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.