Author: dazarov
Date: 2010-03-28 07:47:43 -0400 (Sun, 28 Mar 2010)
New Revision: 21091
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/ELVariableRefactoringTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4990
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/ELVariableRefactoringTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/ELVariableRefactoringTest.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/ELVariableRefactoringTest.java 2010-03-28
11:47:43 UTC (rev 21091)
@@ -0,0 +1,53 @@
+package org.jboss.tools.jsf.test.refactoring;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.jboss.tools.jsf.el.refactoring.RenameELVariableProcessor;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+import org.jboss.tools.tests.AbstractRefactorTest;
+
+public class ELVariableRefactoringTest extends AbstractRefactorTest {
+ static String projectName = "JSFKickStartProject";
+ static IProject project;
+
+ public ELVariableRefactoringTest(){
+ super("EL Variable Refactoring Test");
+ }
+
+ protected void setUp() throws Exception {
+ project = ProjectImportTestSetup.loadProject(projectName);
+ project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ }
+
+ public void testELVariableRename() throws CoreException {
+ ArrayList<TestChangeStructure> list = new
ArrayList<TestChangeStructure>();
+
+ TestChangeStructure structure = new TestChangeStructure(project.getProject(),
"/WebContent/pages/hello.jsp");
+ TestTextChange change = new TestTextChange(349, 8, "customer");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ structure = new TestChangeStructure(project,
"/WebContent/WEB-INF/faces-config.xml");
+ change = new TestTextChange(409, 8, "customer");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ structure = new TestChangeStructure(project,
"/WebContent/pages/inputUserName.jsp");
+ change = new TestTextChange(494, 8, "customer");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ IFile sourceFile =
project.getProject().getFile("/WebContent/pages/hello.jsp");
+
+ RenameELVariableProcessor processor = new RenameELVariableProcessor(sourceFile,
"user");
+ processor.setNewName("customer");
+
+ checkRename(processor, list);
+ }
+
+}
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/ELVariableRefactoringTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain