|
From: <mir...@us...> - 2007-03-22 09:12:12
|
Revision: 2205
http://svn.sourceforge.net/rubyeclipse/?rev=2205&view=rev
Author: mirkostocker
Date: 2007-03-22 02:12:10 -0700 (Thu, 22 Mar 2007)
Log Message:
-----------
rename "temp" to "local" in the tests.. this should be the last one.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/LocalToFieldTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_LocalToField.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/LocalToFieldConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_LocalToFieldChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/LocalInlinerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineLocal.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineLocalConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineLocalConditionChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/TS_RenameLocal.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/SplitLocalTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/TS_SplitLocal.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/SplitLocalConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/TS_SplitLocalChecks.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/formatsource/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineTempConditionChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/TS_RenameLocalVariable.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/SplitTempTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/TS_SplitTemp.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/SplitTempConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/TS_SplitTempChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -33,14 +33,14 @@
import org.rubypeople.rdt.refactoring.tests.classnodeprovider.TS_ClassNodeProvider;
import org.rubypeople.rdt.refactoring.tests.core.TS_Core;
-import org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.TS_TempToField;
+import org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.TS_LocalToField;
import org.rubypeople.rdt.refactoring.tests.core.encapsulatefield.TS_EncapsulateField;
import org.rubypeople.rdt.refactoring.tests.core.extractmethod.TS_ExtractMethod;
import org.rubypeople.rdt.refactoring.tests.core.formatsource.TS_FormatSource;
import org.rubypeople.rdt.refactoring.tests.core.generateaccessors.TS_GenerateAccessors;
import org.rubypeople.rdt.refactoring.tests.core.generateconstructor.TS_GenerateConstructor;
import org.rubypeople.rdt.refactoring.tests.core.inlineclass.TS_InlineClass;
-import org.rubypeople.rdt.refactoring.tests.core.inlinelocal.TS_InlineTemp;
+import org.rubypeople.rdt.refactoring.tests.core.inlinelocal.TS_InlineLocal;
import org.rubypeople.rdt.refactoring.tests.core.inlinemethod.TS_InlineMethod;
import org.rubypeople.rdt.refactoring.tests.core.mergeclasspartsinfile.TS_MergeClassPartsInFile;
import org.rubypeople.rdt.refactoring.tests.core.mergewithexternalclassparts.TS_MergeWithExternalClassParts;
@@ -52,9 +52,9 @@
import org.rubypeople.rdt.refactoring.tests.core.rename.TS_Rename;
import org.rubypeople.rdt.refactoring.tests.core.renameclass.TS_RenameClass;
import org.rubypeople.rdt.refactoring.tests.core.renamefield.TS_RenameField;
-import org.rubypeople.rdt.refactoring.tests.core.renamelocal.TS_RenameLocalVariable;
+import org.rubypeople.rdt.refactoring.tests.core.renamelocal.TS_RenameLocal;
import org.rubypeople.rdt.refactoring.tests.core.renamemethod.TS_RenameMethod;
-import org.rubypeople.rdt.refactoring.tests.core.splitlocal.TS_SplitTemp;
+import org.rubypeople.rdt.refactoring.tests.core.splitlocal.TS_SplitLocal;
import org.rubypeople.rdt.refactoring.tests.util.TS_Util;
public class TS_All
@@ -67,17 +67,17 @@
suite.addTest(TS_GenerateConstructor.suite());
suite.addTest(TS_OverrideMethod.suite());
suite.addTest(TS_PushDown.suite());
- suite.addTest(TS_RenameLocalVariable.suite());
+ suite.addTest(TS_RenameLocal.suite());
suite.addTest(TS_Util.suite());
suite.addTest(TS_ClassNodeProvider.suite());
suite.addTest(TS_FormatSource.suite());
- suite.addTest(TS_TempToField.suite());
+ suite.addTest(TS_LocalToField.suite());
suite.addTest(TS_Core.suite());
suite.addTest(TS_ExtractMethod.suite());
suite.addTest(TS_MergeWithExternalClassParts.suite());
suite.addTest(TS_MergeClassPartsInFile.suite());
- suite.addTest(TS_InlineTemp.suite());
- suite.addTest(TS_SplitTemp.suite());
+ suite.addTest(TS_InlineLocal.suite());
+ suite.addTest(TS_SplitLocal.suite());
suite.addTest(TS_EncapsulateField.suite());
suite.addTest(TS_InlineMethod.suite());
suite.addTest(TS_RenameField.suite());
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/LocalToFieldTester.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/LocalToFieldTester.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/LocalToFieldTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,94 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.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.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConditionChecker;
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConfig;
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConverter;
+import org.rubypeople.rdt.refactoring.tests.FilePropertyData;
+import org.rubypeople.rdt.refactoring.tests.FileTestData;
+import org.rubypeople.rdt.refactoring.tests.RefactoringTestCase;
+
+public class LocalToFieldTester extends RefactoringTestCase {
+
+ private String fileName;
+
+ public LocalToFieldTester(String fileName) {
+ this.fileName = fileName;
+ }
+
+ protected int getInitPlace(String initPlace) {
+ if (initPlace.equalsIgnoreCase("TempToFieldConverter.INIT_IN_METHOD")) {
+ return LocalToFieldConverter.INIT_IN_METHOD;
+ } else if (initPlace.equalsIgnoreCase("TempToFieldConverter.INIT_IN_CONSTRUCTOR")) {
+ return LocalToFieldConverter.INIT_IN_CONSTRUCTOR;
+ } else {
+ assertTrue(false);
+ return 0;
+ }
+
+ }
+
+ protected void runTempToFieldTest(FilePropertyData data, String sourceDocument, String expectedDocument, String newName, boolean isClassField, int initPlace,
+ int cursorPosition) throws BadLocationException {
+ LocalToFieldConfig config = new LocalToFieldConfig(data, cursorPosition);
+ LocalToFieldConditionChecker checker = new LocalToFieldConditionChecker(config);
+ if (!checker.shouldPerform()) {
+ fail();
+ }
+ LocalToFieldConverter converter = new LocalToFieldConverter(config);
+ converter.setInitPlace(initPlace);
+ converter.setIsClassField(isClassField);
+ converter.setNewName(newName);
+ createEditAndCompareResult(sourceDocument, expectedDocument, converter);
+ }
+
+ @Override
+ public void runTest() throws FileNotFoundException, IOException, BadLocationException {
+ FileTestData data = new FileTestData(fileName, getClass());
+ String source = data.getSource();
+ String expected = data.getExpectedResult();
+ String newName = data.getProperty("newName");
+ boolean isClassField = data.getBoolProperty("isClassField");
+ int initPlace = getInitPlace(data.getProperty("initPlace"));
+ int cursorPos = data.getIntProperty("cursorPosition");
+ runTempToFieldTest(data, source, expected, newName, isClassField, initPlace, cursorPos);
+ }
+
+ @Override
+ public String getName() {
+ return fileName;
+ }
+}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_LocalToField.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_LocalToField.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_LocalToField.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,46 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.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.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
+import org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.conditionchecks.TS_LocalToFieldChecks;
+
+public class TS_LocalToField extends FileTestSuite
+{
+ public static Test suite() {
+ TestSuite suite = createSuite("TempToField", "temp_to_field_test*test_source", LocalToFieldTester.class);
+ suite.addTest(TS_LocalToFieldChecks.suite());
+ return suite;
+ }
+}
\ No newline at end of file
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,46 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.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.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Lukas Felber <lf...@hs...>
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
-import org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.conditionchecks.TS_TempToFieldChecks;
-
-public class TS_TempToField extends FileTestSuite
-{
- public static Test suite() {
- TestSuite suite = createSuite("TempToField", "temp_to_field_test*test_source", TempToFieldTester.class);
- suite.addTest(TS_TempToFieldChecks.suite());
- return suite;
- }
-}
\ No newline at end of file
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,94 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.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.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Lukas Felber <lf...@hs...>
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConditionChecker;
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConfig;
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConverter;
-import org.rubypeople.rdt.refactoring.tests.FilePropertyData;
-import org.rubypeople.rdt.refactoring.tests.FileTestData;
-import org.rubypeople.rdt.refactoring.tests.RefactoringTestCase;
-
-public class TempToFieldTester extends RefactoringTestCase {
-
- private String fileName;
-
- public TempToFieldTester(String fileName) {
- this.fileName = fileName;
- }
-
- protected int getInitPlace(String initPlace) {
- if (initPlace.equalsIgnoreCase("TempToFieldConverter.INIT_IN_METHOD")) {
- return LocalToFieldConverter.INIT_IN_METHOD;
- } else if (initPlace.equalsIgnoreCase("TempToFieldConverter.INIT_IN_CONSTRUCTOR")) {
- return LocalToFieldConverter.INIT_IN_CONSTRUCTOR;
- } else {
- assertTrue(false);
- return 0;
- }
-
- }
-
- protected void runTempToFieldTest(FilePropertyData data, String sourceDocument, String expectedDocument, String newName, boolean isClassField, int initPlace,
- int cursorPosition) throws BadLocationException {
- LocalToFieldConfig config = new LocalToFieldConfig(data, cursorPosition);
- LocalToFieldConditionChecker checker = new LocalToFieldConditionChecker(config);
- if (!checker.shouldPerform()) {
- fail();
- }
- LocalToFieldConverter converter = new LocalToFieldConverter(config);
- converter.setInitPlace(initPlace);
- converter.setIsClassField(isClassField);
- converter.setNewName(newName);
- createEditAndCompareResult(sourceDocument, expectedDocument, converter);
- }
-
- @Override
- public void runTest() throws FileNotFoundException, IOException, BadLocationException {
- FileTestData data = new FileTestData(fileName, getClass());
- String source = data.getSource();
- String expected = data.getExpectedResult();
- String newName = data.getProperty("newName");
- boolean isClassField = data.getBoolProperty("isClassField");
- int initPlace = getInitPlace(data.getProperty("initPlace"));
- int cursorPos = data.getIntProperty("cursorPosition");
- runTempToFieldTest(data, source, expected, newName, isClassField, initPlace, cursorPos);
- }
-
- @Override
- public String getName() {
- return fileName;
- }
-}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/LocalToFieldConditionTester.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/LocalToFieldConditionTester.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/LocalToFieldConditionTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,65 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.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.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.conditionchecks;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConditionChecker;
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConfig;
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConverter;
+import org.rubypeople.rdt.refactoring.tests.FilePropertyData;
+import org.rubypeople.rdt.refactoring.tests.FileTestData;
+import org.rubypeople.rdt.refactoring.tests.RefactoringConditionTestCase;
+
+public class LocalToFieldConditionTester extends RefactoringConditionTestCase {
+ private FilePropertyData testData;
+ private LocalToFieldConfig config;
+
+ public LocalToFieldConditionTester(String fileName) {
+ super(fileName);
+ }
+
+ @Override
+ public void runTest() throws FileNotFoundException, IOException {
+ testData = new FileTestData(getName(), ".test_source", ".test_source");
+ config = new LocalToFieldConfig(testData, testData.getIntProperty("cursorPosition"));
+ LocalToFieldConditionChecker checker = new LocalToFieldConditionChecker(config);
+ checkConditions(checker, testData);
+ }
+
+ @Override
+ protected void createEditProviderAndSetUserInput() {
+ LocalToFieldConverter converter = new LocalToFieldConverter(config);
+ converter.setIsClassField(testData.getBoolProperty("isClassField"));
+ converter.setNewName(testData.getProperty("newName"));
+ }
+}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_LocalToFieldChecks.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_LocalToFieldChecks.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_LocalToFieldChecks.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,43 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.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.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.conditionchecks;
+
+import junit.framework.Test;
+
+import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
+
+public class TS_LocalToFieldChecks extends FileTestSuite {
+
+ public static Test suite() {
+ return createSuite("ConvertTempToFieldTests", "temp_to_field_checker_test_*test_source", LocalToFieldConditionTester.class);
+ }
+
+}
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,43 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.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.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Lukas Felber <lf...@hs...>
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.conditionchecks;
-
-import junit.framework.Test;
-
-import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
-
-public class TS_TempToFieldChecks extends FileTestSuite {
-
- public static Test suite() {
- return createSuite("ConvertTempToFieldTests", "temp_to_field_checker_test_*test_source", TempToFieldConditionTester.class);
- }
-
-}
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,65 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.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.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Lukas Felber <lf...@hs...>
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.conditionchecks;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConditionChecker;
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConfig;
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConverter;
-import org.rubypeople.rdt.refactoring.tests.FilePropertyData;
-import org.rubypeople.rdt.refactoring.tests.FileTestData;
-import org.rubypeople.rdt.refactoring.tests.RefactoringConditionTestCase;
-
-public class TempToFieldConditionTester extends RefactoringConditionTestCase {
- private FilePropertyData testData;
- private LocalToFieldConfig config;
-
- public TempToFieldConditionTester(String fileName) {
- super(fileName);
- }
-
- @Override
- public void runTest() throws FileNotFoundException, IOException {
- testData = new FileTestData(getName(), ".test_source", ".test_source");
- config = new LocalToFieldConfig(testData, testData.getIntProperty("cursorPosition"));
- LocalToFieldConditionChecker checker = new LocalToFieldConditionChecker(config);
- checkConditions(checker, testData);
- }
-
- @Override
- protected void createEditProviderAndSetUserInput() {
- LocalToFieldConverter converter = new LocalToFieldConverter(config);
- converter.setIsClassField(testData.getBoolProperty("isClassField"));
- converter.setNewName(testData.getProperty("newName"));
- }
-}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/LocalInlinerTester.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/LocalInlinerTester.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/LocalInlinerTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,77 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.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.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.tests.core.inlinelocal;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConditionChecker;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConfig;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.LocalVariableInliner;
+import org.rubypeople.rdt.refactoring.tests.FileTestData;
+import org.rubypeople.rdt.refactoring.tests.RefactoringTestCase;
+
+public class LocalInlinerTester extends RefactoringTestCase {
+
+ private String fileName;
+
+ private FileTestData testData;
+
+ public LocalInlinerTester(String fileName) {
+ this.fileName = fileName;
+ }
+
+ private void runInlineTempTest(FileTestData data) throws BadLocationException {
+
+ InlineLocalConfig config = new InlineLocalConfig(data, data.getIntProperty("caretPosition"));
+ InlineLocalConditionChecker checker = new InlineLocalConditionChecker(config);
+ if (!checker.shouldPerform()) {
+ fail();
+ }
+ LocalVariableInliner inliner = new LocalVariableInliner(config);
+ config.setReplaceTempWithQuery(data.getBoolProperty("replaceWithQuery"));
+ config.setNewMethodName(data.getProperty("newMethodName"));
+
+ createEditAndCompareResult(data.getActiveFileContent(), data.getExpectedResult(), inliner);
+ }
+
+ @Override
+ public void runTest() throws FileNotFoundException, IOException, BadLocationException {
+ testData = new FileTestData(fileName, getClass());
+ runInlineTempTest(testData);
+ }
+
+ @Override
+ public String getName() {
+ return fileName;
+ }
+}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineLocal.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineLocal.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineLocal.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,44 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.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.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.tests.core.inlinelocal;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
+import org.rubypeople.rdt.refactoring.tests.core.inlinelocal.conditionchecks.TS_InlineLocalConditionChecks;
+
+public class TS_InlineLocal extends FileTestSuite {
+
+ public static Test suite() {
+ TestSuite suite = createSuite("Inline Temp", "inline_temp_test_*.test_properties", LocalInlinerTester.class);
+ suite.addTest(TS_InlineLocalConditionChecks.suite());
+ return suite;
+ }
+}
\ No newline at end of file
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,44 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.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.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Lukas Felber <lf...@hs...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.tests.core.inlinelocal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
-import org.rubypeople.rdt.refactoring.tests.core.inlinelocal.conditionchecks.TS_InlineTempConditionChecks;
-
-public class TS_InlineTemp extends FileTestSuite {
-
- public static Test suite() {
- TestSuite suite = createSuite("Inline Temp", "inline_temp_test_*.test_properties", TempInlinerTester.class);
- suite.addTest(TS_InlineTempConditionChecks.suite());
- return suite;
- }
-}
\ No newline at end of file
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,77 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.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.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Lukas Felber <lf...@hs...>
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.tests.core.inlinelocal;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConditionChecker;
-import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConfig;
-import org.rubypeople.rdt.refactoring.core.inlinelocal.LocalVariableInliner;
-import org.rubypeople.rdt.refactoring.tests.FileTestData;
-import org.rubypeople.rdt.refactoring.tests.RefactoringTestCase;
-
-public class TempInlinerTester extends RefactoringTestCase {
-
- private String fileName;
-
- private FileTestData testData;
-
- public TempInlinerTester(String fileName) {
- this.fileName = fileName;
- }
-
- private void runInlineTempTest(FileTestData data) throws BadLocationException {
-
- InlineLocalConfig config = new InlineLocalConfig(data, data.getIntProperty("caretPosition"));
- InlineLocalConditionChecker checker = new InlineLocalConditionChecker(config);
- if (!checker.shouldPerform()) {
- fail();
- }
- LocalVariableInliner inliner = new LocalVariableInliner(config);
- config.setReplaceTempWithQuery(data.getBoolProperty("replaceWithQuery"));
- config.setNewMethodName(data.getProperty("newMethodName"));
-
- createEditAndCompareResult(data.getActiveFileContent(), data.getExpectedResult(), inliner);
- }
-
- @Override
- public void runTest() throws FileNotFoundException, IOException, BadLocationException {
- testData = new FileTestData(fileName, getClass());
- runInlineTempTest(testData);
- }
-
- @Override
- public String getName() {
- return fileName;
- }
-}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineLocalConditionTester.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineLocalConditionTester.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineLocalConditionTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,69 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.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.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.tests.core.inlinelocal.conditionchecks;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConditionChecker;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConfig;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.LocalVariableInliner;
+import org.rubypeople.rdt.refactoring.tests.FileTestData;
+import org.rubypeople.rdt.refactoring.tests.RefactoringConditionTestCase;
+
+public class InlineLocalConditionTester extends RefactoringConditionTestCase {
+
+ private InlineLocalConfig config;
+ private FileTestData testData;
+
+ public InlineLocalConditionTester(String fileName) {
+ super(fileName);
+ }
+
+ @Override
+ public void runTest() throws FileNotFoundException, IOException {
+ testData = new FileTestData(getName(), ".test_source", ".test_source");
+
+ config = new InlineLocalConfig(testData, testData.getIntProperty("cursorPosition"));
+ InlineLocalConditionChecker checker = new InlineLocalConditionChecker(config);
+ checkConditions(checker, testData);
+ }
+
+ @Override
+ protected void createEditProviderAndSetUserInput() {
+ new LocalVariableInliner(config);
+ if(testData.hasProperty("newName")) {
+ config.setReplaceTempWithQuery(true);
+ config.setNewMethodName(testData.getProperty("newName"));
+ }
+ }
+
+}
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,69 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.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.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Lukas Felber <lf...@hs...>
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.tests.core.inlinelocal.conditionchecks;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConditionChecker;
-import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConfig;
-import org.rubypeople.rdt.refactoring.core.inlinelocal.LocalVariableInliner;
-import org.rubypeople.rdt.refactoring.tests.FileTestData;
-import org.rubypeople.rdt.refactoring.tests.RefactoringConditionTestCase;
-
-public class InlineTempConditionTester extends RefactoringConditionTestCase {
-
- private InlineLocalConfig config;
- private FileTestData testData;
-
- public InlineTempConditionTester(String fileName) {
- super(fileName);
- }
-
- @Override
- public void runTest() throws FileNotFoundException, IOException {
- testData = new FileTestData(getName(), ".test_source", ".test_source");
-
- config = new InlineLocalConfig(testData, testData.getIntProperty("cursorPosition"));
- InlineLocalConditionChecker checker = new InlineLocalConditionChecker(config);
- checkConditions(checker, testData);
- }
-
- @Override
- protected void createEditProviderAndSetUserInput() {
- new LocalVariableInliner(config);
- if(testData.hasProperty("newName")) {
- config.setReplaceTempWithQuery(true);
- config.setNewMethodName(testData.getProperty("newName"));
- }
- }
-
-}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineLocalConditionChecks.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineTempConditionChecks.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineLocalConditionChecks.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineLocalConditionChecks.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,43 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.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.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.tests.core.inlinelocal.conditionchecks;
+
+import junit.framework.TestSuite;
+
+import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
+
+public class TS_InlineLocalConditionChecks extends FileTestSuite {
+
+ public static TestSuite suite() {
+ return createSuite("InlineTempConditionChecks", "inline_temp_checker_test_*test_source", InlineLocalConditionTester.class);
+ }
+
+}
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineTempConditionChecks.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/...
[truncated message content] |