diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java index f5cae2a1a241..97017a537444 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java @@ -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(); diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTestBase.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTestBase.java new file mode 100644 index 000000000000..b15d628620bc --- /dev/null +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTestBase.java @@ -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 expected, @NotNull List actual) { + assertTrue("Gist content differs from sample", Comparing.haveEqualElements(expected, actual)); + } +} diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java index 17a0c68781e4..b54bd8c62b4e 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java @@ -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 expected, @NotNull List actual) { - assertTrue("Gist content differs from sample", Comparing.haveEqualElements(expected, actual)); - } - protected void registerCancelingLoginDialogHandler() { myDialogManager.registerDialogHandler(GithubLoginDialog.class, new TestDialogHandler() { @Override diff --git a/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java b/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java index b95f31dd7fbc..3d3d8201e03a 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java +++ b/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java @@ -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;