Examples of User


Examples of org.superbiz.deltaspike.domain.User

        final String userName = "gp";
        final String firstName = "Gerhard";
        final String lastName = "Petracek";

        UserRepository mockedUserRepository = mock(JpaUserRepository.class); //don't use the interface here to avoid issues with mockito and cdi proxies
        when(mockedUserRepository.loadUser(userName)).thenReturn(new User(userName, firstName, lastName.toUpperCase() /*just to illustrate that the mock-instance is used*/));
        mockManager.addMock(mockedUserRepository);


        this.windowContext.activateWindow("testWindow");

        this.registrationPage.getUser().setUserName(userName);
        this.registrationPage.getUser().setFirstName(firstName);
        this.registrationPage.getUser().setLastName(lastName);
        this.registrationPage.getUser().setPassword("123");

        Class<? extends Pages> targetPage = this.registrationPage.register();

        Assert.assertEquals(Pages.Login.class, targetPage);
        Assert.assertFalse(FacesContext.getCurrentInstance().getMessageList().isEmpty());
        Assert.assertEquals(webappMessageBundle.msgUserRegistered(userName), FacesContext.getCurrentInstance().getMessageList().iterator().next().getSummary());

        User user = this.userRepository.loadUser(userName);
        Assert.assertNotNull(user);
        Assert.assertEquals(firstName, user.getFirstName());
        Assert.assertEquals(lastName.toUpperCase(), user.getLastName());
    }
View Full Code Here

Examples of org.superbiz.myfaces.domain.User

        return Pages.Login.class;
    }

    public Class<? extends Pages> login() {
        User user = this.userRepository.loadUser(this.user.getUserName());
        if (user != null && user.getPassword().equals(this.user.getPassword())) {
            this.messageContext.message().text("{msgLoginSuccessful}").add();
            this.userHolder.setCurrentUser(user);
            return Pages.About.class;
        }
View Full Code Here

Examples of org.superbiz.rest.model.User

    }

    @Test
    public void create() throws NamingException {
        UserDAO dao = (UserDAO) container.getContext().lookup("java:global/rest-example/UserDAO");
        User user = dao.create("foo", "dummy", "foo@dummy.org");
        assertNotNull(dao.find(user.getId()));

        String uri = "http://127.0.0.1:" + System.getProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT) + "/" + webApp.getName();
        UserServiceClientAPI client = JAXRSClientFactory.create(uri, UserServiceClientAPI.class);
        User retrievedUser = client.show(user.getId());
        assertNotNull(retrievedUser);
        assertEquals("foo", retrievedUser.getFullname());
        assertEquals("dummy", retrievedUser.getPassword());
        assertEquals("foo@dummy.org", retrievedUser.getEmail());
    }
View Full Code Here

Examples of org.sylfra.idea.plugins.revu.model.User

    }
  }

  protected boolean isEnabledForReview(@NotNull Review review)
  {
    User user = RevuUtils.getCurrentUser(review);
    Set<User> adminUsers = review.getDataReferential().getUsersByRole(true).get(User.Role.ADMIN);
    return ((!review.isEmbedded())
      && (((adminUsers == null) || (adminUsers.isEmpty())) || ((user != null) && (user.hasRole(User.Role.ADMIN)))));
  }
View Full Code Here

Examples of org.tamacat.dao.rdb.User

    );
  }
 
  @Test
  public void testGetInsertSQL() {
    User user = new User();
    user.setValue(User.USER_ID, "admin");
    user.setValue(User.PASSWORD, "test");
    user.setValue(User.DEPT_ID, "123");
    query.addUpdateColumns(User.TABLE.getColumns());
   
    assertEquals(
      "INSERT INTO users (user_id,password,dept_id)"
      + " VALUES ('admin','test','123')", query.getInsertSQL(user));
View Full Code Here

Examples of org.tarantool.facade.User

  public static final int TEMPLATE_SPACE = 125;
  public static final int TEMPLATE_CALL_SPACE = 127;

  @Test
  public void testCycle() throws ParseException, MalformedURLException {
    User user = new User();
    SocketChannelPooledConnectionFactory connectionFactory = new SocketChannelPooledConnectionFactory("localhost", 33313, 1, 10);
    Mapping<User> mapping = new Mapping<User>(User.class, TEMPLATE_SPACE, "id", "phone", "point", "iq", "height", "lifeFormId", "salary", "birthday",
        "name", "sign", "male");

    TarantoolTemplate template = new TarantoolTemplate(connectionFactory);
    template.addMapping(mapping);
    assertNotNull(template.save(user).insertOrReplaceAndGet());
    try {
      template.save(user).insert();
      fail();
    } catch (TarantoolException ignored) {

    }
    assertEquals(1, template.save(user).replace());
    assertNotNull(template.find(User.class, 0, "id").condition(user.getId()).list());
    assertEquals(user.getPhone() + 1L, template.update(User.class, user.getId()).add("phone", 1).updateAndGet().getPhone());

    connectionFactory.free();
    return;
  }
View Full Code Here

Examples of org.traccar.web.shared.model.User

        if (applicationSettings == null) {
            return getApplicationSettings();
        } else {
            EntityManager entityManager = getServletEntityManager();
            synchronized (entityManager) {
                User user = getSessionUser();
                if (user.getAdmin()) {
                    entityManager.getTransaction().begin();
                    try {
                        entityManager.merge(applicationSettings);
                        entityManager.getTransaction().commit();
                        this.applicationSettings =  applicationSettings;
View Full Code Here

Examples of org.uned.agonzalo16.bitacora.domain.User

  }

  @Test
  public void testInvalidUser() {
    List<User> users = new ArrayList<User>();
    users.add(new User());

    when(userDao.findAll()).thenReturn(users);
    when(userDao.findByUsername((String) any())).thenReturn(null);

    try {
View Full Code Here

Examples of org.voltdb.catalog.User

        // add an entry to the catalog
        final Procedure procedure = db.getProcedures().add(shortName);
        procedure.setId(compiler.getNextProcedureId());
        for (String userName : procedureDescriptor.m_authUsers) {
            final User user = db.getUsers().get(userName);
            if (user == null) {
                throw compiler.new VoltCompilerException("Procedure " + className + " has a user " + userName + " that does not exist");
            }
            final UserRef userRef = procedure.getAuthusers().add(userName);
            userRef.setUser(user);
View Full Code Here

Examples of org.voltdb.compiler.deploymentfile.UsersType.User

            UsersType users = factory.createUsersType();
            deployment.setUsers(users);

            // <user>
            for (final UserInfo info : m_users) {
                User user = factory.createUsersTypeUser();
                users.getUser().add(user);
                user.setName(info.name);
                user.setPassword(info.password);

                // build up user/@groups.
                if (info.groups.length > 0) {
                    final StringBuilder groups = new StringBuilder();
                    for (final String group : info.groups) {
                        if (groups.length() > 0)
                            groups.append(",");
                        groups.append(group.toLowerCase());
                    }
                    user.setGroups(groups.toString());
                }
            }
        }

        // <httpd>. Disabled unless port # is configured by a testcase
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.