Index: TestHarness4LAMS2/src/org/lamsfoundation/testharness/MockUser.java =================================================================== diff -u -r41955af92f3e17f2f11c07d94ae1a5f92b0d998f -r159c15ed2f6cc7c8f273367d199b196effd5f340 --- TestHarness4LAMS2/src/org/lamsfoundation/testharness/MockUser.java (.../MockUser.java) (revision 41955af92f3e17f2f11c07d94ae1a5f92b0d998f) +++ TestHarness4LAMS2/src/org/lamsfoundation/testharness/MockUser.java (.../MockUser.java) (revision 159c15ed2f6cc7c8f273367d199b196effd5f340) @@ -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