JBoss Tools SVN: r22426 - trunk/tests.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-28 18:01:54 -0400 (Fri, 28 May 2010)
New Revision: 22426
Modified:
trunk/tests/pom.xml
Log:
add site
Modified: trunk/tests/pom.xml
===================================================================
--- trunk/tests/pom.xml 2010-05-28 22:01:06 UTC (rev 22425)
+++ trunk/tests/pom.xml 2010-05-28 22:01:54 UTC (rev 22426)
@@ -14,6 +14,7 @@
<modules>
<module>features</module>
<module>plugins</module>
+ <module>site</module>
</modules>
</project>
-
\ No newline at end of file
+
14 years, 7 months
JBoss Tools SVN: r22425 - in trunk/common: site and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-28 18:01:06 -0400 (Fri, 28 May 2010)
New Revision: 22425
Added:
trunk/common/site/
trunk/common/site/pom.xml
trunk/common/site/site.xml
Modified:
trunk/common/pom.xml
Log:
add site
Modified: trunk/common/pom.xml
===================================================================
--- trunk/common/pom.xml 2010-05-28 21:53:14 UTC (rev 22424)
+++ trunk/common/pom.xml 2010-05-28 22:01:06 UTC (rev 22425)
@@ -15,6 +15,7 @@
<module>features</module>
<module>plugins</module>
<module>tests</module>
+ <module>site</module>
</modules>
</project>
-
\ No newline at end of file
+
Added: trunk/common/site/pom.xml
===================================================================
--- trunk/common/site/pom.xml (rev 0)
+++ trunk/common/site/pom.xml 2010-05-28 22:01:06 UTC (rev 22425)
@@ -0,0 +1,13 @@
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>common.site</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>eclipse-update-site</packaging>
+</project>
Added: trunk/common/site/site.xml
===================================================================
--- trunk/common/site/site.xml (rev 0)
+++ trunk/common/site/site.xml 2010-05-28 22:01:06 UTC (rev 22425)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <description>To install these features, point Eclipse at this site.</description>
+ <!-- JBoss Tools common Nightly Build Update Site -->
+ <category-def label="JBoss Tools common Nightly Build Update Site" name="JBoss Tools common Nightly Build Update Site">
+ <description>JBoss Tools common Nightly Build Update Site: contains all features in this build.</description>
+ </category-def>
+ <feature url="features/org.jboss.tools.common.all.feature_0.0.0.jar" id="org.jboss.tools.common.all.feature" version="0.0.0">
+ <category name="JBoss Tools common Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.common.core.feature_0.0.0.jar" id="org.jboss.tools.common.core.feature" version="0.0.0">
+ <category name="JBoss Tools common Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.common.feature_0.0.0.jar" id="org.jboss.tools.common.feature" version="0.0.0">
+ <category name="JBoss Tools common Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.common.text.ext.feature_0.0.0.jar" id="org.jboss.tools.common.text.ext.feature" version="0.0.0">
+ <category name="JBoss Tools common Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.common.ui.feature_0.0.0.jar" id="org.jboss.tools.common.ui.feature" version="0.0.0">
+ <category name="JBoss Tools common Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.common.verification.feature_0.0.0.jar" id="org.jboss.tools.common.verification.feature" version="0.0.0">
+ <category name="JBoss Tools common Nightly Build Update Site"/>
+ </feature>
+
+</site>
14 years, 7 months
JBoss Tools SVN: r22424 - in trunk/jmx: site and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-28 17:53:14 -0400 (Fri, 28 May 2010)
New Revision: 22424
Added:
trunk/jmx/site/
trunk/jmx/site/pom.xml
trunk/jmx/site/site.xml
Modified:
trunk/jmx/pom.xml
Log:
add site
Modified: trunk/jmx/pom.xml
===================================================================
--- trunk/jmx/pom.xml 2010-05-28 21:52:35 UTC (rev 22423)
+++ trunk/jmx/pom.xml 2010-05-28 21:53:14 UTC (rev 22424)
@@ -15,6 +15,7 @@
<module>features</module>
<module>plugins</module>
<module>tests</module>
+ <module>site</module>
</modules>
</project>
-
\ No newline at end of file
+
Added: trunk/jmx/site/pom.xml
===================================================================
--- trunk/jmx/site/pom.xml (rev 0)
+++ trunk/jmx/site/pom.xml 2010-05-28 21:53:14 UTC (rev 22424)
@@ -0,0 +1,13 @@
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jmx.site</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>eclipse-update-site</packaging>
+</project>
Added: trunk/jmx/site/site.xml
===================================================================
--- trunk/jmx/site/site.xml (rev 0)
+++ trunk/jmx/site/site.xml 2010-05-28 21:53:14 UTC (rev 22424)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <description>To install these features, point Eclipse at this site.</description>
+ <!-- JBoss Tools jmx Nightly Build Update Site -->
+ <category-def label="JBoss Tools jmx Nightly Build Update Site" name="JBoss Tools jmx Nightly Build Update Site">
+ <description>JBoss Tools jmx Nightly Build Update Site: contains all features in this build.</description>
+ </category-def>
+ <feature url="features/org.jboss.tools.jmx.feature_0.0.0.jar" id="org.jboss.tools.jmx.feature" version="0.0.0">
+ <category name="JBoss Tools jmx Nightly Build Update Site"/>
+ </feature>
+
+</site>
14 years, 7 months
JBoss Tools SVN: r22423 - in trunk/jst: tests/org.jboss.tools.jst.jsp.test/projects and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-28 17:52:35 -0400 (Fri, 28 May 2010)
New Revision: 22423
Removed:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/CAForCompositeComponentTest/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/CAForELinStyleTest/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/CAForIDTest/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide2016Test/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1813Test/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/MissingKBBuilderTest/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/StrutsJbide1648Test/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForCompositeComponentTest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForELinStyleTest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForIDTest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForUnclosedELTest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2016Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java
trunk/jst/tests/org.jboss.tools.jst.text.ext.test/projects/
trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/OpenOnsTest.java
trunk/jst/tests/org.jboss.tools.jst.web.test/projects/TestsWebArtefacts/
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/JsfExtAllTests.java
trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/JstWebAllTests.java
trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext.test/.settings/org.eclipse.jdt.core.prefs
trunk/jst/tests/org.jboss.tools.ui.bot.ext.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
jst component tests fix:
- tests that requires jsf moved to jsf
- manifest errors fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -24,52 +24,63 @@
* @author Viacheslav Kabanovich
*/
public class LibraryScanner implements IFileScanner {
+
+ public static final String FILE_SYSTEMS_PATH = "FileSystems"; //$NON-NLS-1$
+ public static final String FILE_SYSTEM_JAR_PATH = "FileSystemJar"; //$NON-NLS-1$
+ public static final String META_INF_PATH = "META-INF"; //$NON-NLS-1$
+
+ public static final String JAR_SUFFIX = ".jar"; //$NON-NLS-1$
+ public static final String ZIP_SUFFIX = ".zip"; //$NON-NLS-1$
+
//Now it is absolute file on disk
IPath sourcePath = null;
public LibraryScanner() {}
public boolean isRelevant(IFile f) {
- if(EclipseResourceUtil.isJar(f.getName())) return true;
- return false;
+ String name = f.getName().toLowerCase();
+ return name.endsWith(JAR_SUFFIX) || name.endsWith(ZIP_SUFFIX);
}
public boolean isLikelyComponentSource(IFile f) {
XModel model = InnerModelHelper.createXModel(f.getProject());
- if(model == null) return false;
- XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
- if(o == null) return false;
- if(!o.getModelEntity().getName().equals("FileSystemJar")) { //$NON-NLS-1$
- ((FileSystemsImpl)o.getModel().getByPath("FileSystems")).updateOverlapped(); //$NON-NLS-1$
- o = EclipseResourceUtil.getObjectByResource(f);
- if(o == null || !o.getModelEntity().getName().equals("FileSystemJar")) return false; //$NON-NLS-1$
+ boolean result = false;
+ if(model != null) {
+ XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
+ if(o != null) {
+ if(o.getModelEntity().getName().equals(FILE_SYSTEM_JAR_PATH)) {
+ result = isLikelyComponentSource(o);
+ } else {
+ ((FileSystemsImpl)o.getModel().getByPath(FILE_SYSTEMS_PATH)).updateOverlapped();
+ o = EclipseResourceUtil.getObjectByResource(f);
+ result = o != null && o.getModelEntity().getName().equals(FILE_SYSTEM_JAR_PATH);
+ }
+ }
}
- return isLikelyComponentSource(o);
+ return result;
}
public LoadedDeclarations parse(IFile f, IKbProject sp) throws ScannerException {
XModel model = InnerModelHelper.createXModel(f.getProject());
- if(model == null) return null;
XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
- if(o == null) return null;
- if(!o.getModelEntity().getName().equals("FileSystemJar")) { //$NON-NLS-1$
- ((FileSystemsImpl)o.getModel().getByPath("FileSystems")).updateOverlapped(); //$NON-NLS-1$
+ if(!o.getModelEntity().getName().equals(FILE_SYSTEM_JAR_PATH)) {
+ ((FileSystemsImpl)o.getModel().getByPath(FILE_SYSTEMS_PATH)).updateOverlapped();
o = EclipseResourceUtil.getObjectByResource(f);
- if(o == null || !o.getModelEntity().getName().equals("FileSystemJar")) return null; //$NON-NLS-1$
+ if(o == null || !o.getModelEntity().getName().equals(FILE_SYSTEM_JAR_PATH)) return null;
}
return parse(o, f.getFullPath(), sp);
}
public boolean isLikelyComponentSource(XModelObject o) {
if(o == null) return false;
- if(o.getChildByPath("META-INF") != null) return true; //$NON-NLS-1$
+ if(o.getChildByPath(META_INF_PATH) != null) return true;
return false;
}
public LoadedDeclarations parse(XModelObject o, IPath path, IKbProject sp) throws ScannerException {
if(o == null) return null;
sourcePath = path;
- XModelObject metaInf = o.getChildByPath("META-INF"); //$NON-NLS-1$
+ XModelObject metaInf = o.getChildByPath(META_INF_PATH);
if(metaInf == null) return null;
LoadedDeclarations ds = new LoadedDeclarations();
@@ -107,9 +118,6 @@
XMLScanner s = new XMLScanner();
LoadedDeclarations ds1 = s.parse(tld, path, sp);
ds = add(ds, ds1);
- if(ds1 != null && !ds1.isEmpty()) {
- System.out.println(tld.getPath() + ":" + ds1.getLibraries().get(0).getURI());
- }
} else if(tld.getFileType() == XModelObject.FOLDER) {
LoadedDeclarations ds1 = parseInPackages(tld, path, sp);
ds = add(ds, ds1);
@@ -148,7 +156,7 @@
public static boolean isCompositeComponentFile(XModelObject o) {
if(o == null) return false;
String entity = o.getModelEntity().getName();
- if(entity.startsWith(JSF2ResourcesScanner.ENT_COMPOSITE_COMPONENT)) return true; //$NON-NLS-1$
+ if(entity.startsWith(JSF2ResourcesScanner.ENT_COMPOSITE_COMPONENT)) return true;
return false;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -52,6 +52,9 @@
public static final String ATTR_FUNC_NAME = "function-name"; //$NON-NLS-1$
public static final String ATTR_COMPONENT_TYPE = "component-type"; //$NON-NLS-1$
+ public static final String XML_SUFFIX = ".xml";
+ public static final String TLD_SUFFIX = ".tld";
+
public XMLScanner() {}
/**
@@ -61,9 +64,8 @@
* @return
*/
public boolean isRelevant(IFile resource) {
- if(resource.getName().endsWith(".xml")) return true; //$NON-NLS-1$
- if(resource.getName().endsWith(".tld")) return true; //$NON-NLS-1$
- return false;
+ String name = resource.getName().toLowerCase();
+ return name.endsWith(XML_SUFFIX) || name.endsWith(TLD_SUFFIX); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -3,45 +3,23 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.jboss.tools.jst.jsp.test.ca.CAForCompositeComponentTest;
-import org.jboss.tools.jst.jsp.test.ca.CAForELinStyleTest;
-import org.jboss.tools.jst.jsp.test.ca.CAForIDTest;
-import org.jboss.tools.jst.jsp.test.ca.CAForUnclosedELTest;
import org.jboss.tools.jst.jsp.test.ca.Jbide1791Test;
import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1704Test;
import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1717Test;
-import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1807Test;
-import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1813Test;
-import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide2016Test;
-import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide2437Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1585Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1641Test;
-import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1759Test;
-import org.jboss.tools.jst.jsp.test.ca.MissingKBBuilderTest;
-import org.jboss.tools.jst.jsp.test.ca.StrutsJspJbide1648Test;
public class JstJspAllTests {
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.jboss.tools.jst.jsp.test");
- suite.addTestSuite(CAForUnclosedELTest.class);
- suite.addTestSuite(CAForCompositeComponentTest.class);
- suite.addTestSuite(MissingKBBuilderTest.class);
- suite.addTestSuite(JsfJspJbide1807Test.class);
- suite.addTestSuite(CAForIDTest.class);
- suite.addTestSuite(JsfJspJbide1813Test.class);
suite.addTestSuite(JstJspJbide1585Test.class);
- suite.addTestSuite(StrutsJspJbide1648Test.class);
suite.addTestSuite(JstJspJbide1641Test.class);
suite.addTestSuite(JsfJspJbide1704Test.class);
suite.addTestSuite(JsfJspJbide1717Test.class);
- suite.addTestSuite(JstJspJbide1759Test.class);
suite.addTestSuite(Jbide1791Test.class);
- suite.addTestSuite(JsfJspJbide2437Test.class);
suite.addTestSuite(JspPreferencesPageTest.class);
- suite.addTestSuite(JsfJspJbide2016Test.class);
- suite.addTestSuite(CAForELinStyleTest.class);
-
+
return suite;
}
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForCompositeComponentTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForCompositeComponentTest.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForCompositeComponentTest.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,47 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class CAForCompositeComponentTest extends ContentAssistantTestCase{
- TestProjectProvider provider = null;
- boolean makeCopy = true;
- private static final String PROJECT_NAME = "CAForCompositeComponentTest";
- private static final String PAGE_NAME = "/WebContent/pages/greeting.xhtml";
- private static final String TAG_NAME = "/WebContent/resources/sample/tag2.xhtml";
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testCAForCompositeComponent(){
- String[] proposals = {
- "sample:tag", "sample:tag2", "sample:tag3"
- };
-
- checkProposals(PAGE_NAME, "<sample:tag />", 8, proposals, false);
-
- proposals = new String[]{
- "aaa"
- };
- checkProposals(PAGE_NAME, "<sample:tag />", 12, proposals, false);
- }
-
- /**
- * JBIDE-5941
- */
- public void testCAForCCAttrs(){
- String[] proposals = {
- "cc.attrs.a2", "cc.attrs.b3", "cc.attrs.onclick"
- };
-
- checkProposals(TAG_NAME, "#{cc.attrs.}", 11, proposals, false);
-
- }
-}
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForELinStyleTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForELinStyleTest.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForELinStyleTest.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,29 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class CAForELinStyleTest extends ContentAssistantTestCase{
- TestProjectProvider provider = null;
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "CAForELinStyleTest";
- private static final String PAGE_NAME = "/WebContent/pages/greeting.xhtml";
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testCAForELinStyleTest(){
- String[] proposals = {
- "person",
- };
-
- checkProposals(PAGE_NAME, "background-color:#{}", 19, proposals, false);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForIDTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForIDTest.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForIDTest.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,45 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class CAForIDTest extends ContentAssistantTestCase{
- TestProjectProvider provider = null;
- boolean makeCopy = true;
- private static final String PROJECT_NAME = "CAForIDTest";
- private static final String PAGE_NAME = "/WebContent/pages/inputUserName.jsp";
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testCAForIDTest(){
- String[] proposals = {
- "greetingForm",
- };
-
- checkProposals(PAGE_NAME, "<a4j:commandButton focus=\"\"/>", 26, proposals, false, false);
- }
-
- public void testCAForConverterIDTest(){
- String[] proposals = {
- "converter1",
- };
-
- checkProposals(PAGE_NAME, "<h:inputText value=\"#{user.name}\" required=\"true\" converter=\"\">", 61, proposals, false, false);
- }
-
- public void testCAForValidatorIDTest(){
- String[] proposals = {
- "validator1",
- };
-
- checkProposals(PAGE_NAME, "<f:validator validatorId=\"\" />", 26, proposals, false, false);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForUnclosedELTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForUnclosedELTest.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForUnclosedELTest.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,30 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class CAForUnclosedELTest extends ContentAssistantTestCase{
- TestProjectProvider provider = null;
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "CAForELinStyleTest";
- private static final String PAGE_NAME = "/WebContent/pages/greeting.xhtml";
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testCAForUnclosedELTest(){
- String[] proposals = {
- "person",
- };
-
- checkProposals(PAGE_NAME, "<ui:define name=\"pageTitle#{ \"", 30, proposals, false);
- checkProposals(PAGE_NAME, "<ui:define name=\"pageHeader\">Greeting Page#{ </ui:define>", 46, proposals, false);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,35 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class JsfJspJbide1807Test extends ContentAssistantTestCase{
- TestProjectProvider provider = null;
- boolean makeCopy = true;
- private static final String PROJECT_NAME = "JsfJspJbide1807Test";
- private static final String PAGE_NAME = "/WebContent/pages/greeting.xhtml";
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testJsfJspJbide1807Test(){
-
- // JBIDE-4341: the EL proposals are not to be returned (and tested) here anymore.
- // - The EL-proposals are removed from the test-list.
- // - The "/pages" proposal is added as the main case to test
- String[] proposals={
- "/pages/",
- "/templates/",
- "#{}"
- };
-
- checkProposals(PAGE_NAME, "<input type=\"image\" src=\"", 25, proposals, true, true);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,35 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class JsfJspJbide1813Test extends ContentAssistantTestCase{
- TestProjectProvider provider = null;
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "JsfJspJbide1813Test";
- private static final String PAGE_NAME = "/WebContent/pages/greeting.xhtml";
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testJsfJspJbide1813Test(){
-
- // JBIDE-4341: the EL proposals are not to be returned (and tested) here anymore.
- // The EL-proposals are removed from the test-list.
- //
- String[] proposals={
- "ltr",
- "rtl",
- "#{}"
- };
-
- checkProposals(PAGE_NAME, "dir=\"\"", 5, proposals, true);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2016Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2016Test.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2016Test.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,29 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class JsfJspJbide2016Test extends ContentAssistantTestCase{
- TestProjectProvider provider = null;
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "JsfJbide2016Test";
- private static final String PAGE_NAME = "/WebContent/pages/greeting.jsp";
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testJsfJspJbide2016Test(){
- String[] proposals = {
- "user.name",
- };
-
- checkProposals(PAGE_NAME, "value=\"#{user.}\"", 14, proposals, false);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,82 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class JsfJspJbide2437Test extends ContentAssistantTestCase {
- TestProjectProvider provider = null;
-
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "JsfJbide1704Test";
- private static final String PAGE_NAME = "/WebContent/pages/greeting1.xhtml";
-
- public static Test suite() {
- return new TestSuite(JsfJspJbide2437Test.class);
- }
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- provider.dispose();
- }
-
- public void testJsfJspJbide2437 () throws BadLocationException {
- openEditor(PAGE_NAME);
- JobUtils.waitForIdle();
- ICompletionProposal[] result= null;
- String errorMessage = null;
-
- IRegion reg = new FindReplaceDocumentAdapter(document).find(0, "/templates/common.xhtml", true, true, false, false);
-
- IContentAssistProcessor p= TestUtil.getProcessor(viewer, reg.getOffset(), contentAssistant);
- assertNotNull("Cannot obtain IContentAssistProcessor instance",p);
- result= p.computeCompletionProposals(viewer, reg.getOffset());
-
- boolean bELProposalsFound = false;
- boolean bTemplatePathProposalsFound = false;
- for (int k = 0; result != null && k < result.length &&
- (!bELProposalsFound || !bTemplatePathProposalsFound); k++) {
- if (result[k] instanceof AutoContentAssistantProposal) {
- AutoContentAssistantProposal proposal = (AutoContentAssistantProposal)result[k];
-
- // Test the display string for the proposals - it has to shown the thmplate path beginning or EL-expression beginning
- // because the CA is started the calculation from the very beginning of the attribute value.
- String dispString = proposal.getDisplayString();
-
- assertFalse("The CA proposal returned NULL display string.", (dispString == null));
-
- if (dispString.startsWith("#{") || dispString.startsWith("${")) {
- bELProposalsFound = true;
- } else if (dispString.indexOf("/") != -1) {
- bTemplatePathProposalsFound = true;
- }
- }
- }
-
- // There should be proposals for template paths
- assertTrue("Content Assistant peturned no proposals for template paths.", bTemplatePathProposalsFound);
- // There should be proposals for EL-expresions
-
- // JBIDE-4341: JstJspAllTests/testJsfJspJbide1813Test failing with missing applicationScope in completions
- // Due to the current EL-prompting rules there is no EL-proposals allowed if there are no EL-starting char
- // sequence in the text. So, The following code line is commented out. This is the subject to rollback in the future.
- //
-// assertTrue("Content Assistant peturned no proposals for EL.", bELProposalsFound);
-
- closeEditor();
- }
-
-}
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,148 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.TestProjectProvider;
-/**
- * JBIDE-4341 JstJspAllTests/testJsfJspJbide1813Test failing with missing applicationScope in completions
- *
- * The #{ characters are added to INSERTION_BEGIN_STRING, but it is a subject to rollback in the future.
- * The current EL-prompting rules don't allow to call prompting on EL when there is no EL-starting
- * char sequence in the text. This doing this test to be completely useless.
- *
- * @author Jeremy
- *
- */
-public class JstJspJbide1759Test extends ContentAssistantTestCase {
- TestProjectProvider provider = null;
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "JsfJbide1704Test";
- private static final String PAGE_NAME = "/WebContent/pages/greeting";
- private static final String[] PAGE_EXTS = {".jsp", ".xhtml"};
- private static final String INSERT_BEFORE_STRING = "<h:outputText";
- private static final String INSERTION_BEGIN_STRING = "<h:outputText value=\"#{";
- private static final String INSERTION_END_STRING = "\" />";
- private static final String WHITESPACE_INSERTION_STRING = "";
-
- public static Test suite() {
- return new TestSuite(JstJspJbide1759Test.class);
- }
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testJstJspJbide1759() {
- try {
- JobUtils.waitForIdle();
- } catch (Exception e) {
- e.printStackTrace();
- }
- assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
-
- for (int i = 0; i < PAGE_EXTS.length; i++) {
- testJstJspJbide1759(PAGE_NAME + PAGE_EXTS[i]);
- }
- }
-
- private void testJstJspJbide1759(String pageName) {
-
- openEditor(pageName);
-
- // Find start of <h:outputText> tag
- String documentContent = document.get();
- int start = (documentContent == null ? -1 : documentContent.indexOf(INSERT_BEFORE_STRING));
-
- assertTrue("Cannot find the starting point in the test file \"" + pageName + "\"", (start != -1));
-
- // First of all perform the test on a region placed in one space behind empty-valued attribute -
- // this is to return normal list of attribute names proposal list
-
- String documentContentModified = documentContent.substring(0, start) +
- INSERTION_BEGIN_STRING + WHITESPACE_INSERTION_STRING + INSERTION_END_STRING + documentContent.substring(start);
-
- int offsetToTest = start + INSERTION_BEGIN_STRING.length();
-
-
- jspTextEditor.setText(documentContentModified);
-
- ICompletionProposal[] result= null;
- String errorMessage = null;
-
- IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
- if (p != null) {
- try {
- result= p.computeCompletionProposals(viewer, offsetToTest);
- } catch (Throwable x) {
- x.printStackTrace();
- }
- errorMessage= p.getErrorMessage();
- }
-
-
- List<String> customCompletionProposals = new ArrayList<String>();
- for (int i = 0; i < result.length; i++) {
- // There should be at least one proposal of type CustomCompletionProposal in the result
- if (result[i] instanceof CustomCompletionProposal) {
- customCompletionProposals.add(((CustomCompletionProposal)result[i]).getReplacementString());
- }
- }
- assertFalse("Content Assistant returned no proposals of type CustomCompletionProposal.",customCompletionProposals.isEmpty());
-
- try {
- JobUtils.waitForIdle();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
-
- // Next perform the test on a region placed in one space behind an attribute those value is a container
- // (contains JSF expression) - this has to return the same normal list of attribute names proposal list as
- // we got at the first step (because the tag is the same, but only the attribute value is changed)
-
- documentContentModified = documentContent.substring(0, start) +
- INSERTION_BEGIN_STRING + INSERTION_END_STRING + documentContent.substring(start);
-
- offsetToTest = start + INSERTION_BEGIN_STRING.length();
-
- jspTextEditor.setText(documentContentModified);
-
- p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
- if (p != null) {
- try {
- result= p.computeCompletionProposals(viewer, offsetToTest);
- } catch (Throwable x) {
- x.printStackTrace();
- }
- errorMessage= p.getErrorMessage();
- }
-
- for (int i = 0; i < result.length; i++) {
- // There should be the same proposals as in the saved result
- if (result[i] instanceof CustomCompletionProposal) {
- assertTrue("Content Assistant returned additional proposal (proposal returned doesn't exist in the saved list).",
- customCompletionProposals.contains(((CustomCompletionProposal)result[i]).getReplacementString()));
- customCompletionProposals.remove(((CustomCompletionProposal)result[i]).getReplacementString());
- }
- }
- assertTrue("Content Assistant didn't return some of the required proposals.",customCompletionProposals.isEmpty());
-
- closeEditor();
- }
-}
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,61 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class MissingKBBuilderTest extends ContentAssistantTestCase{
- TestProjectProvider provider = null;
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "MissingKBBuilderTest";
- private static final String PAGE_NAME = "/WebContent/pages/inputname.xhtml";
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testCAForIDTest(){
- String[] proposals = {
- "resources"
- };
-
- ICompletionProposal[] ps = checkProposals(PAGE_NAME, "<f:loadBundle basename=\"\" var=\"msg\" />", 24);
- System.out.println("-1->" + (ps == null ? 0 : ps.length));
- JobUtils.waitForIdle(2000);
- ps = checkProposals(PAGE_NAME, "<f:loadBundle basename=\"\" var=\"msg\" />", 24, proposals, false);
- System.out.println("-2->" + (ps == null ? 0 : ps.length));
- }
-
- protected ICompletionProposal[] checkProposals(String fileName, String substring, int offset){
- openEditor(fileName);
-
- int position = 0;
- if (substring != null) {
- String documentContent = document.get();
- position = documentContent.indexOf(substring);
- }
-
- ICompletionProposal[] result = null;
-
- IContentAssistProcessor p = TestUtil.getProcessor(viewer, position + offset, contentAssistant);
- if (p != null) {
- try {
- result = p.computeCompletionProposals(viewer, position + offset);
- } catch (Throwable x) {
- x.printStackTrace();
- }
- }
-
- return result;
- }
-
-}
\ No newline at end of file
Deleted: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,75 +0,0 @@
-package org.jboss.tools.jst.jsp.test.ca;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class StrutsJspJbide1648Test extends ContentAssistantTestCase {
- TestProjectProvider provider = null;
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "StrutsJbide1648Test";
- private static final String[] PAGE_NAMES = {
- "/WebContent/pages/a.jsp",
- "/WebContent/pages/a.xhtml"
- };
-
- public static Test suite() {
- return new TestSuite(StrutsJspJbide1648Test.class);
- }
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testStrutsJspJbide1648() {
- try {
- JobUtils.waitForIdle();
- } catch (Exception e) {
- e.printStackTrace();
- }
- assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
-
- for (int i = 0; i < PAGE_NAMES.length; i++) {
- doTestOnPage(PAGE_NAMES[i]);
- }
-
- }
-
- private void doTestOnPage(String pageName) {
- openEditor(pageName);
-
- ICompletionProposal[] result= null;
- String errorMessage = null;
-
- try {
- IContentAssistProcessor p= TestUtil.getProcessor(viewer, 0, contentAssistant);
- if (p != null) {
- result= p.computeCompletionProposals(viewer, 0);
- errorMessage= p.getErrorMessage();
- }
-
- } catch (Throwable x) {
- x.printStackTrace();
- if (x instanceof NullPointerException) {
- assertTrue("Content Assistant failed with NullPointerException", false);
- } else {
- assertTrue("Content Assistant failed with exception: \n" + x.getLocalizedMessage(), false);
- }
- }
-
- closeEditor();
-
- }
-}
Modified: trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/JsfExtAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/JsfExtAllTests.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/JsfExtAllTests.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -7,16 +7,21 @@
public class JsfExtAllTests {
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for default package");
- //$JUnit-BEGIN$
-
- suite.addTest(new ProjectImportTestSetup(new TestSuite(OpenOnsTest.class),
- "org.jboss.tools.jst.text.ext.test",
- new String[]{"projects/HiperlinksTestProject"},
- new String[]{"HiperlinksTestProject"}));
+
+ // all tests were moved to jst.ui.test plugin
+ public void testJsfTextExt () {
- //$JUnit-END$
- return suite;
}
+// public static Test suite() {
+// TestSuite suite = new TestSuite("Test for default package");
+// //$JUnit-BEGIN$
+//
+// suite.addTest(new ProjectImportTestSetup(new TestSuite(OpenOnsTest.class),
+// "org.jboss.tools.jst.text.ext.test",
+// new String[]{"projects/HiperlinksTestProject"},
+// new String[]{"HiperlinksTestProject"}));
+//
+// //$JUnit-END$
+// return suite;
+// }
}
Deleted: trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/OpenOnsTest.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/OpenOnsTest.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,575 +0,0 @@
-package org.jboss.tools.jst.text.ext.test;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.EditorPart;
-import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
-import org.jboss.tools.common.model.ui.editors.multipage.DefaultMultipageEditor;
-import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
-import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.WorkbenchUtils;
-
-public class OpenOnsTest extends TestCase {
-
- public static final String OPENON_TEST_PROJECT = "HiperlinksTestProject";
-
-
- public IProject project = null;
-
- protected void setUp() {
- project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- OPENON_TEST_PROJECT);
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
- JobUtils.waitForIdle();
- IWorkbench workbench = PlatformUI.getWorkbench();
- }
-
- protected void tearDown() {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
- }
-
- public OpenOnsTest() {
- super("styleClass OpenOn tests");
- }
-
- public static final String WEB_XML_FILE_PATH = OPENON_TEST_PROJECT+"/WebContent/WEB-INF/web.xml";
-
- public void testFilterNameOpenOn() throws PartInitException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(WEB_XML_FILE_PATH);
- editor = ((EditorPartWrapper)editor).getEditor();
- JobUtils.waitForIdle();
- DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
- xmlMultyPageEditor.selectPageByName("Source");
- ISourceViewer viewer = xmlMultyPageEditor.getSourceEditor().getTextViewer();
-
- IDocument document = viewer.getDocument();
- IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
- "Filter1", true, true, false, false);
- reg = new FindReplaceDocumentAdapter(document).find(reg.getOffset()+reg.getLength()+1,
- "Filter1", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
- assertEquals("<filter-name>", selection.getText());
- }
-
- public void testRoleNameOpenOn() throws PartInitException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(WEB_XML_FILE_PATH);
- editor = ((EditorPartWrapper)editor).getEditor();
- JobUtils.waitForIdle();
- DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
- xmlMultyPageEditor.selectPageByName("Source");
- ISourceViewer viewer = xmlMultyPageEditor.getSourceEditor().getTextViewer();
-
- IDocument document = viewer.getDocument();
- IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
- "Designer", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
- assertEquals("<role-name>", selection.getText());
- }
-
- public void testServletNameOpenOn() throws PartInitException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(WEB_XML_FILE_PATH);
- editor = ((EditorPartWrapper)editor).getEditor();
- JobUtils.waitForIdle();
- DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
- xmlMultyPageEditor.selectPageByName("Source");
- ISourceViewer viewer = xmlMultyPageEditor.getSourceEditor().getTextViewer();
-
- IDocument document = viewer.getDocument();
- IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
- "Faces Servlet", true, true, false, false);
- reg = new FindReplaceDocumentAdapter(document).find(reg.getOffset()+reg.getLength()+1,
- "Faces Servlet", true, true, false, false);
- reg = new FindReplaceDocumentAdapter(document).find(reg.getOffset()+reg.getLength()+1,
- "Faces Servlet", true, true, false, false);
- reg = new FindReplaceDocumentAdapter(document).find(reg.getOffset()+reg.getLength()+1,
- "Faces Servlet", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
- assertEquals("<servlet-name>", selection.getText());
- }
-
- public static final String TAGLIB_URI_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/tldUriHyperlinkTests.jsp";
-
- public void testTaglibUriFromJarOpenOn() throws BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(TAGLIB_URI_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
- IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
- IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
- "jsf/core", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- System.out.println(fileName);
- assertTrue("jsf_core.tld".equals(fileName));
- }
- public static final String TAGLIB_URI_JSP_ROOT_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/jspTagsHyperlinkTests.jsp";
-
- public void testTaglibUriFromJarinJspRootOpenOn() throws BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(TAGLIB_URI_JSP_ROOT_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
- IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
- IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
- "jsf/core", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
-
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- System.out.println(fileName);
- assertTrue("jsf_core.tld".equals(fileName));
- }
-
- public static final String STYLE_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/styleHyperlinkTests.jsp";
- public static final String CSS1_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/stylesheet/style1.css";
- public static final String CSS2_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/stylesheet/style2.css";
-
- public void testStylesheetOpenOn() throws BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(STYLE_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
- IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
- IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
- "stylesheet/style1.css", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- assertTrue("style1.css".equals(fileName));
- }
-
- public void testStyleClassOpenOns() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(STYLE_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
- IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
- IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
- "style-class9\"", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- assertTrue("styleHyperlinkTests.jsp".equals(fileName));
-
- reg = new FindReplaceDocumentAdapter(document).find(0,
- "style-class3", true, true, false, false);
- links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- fileName = editor.getEditorInput().getName();
- assertTrue("style1.css".equals(fileName));
-
- reg = new FindReplaceDocumentAdapter(document).find(0,
- "style-class6", true, true, false, false);
- links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- links[0].open();
- JobUtils.waitForIdle();
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- fileName = editor.getEditorInput().getName();
- assertTrue("style2.css".equals(fileName));
- }
-
- public static final String CLASS_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/classHyperlinkTests.jsp";
- public static final String CLASS1_TEST_FILE = OPENON_TEST_PROJECT + "/JavaSource/org/jboss/test/ChangeListenerInstance.java";
-
- public void testClassNameOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(CLASS_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "org.jboss.tools.test.ChangeListenerInstance", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- assertTrue("ChangeListenerInstance.java".equals(fileName));
- }
-
- public void testTaglibTagNameOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(CLASS_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "view", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- System.out.println(links[0].getClass().getName());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- assertTrue("jsf_core.tld".equals(fileName));
- }
-
- public static final String USE_BEAN_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/beanHyperlinkTests.jsp";
-
- public void testUseBeanClassOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(USE_BEAN_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "b1", true, true, false, false);
- reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(reg.getOffset()+reg.getLength(),
- "b1", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
- assertEquals("<jsp:useBean id=\"b1\" class=\"org.jboss.tools.test.TestBean1\">", selection.getText());
-
- reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "org.jboss.tools.test.TestBean1", true, true, false, false);
- links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- String fileName = editor.getEditorInput().getName();
- assertTrue("TestBean1.java".equals(fileName));
- }
-
- public void testGetBeanPropertyOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(USE_BEAN_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "property1", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
-
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- String fileName = editor.getEditorInput().getName();
- assertTrue("TestBean1.java".equals(fileName));
- }
-
- public void testSetBeanPropertyOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(USE_BEAN_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "property2", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
-
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- String fileName = editor.getEditorInput().getName();
- assertTrue("TestBean1.java".equals(fileName));
- }
-
- public static final String FORWARD_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/forwardHiperlinkTests.jsp";
-
-
- public void testJspForwardOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(FORWARD_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(viewer.getDocument()).find(0,
- "forward/forwardHiperlinkPage2Tests.jsp", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- assertTrue("forwardHiperlinkPage2Tests.jsp".equals(fileName));
-
- reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "forwardHiperlinkPage1Tests.jsp", true, true, false, false);
- links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
-
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- fileName = editor.getEditorInput().getName();
- assertTrue("forwardHiperlinkPage1Tests.jsp".equals(fileName));
- }
-
- public static final String INCLUDE_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/includeHiperlinkTests.jsp";
-
-
- public void testJspIncludeOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(INCLUDE_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "include/includeHiperlinkPage2Tests.jsp", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- assertTrue("includeHiperlinkPage2Tests.jsp".equals(fileName));
-
- reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "includeHiperlinkPage1Tests.jsp", true, true, false, false);
- links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- fileName = editor.getEditorInput().getName();
- assertTrue("includeHiperlinkPage1Tests.jsp".equals(fileName));
- }
-
- public static final String FACELETS_XHTML_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/faceletsHiperlinkTests.xhtml";
-
-
- public void testJspXmlElementNameOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(FACELETS_XHTML_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "message", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- assertTrue("html_basic.tld".equals(fileName));
- }
-
- public static final String JSP_XMLNS_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/jspXmlFormatTests.jsp";
-
-
- public void testJspXmlnsNameOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(FACELETS_XHTML_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "http://java.sun.com/jsf/html", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- assertTrue("html_basic.tld".equals(fileName));
- }
-
- public static final String TLD_ATTRIBUTE_NAME_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/WEB-INF/tldAttributeNameOpenOnTests.tld";
-
- public void testTldAttributeNameOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(TLD_ATTRIBUTE_NAME_TEST_FILE);
- assertTrue(editor instanceof DefaultMultipageEditor);
- DefaultMultipageEditor tldEditor = (DefaultMultipageEditor) editor;
- tldEditor.selectPageByName("Source");
- ISourceViewer viewer = tldEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(tldEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "attr1", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
- assertEquals("<name>", selection.getText());
- }
-
- public static final String FACELET_TAGLIB_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/WEB-INF/faceletTaglibOpenOnTests.taglib.xml";
-
- public void testFaceletTaglibTypeOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(FACELET_TAGLIB_TEST_FILE);
- editor = ((EditorPartWrapper)editor).getEditor();
- JobUtils.waitForIdle();
- DefaultMultipageEditor faceletEditor = (DefaultMultipageEditor) editor;
- faceletEditor.selectPageByName("Source");
- ISourceViewer viewer = faceletEditor.getSourceEditor().getTextViewer();
-
- // find a region that matches <type>java.lang.String</type>
- IRegion reg = new FindReplaceDocumentAdapter(faceletEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "java.lang.String", true, true, false, false);
-
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length != 0);
-
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- String title = editor.getTitle();
- assertTrue("java.lang.String declaration should be opened, but \'" + title + "\' is actially openned in active editor",
- title.startsWith("String."));
- }
-
- public static final String XHTML_STYLE_CLASS_NAME_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/xhtmlStyleClassHiperlinkTests.xhtml";
-
-
- public void testFacletsStyleClassOpenOnJbide2890() throws BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(XHTML_STYLE_CLASS_NAME_TEST_FILE);
- assertTrue(editor instanceof JSPMultiPageEditor);
- JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
- ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-
- IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "style-class1", true, true, false, false);
- IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- assertNotNull(links);
- assertTrue(links.length!=0);
- //assertNotNull(links[0].getHyperlinkText());
- assertNotNull(links[0].toString());
- links[0].open();
- JobUtils.waitForIdle();
- editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-
- String fileName = editor.getEditorInput().getName();
- assertTrue("style1.css".equals(fileName));
- }
-}
Modified: trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/JstWebAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/JstWebAllTests.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/JstWebAllTests.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -17,7 +17,7 @@
public static Test suite() {
TestSuite suite = new TestSuite(JstWebAllTests.class.getName());
- suite.addTest(WebContentAssistProviderTest.suite());
+ suite.addTestSuite(WebContentAssistProviderTest.class);
return suite;
}
}
\ No newline at end of file
Modified: trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java 2010-05-28 21:52:35 UTC (rev 22423)
@@ -27,63 +27,15 @@
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.TestProjectProvider;
-
+/**
+ * Tests were moved to jsf.test plugin to fix tycho junit test errors
+ * @author eskimo
+ *
+ */
public class WebContentAssistProviderTest extends TestCase {
- TestProjectProvider provider = null;
- IProject project = null;
- boolean makeCopy = true;
- XModel projectModel;
- WebPromptingProvider webPromptingProvider;
-
- public static Test suite() {
- return new TestSuite(WebContentAssistProviderTest.class);
- }
-
- public void testTlds() {
- // Wait all the builders to finish
- JobUtils.waitForIdle(2000);
-
- List tldList = webPromptingProvider.getList(projectModel, WebPromptingProvider.JSF_GET_TAGLIBS, "", null);
- assertTrue("TLD list does not contain expected TLD in XModel.", tldList.contains("http://jboss.com/products/seam/taglib"));
- }
-
- public void testJsfBeanPropertyList() {
- // seam beans list
- List beanList = webPromptingProvider.getList(projectModel, WebPromptingProvider.JSF_BEAN_PROPERTIES, "facesManagedBean", new Properties());
- assertTrue("Bean property list does not contain Managed bean property in XModel.", beanList.contains("property1"));
- }
-
- public void testBundles() {
- // bundle name list
- List bundleList = webPromptingProvider.getList(projectModel, WebPromptingProvider.JSF_BUNDLES, "", null);
- assertTrue("Bundle name list does not contain expected name in XModel.", bundleList.contains("org.jboss.seam.example.numberguess.test"));
- // bundle property list
- List bundlePropertyList = webPromptingProvider.getList(projectModel, WebPromptingProvider.JSF_BUNDLE_PROPERTIES, "org.jboss.seam.example.numberguess.test", null);
- assertTrue("Bundle property list does not contain expected property in XModel.", bundlePropertyList.contains("bundleProperty1"));
- }
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jst.web.test", null, "TestsWebArtefacts", makeCopy);
- project = provider.getProject();
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- project.build(IncrementalProjectBuilder.FULL_BUILD,null);
- XModelObject xmo = EclipseResourceUtil.getObjectByResource(project);
- assertNotNull("Can't get XModel Object for test project.", xmo);
- projectModel = xmo.getModel();
- Watcher.getInstance(projectModel).forceUpdate();
- projectModel.update();
- assertNotNull("Can't get XModel for test project.", projectModel);
-
- // Wait all the builders to finish
- JobUtils.waitForIdle(2000);
+ public void testJstComponentRelatedFunctionality() {
- webPromptingProvider = WebPromptingProvider.getInstance();
}
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
}
\ No newline at end of file
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext.test/.settings/org.eclipse.jdt.core.prefs 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext.test/.settings/org.eclipse.jdt.core.prefs 2010-05-28 21:52:35 UTC (rev 22423)
@@ -1,4 +1,4 @@
-#Mon Aug 31 15:12:26 CEST 2009
+#Fri May 28 11:59:32 PDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext.test/META-INF/MANIFEST.MF 2010-05-28 20:44:53 UTC (rev 22422)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext.test/META-INF/MANIFEST.MF 2010-05-28 21:52:35 UTC (rev 22423)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: WebService SWTBot Tests
Bundle-SymbolicName: org.jboss.tools.ws.ui.bot.test
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 3.1.0.qualifier
Bundle-Activator: org.jboss.tools.ui.bot.ext.test.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
14 years, 7 months
JBoss Tools SVN: r22422 - trunk/jmx/releng/maps.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-28 16:44:53 -0400 (Fri, 28 May 2010)
New Revision: 22422
Modified:
trunk/jmx/releng/maps/project.map
Log:
remove interative test
Modified: trunk/jmx/releng/maps/project.map
===================================================================
--- trunk/jmx/releng/maps/project.map 2010-05-28 20:44:33 UTC (rev 22421)
+++ trunk/jmx/releng/maps/project.map 2010-05-28 20:44:53 UTC (rev 22422)
@@ -6,4 +6,3 @@
plugin@org.jboss.tools.jmx.ui=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.ui
plugin@org.jboss.tools.jmx.core.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.core.test
plugin@org.jboss.tools.jmx.ui.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.ui.test
-plugin@org.jboss.tools.jmx.ui.test.interactive=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.ui.test.interactive
14 years, 7 months
JBoss Tools SVN: r22421 - trunk/jmx/releng/psfs.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-28 16:44:33 -0400 (Fri, 28 May 2010)
New Revision: 22421
Modified:
trunk/jmx/releng/psfs/project.subclipse.psf
trunk/jmx/releng/psfs/project.subversive.psf
Log:
remove interative test
Modified: trunk/jmx/releng/psfs/project.subclipse.psf
===================================================================
--- trunk/jmx/releng/psfs/project.subclipse.psf 2010-05-28 20:37:34 UTC (rev 22420)
+++ trunk/jmx/releng/psfs/project.subclipse.psf 2010-05-28 20:44:33 UTC (rev 22421)
@@ -9,6 +9,5 @@
<project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/plugins/org.j..."/>
<project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
<project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
</provider>
</psf>
Modified: trunk/jmx/releng/psfs/project.subversive.psf
===================================================================
--- trunk/jmx/releng/psfs/project.subversive.psf 2010-05-28 20:37:34 UTC (rev 22420)
+++ trunk/jmx/releng/psfs/project.subversive.psf 2010-05-28 20:44:33 UTC (rev 22421)
@@ -9,6 +9,5 @@
<project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/plugins/org.j..."/>
<project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
<project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
</provider>
</psf>
14 years, 7 months
JBoss Tools SVN: r22420 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-05-28 16:37:34 -0400 (Fri, 28 May 2010)
New Revision: 22420
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
Log:
https://jira.jboss.org/browse/JBIDE-6386
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2010-05-28 20:18:43 UTC (rev 22419)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2010-05-28 20:37:34 UTC (rev 22420)
@@ -80,7 +80,7 @@
IAnnotation annotation = annotatable.getAnnotation(CDIConstants.INJECT_ANNOTATION_TYPE_NAME);
if (annotation == null)
return;
- IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element);
+ IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element, 0);
if(injectionPoint != null){
Set<IBean> resultBeanSet = cdiProject.getBeans(injectionPoint);
List<IBean> resultBeanList = CDIUtil.sortBeans(resultBeanSet);
14 years, 7 months
JBoss Tools SVN: r22419 - trunk.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-28 16:18:43 -0400 (Fri, 28 May 2010)
New Revision: 22419
Modified:
trunk/parent-pom.xml
Log:
add wtp helios site
Modified: trunk/parent-pom.xml
===================================================================
--- trunk/parent-pom.xml 2010-05-28 20:11:39 UTC (rev 22418)
+++ trunk/parent-pom.xml 2010-05-28 20:18:43 UTC (rev 22419)
@@ -168,8 +168,8 @@
</issueManagement>
<profiles>
- <!-- TODO: verify that this profile overrides the default profile if BUILD_NUMBER is
- set (by a Hudson job) -->
+ <!-- TODO: verify that this profile overrides the default profile if BUILD_NUMBER
+ is set (by a Hudson job) -->
<profile>
<id>hudson</id>
<activation>
@@ -184,7 +184,8 @@
<artifactId>maven-osgi-packaging-plugin</artifactId>
<version>${tychoVersion}</version>
<configuration>
- <format>'v'yyyyMMdd-HHmm'-H${BUILD_NUMBER}-${BUILD_ALIAS}'</format>
+ <format>'v'yyyyMMdd-HHmm'-H${BUILD_NUMBER}-${BUILD_ALIAS}'
+ </format>
<archiveSite>true</archiveSite>
</configuration>
</plugin>
@@ -211,6 +212,17 @@
</releases>
</repository>
<repository>
+ <id>webtools32</id>
+ <url>http://download.eclipse.org/webtools/repository/helios</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ <repository>
<id>eclipse36</id>
<url>http://download.eclipse.org/eclipse/updates/3.6/</url>
<layout>p2</layout>
14 years, 7 months
JBoss Tools SVN: r22417 - in trunk/seam: plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-28 15:40:10 -0400 (Fri, 28 May 2010)
New Revision: 22417
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
Log:
Performance fix for seam.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -10,17 +10,14 @@
******************************************************************************/
package org.jboss.tools.seam.core;
-import java.io.IOException;
import java.util.Map;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.SeamResourceVisitor;
@@ -30,123 +27,55 @@
import org.jboss.tools.seam.internal.core.scanner.xml.XMLScanner;
public class SeamCoreBuilder extends IncrementalProjectBuilder {
+
public static String BUILDER_ID = "org.jboss.tools.seam.core.seambuilder"; //$NON-NLS-1$
-
- SeamResourceVisitor resourceVisitor = null;
-
- SeamProject getSeamProject() {
- IProject p = getProject();
- if(p == null) return null;
- return (SeamProject)SeamCorePlugin.getSeamProject(p, false);
- }
-
- SeamResourceVisitor getResourceVisitor() {
- if(resourceVisitor == null) {
- SeamProject p = getSeamProject();
- resourceVisitor = new SeamResourceVisitor(p);
- }
- return resourceVisitor;
- }
-
- class SampleDeltaVisitor implements IResourceDeltaVisitor {
- /*
- * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
- */
- public boolean visit(IResourceDelta delta) throws CoreException {
- IResource resource = delta.getResource();
- switch (delta.getKind()) {
- case IResourceDelta.ADDED:
- return getResourceVisitor().getVisitor().visit(resource);
- case IResourceDelta.REMOVED:
- SeamProject p = getSeamProject();
- if(p != null) p.pathRemoved(resource.getFullPath());
- break;
- case IResourceDelta.CHANGED:
- return getResourceVisitor().getVisitor().visit(resource);
- }
- //return true to continue visiting children.
- return true;
- }
- }
-
+
/**
* @see org.eclipse.core.resource.InternalProjectBuilder#build(int,
* java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
*/
protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
throws CoreException {
- SeamProject sp = getSeamProject();
- if(sp == null) {
- return null;
- }
-
- if(sp.hasNoStorage()) {
- kind = FULL_BUILD;
- }
+ SeamProject seamProject = (SeamProject)SeamCorePlugin.getSeamProject(getProject(), false);
+ SeamResourceVisitor resourceVisitor = new SeamResourceVisitor(seamProject);
long begin = System.currentTimeMillis();
- sp.postponeFiring();
-
+ seamProject.postponeFiring();
+
try {
-
- sp.resolveStorage(kind != FULL_BUILD);
-
- if(sp.getClassPath().update()) {
- sp.getClassPath().process();
- } else if(sp.getClassPath().hasToUpdateProjectDependencies()) {
- sp.getClassPath().validateProjectDependencies();
- }
+ seamProject.build();
TypeInfoCollector.cleanCache();
- if (kind == FULL_BUILD) {
- fullBuild(monitor);
- } else {
- IResourceDelta delta = getDelta(getProject());
- if (delta == null) {
- fullBuild(monitor);
- } else {
- incrementalBuild(delta, monitor);
+ IResourceDelta delta = getDelta(getProject());
+
+ if (seamProject.hasNoStorage() || delta == null ) {
+ IPath[] paths = resourceVisitor.getPathsToVisit();
+ for (IPath iPath : paths) {
+ getProject().findMember(iPath.removeFirstSegments(1)).accept(resourceVisitor);
}
+ } else {
+ delta.accept(resourceVisitor);
}
+
long end = System.currentTimeMillis();
- sp.fullBuildTime += end - begin;
- try {
- sp.store();
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(NLS.bind(SeamCoreMessages.SeamCoreBuilder_1,sp.getProject().getName()), e); //$NON-NLS-1$
- }
-
- sp.postBuild();
-
+ seamProject.fullBuildTime += end - begin;
+ seamProject.postBuild();
+
} finally {
- sp.fireChanges();
+ seamProject.fireChanges();
}
-
+ // Check if we need to return something here instead of null
return null;
}
- protected void fullBuild(final IProgressMonitor monitor)
- throws CoreException {
- try {
- getProject().accept(getResourceVisitor().getVisitor());
- } catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- }
-
- protected void incrementalBuild(IResourceDelta delta,
- IProgressMonitor monitor) throws CoreException {
- // the visitor does the work.
- delta.accept(new SampleDeltaVisitor());
- }
/**
* Access to xml scanner for test.
* @return
*/
- public static IFileScanner getXMLScanner() {
+ public static IFileScanner createXMLScanner() {
return new XMLScanner();
}
@@ -154,7 +83,7 @@
* Access to java scanner for test.
* @return
*/
- public static IFileScanner getJavaScanner() {
+ public static IFileScanner createJavaScanner() {
return new JavaScanner();
}
@@ -162,13 +91,12 @@
* Access to library scanner for test.
* @return
*/
- public static IFileScanner getLibraryScanner() {
+ public static IFileScanner createLibraryScanner() {
return new LibraryScanner();
}
protected void clean(IProgressMonitor monitor) throws CoreException {
- SeamProject sp = getSeamProject();
- if(sp != null) sp.clean();
+ ((SeamProject)SeamCorePlugin.getSeamProject(getProject(), false)).clean();
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.core;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -18,6 +19,9 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.ISaveContext;
+import org.eclipse.core.resources.ISaveParticipant;
+import org.eclipse.core.resources.ISavedState;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -65,6 +69,37 @@
super.start(context);
cleanCachedProjects();
ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener);
+ ISavedState lastState =
+ ResourcesPlugin.getWorkspace().addSaveParticipant(this, new ISaveParticipant() {
+
+ public void saving(ISaveContext context)
+ throws CoreException {
+ switch (context.getKind()) {
+ case ISaveContext.SNAPSHOT:
+ case ISaveContext.FULL_SAVE:
+ break;
+ case ISaveContext.PROJECT_SAVE:
+ SeamProject sp = (SeamProject)SeamCorePlugin.getSeamProject(context.getProject(), false);
+ try {
+ sp.store();
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ break;
+ }
+ }
+
+ public void rollback(ISaveContext context) {
+
+ }
+
+ public void prepareToSave(ISaveContext context) throws CoreException {
+ }
+
+ public void doneSaving(ISaveContext context) {
+ }
+ });
+
}
static void cleanCachedProjects() {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -357,6 +357,11 @@
}
}
+ public void build() {
+ resolveStorage(hasNoStorage());
+ getClassPath().build();
+ }
+
/**
*
*/
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -17,6 +17,8 @@
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -39,7 +41,7 @@
/**
* @author Viacheslav Kabanovich
*/
-public class SeamResourceVisitor implements IResourceVisitor {
+public class SeamResourceVisitor implements IResourceVisitor, IResourceDeltaVisitor {
static IFileScanner[] FILE_SCANNERS = {
new JavaScanner(),
new XMLScanner(),
@@ -51,6 +53,15 @@
IPath[] srcs = new IPath[0];
IPath webinf = null;
+ public IPath[] getPathsToVisit() {
+ IPath[] dest = new IPath[srcs.length + (webinf==null?0:1)];
+ System.arraycopy(srcs, 0, dest, 0, srcs.length);
+ if(webinf!=null) {
+ dest[srcs.length] = webinf;
+ }
+ return dest;
+ }
+
public SeamResourceVisitor(SeamProject p) {
this.p = p;
@@ -69,19 +80,10 @@
}
}
}
-
- public IResourceVisitor getVisitor() {
- return this;
- }
public boolean visit(IResource resource) {
if(resource instanceof IFile) {
IFile f = (IFile)resource;
- for (int i = 0; i < outs.length; i++) {
- if(outs[i].isPrefixOf(resource.getFullPath())) {
- return false;
- }
- }
for (int i = 0; i < FILE_SCANNERS.length; i++) {
IFileScanner scanner = FILE_SCANNERS[i];
if(scanner.isRelevant(f)) {
@@ -103,29 +105,6 @@
}
}
}
- if(resource instanceof IFolder) {
- IPath path = resource.getFullPath();
- for (int i = 0; i < outs.length; i++) {
- if(outs[i].isPrefixOf(path)) {
- return false;
- }
- }
- for (int i = 0; i < srcs.length; i++) {
- if(srcs[i].isPrefixOf(path) || path.isPrefixOf(srcs[i])) {
- return true;
- }
- }
- if(webinf != null) {
- if(webinf.isPrefixOf(path) || path.isPrefixOf(webinf)) {
- return true;
- }
- }
- if(resource == resource.getProject()) {
- return true;
- }
- return false;
- }
- //return true to continue visiting children.
return true;
}
@@ -164,4 +143,68 @@
}
}
+ public boolean visit(IResourceDelta delta) throws CoreException {
+ IResource resource = delta.getResource();
+ switch (delta.getKind()) {
+ case IResourceDelta.ADDED:
+ case IResourceDelta.CHANGED:
+ if(resource instanceof IFile) {
+ IFile f = (IFile)resource;
+ for (int i = 0; i < outs.length; i++) {
+ if(outs[i].isPrefixOf(resource.getFullPath())) {
+ return false;
+ }
+ }
+ for (int i = 0; i < FILE_SCANNERS.length; i++) {
+ IFileScanner scanner = FILE_SCANNERS[i];
+ if(scanner.isRelevant(f)) {
+ long t = System.currentTimeMillis();
+ if(!scanner.isLikelyComponentSource(f)) {
+ p.pathRemoved(f.getFullPath());
+ return false;
+ }
+ LoadedDeclarations c = null;
+ try {
+ c = scanner.parse(f, p);
+ } catch (ScannerException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+ if(c != null) componentsLoaded(c, f);
+ long dt = System.currentTimeMillis() - t;
+ timeUsed += dt;
+// System.out.println("Time=" + timeUsed);
+ }
+ }
+ }
+ if(resource instanceof IFolder) {
+ IPath path = resource.getFullPath();
+ for (int i = 0; i < outs.length; i++) {
+ if(outs[i].isPrefixOf(path)) {
+ return false;
+ }
+ }
+ for (int i = 0; i < srcs.length; i++) {
+ if(srcs[i].isPrefixOf(path) || path.isPrefixOf(srcs[i])) {
+ return true;
+ }
+ }
+ if(webinf != null) {
+ if(webinf.isPrefixOf(path) || path.isPrefixOf(webinf)) {
+ return true;
+ }
+ }
+ if(resource == resource.getProject()) {
+ return true;
+ }
+ return false;
+ }
+ //return true to continue visiting children.
+ return true;
+ case IResourceDelta.REMOVED:
+ p.pathRemoved(resource.getFullPath());
+ break;
+ }
+ return true;
+ }
+
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -33,6 +33,7 @@
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCoreMessages;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.ScannerException;
@@ -52,8 +53,7 @@
* @return
*/
public boolean isRelevant(IFile resource) {
- if(resource.getName().endsWith(".java")) return true; //$NON-NLS-1$
- return false;
+ return resource.getName().endsWith(".java");
}
/**
@@ -76,6 +76,8 @@
return true;
}
+ private ASTParser p = ASTParser.newParser(AST.JLS3);
+
/**
* Returns component or list of component
* TODO change return type
@@ -93,7 +95,6 @@
}
if(u == null) return null;
ICompilationUnit[] us = new ICompilationUnit[]{u};
- ASTParser p = ASTParser.newParser(AST.JLS3);
p.setSource(u);
p.setResolveBindings(true);
if("package-info.java".equals(f.getFullPath().lastSegment())) {
@@ -150,7 +151,7 @@
try {
ts = source.getTypes();
} catch (JavaModelException e) {
- //ignore
+ SeamCorePlugin.getPluginLog().logError(e);
}
if(ts == null || ts.length == 0) return;
for (int i = 0; i < ts.length; i++) {
@@ -159,7 +160,7 @@
try {
f = ts[i].getFlags();
} catch (JavaModelException e) {
- //ignore
+ SeamCorePlugin.getPluginLog().logError(e);
continue;
}
if(Flags.isPublic(f)) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -286,4 +286,11 @@
processedPaths.clear();
}
+ public void build() {
+ if(update()) {
+ process();
+ } else if(hasToUpdateProjectDependencies()) {
+ validateProjectDependencies();
+ }
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.internal.core.scanner.lib;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
@@ -25,6 +26,7 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
@@ -63,42 +65,52 @@
return false;
}
+ XModelObject o = null;
+ XModel model = null;
+
public boolean isLikelyComponentSource(IFile f) {
- XModel model = InnerModelHelper.createXModel(f.getProject());
- if(model == null) return false;
- XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
- if(o == null) return false;
- if(!o.getModelEntity().getName().equals("FileSystemJar")) { //$NON-NLS-1$
- ((FileSystemsImpl)o.getModel().getByPath("FileSystems")).updateOverlapped(); //$NON-NLS-1$
- o = EclipseResourceUtil.getObjectByResource(f);
- if(o == null || !o.getModelEntity().getName().equals("FileSystemJar")) return false; //$NON-NLS-1$
+ cleanState();
+ boolean isComponent = false;
+ try {
+ model = InnerModelHelper.createXModel(f.getProject());
+ if(model != null) {
+ o = EclipseResourceUtil.getObjectByResource(model, f);
+ if(o != null && o.getModelEntity().getName().equals("FileSystemJar")) {
+ ((FileSystemsImpl)o.getModel().getByPath("FileSystems")).updateOverlapped(); //$NON-NLS-1$
+ o = EclipseResourceUtil.getObjectByResource(f);
+ if(o != null && o.getModelEntity().getName().equals("FileSystemJar")) {
+ isComponent = isLikelyComponentSource(o);
+ }
+ }
+ }
+ } finally {
+ if(!isComponent) {
+ cleanState();
+ }
}
- return isLikelyComponentSource(o);
+ return isComponent;
}
+ private void cleanState() {
+ model = null;
+ o = null;
+ }
+
public LoadedDeclarations parse(IFile f, ISeamProject sp) throws ScannerException {
- XModel model = InnerModelHelper.createXModel(f.getProject());
- if(model == null) return null;
- XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
- if(o == null) return null;
- if(!o.getModelEntity().getName().equals("FileSystemJar")) { //$NON-NLS-1$
- ((FileSystemsImpl)o.getModel().getByPath("FileSystems")).updateOverlapped(); //$NON-NLS-1$
- o = EclipseResourceUtil.getObjectByResource(f);
- if(o == null || !o.getModelEntity().getName().equals("FileSystemJar")) return null; //$NON-NLS-1$
+ LoadedDeclarations decls = null;
+ if(o!=null) {
+ decls = parse(o, f.getFullPath(), sp);
}
- return parse(o, f.getFullPath(), sp);
+ return decls;
}
- public boolean isLikelyComponentSource(XModelObject o) {
- if(o == null) return false;
- if(o.getChildByPath("seam.properties") != null) return true; //$NON-NLS-1$
- if(o.getChildByPath("META-INF/seam.properties") != null) return true; //$NON-NLS-1$
- if(o.getChildByPath("META-INF/components.xml") != null) return true; //$NON-NLS-1$
- return false;
+ public static final boolean isLikelyComponentSource(XModelObject o) {
+ return o.getChildByPath("seam.properties") != null
+ || o.getChildByPath("META-INF/seam.properties") != null
+ || o.getChildByPath("META-INF/components.xml") != null;
}
public LoadedDeclarations parse(XModelObject o, IPath path, ISeamProject sp) throws ScannerException {
- if(o == null) return null;
sourcePath = path;
XModelObject seamProperties = o.getChildByPath("META-INF/seam.properties"); //$NON-NLS-1$
if(seamProperties == null) seamProperties = o.getChildByPath("seam.properties"); //$NON-NLS-1$
@@ -111,6 +123,10 @@
processJavaClasses(o, ds);
} catch (JavaModelException e) {
throw new ScannerException(SeamCoreMessages.LIBRARY_SCANNER_CANNOT_PROCESS_JAVA_CLASSES, e);
+ } catch (ClassFormatException e) {
+ throw new ScannerException(SeamCoreMessages.LIBRARY_SCANNER_CANNOT_PROCESS_JAVA_CLASSES, e);
+ } catch (IOException e) {
+ throw new ScannerException(SeamCoreMessages.LIBRARY_SCANNER_CANNOT_PROCESS_JAVA_CLASSES, e);
}
if(componentsXML != null) {
@@ -126,25 +142,27 @@
return ds;
}
- protected void processJavaClasses(XModelObject o, LoadedDeclarations ds) throws JavaModelException {
+ protected void processJavaClasses(XModelObject o, LoadedDeclarations ds) throws JavaModelException, ClassFormatException, IOException {
IJavaProject javaProject = JavaCore.create(classPath.getProject().getProject());
String location = o.getAttributeValue("location"); //$NON-NLS-1$
location = XModelObjectUtil.expand(location, o.getModel(), null);
IFile[] fs = ModelPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(location));
IPackageFragmentRoot root = null;
- if(fs != null) for (int i = 0; i < fs.length && root == null; i++) {
- root = javaProject.findPackageFragmentRoot(fs[i].getFullPath());
- }
- if(root == null) {
- root = javaProject.findPackageFragmentRoot(new Path(location));
- }
- if(root == null) return;
- process(root, ds);
-
+ if(fs != null) {
+ for (int i = 0; i < fs.length && root == null; i++) {
+ root = javaProject.findPackageFragmentRoot(fs[i].getFullPath());
+ }
+ if(root == null) {
+ root = javaProject.findPackageFragmentRoot(new Path(location));
+ if(root != null) {
+ process(root, ds);
+ }
+ }
+ }
}
- protected void process(IParent element, LoadedDeclarations ds) throws JavaModelException {
+ protected void process(IParent element, LoadedDeclarations ds) throws JavaModelException, ClassFormatException, IOException {
if(element == null) return;
IJavaElement[] es = element.getChildren();
String prefix = null;
@@ -171,7 +189,7 @@
}
}
- void processWithClassReader(IClassFile typeRoot, LoadedDeclarations ds, String prefix) {
+ void processWithClassReader(IClassFile typeRoot, LoadedDeclarations ds, String prefix) throws JavaModelException, ClassFormatException, IOException {
IType type = typeRoot.getType();
ClassFileReader reader = getReader(type, typeRoot);
@@ -189,7 +207,7 @@
}
}
- String processPackageInfo(IClassFile typeRoot, LoadedDeclarations ds) {
+ String processPackageInfo(IClassFile typeRoot, LoadedDeclarations ds) throws JavaModelException, ClassFormatException, IOException {
IType type = typeRoot.getType();
ClassFileReader reader = getReader(type, typeRoot);
@@ -218,33 +236,24 @@
}
static IBinaryAnnotation getNamespaceAnnotation(IBinaryAnnotation[] as) {
- if(as != null) for (int i = 0; i < as.length; i++) {
- String type = TypeScanner.getTypeName(as[i]);
- if(type != null && type.equals(SeamAnnotations.NAMESPACE_ANNOTATION_TYPE)) {
- return as[i];
+ if(as != null) {
+ for (int i = 0; i < as.length; i++) {
+ String type = TypeScanner.getTypeName(as[i]);
+ if(type != null && type.equals(SeamAnnotations.NAMESPACE_ANNOTATION_TYPE)) {
+ return as[i];
+ }
}
}
return null;
}
- private ClassFileReader getReader(IType type, IClassFile typeRoot) {
+ private ClassFileReader getReader(IType type, IClassFile typeRoot) throws JavaModelException, ClassFormatException, IOException {
String className = type.getFullyQualifiedName();
-
+ ClassFileReader newReader = null;
byte[] bs = null;
- try {
bs = typeRoot.getBytes();
- } catch (JavaModelException e) {
- return null;
- }
-
- try {
return ClassFileReader.read(new ByteArrayInputStream(bs), className, false);
- } catch (Throwable t) {
- //ignore
- }
-
- return null;
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -43,8 +43,7 @@
* @return
*/
public boolean isRelevant(IFile resource) {
- if(resource.getName().equals("seam.properties")) return true; //$NON-NLS-1$
- return false;
+ return resource.getName().equals("seam.properties");
}
/**
@@ -54,9 +53,7 @@
* @return
*/
public boolean isLikelyComponentSource(IFile f) {
- if(!f.isSynchronized(IFile.DEPTH_ZERO) || !f.exists()) return false;
- if(f.getName().equals("seam.properties")) return true; //$NON-NLS-1$
- return false;
+ return f.isSynchronized(IFile.DEPTH_ZERO) && f.exists() && f.getName().equals("seam.properties");
}
/**
@@ -67,53 +64,55 @@
*/
public LoadedDeclarations parse(IFile f, ISeamProject sp) throws ScannerException {
XModel model = InnerModelHelper.createXModel(f.getProject());
- if(model == null) return null;
XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
return parse(o, f.getFullPath());
}
public LoadedDeclarations parse(XModelObject o, IPath source) {
- if(o == null) return null;
+ LoadedDeclarations ds = null;
+
+ if(o != null) {
- if(o.getParent() instanceof FolderImpl) {
- IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(source);
- if(f != null && f.exists()) {
- try {
- ((FolderImpl)o.getParent()).updateChildFile(o, f.getLocation().toFile());
- } catch (XModelException e) {
- ModelPlugin.getPluginLog().logError(e);
+ if(o.getParent() instanceof FolderImpl) {
+ IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(source);
+ if(f != null && f.exists()) {
+ try {
+ ((FolderImpl)o.getParent()).updateChildFile(o, f.getLocation().toFile());
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
}
}
- }
-
- LoadedDeclarations ds = new LoadedDeclarations();
-
- XModelObject[] properties = o.getChildren();
- Map<String, SeamPropertiesDeclaration> ds1 = new HashMap<String, SeamPropertiesDeclaration>();
- for (int i = 0; i < properties.length; i++) {
- String name = properties[i].getAttributeValue("name"); //$NON-NLS-1$
- int q = name.lastIndexOf('.');
- if(q < 0) continue;
- String componentName = name.substring(0, q);
- String propertyName = name.substring(q + 1);
- SeamPropertiesDeclaration d = ds1.get(componentName);
- if(d == null) {
- d = new SeamPropertiesDeclaration();
- d.setId(properties[i]);
- d.setSourcePath(source);
- d.setName(componentName);
- ds1.put(componentName, d);
+
+ ds = new LoadedDeclarations();
+
+ XModelObject[] properties = o.getChildren();
+ Map<String, SeamPropertiesDeclaration> ds1 = new HashMap<String, SeamPropertiesDeclaration>();
+ for (int i = 0; i < properties.length; i++) {
+ String name = properties[i].getAttributeValue("name"); //$NON-NLS-1$
+ int q = name.lastIndexOf('.');
+ if(q < 0) continue;
+ String componentName = name.substring(0, q);
+ String propertyName = name.substring(q + 1);
+ SeamPropertiesDeclaration d = ds1.get(componentName);
+ if(d == null) {
+ d = new SeamPropertiesDeclaration();
+ d.setId(properties[i]);
+ d.setSourcePath(source);
+ d.setName(componentName);
+ ds1.put(componentName, d);
+ }
+ SeamProperty p = new SeamProperty();
+ p.setId(properties[i]);
+ p.setName(new XMLValueInfo(properties[i], "name")); //$NON-NLS-1$
+ p.setName(propertyName);
+ SeamValueString v = new SeamValueString();
+ v.setValue(new XMLValueInfo(properties[i], "value")); //$NON-NLS-1$
+ p.setValue(v);
+ d.addProperty(p);
}
- SeamProperty p = new SeamProperty();
- p.setId(properties[i]);
- p.setName(new XMLValueInfo(properties[i], "name")); //$NON-NLS-1$
- p.setName(propertyName);
- SeamValueString v = new SeamValueString();
- v.setValue(new XMLValueInfo(properties[i], "value")); //$NON-NLS-1$
- p.setValue(v);
- d.addProperty(p);
+ ds.getComponents().addAll(ds1.values());
}
- ds.getComponents().addAll(ds1.values());
return ds;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -58,6 +58,9 @@
*/
public class XMLScanner implements IFileScanner {
+ private XModel model;
+ private XModelObject o;
+
public XMLScanner() {}
/**
@@ -67,9 +70,7 @@
* @return
*/
public boolean isRelevant(IFile resource) {
- if(resource.getName().equals("components.xml")) return true; //$NON-NLS-1$
- if(resource.getName().endsWith(".component.xml")) return true; //$NON-NLS-1$
- return false;
+ return resource.getName().equals("components.xml") || resource.getName().endsWith(".component.xml");
}
/**
@@ -79,15 +80,28 @@
* @return
*/
public boolean isLikelyComponentSource(IFile f) {
- if(!f.isSynchronized(IFile.DEPTH_ZERO) || !f.exists()) return false;
- XModel model = InnerModelHelper.createXModel(f.getProject());
- if(model == null) return false;
- XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
- if(o == null) return false;
- if(o.getModelEntity().getName().startsWith("FileSeamComponent")) return true; //$NON-NLS-1$
- return false;
+ cleanState();
+ boolean isComponentSource = false;
+ if(f.isSynchronized(IFile.DEPTH_ZERO) && f.exists()) {
+ model = InnerModelHelper.createXModel(f.getProject());
+ if(model != null) {
+ o = EclipseResourceUtil.getObjectByResource(model, f);
+ if(o != null) {
+ isComponentSource = o.getModelEntity().getName().startsWith("FileSeamComponent"); //$NON-NLS-1$
+ }
+ }
+ }
+ if(!isComponentSource) {
+ cleanState();
+ }
+ return isComponentSource;
}
+ private void cleanState() {
+ model = null;
+ o = null;
+ }
+
/**
* Returns list of components
* @param f
@@ -95,9 +109,8 @@
* @throws ScannerException
*/
public LoadedDeclarations parse(IFile f, ISeamProject sp) throws ScannerException {
- XModel model = InnerModelHelper.createXModel(f.getProject());
- if(model == null) return null;
- XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
+ model = InnerModelHelper.createXModel(f.getProject());
+ o = EclipseResourceUtil.getObjectByResource(model, f);
return parse(o, f.getFullPath(), sp);
}
@@ -121,8 +134,6 @@
}
public LoadedDeclarations parse(XModelObject o, IPath source, ISeamProject sp) {
- if(o == null) return null;
-
NamespaceMapping nm = NamespaceMapping.load(o);
if(o.getParent() instanceof FolderImpl) {
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -88,7 +88,7 @@
IFile f = project.getFile("WebContent/WEB-INF/components.xml");
assertTrue("Cannot find components.xml in test project", f != null && f.exists());
- IFileScanner scanner = SeamCoreBuilder.getXMLScanner();
+ IFileScanner scanner = SeamCoreBuilder.createXMLScanner();
assertTrue("Scanner cannot recognise components.xml", scanner.isRelevant(f));
assertTrue("Scanner cannot recognise components.xml content", scanner.isLikelyComponentSource(f));
ISeamComponentDeclaration[] cs = null;
@@ -206,7 +206,7 @@
IFile f = project.getFile("JavaSource/demo/User.java");
assertTrue("Cannot find User.java in test project", f != null && f.exists());
- IFileScanner scanner = SeamCoreBuilder.getJavaScanner();
+ IFileScanner scanner = SeamCoreBuilder.createJavaScanner();
assertTrue("Scanner cannot recognise User.java", scanner.isRelevant(f));
assertTrue("Scanner cannot recognise User.java content", scanner.isLikelyComponentSource(f));
ISeamComponentDeclaration[] cs = null;
@@ -291,7 +291,7 @@
IFile f = project.getFile("WebContent/WEB-INF/lib/jboss-seam.jar");
assertTrue("Cannot find User.java in test project", f != null && f.exists());
- LibraryScanner scanner =(LibraryScanner)SeamCoreBuilder.getLibraryScanner();
+ LibraryScanner scanner =(LibraryScanner)SeamCoreBuilder.createLibraryScanner();
ClassPath cp = ((SeamProject)seamProject).getClassPath();
scanner.setClassPath(cp);
cp.update();
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -79,7 +79,7 @@
return new File(location);
}
- public void testBigProject() {
+ public void testBigProject() throws IOException {
ISeamProject sp = getSeamProject();
ISeamComponent[] cs = sp.getComponents();
int components = cs.length;
@@ -88,6 +88,7 @@
}
SeamProject impl = (SeamProject)sp;
System.out.println("Full build of " + components + " components completed in " + impl.fullBuildTime + "ms");
+ impl.store();
long time = impl.reload();
System.out.println("Reloaded " + sp.getComponents().length + " components in " + time + "ms");
List<Long> statistics = impl.statistics;
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -108,10 +108,8 @@
return SEAM_EAP_121_HOME_PROPERY;
}
- protected void tearDown()
+ protected void tearDown() throws Exception
- throws Exception
-
{
// Wait until all jobs is finished to avoid delete project problems
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2010-05-28 19:17:47 UTC (rev 22416)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2010-05-28 19:40:10 UTC (rev 22417)
@@ -64,8 +64,6 @@
// ws.removeResourceChangeListener( ValManager.getDefault() );
// EventManager.getManager().shutdown();
- suspendXJobs = XJob.isSuspended();
- XJob.setSuspended(true);
assertSeamHomeAvailable();
seam2Facet = ProjectFacetsManager.getProjectFacet("jst.seam");
@@ -94,7 +92,6 @@
super.tearDown();
ValidationFramework.getDefault().suspendAllValidation(
suspendAllValidation);
- XJob.setSuspended(suspendXJobs);
ResourcesPlugin.getWorkspace().addResourceChangeListener(
EventManager.getManager(),
14 years, 7 months