]> WPIA git - gigi.git/blob - tests/org/cacert/gigi/testUtils/ClientTest.java
UPD: clean up/document/beatufy testcases.
[gigi.git] / tests / org / cacert / gigi / testUtils / ClientTest.java
1 package org.cacert.gigi.testUtils;
2
3 import java.io.IOException;
4
5 import org.cacert.gigi.dbObjects.User;
6
7 /**
8  * Superclass for testsuites in a scenario where there is an registered member,
9  * who is already logged on.
10  */
11 public abstract class ClientTest extends ManagedTest {
12
13     /**
14      * Email of the member.
15      */
16     protected String email = createUniqueName() + "@example.org";
17
18     /**
19      * Id of the member
20      */
21     protected int id = createVerifiedUser("a", "b", email, TEST_PASSWORD);
22
23     /**
24      * {@link User} object of the member
25      */
26     protected User u = User.getById(id);
27
28     /**
29      * Session cookie of the member.
30      */
31     protected String cookie;
32
33     public ClientTest() {
34         try {
35             cookie = login(email, TEST_PASSWORD);
36         } catch (IOException e) {
37             throw new Error(e);
38         }
39     }
40 }