Github: small test cleanup

This commit is contained in:
Aleksey Pivovarov
2014-04-24 12:43:48 +04:00
parent 6d6d583c48
commit c726c534c0
4 changed files with 44 additions and 8 deletions
@@ -16,7 +16,9 @@
package org.jetbrains.plugins.github;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorFactory;
import com.intellij.openapi.editor.impl.EditorImpl;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.vfs.VirtualFile;
@@ -29,8 +31,7 @@ import static org.jetbrains.plugins.github.api.GithubGist.FileContent;
/**
* @author Aleksey Pivovarov
*/
public class GithubCreateGistContentTest extends GithubCreateGistTestBase {
public class GithubCreateGistContentTest extends GithubCreateGistContentTestBase {
@Override
protected void beforeTest() throws Exception {
createProjectFiles();
@@ -0,0 +1,39 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.plugins.github;
import com.intellij.openapi.util.Comparing;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.github.test.GithubTest;
import java.util.List;
import static org.jetbrains.plugins.github.api.GithubGist.FileContent;
/**
* @author Aleksey Pivovarov
*/
public abstract class GithubCreateGistContentTestBase extends GithubTest {
@Override
protected void beforeTest() throws Exception {
createProjectFiles();
}
protected void checkEquals(@NotNull List<FileContent> expected, @NotNull List<FileContent> actual) {
assertTrue("Gist content differs from sample", Comparing.haveEqualElements(expected, actual));
}
}
@@ -135,10 +135,6 @@ public abstract class GithubCreateGistTestBase extends GithubTest {
assertTrue("Gist content differs from sample", Comparing.haveEqualElements(files, expected));
}
protected void checkEquals(@NotNull List<FileContent> expected, @NotNull List<FileContent> actual) {
assertTrue("Gist content differs from sample", Comparing.haveEqualElements(expected, actual));
}
protected void registerCancelingLoginDialogHandler() {
myDialogManager.registerDialogHandler(GithubLoginDialog.class, new TestDialogHandler<GithubLoginDialog>() {
@Override
@@ -153,6 +153,8 @@ public abstract class GithubTest extends GitPlatformTest {
@Override
protected final void setUp() throws Exception {
super.setUp();
final String host = System.getenv("idea.test.github.host");
final String login1 = System.getenv("idea.test.github.login1");
final String login2 = System.getenv("idea.test.github.login2");
@@ -163,8 +165,6 @@ public abstract class GithubTest extends GitPlatformTest {
assumeNotNull(login1);
assumeNotNull(password);
super.setUp();
myHost = host;
myLogin1 = login1;
myLogin2 = login2;