X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2FtestUtils%2FClientTest.java;fp=tests%2Forg%2Fcacert%2Fgigi%2FtestUtils%2FClientTest.java;h=0000000000000000000000000000000000000000;hp=923fd97a70486ecdd14348a1aaefffd2a33e6330;hb=bccd4cc0dba0f89aa045b113bac46eb8cc1dab4e;hpb=c9ed09f0007fc2c813815be927a5a24b23dab83c diff --git a/tests/org/cacert/gigi/testUtils/ClientTest.java b/tests/org/cacert/gigi/testUtils/ClientTest.java deleted file mode 100644 index 923fd97a..00000000 --- a/tests/org/cacert/gigi/testUtils/ClientTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.cacert.gigi.testUtils; - -import java.io.IOException; -import java.net.HttpURLConnection; - -import org.cacert.gigi.dbObjects.User; - -/** - * Superclass for testsuites in a scenario where there is an registered member, - * who is already logged on. - */ -public abstract class ClientTest extends ManagedTest { - - /** - * Email of the member. - */ - protected String email = createUniqueName() + "@example.org"; - - /** - * Id of the member - */ - protected int id = createVerifiedUser("a", "b", email, TEST_PASSWORD); - - /** - * {@link User} object of the member - */ - protected User u = User.getById(id); - - /** - * Session cookie of the member. - */ - protected String cookie; - - public ClientTest() { - try { - cookie = login(email, TEST_PASSWORD); - } catch (IOException e) { - throw new Error(e); - } - } - - public HttpURLConnection post(String path, String query) throws IOException { - return post(path, query, 0); - } - - public HttpURLConnection post(String path, String query, int formIndex) throws IOException { - return post(cookie, path, query, formIndex); - } - - public HttpURLConnection get(String path) throws IOException { - return get(cookie, path); - } - -}