Author: akazakov
Date: 2009-05-27 19:24:06 -0400 (Wed, 27 May 2009)
New Revision: 15572
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/.project
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/META-INF/application.xml
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.classpath
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.project
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.project
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamRefactoringAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4351
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF 2009-05-27
23:04:09 UTC (rev 15571)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF 2009-05-27
23:24:06 UTC (rev 15572)
@@ -35,5 +35,6 @@
org.eclipse.jst.jsf.core,
org.eclipse.wst.validation,
org.eclipse.jdt.launching,
- org.eclipse.jdt.ui
+ org.eclipse.jdt.ui,
+ org.eclipse.jst.j2ee;bundle-version="1.1.300"
Bundle-Localization: plugin
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.project
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.project 2009-05-27
23:04:09 UTC (rev 15571)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.project 2009-05-27
23:24:06 UTC (rev 15572)
@@ -22,10 +22,10 @@
</buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.jboss.tools.jsf.jsfnature</nature>
<nature>org.jboss.tools.seam.core.seamnature</nature>
</natures>
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/.project
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/.project 2009-05-27
23:04:09 UTC (rev 15571)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/.project 2009-05-27
23:24:06 UTC (rev 15572)
@@ -3,8 +3,8 @@
<name>Test1-ear</name>
<comment></comment>
<projects>
- <project>Test1-ejb</project>
- <project>Test1</project>
+ <project>seamtestproject-ejb</project>
+ <project>seamtestproject</project>
</projects>
<buildSpec>
<buildCommand>
@@ -12,15 +12,9 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
- <nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
</natures>
-</projectDescription>
+</projectDescription>
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/META-INF/application.xml
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/META-INF/application.xml 2009-05-27
23:04:09 UTC (rev 15571)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/META-INF/application.xml 2009-05-27
23:24:06 UTC (rev 15572)
@@ -3,54 +3,23 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">
-
+
<display-name>t2</display-name>
-
+
<module>
<web>
<web-uri>Test1.war</web-uri>
<context-root>/Test1</context-root>
</web>
</module>
-
+
<module>
<ejb>Test1-ejb.jar</ejb>
</module>
-
+
<!-- Seam and EL -->
<module>
<java>jboss-seam.jar</java>
</module>
- <!-- jBPM -->
- <module>
- <java>jbpm-3.1.4.jar</java>
- </module>
-
- <!-- Drools and dependencies -->
- <module>
- <java>drools-core-3.0.5.jar</java>
- </module>
- <module>
- <java>drools-compiler-3.0.5.jar</java>
- </module>
- <module>
- <java>janino-2.4.3.jar</java>
- </module>
- <module>
- <java>antlr-2.7.6.jar</java>
- </module>
- <module>
- <java>antlr-3.0ea8.jar</java>
- </module>
- <module>
- <java>commons-jci-core-1.0-406301.jar</java>
- </module>
- <module>
- <java>commons-jci-janino-2.4.3.jar</java>
- </module>
- <module>
- <java>stringtemplate-2.3b6.jar</java>
- </module>
-
-</application>
+</application>
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.classpath
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.classpath 2009-05-27
23:04:09 UTC (rev 15571)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.classpath 2009-05-27
23:24:06 UTC (rev 15572)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="ejbModule"/>
- <classpathentry exported="true" kind="con"
path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con"
path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/JBoss
4.2 Runtime"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="build/classes"/>
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.project
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.project 2009-05-27
23:04:09 UTC (rev 15571)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.project 2009-05-27
23:24:06 UTC (rev 15572)
@@ -16,22 +16,22 @@
</arguments>
</buildCommand>
<buildCommand>
- <name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
+ <name>org.jboss.tools.seam.core.seambuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>org.jboss.tools.seam.core.seambuilder</name>
+ <name>org.hibernate.eclipse.console.hibernateBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
- <nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.jboss.tools.seam.core.seamnature</nature>
+ <nature>org.hibernate.eclipse.console.hibernateNature</nature>
</natures>
-</projectDescription>
+</projectDescription>
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-05-27
23:04:09 UTC (rev 15571)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-05-27
23:24:06 UTC (rev 15572)
@@ -482,7 +482,7 @@
refreshProject(project);
int number = getMarkersNumber(component12File);
- assertTrue("Problem marker was found in Component12.java", number == 0);
+ assertEquals("Problem marker was found in Component12.java", 0, number);
// Unknown factory name
System.out.println("Test - Unknown factory name");
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-05-27
23:04:09 UTC (rev 15571)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-05-27
23:24:06 UTC (rev 15572)
@@ -9,6 +9,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.ISeamComponent;
@@ -27,55 +28,52 @@
static IProject ejbProject;
static ISeamProject seamWarProject;
static ISeamProject seamEjbProject;
-
+
public SeamComponentRefactoringTest(){
super("Seam Component Refactoring Test");
}
-
+
protected void setUp() throws Exception {
- if(warProject==null) {
- warProject = ProjectImportTestSetup.loadProject(warProjectName);
- }
- if(seamWarProject==null) {
- seamWarProject = loadSeamProject(warProject);
- }
-
- if(earProject==null) {
- earProject = ProjectImportTestSetup.loadProject(earProjectName);
- }
-
- if(ejbProject==null) {
- ejbProject = ProjectImportTestSetup.loadProject(ejbProjectName);
- }
- if(seamEjbProject==null) {
- seamEjbProject = loadSeamProject(ejbProject);
- }
+ loadProjects();
+ List<IProject> projectList = new ArrayList<IProject>();
+ projectList.add(ejbProject);
+ projectList.add(warProject);
+ J2EEComponentClasspathUpdater.getInstance().forceUpdate(projectList);
+ loadProjects();
}
-
+
+ private void loadProjects() throws Exception {
+ earProject = ProjectImportTestSetup.loadProject(earProjectName);
+ ejbProject = ProjectImportTestSetup.loadProject(ejbProjectName);
+ warProject = ProjectImportTestSetup.loadProject(warProjectName);
+ seamEjbProject = loadSeamProject(ejbProject);
+ seamWarProject = loadSeamProject(warProject);
+ }
+
private ISeamProject loadSeamProject(IProject project) throws CoreException {
JobUtils.waitForIdle();
System.out.println("Project - "+project);
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
assertNotNull("Seam project for " + project.getName() + " is null",
seamProject);
-
+
return seamProject;
}
-
+
public void testSeamComponentRename() throws CoreException {
ArrayList<TestChangeStructure> list = new
ArrayList<TestChangeStructure>();
-
+
TestChangeStructure structure = new TestChangeStructure(ejbProject.getProject(),
"/ejbModule/org/domain/"+warProjectName+"/session/TestComponent.java",
89, 6, "\"best\"");
list.add(structure);
-
+
structure = new TestChangeStructure(warProject,
"/WebContent/WEB-INF/components.xml",
1106, 4, "best");
list.add(structure);
structure = new TestChangeStructure(warProject,
"/WebContent/WEB-INF/components.xml",
1934, 4, "best");
list.add(structure);
-
+
structure = new TestChangeStructure(ejbProject,
"/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
420, 11, "@In(\"best\")");
list.add(structure);
@@ -91,26 +89,26 @@
structure = new TestChangeStructure(ejbProject,
"/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
589, 4, "best");
list.add(structure);
-
+
structure = new TestChangeStructure(ejbProject,
"/ejbModule/seam.properties",
0, 4, "best");
list.add(structure);
-
+
structure = new TestChangeStructure(warProject, "/WebContent/test.xhtml",
1088, 4, "best");
list.add(structure);
-
+
structure = new TestChangeStructure(warProject, "/WebContent/test.jsp",
227, 4, "best");
list.add(structure);
-
+
structure = new TestChangeStructure(warProject,
"/WebContent/test.properties",
29, 4, "best");
list.add(structure);
-
+
renameComponent(seamEjbProject, "test", "best", list);
}
-
+
private void renameComponent(ISeamProject seamProject, String componentName, String
newName, List<TestChangeStructure> changeList) throws CoreException{
// Test before renaming
ISeamComponent component = seamProject.getComponent(componentName);
@@ -129,10 +127,10 @@
RenameComponentProcessor processor = new RenameComponentProcessor(component);
processor.setNewComponentName(newName);
CompositeChange rootChange = (CompositeChange)processor.createChange(new
NullProgressMonitor());
-
+
rootChange.perform(new NullProgressMonitor());
JobUtils.waitForIdle();
-
+
// Test results
assertNull(seamProject.getComponent(componentName));
assertNotNull(seamProject.getComponent(newName));
@@ -144,14 +142,14 @@
assertEquals(changeStructure.getText(), content.substring(changeStructure.getOffset(),
changeStructure.getOffset()+changeStructure.getLength()));
}
}
-
+
class TestChangeStructure{
private IProject project;
private String fileName;
private int offset;
private int length;
private String text;
-
+
public TestChangeStructure(IProject project, String fileName, int offset, int length,
String text){
this.project = project;
this.fileName = fileName;
@@ -159,25 +157,25 @@
this.length = length;
this.text = text;
}
-
+
public IProject getProject(){
return project;
}
-
+
public String getFileName(){
return fileName;
}
-
+
public int getOffset(){
return offset;
}
-
+
public int getLength(){
return length;
}
-
+
public String getText(){
return text;
}
}
-}
+}
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamRefactoringAllTests.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamRefactoringAllTests.java 2009-05-27
23:04:09 UTC (rev 15571)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamRefactoringAllTests.java 2009-05-27
23:24:06 UTC (rev 15572)
@@ -28,8 +28,8 @@
new String[]{"RefactoringTestProject-war",
"RefactoringTestProject-ejb", "RefactoringTestProject-test"}));
suite.addTest(new ProjectImportTestSetup(new
TestSuite(SeamComponentRefactoringTest.class),
"org.jboss.tools.seam.core.test",
- new
String[]{"projects/Test1","projects/Test1-ear","projects/Test1-ejb"},
- new String[]{"Test1","Test1-ear","Test1-ejb"}));
+ new
String[]{"projects/Test1-ear","projects/Test1-ejb","projects/Test1"},
+ new String[]{"Test1-ear","Test1-ejb","Test1"}));
return suite;
}
}
\ No newline at end of file