diff --git a/core/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractConstantHistory.rts b/core/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractConstantHistory.rts
new file mode 100644
index 00000000000..ad7301cdaea
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractConstantHistory.rts
@@ -0,0 +1,232 @@
+//!ExtractConstantInt
+//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
+//@A.h
+#ifndef A_H_
+#define A_H_
+
+class A
+{
+public:
+ A();
+ virtual ~A();
+ int foo();
+ void bar();
+};
+
+#endif /*A_H_*/
+
+//=
+#ifndef A_H_
+#define A_H_
+
+class A
+{
+public:
+ A();
+ virtual ~A();
+ int foo();
+ void bar();
+ static const int theAnswer = 42;
+};
+
+#endif /*A_H_*/
+
+//@A.cpp
+#include "A.h"
+
+A::A()
+{
+}
+
+A::~A()
+{
+}
+
+int A::foo()
+{
+ return 42; //Hallo
+}
+
+void A::bar()
+{
+ int a = 42;
+ int b = 42;
+}
+
+//=
+#include "A.h"
+
+A::A()
+{
+}
+
+A::~A()
+{
+}
+
+int A::foo()
+{
+ return theAnswer; //Hallo
+}
+
+void A::bar()
+{
+ int a = theAnswer;
+ int b = theAnswer;
+}
+
+//@refScript.xml
+
+
+
+
+
+
+//!replaceNumberProtected
+//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
+//@A.h
+#ifndef A_H_
+#define A_H_
+
+class A
+{
+public:
+ A();
+ virtual ~A();
+ int foo();
+};
+
+#endif /*A_H_*/
+
+//=
+#ifndef A_H_
+#define A_H_
+
+class A
+{
+public:
+ A();
+ virtual ~A();
+ int foo();
+protected:
+ static const int theAnswer = 42;
+};
+
+#endif /*A_H_*/
+
+//@A.cpp
+#include "A.h"
+
+A::A()
+{
+}
+
+A::~A()
+{
+}
+
+int A::foo()
+{
+ return 42;
+}
+
+//=
+#include "A.h"
+
+A::A()
+{
+}
+
+A::~A()
+{
+}
+
+int A::foo()
+{
+ return theAnswer;
+}
+
+//@refScript.xml
+
+
+
+
+
+//!replaceNumberPrivate
+//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
+//@A.h
+#ifndef A_H_
+#define A_H_
+
+class A
+{
+public:
+ A();
+ virtual ~A();
+ int foo();
+};
+
+#endif /*A_H_*/
+
+//=
+#ifndef A_H_
+#define A_H_
+
+class A
+{
+public:
+ A();
+ virtual ~A();
+ int foo();
+private:
+ static const int theAnswer = 42;
+};
+
+#endif /*A_H_*/
+
+//@A.cpp
+#include "A.h"
+
+A::A()
+{
+}
+
+A::~A()
+{
+}
+
+int A::foo()
+{
+ return 42;
+}
+
+//=
+#include "A.h"
+
+A::A()
+{
+}
+
+A::~A()
+{
+}
+
+int A::foo()
+{
+ return theAnswer;
+}
+
+//@refScript.xml
+
+
+
+
diff --git a/core/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractLocalVariableHistory.rts b/core/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractLocalVariableHistory.rts
new file mode 100644
index 00000000000..b01f4096137
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractLocalVariableHistory.rts
@@ -0,0 +1,21 @@
+//!extract local variable from for loop
+//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
+//@main.cpp
+void foo(){
+ for(int n = 5 + 2; n < 10; ++n);
+}
+
+//=
+void foo(){
+ int i = 5 + 2;
+ for(int n = i; n < 10; ++n);
+}
+
+//@refScript.xml
+
+
+
+
diff --git a/core/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractMethodHistory.rts b/core/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractMethodHistory.rts
new file mode 100644
index 00000000000..d359fd5bcc4
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/refactoring/ExtractMethodHistory.rts
@@ -0,0 +1,263 @@
+//!ExtractFunctionHistoryRefactoringTest variable defined in scope
+//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
+//@A.h
+#ifndef A_H_
+#define A_H_
+
+class A
+{
+public:
+ A();
+ virtual ~A();
+ int foo();
+
+private:
+ int help();
+};
+
+#endif /*A_H_*/
+
+//=
+#ifndef A_H_
+#define A_H_
+
+class A
+{
+public:
+ A();
+ virtual ~A();
+ int foo();
+
+private:
+ int help();
+ int exp();
+};
+
+#endif /*A_H_*/
+
+//@A.cpp
+#include "A.h"
+
+A::A()
+{
+}
+
+A::~A()
+{
+}
+int A::foo()
+{
+ int i = 2;
+ ++i;
+ help();
+ return i;
+}
+
+int A::help()
+{
+ return 42;
+}
+
+//=
+#include "A.h"
+
+A::A()
+{
+}
+
+A::~A()
+{
+}
+int A::exp()
+{
+ int i = 2;
+ ++i;
+ help();
+ return i;
+}
+
+int A::foo()
+{
+ int i = exp();
+ return i;
+}
+
+int A::help()
+{
+ return 42;
+}
+
+//@refScript.xml
+
+
+
+
+
+
+//!ExtractFunctionHistoryRefactoringTest
+//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
+//@A.h
+#ifndef A_H_
+#define A_H_
+
+class A
+{
+public:
+ A();
+ virtual ~A();
+ int foo();
+
+private:
+ int help();
+};
+
+#endif /*A_H_*/
+
+//=
+#ifndef A_H_
+#define A_H_
+
+class A
+{
+public:
+ A();
+ virtual ~A();
+ int foo();
+
+private:
+ int help();
+ void exp(int & i);
+};
+
+#endif /*A_H_*/
+
+//@A.cpp
+#include "A.h"
+
+A::A()
+{
+}
+
+A::~A()
+{
+}
+int A::foo()
+{
+ int i = 2;
+ //comment
+ ++i;
+ help();
+ return i;
+}
+
+int A::help()
+{
+ return 42;
+}
+
+//=
+#include "A.h"
+
+A::A()
+{
+}
+
+A::~A()
+{
+}
+void A::exp(int & i)
+{
+ //comment
+ ++i;
+ help();
+}
+
+int A::foo()
+{
+ int i = 2;
+ exp(i);
+ return i;
+}
+
+int A::help()
+{
+ return 42;
+}
+
+//@refScript.xml
+
+
+
+
+
+//!Extract Function History first extracted statement with leading comment
+//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
+//@main.cpp
+int main(){
+
+ int i;
+ // Comment
+ i= 7;
+ return i;
+}
+
+//=
+void exp(int & i)
+{
+ // Comment
+ i = 7;
+}
+
+int main(){
+
+ int i;
+ exp(i);
+ return i;
+}
+
+//@refScript.xml
+
+
+
+
+
+//!Extract Function History extracted statement with trailling comment
+//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
+//@main.cpp
+int main(){
+
+ int i;
+ i= 7; // Comment
+ return i;
+}
+
+//=
+void exp(int & i)
+{
+ i = 7; // Comment
+}
+
+int main(){
+
+ int i;
+ exp(i);
+ return i;
+}
+
+//@refScript.xml
+
+
+
+
diff --git a/core/org.eclipse.cdt.ui.tests/resources/refactoring/HideMethodHistory.rts b/core/org.eclipse.cdt.ui.tests/resources/refactoring/HideMethodHistory.rts
new file mode 100644
index 00000000000..70f04a80d94
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/refactoring/HideMethodHistory.rts
@@ -0,0 +1,44 @@
+//!HideMethodSimple
+//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
+//@A.h
+#ifndef A_H_
+#define A_H_
+
+#include
+
+class A{
+public:
+ A();
+ void method2();
+ std::string toString();
+private:
+ int i;
+};
+
+#endif /*A_H_*/
+
+//=
+#ifndef A_H_
+#define A_H_
+
+#include
+
+class A{
+public:
+ A();
+ std::string toString();
+private:
+ int i;
+ void method2();
+};
+
+#endif /*A_H_*/
+
+//@refScript.xml
+
+
+
+
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringHistoryTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringHistoryTest.java
new file mode 100644
index 00000000000..042688b2d51
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringHistoryTest.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Institute for Software, HSR Hochschule fuer Technik
+ * Rapperswil, University of applied sciences and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Institute for Software (IFS)- initial API and implementation
+ ******************************************************************************/
+package org.eclipse.cdt.ui.tests.refactoring;
+
+import java.io.ByteArrayInputStream;
+import java.util.Properties;
+import java.util.Vector;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.RefactoringDescriptorProxy;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.history.RefactoringHistory;
+import org.eclipse.ltk.internal.core.refactoring.history.RefactoringHistoryService;
+
+import org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest;
+
+import org.eclipse.cdt.internal.ui.refactoring.CRefactoring;
+
+/**
+ * @author Emanuel Graf IFS
+ *
+ */
+public class RefactoringHistoryTest extends
+ ExtractFunctionRefactoringTest {
+
+ private TestSourceFile scriptFile;
+
+ public RefactoringHistoryTest(String name,
+ Vector files) {
+ super(name, files);
+ }
+
+ @Override
+ protected void configureRefactoring(Properties refactoringProperties) {
+ scriptFile = fileMap.get(refactoringProperties.getProperty(
+ "scriptFile", "refScript.xml"));
+
+ }
+
+ @Override
+ protected void runTest() throws Throwable {
+ String xmlSource = scriptFile.getSource();
+ xmlSource = xmlSource.replaceAll("\\$\\$projectPath\\$\\$", project.getLocation().toOSString());
+ RefactoringHistory refHist = RefactoringHistoryService.getInstance()
+ .readRefactoringHistory(
+ new ByteArrayInputStream(xmlSource
+ .getBytes()), 0);
+ for (RefactoringDescriptorProxy proxy : refHist.getDescriptors()) {
+ RefactoringStatus status = new RefactoringStatus();
+ CRefactoring ref = (CRefactoring) proxy
+ .requestDescriptor(new NullProgressMonitor())
+ .createRefactoring(status);
+ assertTrue(status.isOK());
+ RefactoringStatus checkInitialConditions = ref.checkInitialConditions(NULL_PROGRESS_MONITOR);
+
+ if(fatalError){
+ assertConditionsFatalError(checkInitialConditions);
+ return;
+ }
+ else{
+ assertConditionsOk(checkInitialConditions);
+ executeRefactoring(ref);
+ }
+ }
+ }
+
+}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractconstant/ExtractConstantRefactoringTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractconstant/ExtractConstantRefactoringTest.java
index 5f022792c4b..f5dfeb8b74a 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractconstant/ExtractConstantRefactoringTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractconstant/ExtractConstantRefactoringTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2009 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -21,6 +21,7 @@ import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.cdt.ui.tests.refactoring.RefactoringTest;
import org.eclipse.cdt.ui.tests.refactoring.TestSourceFile;
+import org.eclipse.cdt.internal.ui.refactoring.CRefactoring;
import org.eclipse.cdt.internal.ui.refactoring.extractconstant.ExtractConstantInfo;
import org.eclipse.cdt.internal.ui.refactoring.extractconstant.ExtractConstantRefactoring;
import org.eclipse.cdt.internal.ui.refactoring.utils.VisibilityEnum;
@@ -41,22 +42,16 @@ public class ExtractConstantRefactoringTest extends RefactoringTest {
protected void runTest() throws Throwable {
IFile refFile = project.getFile(fileName);
ExtractConstantInfo info = new ExtractConstantInfo();
- ExtractConstantRefactoring refactoring = new ExtractConstantRefactoring( refFile, selection, info);
- try {
- refactoring.lockIndex();
- RefactoringStatus checkInitialConditions = refactoring.checkInitialConditions(NULL_PROGRESS_MONITOR);
- assertConditionsOk(checkInitialConditions);
- info.setName("theAnswer"); //$NON-NLS-1$
- info.setVisibility(visibility);
- Change createChange = refactoring.createChange(NULL_PROGRESS_MONITOR);
- RefactoringStatus finalConditions = refactoring.checkFinalConditions(NULL_PROGRESS_MONITOR);
- assertConditionsOk(finalConditions);
- createChange.perform(NULL_PROGRESS_MONITOR);
- }finally {
- refactoring.unlockIndex();
- }
+ CRefactoring refactoring = new ExtractConstantRefactoring(refFile, selection, info, cproject);
+ RefactoringStatus checkInitialConditions = refactoring.checkInitialConditions(NULL_PROGRESS_MONITOR);
+ assertConditionsOk(checkInitialConditions);
+ info.setName("theAnswer"); //$NON-NLS-1$
+ info.setVisibility(visibility);
+ Change createChange = refactoring.createChange(NULL_PROGRESS_MONITOR);
+ RefactoringStatus finalConditions = refactoring.checkFinalConditions(NULL_PROGRESS_MONITOR);
+ assertConditionsOk(finalConditions);
+ createChange.perform(NULL_PROGRESS_MONITOR);
compareFiles(fileMap);
-
}
@Override
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractconstant/ExtractConstantTestSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractconstant/ExtractConstantTestSuite.java
index 33008093668..6805442382a 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractconstant/ExtractConstantTestSuite.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractconstant/ExtractConstantTestSuite.java
@@ -27,6 +27,8 @@ public class ExtractConstantTestSuite extends TestSuite {
TestSuite suite = new ExtractConstantTestSuite();
suite.addTest(RefactoringTester.suite("ExtractConstantRefactoringTest",
"resources/refactoring/ExtractConstant.rts"));
+ suite.addTest(RefactoringTester.suite("ExtractConstantHistoryRefactoringTest",
+ "resources/refactoring/ExtractConstantHistory.rts"));
return suite;
}
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractfunction/ExtractFunctionRefactoringTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractfunction/ExtractFunctionRefactoringTest.java
index ad5832fec45..e2929b5fc1f 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractfunction/ExtractFunctionRefactoringTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractfunction/ExtractFunctionRefactoringTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2009 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -40,6 +40,7 @@ public class ExtractFunctionRefactoringTest extends RefactoringTest {
protected int returnParameterIndex;
protected boolean fatalError;
private VisibilityEnum visibility;
+ private static int nr = 1;
/**
* @param name
@@ -53,7 +54,7 @@ public class ExtractFunctionRefactoringTest extends RefactoringTest {
protected void runTest() throws Throwable {
IFile refFile = project.getFile(fileName);
ExtractFunctionInformation info = new ExtractFunctionInformation();
- CRefactoring refactoring = new ExtractFunctionRefactoring( refFile, selection, info);
+ CRefactoring refactoring = new ExtractFunctionRefactoring( refFile, selection, info, cproject);
RefactoringStatus checkInitialConditions = refactoring.checkInitialConditions(NULL_PROGRESS_MONITOR);
if(fatalError){
@@ -62,18 +63,28 @@ public class ExtractFunctionRefactoringTest extends RefactoringTest {
}
else{
assertConditionsOk(checkInitialConditions);
- executeRefactoring(info, refactoring);
+ setValues(info);
+ executeRefactoring(refactoring);
}
}
- private void executeRefactoring(ExtractFunctionInformation info, CRefactoring refactoring) throws CoreException, Exception {
+ protected void executeRefactoring(CRefactoring refactoring) throws CoreException, Exception {
+ RefactoringStatus finalConditions = refactoring.checkFinalConditions(NULL_PROGRESS_MONITOR);
+ assertConditionsOk(finalConditions);
+ Change createChange = refactoring.createChange(NULL_PROGRESS_MONITOR);
+ createChange.perform(NULL_PROGRESS_MONITOR);
+ compareFiles(fileMap);
+ }
+
+ private void setValues(ExtractFunctionInformation info) {
info.setMethodName(methodName);
info.setReplaceDuplicates(replaceDuplicates);
if(info.getInScopeDeclaredVariable() == null){
if(returnValue) {
info.setReturnVariable(info.getAllAfterUsedNames().get(returnParameterIndex));
+ info.getAllAfterUsedNames().get(returnParameterIndex).setUserSetIsReference(false);
}
} else {
info.setReturnVariable( info.getInScopeDeclaredVariable() );
@@ -85,13 +96,6 @@ public class ExtractFunctionRefactoringTest extends RefactoringTest {
name.setUserSetIsReference(name.isReference());
}
}
-
- Change createChange = refactoring.createChange(NULL_PROGRESS_MONITOR);
- RefactoringStatus finalConditions = refactoring.checkFinalConditions(NULL_PROGRESS_MONITOR);
- assertConditionsOk(finalConditions);
- createChange.perform(NULL_PROGRESS_MONITOR);
-
- compareFiles(fileMap);
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractfunction/ExtractFunctionTestSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractfunction/ExtractFunctionTestSuite.java
index 0f9e6a8911f..816fe41c6d6 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractfunction/ExtractFunctionTestSuite.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractfunction/ExtractFunctionTestSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2009 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -29,6 +29,7 @@ public class ExtractFunctionTestSuite extends TestSuite {
suite.addTest(RefactoringTester.suite("Extract Expression", "resources/refactoring/ExtractExpression.rts"));
suite.addTest(RefactoringTester.suite("ExtractMethodPreprocessorRefactoringTests", "resources/refactoring/ExtractMethodPreprocessor.rts"));
suite.addTest(RefactoringTester.suite("Extract Function Templates Tests", "resources/refactoring/ExtractFunctionTemplates.rts"));
+ suite.addTest(RefactoringTester.suite("Extract Method History Test", "resources/refactoring/ExtractMethodHistory.rts"));
return suite;
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractlocalvariable/ExtractLocalVariableRefactoringTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractlocalvariable/ExtractLocalVariableRefactoringTest.java
index c59b91e563b..40555be621b 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractlocalvariable/ExtractLocalVariableRefactoringTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractlocalvariable/ExtractLocalVariableRefactoringTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2009 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -43,7 +43,7 @@ public class ExtractLocalVariableRefactoringTest extends RefactoringTest {
IFile refFile = project.getFile(fileName);
NameNVisibilityInformation info = new NameNVisibilityInformation();
info.setName(variableName);
- CRefactoring refactoring = new ExtractLocalVariableRefactoring( refFile, selection, info);
+ CRefactoring refactoring = new ExtractLocalVariableRefactoring( refFile, selection, info, cproject);
RefactoringStatus checkInitialConditions = refactoring.checkInitialConditions(NULL_PROGRESS_MONITOR);
if(fatalError){
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractlocalvariable/ExtractLocalVariableTestSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractlocalvariable/ExtractLocalVariableTestSuite.java
index dc3f7d36fb4..40bacfe0a48 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractlocalvariable/ExtractLocalVariableTestSuite.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/extractlocalvariable/ExtractLocalVariableTestSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2009 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -28,6 +28,8 @@ public class ExtractLocalVariableTestSuite extends TestSuite {
TestSuite suite = new ExtractLocalVariableTestSuite();
suite.addTest(RefactoringTester.suite("ExtractLocalVariableRefactoringTests",
"resources/refactoring/ExtractLocalVariable.rts"));
+ suite.addTest(RefactoringTester.suite("ExtractLocalVariableRefactoringHistoryTests",
+ "resources/refactoring/ExtractLocalVariableHistory.rts"));
return suite;
}
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/gettersandsetters/GenerateGettersAndSettersTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/gettersandsetters/GenerateGettersAndSettersTest.java
index 7bb838c0647..4cd19b043e3 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/gettersandsetters/GenerateGettersAndSettersTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/gettersandsetters/GenerateGettersAndSettersTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2009 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -52,7 +52,7 @@ public class GenerateGettersAndSettersTest extends RefactoringTest {
@Override
protected void runTest() throws Throwable {
IFile refFile = project.getFile(fileName);
- refactoring = new GenerateGettersAndSettersRefactoring(refFile, selection, null);
+ refactoring = new GenerateGettersAndSettersRefactoring(refFile, selection, null, cproject);
RefactoringStatus initialConditions = refactoring.checkInitialConditions(NULL_PROGRESS_MONITOR);
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/hidemethod/HideMethodRefactoringTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/hidemethod/HideMethodRefactoringTest.java
index 06a4238a0f2..678ac57cb30 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/hidemethod/HideMethodRefactoringTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/hidemethod/HideMethodRefactoringTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2009 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -40,9 +40,7 @@ public class HideMethodRefactoringTest extends RefactoringTest {
protected void runTest() throws Throwable {
IFile refFile = project.getFile(fileWithSelection);
- CRefactoring refactoring = new HideMethodRefactoring(refFile,selection, null);
- try {
- refactoring.lockIndex();
+ CRefactoring refactoring = new HideMethodRefactoring(refFile,selection, null, cproject);
RefactoringStatus checkInitialConditions = refactoring.checkInitialConditions(NULL_PROGRESS_MONITOR);
if(errors > 0) {
assertConditionsError(checkInitialConditions, errors);
@@ -52,7 +50,7 @@ public class HideMethodRefactoringTest extends RefactoringTest {
}else {
assertConditionsOk(checkInitialConditions);
}
-
+
Change createChange = refactoring.createChange(NULL_PROGRESS_MONITOR);
RefactoringStatus finalConditions = refactoring.checkFinalConditions(NULL_PROGRESS_MONITOR);
if(warnings > 0){
@@ -63,10 +61,6 @@ public class HideMethodRefactoringTest extends RefactoringTest {
createChange.perform(NULL_PROGRESS_MONITOR);
compareFiles(fileMap);
- }
- finally {
- refactoring.unlockIndex();
- }
}
@Override
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/hidemethod/HideMethodTestSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/hidemethod/HideMethodTestSuite.java
index 10dd0f5d670..283f530108a 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/hidemethod/HideMethodTestSuite.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/hidemethod/HideMethodTestSuite.java
@@ -27,6 +27,8 @@ public class HideMethodTestSuite extends TestSuite {
TestSuite suite = new HideMethodTestSuite();
suite.addTest(RefactoringTester.suite("HideMethodRefactoringTests",
"resources/refactoring/HideMethod.rts"));
+ suite.addTest(RefactoringTester.suite("HideMethodRefactoringHistoryTests",
+ "resources/refactoring/HideMethodHistory.rts"));
return suite;
}
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/implementmethod/ImplementMethodRefactoringTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/implementmethod/ImplementMethodRefactoringTest.java
index b78474b0f14..f1f1a82b932 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/implementmethod/ImplementMethodRefactoringTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/implementmethod/ImplementMethodRefactoringTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2009 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -42,7 +42,7 @@ public class ImplementMethodRefactoringTest extends RefactoringTest {
IFile refFile = project.getFile(fileName);
- CRefactoring refactoring = new ImplementMethodRefactoring(refFile, selection, null);
+ CRefactoring refactoring = new ImplementMethodRefactoring(refFile, selection, null, cproject);
try {
refactoring.lockIndex();
diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml
index 713f45ea7da..9cd4a99660e 100644
--- a/core/org.eclipse.cdt.ui/plugin.xml
+++ b/core/org.eclipse.cdt.ui/plugin.xml
@@ -1221,7 +1221,10 @@
-
+
+
+
+
+
+
+
+
+