From 2ab27d276e26d18acae595f82ad0f15cb47f29bd Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Fri, 3 Aug 2012 17:19:26 +0400 Subject: [PATCH] cleanup --- .../plugins/groovy/GroovyActionsTest.groovy | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/GroovyActionsTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/GroovyActionsTest.groovy index 4e1574c262b5..9aabfc97ea65 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/GroovyActionsTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/GroovyActionsTest.groovy @@ -29,37 +29,35 @@ import org.jetbrains.plugins.groovy.util.TestUtils */ public class GroovyActionsTest extends LightCodeInsightFixtureTestCase { - protected String getBasePath() { - return TestUtils.testDataPath + "groovy/actions/"; - } + final String basePath = TestUtils.testDataPath + 'groovy/actions/'; - public void testSelectWordBeforeMethod() throws Throwable { + public void testSelectWordBeforeMethod() { doTestForSelectWord 1; } - public void testSWInGString1() throws Exception {doTestForSelectWord(1);} - public void testSWInGString2() throws Exception {doTestForSelectWord(2);} - public void testSWInGString3() throws Exception {doTestForSelectWord(3);} - public void testSWInGString4() throws Exception {doTestForSelectWord(4);} - public void testSWInGString5() throws Exception {doTestForSelectWord(5);} - public void testSWInParameterList() throws Exception {doTestForSelectWord(3);} + public void testSWInGString1() {doTestForSelectWord(1);} + public void testSWInGString2() {doTestForSelectWord(2);} + public void testSWInGString3() {doTestForSelectWord(3);} + public void testSWInGString4() {doTestForSelectWord(4);} + public void testSWInGString5() {doTestForSelectWord(5);} + public void testSWInParameterList() {doTestForSelectWord(3);} public void testSWInArgLabel1() {doTestForSelectWord(2)} public void testSWInArgLabel2() {doTestForSelectWord(2)} public void testSWInArgLabel3() {doTestForSelectWord(2)} - public void testSWListLiteralArgument() throws Exception { + public void testSWListLiteralArgument() { doTestForSelectWord 2, "foo([a], b)", "foo([a], b)" } - public void testSWMethodParametersBeforeQualifier() throws Exception { + public void testSWMethodParametersBeforeQualifier() { doTestForSelectWord 2, "a.foo(b)", "a.foo(b)" } - public void testSWInCodeBlock() throws Exception {doTestForSelectWord 3} + public void testSWInCodeBlock() {doTestForSelectWord 3} public void testElseBranch() { doTestForSelectWord (3, '''\ @@ -79,29 +77,29 @@ def foo() { ''') } - private void doTestForSelectWord(int count, String input, String expected) throws Exception { + private void doTestForSelectWord(int count, String input, String expected) { myFixture.configureByText("a.groovy", input); selectWord(count) myFixture.checkResult(expected); } - private void doTestForSelectWord(int count) throws Exception { + private void doTestForSelectWord(int count) { myFixture.configureByFile(getTestName(false) + ".groovy"); selectWord(count) myFixture.checkResultByFile(getTestName(false) + "_after.groovy"); } private def selectWord(int count) { - myFixture.getEditor().getSettings().setCamelWords(true); + myFixture.editor.settings.camelWords = true; for (int i = 0; i < count; i++) { performEditorAction(IdeActions.ACTION_EDITOR_SELECT_WORD_AT_CARET); } } private void performEditorAction(final String actionId) { - final EditorActionHandler handler = EditorActionManager.getInstance().getActionHandler(actionId); - final Editor editor = myFixture.getEditor(); - handler.execute(editor, DataManager.getInstance().getDataContext(editor.getContentComponent())); + final EditorActionHandler handler = EditorActionManager.instance.getActionHandler(actionId); + final Editor editor = myFixture.editor; + handler.execute(editor, DataManager.instance.getDataContext(editor.contentComponent)); } }