mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Github test: use separate account for pagination test
This commit is contained in:
+3
-1
@@ -26,6 +26,8 @@ import java.util.List;
|
||||
public class GithubRequestPagingTest extends GithubTest {
|
||||
|
||||
public void testCase() throws Throwable {
|
||||
GithubSettings.getInstance().setAuthData(auth2, false);
|
||||
|
||||
List<RepositoryInfo> availableRepos = GithubUtil.getAvailableRepos(GithubUtil.getAuthData());
|
||||
List<String> realData = new ArrayList<String>();
|
||||
for (RepositoryInfo info : availableRepos) {
|
||||
@@ -33,7 +35,7 @@ public class GithubRequestPagingTest extends GithubTest {
|
||||
}
|
||||
|
||||
List<String> expectedData = new ArrayList<String>();
|
||||
for (int i = 1; i <= 250; i++) {
|
||||
for (int i = 1; i <= 251; i++) {
|
||||
expectedData.add(String.valueOf(i));
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -32,16 +32,20 @@ import org.jetbrains.plugins.github.test.GithubTest;
|
||||
import org.jetbrains.plugins.github.ui.GithubShareDialog;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @author Aleksey Pivovarov
|
||||
*/
|
||||
public abstract class GithubShareProjectTestBase extends GithubTest {
|
||||
protected static final String PROJECT_NAME = "new_project_from_test";
|
||||
protected static String PROJECT_NAME;
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
Random rnd = new Random();
|
||||
PROJECT_NAME = "new_project_from_share_test_" + rnd.nextLong();
|
||||
registerHttpAuthService();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ import git4idea.test.TestDialogManager;
|
||||
import git4idea.test.TestNotificator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.github.GithubAuthData;
|
||||
import org.jetbrains.plugins.github.GithubSettings;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -72,6 +73,9 @@ public abstract class GithubTest extends UsefulTestCase {
|
||||
|
||||
@NotNull private IdeaProjectTestFixture myProjectFixture;
|
||||
|
||||
@NotNull protected GithubAuthData auth1;
|
||||
@NotNull protected GithubAuthData auth2;
|
||||
|
||||
@SuppressWarnings({"JUnitTestCaseWithNonTrivialConstructors", "UnusedDeclaration"})
|
||||
protected GithubTest() {
|
||||
PlatformTestCase.initPlatformLangPrefix();
|
||||
@@ -193,13 +197,17 @@ public abstract class GithubTest extends UsefulTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
final String host = System.getenv("idea.test.github.host");
|
||||
final String login = System.getenv("idea.test.github.login");
|
||||
final String password = System.getenv("idea.test.github.password");
|
||||
final String login = System.getenv("idea.test.github.login1");
|
||||
final String password = System.getenv("idea.test.github.password1");
|
||||
final String login2 = System.getenv("idea.test.github.login2");
|
||||
final String password2 = System.getenv("idea.test.github.password2");
|
||||
|
||||
// TODO change to assert when a stable Github testing server is ready
|
||||
assumeNotNull(host);
|
||||
assumeNotNull(login);
|
||||
assumeNotNull(password);
|
||||
assumeNotNull(login2);
|
||||
assumeNotNull(password2);
|
||||
|
||||
super.setUp();
|
||||
|
||||
@@ -217,6 +225,9 @@ public abstract class GithubTest extends UsefulTestCase {
|
||||
myGitHubSettings.setLogin(login);
|
||||
myGitHubSettings.setPassword(password);
|
||||
|
||||
auth1 = new GithubAuthData(host, login, password);
|
||||
auth2 = new GithubAuthData(host, login2, password2);
|
||||
|
||||
myDialogManager = (TestDialogManager)ServiceManager.getService(DialogManager.class);
|
||||
myNotificator = (TestNotificator)ServiceManager.getService(myProject, Notificator.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user