Package edu.wpi.cs.wpisuitetng.modules.core.entitymanagers

Examples of edu.wpi.cs.wpisuitetng.modules.core.entitymanagers.UserManager


    map = new HashMap<String, EntityManager>();
    sessions = new SessionManager();
   
    //TODO pull these mappings from some config file and reflect them
    map.put("coreproject", new ProjectManager(data));
    map.put("coreuser", new UserManager(data));
    map.put("defecttrackerdefect", new DefectManager(data));
    map.put("defecttrackercomment", new CommentManager(data));
    map.put("postboardpostboardmessage", new PostBoardEntityManager(data));

    //add just your module to this list
View Full Code Here


   * @return  The UserManager instance
   * @throws WPISuiteException
   */
  public User[] getUsers(String username) throws WPISuiteException
  {
    UserManager u = (UserManager)map.get("coreuser");
    return u.getEntity(username);
  }
View Full Code Here

   * Exposes the Users in the database for direct access.
   * @return  The UserManager instance
   */
  public UserManager getUsers()
  {
    UserManager u = (UserManager)map.get("coreuser");
    return u;
  }
View Full Code Here

   */
  public void testSwitchSessionProject() throws WPISuiteException
  {
    // get the Managers out
    ManagerLayer manager = ManagerLayer.getInstance();
    UserManager users = manager.getUsers();
    SessionManager sessions = manager.getSessions();
    ProjectManager projects = manager.getProjects();
   
    String originalSsid = sessions.createSession(u2);
    Session originalSession = sessions.getSession(originalSsid);
View Full Code Here

   */
  public void testSwitchProjectInvalidSession() throws WPISuiteException
  {
    // get the Managers out
    ManagerLayer manager = ManagerLayer.getInstance();
    UserManager users = manager.getUsers();
    SessionManager sessions = manager.getSessions();
    ProjectManager projects = manager.getProjects();
   
    String originalSsid = "abc123";
   
View Full Code Here

   */
  public void testSwitchProjectInvalidProject() throws WPISuiteException
  {
    // get the Managers out
    ManagerLayer manager = ManagerLayer.getInstance();
    UserManager users = manager.getUsers();
    SessionManager sessions = manager.getSessions();
    ProjectManager projects = manager.getProjects();
   
    String originalSsid = sessions.createSession(u2);
    Session originalSession = sessions.getSession(originalSsid);
View Full Code Here

  String mockSsid = "abc123";
 
  @Before
  public void setUp()
  {
    test = new UserManager(MockDataStore.getMockDataStore());
    testWithRealDB = new UserManager(DataStore.getDataStore());
    temp = new User("test","test","test",0);
    secondUser = new User ("Sam", "sammy","trouty", 1);
    conflict = new User("steve", "steve",null, 0);
    tempSession = new Session(temp, mockSsid);
    admin = new User("adam","adam","password",4);
View Full Code Here

    testWithRealDB.deleteAll(new Session(temp, mockSsid));
  }

  @Test(expected = WPISuiteException.class)
  public void testSaveFail() throws WPISuiteException {
    new UserManager(new Data(){

      @Override
      public <T> boolean save(T aModel) {
        // TODO Auto-generated method stub
        return false;
View Full Code Here

    ).save(null, null);
  }

  @Test
  public void testDeleteEntityFail() throws WPISuiteException {
    new UserManager(new Data(){
      @Override
      public <T> boolean save(T aTNG) {return false;}
      @Override
      public List<Model> retrieve(Class anObjectQueried,String aFieldName, Object theGivenValue) {
        List<Model> a = new ArrayList<Model>();
View Full Code Here

  }
 
  @Test
  public void testDeleteEntity() throws WPISuiteException
  {
    new UserManager(new Data(){
      @Override
      public <T> boolean save(T aTNG) {return false;}
      @Override
      public List<Model> retrieve(Class anObjectQueried,String aFieldName, Object theGivenValue) {
        List<Model> a = new ArrayList<Model>();
View Full Code Here

TOP

Related Classes of edu.wpi.cs.wpisuitetng.modules.core.entitymanagers.UserManager

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.