1 package org.cacert.gigi.testUtils;
3 import java.io.IOException;
4 import java.net.HttpURLConnection;
6 import org.cacert.gigi.dbObjects.User;
9 * Superclass for testsuites in a scenario where there is an registered member,
10 * who is already logged on.
12 public abstract class ClientTest extends ManagedTest {
15 * Email of the member.
17 protected String email = createUniqueName() + "@example.org";
22 protected int id = createVerifiedUser("a", "b", email, TEST_PASSWORD);
25 * {@link User} object of the member
27 protected User u = User.getById(id);
30 * Session cookie of the member.
32 protected String cookie;
36 cookie = login(email, TEST_PASSWORD);
37 } catch (IOException e) {
42 public HttpURLConnection post(String path, String query) throws IOException {
43 return post(path, query, 0);
46 public HttpURLConnection post(String path, String query, int formIndex) throws IOException {
47 return post(cookie, path, query, formIndex);
50 public HttpURLConnection get(String path) throws IOException {
51 return get(cookie, path);