Index: TestHarness4LAMS2/src/org/lamsfoundation/testharness/MockUser.java =================================================================== RCS file: /usr/local/cvsroot/TestHarness4LAMS2/src/org/lamsfoundation/testharness/MockUser.java,v diff -u -r1.5 -r1.6 --- TestHarness4LAMS2/src/org/lamsfoundation/testharness/MockUser.java 13 Jan 2014 08:47:10 -0000 1.5 +++ TestHarness4LAMS2/src/org/lamsfoundation/testharness/MockUser.java 14 Jan 2014 15:53:04 -0000 1.6 @@ -52,27 +52,23 @@ private static final String INDEX_PAGE_FLAG = "images/loading.gif"; private static final String USERNAME = "j_username"; - private static final String PASSWORD = "j_password"; + private static final String PASSWORD = "j_password";; - private static String indexPage; - protected AbstractTest test; protected String userId; protected String username; protected String password; + protected String role; protected WebConversation wc; - public MockUser(AbstractTest test, String username, String password, String userId) { + public MockUser(AbstractTest test, String username, String password, String role, String userId) { this.test = test; this.username = username; + this.role = role; this.password = password; this.userId = userId; } - public static void setIndexPage(String indexPageURL) { - MockUser.indexPage = indexPageURL; - } - private static String sha1(String plaintext) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA1"); return new String(Hex.encodeHex(md.digest(plaintext.getBytes()))); @@ -103,8 +99,7 @@ public void login() { try { wc = new WebConversation(); - WebResponse resp = (WebResponse) new Call(wc, test, username + " fetch index page", MockUser.indexPage) - .execute(); + WebResponse resp = (WebResponse) new Call(wc, test, username + " fetch index page", "").execute(); if (!MockUser.checkPageContains(resp, MockUser.LOGIN_PAGE_FLAG)) { MockUser.log.debug(resp.getText()); throw new TestHarnessException(username + " didn't get login page when hitting LAMS the first time"); @@ -178,4 +173,16 @@ } return form; } + + public boolean equals(Object o){ + return username.equals(((MockUser) o).username); + } + + public int hashCode(){ + return username.hashCode(); + } + + public String getRole() { + return role; + } } \ No newline at end of file