JBoss Tools SVN: r30859 - in trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-04-26 19:33:33 -0400 (Tue, 26 Apr 2011)
New Revision: 30859
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/plugin.properties
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/.project
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/build.properties
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/pom.xml
Log:
https://issues.jboss.org/browse/JBIDE-8787
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/.project
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/.project 2011-04-26 23:12:40 UTC (rev 30858)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/.project 2011-04-26 23:33:33 UTC (rev 30859)
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/META-INF/MANIFEST.MF 2011-04-26 23:12:40 UTC (rev 30858)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/META-INF/MANIFEST.MF 2011-04-26 23:33:33 UTC (rev 30859)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.jboss.tools.cdi.seam.text.ext.test
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.2.0.qualifier
Require-Bundle: org.junit,
org.eclipse.core.resources,
org.eclipse.jface.text,
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/build.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/build.properties 2011-04-26 23:12:40 UTC (rev 30858)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/build.properties 2011-04-26 23:33:33 UTC (rev 30859)
@@ -1,3 +1,9 @@
-source.. = src/
+output.. = bin/
bin.includes = META-INF/,\
+ plugin.properties,\
.
+src.includes = src/,\
+ META-INF/,\
+ build.properties
+jars.compile.order = .
+source.. = src/
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/plugin.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/plugin.properties (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/plugin.properties 2011-04-26 23:33:33 UTC (rev 30859)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.jsf.text.ext.test
+Bundle-Vendor.0 = JBoss by Red Hat
+Bundle-Name.0 = CDI Seam Text Extensions Tests Plug-in
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/plugin.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/pom.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/pom.xml 2011-04-26 23:12:40 UTC (rev 30858)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/pom.xml 2011-04-26 23:33:33 UTC (rev 30859)
@@ -8,9 +8,14 @@
</parent>
<groupId>org.jboss.tools.cdi.tests</groupId>
<artifactId>org.jboss.tools.cdi.seam.text.ext.test</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
+ <properties>
+ <emma.filter>org.jboss.tools.cdi*</emma.filter>
+ <emma.instrument.bundles>org.jboss.tools.cdi.core,org.jboss.tools.cdi.seam.text.ext</emma.instrument.bundles>
+ </properties>
+
<build>
<plugins>
<plugin>
@@ -22,15 +27,6 @@
</explodedBundles>
</configuration>
</plugin>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>maven-osgi-test-plugin</artifactId>
- <configuration>
- <explodedBundles>
- <bundle>org.jboss.tools.cdi.seam.text.ext.test</bundle>
- </explodedBundles>
- </configuration>
- </plugin>
</plugins>
- </build>
+ </build>
</project>
\ No newline at end of file
14 years, 11 months
JBoss Tools SVN: r30858 - in trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test: projects/CDIConfigTest/src/META-INF and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-04-26 19:12:40 -0400 (Tue, 26 Apr 2011)
New Revision: 30858
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/META-INF/
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/META-INF/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/NewQualifier.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/Report.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/ReportDatasource.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTestSetup.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamDefinitionsTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/CDISeamConfigCoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/ExtensionTest.java
Log:
JBIDE-3120
https://issues.jboss.org/browse/JBIDE-3120
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/META-INF/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/META-INF/beans.xml (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/META-INF/beans.xml 2011-04-26 23:12:40 UTC (rev 30858)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:ee"
+ xmlns:config="urn:java:org.jboss.test.config"
+ xmlns:test602="urn:java:org.jboss.test602.report"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+<config:MyAnnotation>
+ <s:Qualifier1/>
+</config:MyAnnotation>
+
+<test602:Report>
+ <s:modifies/>
+ <test602:NewQualifier/>
+</test602:Report>
+
+<test602:ReportDatasource>
+ <s:replaces/>
+ <test602:NewQualifier/>
+</test602:ReportDatasource>
+
+</beans>
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/META-INF/beans.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/NewQualifier.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/NewQualifier.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/NewQualifier.java 2011-04-26 23:12:40 UTC (rev 30858)
@@ -0,0 +1,21 @@
+package org.jboss.test602.report;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Qualifier
+@Target({ TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+public @interface NewQualifier {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/NewQualifier.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/Report.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/Report.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/Report.java 2011-04-26 23:12:40 UTC (rev 30858)
@@ -0,0 +1,5 @@
+package org.jboss.test602.report;
+
+public class Report {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/Report.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/ReportDatasource.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/ReportDatasource.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/ReportDatasource.java 2011-04-26 23:12:40 UTC (rev 30858)
@@ -0,0 +1,5 @@
+package org.jboss.test602.report;
+
+public class ReportDatasource {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/test602/report/ReportDatasource.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/CDISeamConfigCoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/CDISeamConfigCoreAllTests.java 2011-04-26 23:11:51 UTC (rev 30857)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/CDISeamConfigCoreAllTests.java 2011-04-26 23:12:40 UTC (rev 30858)
@@ -26,7 +26,10 @@
TestSuite suiteAll = new TestSuite("CDI Config Core Tests");
suiteAll.addTestSuite(ExtensionTest.class);
+ suiteAll.addTestSuite(SeamDefinitionsTest.class);
- return suiteAll;
+ SeamConfigTestSetup suite = new SeamConfigTestSetup(suiteAll);
+
+ return suite;
}
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/ExtensionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/ExtensionTest.java 2011-04-26 23:11:51 UTC (rev 30857)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/ExtensionTest.java 2011-04-26 23:12:40 UTC (rev 30858)
@@ -3,40 +3,19 @@
import java.io.IOException;
import java.util.Set;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.jboss.tools.cdi.core.CDICorePlugin;
-import org.jboss.tools.cdi.core.IBean;
-import org.jboss.tools.cdi.core.IBeanMember;
import org.jboss.tools.cdi.core.ICDIProject;
-import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.ResourcesUtils;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class ExtensionTest extends TestCase {
- protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.config.core.test";
- IProject project = null;
-
+public class ExtensionTest extends SeamConfigTest {
public ExtensionTest() {}
- public void setUp() throws Exception {
- project = ResourcesUtils.importProject(PLUGIN_ID, "/projects/CDIConfigTest");
- JobUtils.waitForIdle();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JobUtils.waitForIdle();
- }
-
public void testExtension() throws CoreException, IOException {
ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTest.java 2011-04-26 23:12:40 UTC (rev 30858)
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.config.core.test;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointField;
+import org.jboss.tools.cdi.core.IProducer;
+import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
+import org.jboss.tools.cdi.seam.config.core.CDISeamConfigExtension;
+import org.jboss.tools.cdi.seam.config.core.ConfigDefinitionContext;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamBeanDefinition;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamBeansDefinition;
+import org.jboss.tools.cdi.seam.config.core.scanner.SAXElement;
+import org.jboss.tools.test.util.ResourcesUtils;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class SeamConfigTest extends TestCase {
+ protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.config.core.test";
+ protected static String PROJECT_NAME = "CDIConfigTest";
+ protected static String PROJECT_PATH = "/projects/CDIConfigTest";
+
+ protected IProject project;
+ protected ICDIProject cdiProject;
+
+ public SeamConfigTest() {
+ project = getTestProject();
+ cdiProject = CDICorePlugin.getCDIProject(project, false);
+ }
+
+ public IProject getTestProject() {
+ if(project==null) {
+ try {
+ project = findTestProject();
+ if(project==null || !project.exists()) {
+ project = ResourcesUtils.importProject(PLUGIN_ID, PROJECT_PATH);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Can't import CDI test project: " + e.getMessage());
+ }
+ }
+ return project;
+ }
+
+ public static IProject findTestProject() {
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
+ }
+
+ protected CDISeamConfigExtension getConfigExtension(ICDIProject cdi) {
+ Set<IBuildParticipantFeature> bp = cdi.getNature().getExtensionManager().getBuildParticipantFeature();
+ for (IBuildParticipantFeature p: bp) {
+ if(p instanceof CDISeamConfigExtension) {
+ return (CDISeamConfigExtension)p;
+ }
+ }
+ return null;
+
+ }
+
+ protected IInjectionPointField getInjectionPointField(ICDIProject cdi, String beanClassFilePath, String fieldName) {
+ IFile file = cdi.getNature().getProject().getFile(beanClassFilePath);
+ Set<IBean> beans = cdi.getBeans(file.getFullPath());
+ Iterator<IBean> it = beans.iterator();
+ while(it.hasNext()) {
+ IBean b = it.next();
+ if(b instanceof IProducer) it.remove();
+ }
+ assertEquals("Wrong number of the beans", 1, beans.size());
+ Set<IInjectionPoint> injections = beans.iterator().next().getInjectionPoints();
+ for (IInjectionPoint injectionPoint : injections) {
+ if(injectionPoint instanceof IInjectionPointField) {
+ IInjectionPointField field = (IInjectionPointField)injectionPoint;
+ if(fieldName.equals(field.getField().getElementName())) {
+ return field;
+ }
+ }
+ }
+ fail("Can't find \"" + fieldName + "\" injection point filed in " + beanClassFilePath);
+ return null;
+ }
+
+ protected SeamBeansDefinition getBeansDefinition(ConfigDefinitionContext context, String path) {
+ IFile f = project.getFile(path);
+ assertNotNull(f);
+ assertTrue(f.exists());
+ SeamBeansDefinition d = context.getDefinition(f.getFullPath());
+ assertNotNull(d);
+ return d;
+ }
+
+ protected Set<SeamBeanDefinition> findBeanDefinitionByTagName(SeamBeansDefinition seamBeans, String tagname) {
+ Set<SeamBeanDefinition> ds = new HashSet<SeamBeanDefinition>();
+ Set<SeamBeanDefinition> all = seamBeans.getBeanDefinitions();
+ for (SeamBeanDefinition d: all) {
+ SAXElement e = d.getElement();
+ if(tagname.equals(e.getName())) {
+ ds.add(d);
+ }
+ }
+ return ds;
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTestSetup.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTestSetup.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTestSetup.java 2011-04-26 23:12:40 UTC (rev 30858)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.config.core.test;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class SeamConfigTestSetup extends TestSetup {
+
+ protected IProject project;
+
+ public SeamConfigTestSetup(Test test) {
+ super(test);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(SeamConfigTest.PROJECT_NAME);
+ if(project == null || !project.exists()) {
+ project = ResourcesUtils.importProject(SeamConfigTest.PLUGIN_ID, SeamConfigTest.PROJECT_PATH);
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ JobUtils.waitForIdle();
+ project.delete(true, true, null);
+ JobUtils.waitForIdle();
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTestSetup.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamDefinitionsTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamDefinitionsTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamDefinitionsTest.java 2011-04-26 23:12:40 UTC (rev 30858)
@@ -0,0 +1,48 @@
+package org.jboss.tools.cdi.seam.config.core.test;
+
+import java.io.IOException;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IJavaAnnotation;
+import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
+import org.jboss.tools.cdi.seam.config.core.CDISeamConfigExtension;
+import org.jboss.tools.cdi.seam.config.core.ConfigDefinitionContext;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamBeanDefinition;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamBeansDefinition;
+import org.jboss.tools.common.text.ITextSourceReference;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class SeamDefinitionsTest extends SeamConfigTest {
+ public SeamDefinitionsTest() {}
+
+ public void testBeansWithReplacesAndModifies() throws CoreException, IOException {
+ ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
+ ConfigDefinitionContext context = (ConfigDefinitionContext)getConfigExtension(cdi).getContext();
+ SeamBeansDefinition d = getBeansDefinition(context, "src/META-INF/beans.xml");
+
+ Set<SeamBeanDefinition> ds = findBeanDefinitionByTagName(d, "test602:Report");
+ assertEquals(1, ds.size());
+ SeamBeanDefinition report = ds.iterator().next();
+ ITextSourceReference modifies = report.getModifiesLocation();
+ assertNotNull(modifies);
+ IJavaAnnotation annotation = report.getAnnotation("org.jboss.test602.report.NewQualifier");
+ assertNotNull(annotation);
+
+ ds = findBeanDefinitionByTagName(d, "test602:ReportDatasource");
+ assertEquals(1, ds.size());
+ SeamBeanDefinition reportDatasource = ds.iterator().next();
+ ITextSourceReference replaces = reportDatasource.getReplacesLocation();
+ assertNotNull(replaces);
+
+
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamDefinitionsTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 11 months
JBoss Tools SVN: r30857 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core: src/org/jboss/tools/cdi/seam/config/core and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-04-26 19:11:51 -0400 (Tue, 26 Apr 2011)
New Revision: 30857
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamParameterDefinition.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMethodDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java
Log:
JBIDE-3120
https://issues.jboss.org/browse/JBIDE-3120
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/META-INF/MANIFEST.MF 2011-04-26 22:46:59 UTC (rev 30856)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/META-INF/MANIFEST.MF 2011-04-26 23:11:51 UTC (rev 30857)
@@ -28,5 +28,8 @@
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: JBoss by Red Hat
-Export-Package: org.jboss.tools.cdi.seam.config.core
+Export-Package: org.jboss.tools.cdi.seam.config.core,
+ org.jboss.tools.cdi.seam.config.core.definition,
+ org.jboss.tools.cdi.seam.config.core.scanner,
+ org.jboss.tools.cdi.seam.config.core.util
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigConstants.java 2011-04-26 22:46:59 UTC (rev 30856)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigConstants.java 2011-04-26 23:11:51 UTC (rev 30857)
@@ -14,14 +14,34 @@
public interface CDISeamConfigConstants extends CDIConstants {
- public static String SEAM_BEANS_XML = "seam-beans.xml";
+ public String SEAM_BEANS_XML = "seam-beans.xml";
- public static String URI_PREFIX = "urn:java:";
+ public String URI_PREFIX = "urn:java:";
//Problem id: node name was not resolved to Java type
- public static String UNRESOLVED_TYPE = "Unresolved type";
+ public String ERROR_UNRESOLVED_TYPE = "Unresolved type";
//Problem id: node was expected to be resolved to annotation type
- public static String ANNOTATION_EXPECTED = "Annotation expected";
+ public String ERROR_ANNOTATION_EXPECTED = "Annotation expected";
+ public String PACKAGE_EE = "ee";
+
+ public String KEYWORD_ARRAY = "array";
+
+ public String KEYWORD_ENTRY = "entry";
+ public String KEYWORD_E = "e";
+
+ public String KEYWORD_KEY = "key";
+ public String KEYWORD_K = "k";
+
+ public String KEYWORD_VALUE = "value";
+ public String KEYWORD_V = "v";
+
+ public String KEYWORD_REPLACES = "replaces";
+
+ public String KEYWORD_MODIFIES = "modifies";
+
+ public String KEYWORD_PARAMETERS = "parameters";
+
+ public String ATTR_DIMENSIONS = "dimensions";
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java 2011-04-26 22:46:59 UTC (rev 30856)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java 2011-04-26 23:11:51 UTC (rev 30857)
@@ -119,6 +119,12 @@
return result;
}
+ public SeamBeansDefinition getDefinition(IPath path) {
+ if(beanXMLs.containsKey(path)) return beanXMLs.get(path);
+ if(seambeanXMLs.containsKey(path)) return seambeanXMLs.get(path);
+ return null;
+ }
+
public void addAnnotation(String typeName, AnnotationDefinition def) {
IPath path = def.getResource().getFullPath();
// root.clean(typeName);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java 2011-04-26 22:46:59 UTC (rev 30856)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java 2011-04-26 23:11:51 UTC (rev 30857)
@@ -42,4 +42,8 @@
beanDefinitions.add(def);
}
+ public Set<SeamBeanDefinition> getBeanDefinitions() {
+ return beanDefinitions;
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java 2011-04-26 22:46:59 UTC (rev 30856)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java 2011-04-26 23:11:51 UTC (rev 30857)
@@ -15,6 +15,7 @@
import org.jboss.tools.cdi.core.IJavaAnnotation;
import org.jboss.tools.cdi.seam.config.core.scanner.SAXElement;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
*
@@ -23,9 +24,9 @@
*/
public abstract class SeamMemberDefinition {
protected SAXElement element;
- SAXElement replaces = null;
- SAXElement modifies = null;
- Map<String, IJavaAnnotation> annotations = new HashMap<String, IJavaAnnotation>();
+ protected SAXElement replaces = null;
+ protected SAXElement modifies = null;
+ protected Map<String, IJavaAnnotation> annotations = new HashMap<String, IJavaAnnotation>();
public SeamMemberDefinition() {}
@@ -33,6 +34,10 @@
this.element = element;
}
+ public SAXElement getElement() {
+ return element;
+ }
+
public void setReplaces(SAXElement replaces) {
this.replaces = replaces;
}
@@ -44,4 +49,16 @@
public void addAnnotation(IJavaAnnotation a) {
annotations.put(a.getTypeName(), a);
}
+
+ public IJavaAnnotation getAnnotation(String typeName) {
+ return annotations.get(typeName);
+ }
+
+ public ITextSourceReference getReplacesLocation() {
+ return replaces == null ? null : replaces.getLocation();
+ }
+
+ public ITextSourceReference getModifiesLocation() {
+ return modifies == null ? null : modifies.getLocation();
+ }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMethodDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMethodDefinition.java 2011-04-26 22:46:59 UTC (rev 30856)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMethodDefinition.java 2011-04-26 23:11:51 UTC (rev 30857)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.config.core.definition;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.jdt.core.IMethod;
/**
@@ -19,6 +22,7 @@
*/
public class SeamMethodDefinition extends SeamMemberDefinition {
IMethod method;
+ List<SeamParameterDefinition> parameters = new ArrayList<SeamParameterDefinition>();
public SeamMethodDefinition() {}
@@ -26,4 +30,8 @@
this.method = method;
}
+ public void addParameter(SeamParameterDefinition p) {
+ parameters.add(p);
+ }
+
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamParameterDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamParameterDefinition.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamParameterDefinition.java 2011-04-26 23:11:51 UTC (rev 30857)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.config.core.definition;
+
+import org.eclipse.jdt.core.ILocalVariable;
+import org.eclipse.jdt.core.IType;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class SeamParameterDefinition extends SeamMemberDefinition {
+ IType type;
+ String dimentions;
+
+ ILocalVariable parameter;
+
+ public SeamParameterDefinition() {}
+
+ public void setType(IType type) {
+ this.type = type;
+ }
+
+ public void setDimensions(String value) {
+ dimentions = value;
+ }
+
+ public void setParameter(ILocalVariable parameter) {
+ this.parameter = parameter;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamParameterDefinition.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java 2011-04-26 22:46:59 UTC (rev 30856)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java 2011-04-26 23:11:51 UTC (rev 30857)
@@ -14,6 +14,7 @@
import java.util.List;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
import org.jboss.tools.common.text.ITextSourceReference;
@@ -88,6 +89,10 @@
return attributes.get(name);
}
+ public Set<String> getAttributeNames() {
+ return attributes.keySet();
+ }
+
public void addChildElement(SAXElement child) {
child.setParent(this);
children.add(child);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java 2011-04-26 22:46:59 UTC (rev 30856)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java 2011-04-26 23:11:51 UTC (rev 30857)
@@ -2,10 +2,12 @@
import java.io.ByteArrayInputStream;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
@@ -21,6 +23,7 @@
import org.jboss.tools.cdi.seam.config.core.definition.SeamBeansDefinition;
import org.jboss.tools.cdi.seam.config.core.definition.SeamFieldDefinition;
import org.jboss.tools.cdi.seam.config.core.definition.SeamMethodDefinition;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamParameterDefinition;
import org.jboss.tools.cdi.seam.config.core.util.Util;
public class SeamDefinitionBuilder {
@@ -62,18 +65,12 @@
IType type = Util.resolveType(element, project);
if(type == null) {
- result.addUnresolvedNode(element, CDISeamConfigConstants.UNRESOLVED_TYPE);
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
return;
}
- boolean isAnnnotation = false;
- try {
- isAnnnotation = type.isAnnotation();
- } catch (JavaModelException e) {
- CDISeamConfigCorePlugin.getDefault().logError(e);
- result.addUnresolvedNode(element, CDISeamConfigConstants.UNRESOLVED_TYPE);
- return;
- }
- if(isAnnnotation) {
+ TypeCheck typeCheck = new TypeCheck(type, element);
+ if(typeCheck.isCorrupted) return;
+ if(typeCheck.isAnnotation) {
scanAnnotation(element, type);
} else {
scanBean(element, type);
@@ -89,9 +86,7 @@
//children should be annotation declarations.
for (SAXElement c: es) {
IJavaAnnotation a = loadAnnotationDeclaration(c, IN_ANNOTATION_TYPE);
- if(a != null) {
- def.addAnnotation(a, context.getRootContext());
- }
+ if(a != null) def.addAnnotation(a, context.getRootContext());
}
def.revalidateKind(context.getRootContext());
@@ -108,26 +103,24 @@
List<SAXElement> es = element.getChildElements();
for (SAXElement c: es) {
if(!Util.isConfigRelevant(c)) continue;
- if(Util.containsEEPackage(c.getURI())) {
- if("replaces".equals(c.getLocalName())) {
+ if(Util.containsEEPackage(c)) {
+ if(CDISeamConfigConstants.KEYWORD_REPLACES.equals(c.getLocalName())) {
def.setReplaces(c);
continue;
}
- if("modifies".equals(c.getLocalName())) {
+ if(CDISeamConfigConstants.KEYWORD_MODIFIES.equals(c.getLocalName())) {
def.setModifies(c);
continue;
}
}
IType t = Util.resolveType(c, project);
if(t != null) {
- IJavaAnnotation a = loadAnnotationDeclaration(element, IN_ANNOTATION_TYPE);
- if(a != null) {
- def.addAnnotation(a);
- }
+ IJavaAnnotation a = loadAnnotationDeclaration(c, IN_ANNOTATION_TYPE);
+ if(a != null) def.addAnnotation(a);
continue;
}
IMember m = null;
- try {
+ if(c.getURI() != null && c.getURI().equals(element.getURI())) try {
m = Util.resolveMember(type, c);
} catch (JavaModelException e) {
CDISeamConfigCorePlugin.getDefault().logError(e);
@@ -149,19 +142,18 @@
List<SAXElement> es = element.getChildElements();
for (SAXElement c: es) {
if(!Util.isConfigRelevant(c)) continue;
- if(Util.containsEEPackage(c.getURI())) {
- if("value".equals(c.getLocalName())) {
- //TODO do not forget to look for Inline Bean Declarations inside field values.
-
+ if(Util.containsEEPackage(c)) {
+ if(Util.isValue(c)) {
+ scanFieldValue(c);
+ } else if(Util.isEntry(c)) {
+ scanEntry(c);
}
-
+ continue;
}
IType t = Util.resolveType(c, project);
if(t != null) {
- IJavaAnnotation a = loadAnnotationDeclaration(element, IN_ANNOTATION_TYPE);
- if(a != null) {
- def.addAnnotation(a);
- }
+ IJavaAnnotation a = loadAnnotationDeclaration(c, IN_ANNOTATION_TYPE);
+ if(a != null) def.addAnnotation(a);
continue;
}
@@ -169,6 +161,35 @@
return def;
}
+ /**
+ * Scan field value for inline bean declarations.
+ * @param element
+ */
+ private void scanFieldValue(SAXElement element) {
+ if(!Util.isConfigRelevant(element)) return;
+ List<SAXElement> es = element.getChildElements();
+ for (SAXElement c: es) {
+ if(!Util.isConfigRelevant(c)) continue;
+ IType type = Util.resolveType(element, project);
+ if(type == null) continue;
+ TypeCheck typeCheck = new TypeCheck(type, element);
+ if(typeCheck.isCorrupted) return;
+ if(!typeCheck.isAnnotation) {
+ scanBean(element, type);
+ }
+ }
+ }
+
+ private void scanEntry(SAXElement element) {
+ List<SAXElement> es = element.getChildElements();
+ for (SAXElement c: es) {
+ if(!Util.isConfigRelevant(c)) continue;
+ if(Util.isKey(c) || Util.isValue(c)) {
+ scanFieldValue(c);
+ }
+ }
+ }
+
private SeamMethodDefinition scanMethod(SAXElement element, IMethod method) {
SeamMethodDefinition def = new SeamMethodDefinition();
def.setElement(element);
@@ -176,19 +197,22 @@
List<SAXElement> es = element.getChildElements();
for (SAXElement c: es) {
if(!Util.isConfigRelevant(c)) continue;
- if(Util.containsEEPackage(c.getURI())) {
- if("parameters".equals(c.getLocalName())) {
- //TODO
-
- }
-
+ if(Util.containsEEPackage(c)) {
+ if(Util.isParameters(c)) {
+ List<SAXElement> ps = element.getChildElements();
+ for (SAXElement p: ps) {
+ SeamParameterDefinition pd = scanParameter(p);
+ if(pd != null) def.addParameter(pd);
+ }
+ } else if(Util.isArray(c)) {
+ SeamParameterDefinition pd = scanParameter(c);
+ if(pd != null) def.addParameter(pd);
+ }
}
IType t = Util.resolveType(c, project);
if(t != null) {
- IJavaAnnotation a = loadAnnotationDeclaration(element, IN_ANNOTATION_TYPE);
- if(a != null) {
- def.addAnnotation(a);
- }
+ IJavaAnnotation a = loadAnnotationDeclaration(c, IN_ANNOTATION_TYPE);
+ if(a != null) def.addAnnotation(a);
continue;
}
@@ -196,35 +220,102 @@
return def;
}
+ private SeamParameterDefinition scanParameter(SAXElement element) {
+ if(!Util.isConfigRelevant(element)) return null;
+ SeamParameterDefinition def = new SeamParameterDefinition();
+ def.setElement(element);
+ if(Util.isArray(element)) {
+ if(element.hasAttribute(CDISeamConfigConstants.ATTR_DIMENSIONS)) {
+ def.setDimensions(element.getAttribute(CDISeamConfigConstants.ATTR_DIMENSIONS).getValue());
+ }
+ List<SAXElement> es = element.getChildElements();
+ for (SAXElement c: es) {
+ if(!Util.isConfigRelevant(c)) continue;
+ IType type = Util.resolveType(c, project);
+ if(type == null) {
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ continue;
+ }
+ TypeCheck typeCheck = new TypeCheck(type, c);
+ if(typeCheck.isCorrupted) continue;
+ if(typeCheck.isAnnotation) {
+ IJavaAnnotation a = loadAnnotationDeclaration(c, IN_ANNOTATION_TYPE);
+ if(a != null) def.addAnnotation(a);
+ } else {
+ def.setType(type);
+ }
+ }
+ } else {
+ IType type = Util.resolveType(element, project);
+ if(type == null) {
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ return null;
+ }
+ def.setType(type);
+ List<SAXElement> es = element.getChildElements();
+ for (SAXElement c: es) {
+ if(!Util.isConfigRelevant(c)) {
+ continue; //report?
+ }
+ if(Util.containsEEPackage(c)) continue; //we are not interested yet
+ IType t = Util.resolveType(c, project);
+ if(t != null) {
+ IJavaAnnotation a = loadAnnotationDeclaration(c, IN_ANNOTATION_TYPE);
+ if(a != null) def.addAnnotation(a);
+ continue;
+ }
+ }
+ }
+
+ return def;
+ }
+
private IJavaAnnotation loadAnnotationDeclaration(SAXElement element, int contextKind) {
if(!Util.isConfigRelevant(element)) return null;
IType type = Util.resolveType(element, project);
if(type == null) {
if(contextKind == IN_ANNOTATION_TYPE) {
- result.addUnresolvedNode(element, CDISeamConfigConstants.UNRESOLVED_TYPE);
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
}
return null;
}
- boolean isAnnnotation = false;
- try {
- isAnnnotation = type.isAnnotation();
- } catch (JavaModelException e) {
- CDISeamConfigCorePlugin.getDefault().logError(e);
- result.addUnresolvedNode(element, CDISeamConfigConstants.UNRESOLVED_TYPE);
- return null;
- }
- if(isAnnnotation) {
+ TypeCheck typeCheck = new TypeCheck(type, element);
+ if(typeCheck.isCorrupted) return null;
+ if(typeCheck.isAnnotation) {
context.getRootContext().getAnnotationKind(type); // kick it
+ String value = null;
+ SAXText text = element.getTextNode();
+ if(text != null && text.getValue() != null && text.getValue().trim().length() > 0) {
+ value = text.getValue();
+ }
AnnotationLiteral literal = new AnnotationLiteral(resource,
element.getLocation().getStartPosition(), element.getLocation().getLength(),
- null, 0, type);
- //TODO read and add member values.
+ value, IMemberValuePair.K_STRING, type);
+ Set<String> ns = element.getAttributeNames();
+ for (String n: ns) {
+ String v = element.getAttribute(n).getValue();
+ literal.addMemberValuePair(n, v, IMemberValuePair.K_STRING);
+ }
return literal;
} else if(contextKind == IN_ANNOTATION_TYPE) {
- result.addUnresolvedNode(element, CDISeamConfigConstants.ANNOTATION_EXPECTED);
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_ANNOTATION_EXPECTED);
}
return null;
}
+ class TypeCheck {
+ boolean isCorrupted = false;
+ boolean isAnnotation = false;
+ TypeCheck(IType type, SAXElement element) {
+ try {
+ isAnnotation = type.isAnnotation();
+ } catch (JavaModelException e) {
+ CDISeamConfigCorePlugin.getDefault().logError(e);
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ isCorrupted = true;
+ }
+ }
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java 2011-04-26 22:46:59 UTC (rev 30856)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/util/Util.java 2011-04-26 23:11:51 UTC (rev 30857)
@@ -12,7 +12,7 @@
import org.jboss.tools.cdi.seam.config.core.CDISeamConfigConstants;
import org.jboss.tools.cdi.seam.config.core.scanner.SAXElement;
-public class Util {
+public class Util implements CDISeamConfigConstants {
public static Map<String, String> EE_TYPES = new HashMap<String, String>();
static {
@@ -104,12 +104,45 @@
return uri.split(":");
}
+ public static boolean containsEEPackage(SAXElement element) {
+ return containsEEPackage(element.getURI());
+ }
+
public static boolean containsEEPackage(String uri) {
String[] ps = getPackages(uri);
- for (String p: ps) if("ee".equals(p)) {
+ for (String p: ps) if(CDISeamConfigConstants.PACKAGE_EE.equals(p)) {
return true;
}
return false;
}
+ public static boolean isArray(SAXElement element) {
+ return isKeyword(element, KEYWORD_ARRAY);
+ }
+
+ public static boolean isEntry(SAXElement element) {
+ return isKeyword(element, KEYWORD_ENTRY, KEYWORD_E);
+ }
+
+ public static boolean isKey(SAXElement element) {
+ return isKeyword(element, KEYWORD_KEY, KEYWORD_K);
+ }
+
+ public static boolean isValue(SAXElement element) {
+ return isKeyword(element, KEYWORD_VALUE, KEYWORD_V);
+ }
+
+ public static boolean isParameters(SAXElement element) {
+ return isKeyword(element, KEYWORD_PARAMETERS);
+ }
+
+ public static boolean isKeyword(SAXElement element, String keyword) {
+ return keyword.equals(element.getLocalName()) && containsEEPackage(element);
+ }
+
+ public static boolean isKeyword(SAXElement element, String keyword1, String keyword2) {
+ String n = element.getLocalName();
+ return (keyword1.equals(n) || keyword2.equals(n)) && containsEEPackage(element);
+ }
+
}
14 years, 11 months
JBoss Tools SVN: r30855 - in trunk/as: tests and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-04-26 17:49:05 -0400 (Tue, 26 Apr 2011)
New Revision: 30855
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/
Removed:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/
Log:
moving incorrectly placed tests
14 years, 11 months
JBoss Tools SVN: r30854 - in branches/jbosstools-3.2.x/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-04-26 16:34:01 -0400 (Tue, 26 Apr 2011)
New Revision: 30854
Modified:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java
Log:
JBIDE-7614 to branch
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2011-04-26 20:18:58 UTC (rev 30853)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2011-04-26 20:34:01 UTC (rev 30854)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -43,6 +43,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.FileUtil.IFileUtilListener;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
import de.schlichtherle.io.ArchiveDetector;
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2011-04-26 20:18:58 UTC (rev 30853)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2011-04-26 20:34:01 UTC (rev 30854)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -125,7 +125,7 @@
moduleTree, server,
server.getDeployFolder(),
IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- return getDeployPath(moduleTree, folder);
+ return getDeployPath(moduleTree, folder, server);
}
public static IPath getDeployRootFolder(IModule[] moduleTree, IDeployableServer server) {
@@ -144,6 +144,47 @@
return new Path(folder);
}
+ public static IPath getDeployPath(IModule[] moduleTree, String deployFolder, IDeployableServer server) {
+ IPath root = new Path( deployFolder );
+ String type, modName, name, uri, suffixedName;
+ for( int i = 0; i < moduleTree.length; i++ ) {
+ boolean found = false;
+ if( i == 0 ) {
+ // If this is the root module, we can customize the output name
+ DeploymentPreferences prefs = DeploymentPreferenceLoader.loadPreferencesFromServer(server.getServer());
+ DeploymentTypePrefs typePrefs = prefs.getOrCreatePreferences(LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ DeploymentModulePrefs modPrefs = typePrefs.getModulePrefs(moduleTree[0]);
+ if( modPrefs != null ) {
+ String outName = modPrefs.getProperty(IJBossToolingConstants.LOCAL_DEPLOYMENT_OUTPUT_NAME);
+ if( outName != null && !outName.equals("")) { //$NON-NLS-1$
+ found = true;
+ root = root.append(outName);
+ }
+ }
+ }
+
+ // If it's a child module, or the property is not set,
+ // we must respect the deployment model...
+ if( !found ) {
+ type = moduleTree[i].getModuleType().getId();
+ modName = moduleTree[i].getName();
+ name = new Path(modName).lastSegment();
+ suffixedName = name + getSuffix(type);
+ uri = getParentRelativeURI(moduleTree, i, suffixedName);
+ root = root.append(uri);
+ }
+ }
+ return root;
+ }
+
+ /**
+ * This method is deprecated. Please use the following:
+ * @see getDeployPath(IModule[] module, String folder, IDeployableServer server)
+ * @param moduleTree
+ * @param deployFolder
+ * @return
+ */
+ @Deprecated
public static IPath getDeployPath(IModule[] moduleTree, String deployFolder) {
IPath root = new Path( deployFolder );
String type, modName, name, uri, suffixedName;
@@ -197,10 +238,10 @@
String folder = PublishUtil.getDeployRootFolder(
moduleTree, server, defaultFolder,
IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- return PublishUtil.getDeployPath(moduleTree, folder);
+ return PublishUtil.getDeployPath(moduleTree, folder, server);
}
- private static String getSuffix(String type) {
+ public static String getSuffix(String type) {
// TODO
// VirtualReferenceUtilities.INSTANCE. has utility methods to help!!
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2011-04-26 20:18:58 UTC (rev 30853)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2011-04-26 20:34:01 UTC (rev 30854)
@@ -97,5 +97,5 @@
public static final String LOCAL_DEPLOYMENT_NAME = "name"; //$NON-NLS-1$
public static final String LOCAL_DEPLOYMENT_LOC = "location"; //$NON-NLS-1$
public static final String LOCAL_DEPLOYMENT_TEMP_LOC = "tempLocation"; //$NON-NLS-1$
-
+ public static final String LOCAL_DEPLOYMENT_OUTPUT_NAME = "outputName"; //$NON-NLS-1$
}
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-04-26 20:18:58 UTC (rev 30853)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-04-26 20:34:01 UTC (rev 30854)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -76,15 +76,12 @@
// set up needed vars
IDeployableServer server2 = ServerConverter.getDeployableServer(server);
String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
- IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot);
- IModule lastMod = module[module.length-1];
- RSEPublishMethod method2 = (RSEPublishMethod)method;
- IPath destFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2, method2.getRemoteRootFolder());
- //IPath tempDestFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2, method2.getRemoteTemporaryFolder());
+ IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot, server2);
+ IPath destFolder = PublishUtil.getDeployPath(method, module, server2);
String name = sourcePath.lastSegment();
- IStatus result = null;
-
-
+ IStatus result = null;
+ RSEPublishMethod method2 = (RSEPublishMethod)method;
+
// Am I a removal? If yes, remove me, and return
if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
result = removeRemoteDeployment(method2, sourcePath, destFolder, name, monitor);
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2011-04-26 20:18:58 UTC (rev 30853)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2011-04-26 20:34:01 UTC (rev 30854)
@@ -169,6 +169,7 @@
/* Editor Strings */
+ public static String EditorDeployment;
public static String EditorUseWorkspaceMetadata;
public static String EditorUseServersDeployFolder;
public static String EditorUseCustomDeployFolder;
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2011-04-26 20:18:58 UTC (rev 30853)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2011-04-26 20:34:01 UTC (rev 30854)
@@ -144,10 +144,11 @@
DescriptorXPathMatch=Match
#Editor
+EditorDeployment=Deployment
EditorUseWorkspaceMetadata=Use workspace metadata (does not modify JBoss deploy folder)
EditorUseServersDeployFolder=Use the JBoss deploy folder
EditorUseCustomDeployFolder=Use a custom deploy folder
-EditorSetDeployLabel=Deploy Directory
+EditorSetDeployLabel=Deployment Location
EditorSetTempDeployLabel=Temporary Deploy Directory
EditorEditDeployLocCommand=Edit Deployment Location
EditorModule=Module
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2011-04-26 20:18:58 UTC (rev 30853)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2011-04-26 20:34:01 UTC (rev 30854)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -48,11 +48,8 @@
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.forms.IFormColors;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IRuntime;
@@ -62,6 +59,7 @@
import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
@@ -117,32 +115,21 @@
private ModuleDeploymentPage page;
private DeploymentPreferences preferences;
private TreeViewer viewer;
- protected String COLUMN_NAME;
- protected String COLUMN_LOC;
- protected String COLUMN_TEMP_LOC;
- protected String currentDeployType;
+ protected static final String COLUMN_NAME = IJBossToolingConstants.LOCAL_DEPLOYMENT_NAME;
+ protected static final String COLUMN_LOC = IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC;
+ protected static final String COLUMN_TEMP_LOC = IJBossToolingConstants.LOCAL_DEPLOYMENT_TEMP_LOC;
+ protected static final String OUTPUT_NAME = IJBossToolingConstants.LOCAL_DEPLOYMENT_OUTPUT_NAME;
+ protected String currentDeployType = LocalPublishMethod.LOCAL_PUBLISH_METHOD;
private IServerWorkingCopy lastWC;
public DeploymentModuleOptionCompositeAssistant() {
- COLUMN_NAME = IJBossToolingConstants.LOCAL_DEPLOYMENT_NAME;
- COLUMN_LOC = IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC;
- COLUMN_TEMP_LOC = IJBossToolingConstants.LOCAL_DEPLOYMENT_TEMP_LOC;
- currentDeployType = LocalPublishMethod.LOCAL_PUBLISH_METHOD;
}
public ModuleDeploymentPage getPage() {
return page;
}
- public String getCurrentDeployType() {
- return currentDeployType;
- }
-
- public void setCurrentDeployType(String type) {
- this.currentDeployType = type;
- }
-
public void setDeploymentPage(ModuleDeploymentPage page) {
this.page = page;
}
@@ -670,8 +657,7 @@
DeploymentModulePrefs p = preferences.getOrCreatePreferences(currentDeployType)
.getOrCreateModulePrefs((IModule) element);
if (property == COLUMN_LOC) {
- String ret = p.getProperty(COLUMN_LOC);
- return ret == null ? "" : ret;
+ return getOutputFolderAndName(p, (IModule)element);
}
if (property == COLUMN_TEMP_LOC) {
String ret = p.getProperty(COLUMN_TEMP_LOC);
@@ -687,8 +673,12 @@
DeploymentModulePrefs p = preferences.getOrCreatePreferences(currentDeployType)
.getOrCreateModulePrefs(module);
if (property == COLUMN_LOC) {
- page.firePropertyChangeCommand(p, COLUMN_LOC,
- (String) value, Messages.EditorEditDeployLocCommand);
+ String outputName = new Path(((String)value)).lastSegment();
+ String outPath = ((String)value).substring(0, ((String)value).length()-outputName.length());
+ page.firePropertyChangeCommand(p,
+ new String[]{COLUMN_LOC, OUTPUT_NAME},
+ new String[]{outPath,outputName},
+ Messages.EditorEditDeployLocCommand);
viewer.refresh();
} else if (property == COLUMN_TEMP_LOC) {
page.firePropertyChangeCommand(p, COLUMN_TEMP_LOC,
@@ -742,11 +732,7 @@
DeploymentModulePrefs modPref = preferences
.getOrCreatePreferences(currentDeployType)
.getOrCreateModulePrefs(m);
- String result = modPref.getProperty(COLUMN_LOC);
- if (result != null)
- return result;
- modPref.setProperty(COLUMN_LOC, "");
- return "";
+ return getOutputFolderAndName(modPref, m);
}
if (columnIndex == 2) {
DeploymentModulePrefs modPref = preferences
@@ -799,4 +785,19 @@
}
+
+ public static String getDefaultOutputName(IModule module) {
+ return new Path(module.getName()).lastSegment() + PublishUtil.getSuffix(module.getModuleType().getId());
+ }
+
+ protected static String getOutputFolderAndName(DeploymentModulePrefs modPref, IModule m) {
+ String folder = modPref.getProperty(COLUMN_LOC);
+ String outputName = modPref.getProperty(OUTPUT_NAME);
+ outputName = outputName == null || outputName.equals("")
+ ? getDefaultOutputName(m) : outputName;
+
+ if (folder != null)
+ return new Path(folder).append(outputName).toPortableString();
+ return outputName;
+ }
}
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java 2011-04-26 20:18:58 UTC (rev 30853)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java 2011-04-26 20:34:01 UTC (rev 30854)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,20 +10,15 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.ui.editor;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.util.ArrayList;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IEditorInput;
@@ -44,6 +39,7 @@
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentModulePrefs;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentPreferences;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
+import org.jboss.ide.eclipse.as.ui.Messages;
public class ModuleDeploymentPage extends ServerEditorPart {
protected ServerResourceCommandManager commandManager;
@@ -115,7 +111,7 @@
FormToolkit toolkit = getFormToolkit(parent);
ScrolledForm allContent = toolkit.createScrolledForm(parent);
toolkit.decorateFormHeading(allContent.getForm());
- allContent.setText("Deployment");
+ allContent.setText(Messages.EditorDeployment);
allContent.getBody().setLayout(new FormLayout());
return allContent;
}
@@ -148,27 +144,45 @@
}
public void firePropertyChangeCommand(DeploymentModulePrefs p, String key, String val, String cmdName) {
- commandManager.execute(new ChangePropertyCommand(p,key,val,cmdName));
+ firePropertyChangeCommand(p, new String[]{key},new String[]{val},cmdName);
}
+ public void firePropertyChangeCommand(DeploymentModulePrefs p, String[] keys, String[] vals, String cmdName) {
+ commandManager.execute(new ChangePropertyCommand(p, keys,vals,cmdName));
+ }
+
+
private class ChangePropertyCommand extends ServerCommand {
private DeploymentModulePrefs p;
- private String key;
- private String oldVal;
- private String newVal;
+ private String[] keys;
+ private String[] oldVals;
+ private String[] newVals;
public ChangePropertyCommand(DeploymentModulePrefs p, String key, String val, String commandName) {
+ this(p, new String[]{key}, new String[]{val}, commandName);
+ }
+
+ public ChangePropertyCommand(DeploymentModulePrefs p, String[] keys,
+ String[] vals, String commandName) {
super(ModuleDeploymentPage.this.server, commandName);
this.p = p;
- this.key = key;
- this.newVal = val;
- this.oldVal = p.getProperty(key);
+ this.keys = keys;
+ this.newVals = vals;
+ this.oldVals = new String[newVals.length];
+ for( int i = 0; i < newVals.length; i++ ) {
+ oldVals[i] = p.getProperty(keys[i]);
+ }
}
+
public void execute() {
- p.setProperty(key, newVal);
+ for( int i = 0; i < keys.length; i++ ) {
+ p.setProperty(keys[i], newVals[i]);
+ }
savePreferencesToWorkingCopy();
}
public void undo() {
- p.setProperty(key, oldVal);
+ for( int i = 0; i < keys.length; i++) {
+ p.setProperty(keys[i], oldVals[i]);
+ }
savePreferencesToWorkingCopy();
}
}
@@ -195,7 +209,7 @@
public static String makeRelative(String path, IRuntime runtime) {
IJBossServerRuntime rt = getRuntime(runtime);
if (rt == null)
- return path;
+ return path;
return ServerUtil.makeRelative(rt, new Path(path)).toString();
}
14 years, 11 months
JBoss Tools SVN: r30853 - in branches/jbosstools-3.2.x/requirements: jbossas and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-04-26 16:18:58 -0400 (Tue, 26 Apr 2011)
New Revision: 30853
Added:
branches/jbosstools-3.2.x/requirements/.gitignore
branches/jbosstools-3.2.x/requirements/jbossepp/
branches/jbosstools-3.2.x/requirements/jbossepp/build.properties
Modified:
branches/jbosstools-3.2.x/requirements/build.xml
branches/jbosstools-3.2.x/requirements/jbossas/build.properties
branches/jbosstools-3.2.x/requirements/jbossas/buildRequirement.xml
Log:
backport changes in trunk to 3.2.x branch: add jbossepp builder, jbossas6/7 builders, new 'if avail local then copy instead of wget' logic, and .gitignore file
Added: branches/jbosstools-3.2.x/requirements/.gitignore
===================================================================
--- branches/jbosstools-3.2.x/requirements/.gitignore (rev 0)
+++ branches/jbosstools-3.2.x/requirements/.gitignore 2011-04-26 20:18:58 UTC (rev 30853)
@@ -0,0 +1 @@
+download
Modified: branches/jbosstools-3.2.x/requirements/build.xml
===================================================================
--- branches/jbosstools-3.2.x/requirements/build.xml 2011-04-26 19:59:12 UTC (rev 30852)
+++ branches/jbosstools-3.2.x/requirements/build.xml 2011-04-26 20:18:58 UTC (rev 30853)
@@ -3,14 +3,69 @@
<import file="buildRequirements.xml" />
<property name="requirement.root" value="${basedir}" />
- <property name="requirement.download.root" value="${basedir}/download" />
- <property name="requirement.build.root" value="${basedir}/target" />
-
+ <property name="requirement.download.root" value="${requirement.root}/download" />
+ <property name="requirement.build.root" value="${requirement.root}/target" />
<condition property="skipRequirementBuild">
<equals arg1="${maven.test.skip}" arg2="true"/>
</condition>
-
- <target name="default" description="description" unless="skipRequirementBuild">
+
+ <target name="all" description="fetch all requirements defined by subdirs with a build.properties file">
+ <if>
+ <not>
+ <isset property="requirements" />
+ </not>
+ <then>
+ <var name="requirements" value="" />
+ </then>
+ </if>
+ <!-- get all subdirs, and check each one for a build.properties file -->
+ <for param="subdir">
+ <path>
+ <dirset dir="${basedir}" excludes="bin, download, generic, lib, target" />
+ </path>
+ <sequential>
+ <if>
+ <available file="@{subdir}/build.properties" />
+ <then>
+ <basename file="@{subdir}" property="subdir" />
+ <var name="requirements" value="${requirements},${subdir}" />
+ <var name="subdir" unset="true" />
+ </then>
+ </if>
+ </sequential>
+ </for>
+ <!-- remove prefix comma -->
+ <propertyregex defaultvalue="${requirements}" input="${requirements}" replace="\1" regexp=",(.+)" override="true" property="requirements" />
+
+ <echo>requirements=${requirements}</echo>
+ <echo>unzipto=${requirement.build.root}</echo>
+ <buildRequirements requirements="${requirements}" unzipto="${requirement.build.root}" />
+ </target>
+
+ <!-- if there's a mirror of the requirements stuff outside hudson, use that instead; else work in local workspace -->
+ <target name="default" description="to fetch 1 or more requirement(s), set -Drequirements=one,two,three" unless="skipRequirementBuild">
+ <!-- https://jira.jboss.org/jira/browse/JBQA-3313 Use static, shared space outside workspace, instead of fetching directly to the workspace -->
+ <var name="static_build_env.jbds.requirements" value="/home/hudson/static_build_env/jbds/requirements" />
+ <if>
+ <available file="${static_build_env.jbds.requirements}" type="dir" />
+ <then>
+ <for list="${requirements}" param="requirement">
+ <sequential>
+ <!-- if /home/hudson/static_build_env/jbds/requirements/download/jbossas/ exists, copy into
+ ${WORKSPACE}/requirements/download/jbossas/ so no need to re-download zips -->
+ <if>
+ <available file="${static_build_env.jbds.requirements}/download/@{requirement}" />
+ <then>
+ <copy todir="${requirement.download.root}/@{requirement}">
+ <fileset dir="${static_build_env.jbds.requirements}/download/@{requirement}" />
+ </copy>
+ </then>
+ </if>
+ </sequential>
+ </for>
+ </then>
+ </if>
+
<echo>maven.test.skip=${maven.test.skip}</echo>
<echo>settings.offline=${settings.offline}</echo>
<echo>requirements=${requirements}</echo>
Modified: branches/jbosstools-3.2.x/requirements/jbossas/build.properties
===================================================================
--- branches/jbosstools-3.2.x/requirements/jbossas/build.properties 2011-04-26 19:59:12 UTC (rev 30852)
+++ branches/jbosstools-3.2.x/requirements/jbossas/build.properties 2011-04-26 20:18:58 UTC (rev 30853)
@@ -1,5 +1,5 @@
-#jbossas.build.uri=http://downloads.sourceforge.net/sourceforge/jboss
jbossas.build.uri=http://repository.jboss.org/sourceforge
+jbossas.build.uri2=http://downloads.sourceforge.net/sourceforge/jboss
jboss32.build.uri=${jbossas.build.uri}
jboss32.build.name=jboss-3.2.8.SP1
@@ -24,4 +24,21 @@
jboss51.build.uri=${jbossas.build.uri}
jboss51.build.name=jboss-5.1.0.GA
jboss51.build.archive=${jboss51.build.name}.zip
-jboss51.build.archive.md5=78322c75ca0c13002a04418b4a8bc920
\ No newline at end of file
+jboss51.build.archive.md5=78322c75ca0c13002a04418b4a8bc920
+
+# repository.jboss.org is now read-only, so pull from SF.net directly
+jboss60.build.uri=${jbossas.build.uri2}
+jboss60.build.name=jboss-as-distribution-6.0.0.Final
+jboss60.build.archive=${jboss60.build.name}.zip
+jboss60.build.archive.md5=81ed7c2c274881963467c11f204eedfc
+
+# reminder, when updating to something newer, also update:
+# ~/trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/
+# ~/trunk/requirements/jbossas/build.properties
+# latest downloads: http://www.jboss.org/jbossas/downloads
+# current: http://download.jboss.org/jbossas/7.0/jboss-7.0.0.Beta3/jboss-7.0.0.Beta3...
+jboss70.build.uri=http://download.jboss.org/jbossas/7.0/jboss-7.0.0.Beta3/
+jboss70.build.name=jboss-7.0.0.Beta3
+jboss70.build.archive=${jboss70.build.name}.zip
+jboss70.build.archive.md5=c2fbe3c6828a8f740930b961f45792cf
+
Modified: branches/jbosstools-3.2.x/requirements/jbossas/buildRequirement.xml
===================================================================
--- branches/jbosstools-3.2.x/requirements/jbossas/buildRequirement.xml 2011-04-26 19:59:12 UTC (rev 30852)
+++ branches/jbosstools-3.2.x/requirements/jbossas/buildRequirement.xml 2011-04-26 20:18:58 UTC (rev 30853)
@@ -45,5 +45,15 @@
<param name="build.archive" value="${jboss51.build.archive}"/>
<param name="md5" value="${jboss51.build.archive.md5}"/>
</antcall>
+ <antcall target="build-jbossas">
+ <param name="build.uri" value="${jboss60.build.uri}"/>
+ <param name="build.archive" value="${jboss60.build.archive}"/>
+ <param name="md5" value="${jboss60.build.archive.md5}"/>
+ </antcall>
+ <antcall target="build-jbossas">
+ <param name="build.uri" value="${jboss70.build.uri}"/>
+ <param name="build.archive" value="${jboss70.build.archive}"/>
+ <param name="md5" value="${jboss70.build.archive.md5}"/>
+ </antcall>
</target>
</project>
Added: branches/jbosstools-3.2.x/requirements/jbossepp/build.properties
===================================================================
--- branches/jbosstools-3.2.x/requirements/jbossepp/build.properties (rev 0)
+++ branches/jbosstools-3.2.x/requirements/jbossepp/build.properties 2011-04-26 20:18:58 UTC (rev 30853)
@@ -0,0 +1,6 @@
+jbossepp.build.uri=http://download.devel.redhat.com/released/JBossEPP/5.1.0
+build.uri=${jbossepp.build.uri}
+build.archive.root=jboss-epp-5.1.0-unsigned
+build.archive=${build.archive.root}.zip
+md5=5b29407c54b309579b2ee0e26b4a3279
+
14 years, 11 months
JBoss Tools SVN: r30852 - branches/jbosstools-3.2.x/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-04-26 15:59:12 -0400 (Tue, 26 Apr 2011)
New Revision: 30852
Modified:
branches/jbosstools-3.2.x/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java
Log:
JBIDE-8724 unit test failure - just needs delays? (?!)
Modified: branches/jbosstools-3.2.x/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java
===================================================================
--- branches/jbosstools-3.2.x/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java 2011-04-26 19:58:55 UTC (rev 30851)
+++ branches/jbosstools-3.2.x/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java 2011-04-26 19:59:12 UTC (rev 30852)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceDescription;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IncrementalProjectBuilder;
@@ -75,6 +76,12 @@
setupServer();
addArchives();
buildArchive();
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ // Ignored.
+ }
+ JobUtils.waitForIdle(10000);
assertBuiltArchiveContents(index);
changeArchivesDeployPrefs(false, server.getId());
deploy();
@@ -128,6 +135,7 @@
// Builder is off, autodeploy is on, manually call build!
callBuild();
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
assertBinContents(count);
assertBuiltArchiveContents(count);
assertDeployContents(count);
14 years, 11 months
JBoss Tools SVN: r30851 - in trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge: launching and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-04-26 15:58:55 -0400 (Tue, 26 Apr 2011)
New Revision: 30851
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/launching/ForgeRuntime.java
Log:
- make the plugin work with the 'new' forge (without seam)
- startup forge with forge.compatibility.IDE=true to make it also work on Windows
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java 2011-04-26 19:14:11 UTC (rev 30850)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java 2011-04-26 19:58:55 UTC (rev 30851)
@@ -82,6 +82,8 @@
String projectDirName = projectPath.substring(index + 1);
String projectBaseDirPath = projectPath.substring(0, index);
new ProjectImporter(projectBaseDirPath, projectDirName).importProject();
+ } else {
+
}
}
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java 2011-04-26 19:14:11 UTC (rev 30850)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java 2011-04-26 19:58:55 UTC (rev 30851)
@@ -162,13 +162,14 @@
escapeSequence.setLength(0);
lastLineLength = columnNumber - 1;
escapeSequenceStarted = false;
- }
- if (c == 'K') {
+ } else if (c == 'K') {
int doclength = getDocument().getLength();
int currentPosition = lastLinePosition + lastLineLength;
getDocument().replace(currentPosition, doclength - currentPosition, "");
escapeSequenceStarted = false;
- }
+// } else if (c == 'm') {
+//
+ }
} else {
escapeSequence.append(c);
}
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/launching/ForgeRuntime.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/launching/ForgeRuntime.java 2011-04-26 19:14:11 UTC (rev 30850)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/launching/ForgeRuntime.java 2011-04-26 19:58:55 UTC (rev 30851)
@@ -237,8 +237,8 @@
break;
}
}
- ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, "Seam Forge");
- workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.jboss.seam.forge.shell.Bootstrap");
+ ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, "Forge");
+ workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.jboss.forge.shell.Bootstrap");
List<String> classpath = new ArrayList<String>();
// Bundle bundle = Platform.getBundle("org.jboss.tools.seam.forge");
File file = null;
@@ -291,6 +291,7 @@
File workingDir = path.toFile();
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, workingDir.getAbsolutePath());
// workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "-Dseam.forge.shell.colorEnabled=true");
+ workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "-Dforge.compatibility.IDE=true");
ILaunchConfiguration configuration = workingCopy.doSave();
ILaunch launch = configuration.launch(ILaunchManager.RUN_MODE, null, false, false);
IProcess[] processes = launch.getProcesses();
14 years, 11 months
JBoss Tools SVN: r30850 - in trunk/jsf: plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-04-26 15:14:11 -0400 (Tue, 26 Apr 2011)
New Revision: 30850
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidationComponent.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidator.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
Log:
https://issues.jboss.org/browse/JBIDE-8779 Disabled I18n Validator until we refactor it. So far it causes too many problems.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2011-04-26 19:08:33 UTC (rev 30849)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2011-04-26 19:14:11 UTC (rev 30850)
@@ -557,14 +557,6 @@
</extension>
<extension
- point="org.eclipse.ui.ide.markerResolution">
- <markerResolutionGenerator
- class="org.jboss.tools.jsf.web.validation.i18n.I18nMarkerResolutionGenerator"
- markerType="org.jboss.tools.jsf.i18nproblemmarker">
- </markerResolutionGenerator>
- </extension>
-
- <extension
id="jsf2problemmarker"
name="%JSF2ProblemName"
point="org.eclipse.core.resources.markers">
@@ -585,27 +577,6 @@
</super>
</extension>
- <extension
- id="i18nproblemmarker"
- name="%i18nProblemName"
- point="org.eclipse.core.resources.markers">
- <super
- type="org.eclipse.core.resources.problemmarker">
- </super>
- <persistent
- value="true">
- </persistent>
- <attribute
- name="problemType">
- </attribute>
- <attribute
- name="baseElement">
- </attribute>
- <super
- type="org.eclipse.core.resources.textmarker">
- </super>
- </extension>
-
<extension
point="org.eclipse.wst.sse.ui.sourcevalidation">
<validator
@@ -630,9 +601,39 @@
</contentTypeIdentifier>
</validator>
</extension>
+
+<!--
+ <extension
+ point="org.eclipse.ui.ide.markerResolution">
+ <markerResolutionGenerator
+ class="org.jboss.tools.jsf.web.validation.i18n.I18nMarkerResolutionGenerator"
+ markerType="org.jboss.tools.jsf.i18nproblemmarker">
+ </markerResolutionGenerator>
+ </extension>
+
+ <extension
+ id="i18nproblemmarker"
+ name="%i18nProblemName"
+ point="org.eclipse.core.resources.markers">
+ <super
+ type="org.eclipse.core.resources.problemmarker">
+ </super>
+ <persistent
+ value="true">
+ </persistent>
+ <attribute
+ name="problemType">
+ </attribute>
+ <attribute
+ name="baseElement">
+ </attribute>
+ <super
+ type="org.eclipse.core.resources.textmarker">
+ </super>
+ </extension>
+
<extension
point="org.eclipse.wst.sse.ui.sourcevalidation">
- <!--Added by Maksim Areshkau -->
<validator
class="org.jboss.tools.jsf.web.validation.i18n.I18nValidator"
id="org.jboss.tools.jsf.externalize.source.validator"
@@ -699,6 +700,7 @@
</include>
</validator>
</extension>
+-->
<extension
point="org.eclipse.wst.sse.ui.quickFixProcessor">
<quickFixProcessor
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidationComponent.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidationComponent.java 2011-04-26 19:08:33 UTC (rev 30849)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidationComponent.java 2011-04-26 19:14:11 UTC (rev 30850)
@@ -12,7 +12,6 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.jsf.web.validation.JSFAbstractValidationComponent;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
@@ -33,6 +32,9 @@
I18nValidationComponent component = new I18nValidationComponent();
component.setStartOffSet(element.getStartOffset());
component.setLength(element.getLength());
+ if(element.getStructuredDocument()==null) {
+ return null;
+ }
component.setLine(element.getStructuredDocument().getLineOfOffset(
component.getStartOffSet()) + 1);
component.createValidationMessage();
@@ -45,6 +47,9 @@
I18nValidationComponent component = new I18nValidationComponent();
component.setStartOffSet(attr.getValueRegionStartOffset()+1);
component.setLength(attr.getValueRegionText().length()-2);
+ if(attr.getStructuredDocument()==null) {
+ return null;
+ }
component.setLine(attr.getStructuredDocument().getLineOfOffset(
component.getStartOffSet()) + 1);
component.createValidationMessage();
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidator.java 2011-04-26 19:08:33 UTC (rev 30849)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidator.java 2011-04-26 19:14:11 UTC (rev 30850)
@@ -30,13 +30,13 @@
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
import org.eclipse.wst.xml.core.internal.validation.XMLValidationInfo;
import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
import org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.jsf2.model.JSF2ComponentModelManager;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
@@ -75,12 +75,9 @@
public void validate(IRegion dirtyRegion, IValidationContext helper,
IReporter reporter) {
- // TODO Auto-generated method stub
}
public void cleanup(IReporter reporter) {
- // TODO Auto-generated method stub
-
}
@Override
@@ -155,24 +152,26 @@
Node childNode = childNodes.item(i);
if (childNode instanceof Text) {
if (!validateTextNode(((Text) childNode).getNodeValue())) {
- jsfnonValComponents
- .add(I18nValidationComponent
- .createI18nValidationComponent((IDOMText) childNode));
+ I18nValidationComponent comp = I18nValidationComponent.createI18nValidationComponent((IDOMText) childNode);
+ if(comp!=null) {
+ jsfnonValComponents.add(comp);
+ }
}
}
if(childNode instanceof Element){
Element elementToValidate = (Element) childNode;
Attr notValid = getNotValidAttr(elementToValidate);
if(notValid!=null){
- jsfnonValComponents
- .add(I18nValidationComponent
- .createI18nValidationComponent((IDOMAttr)notValid));
+ I18nValidationComponent comp = I18nValidationComponent.createI18nValidationComponent((IDOMAttr)notValid);
+ if(comp!=null) {
+ jsfnonValComponents.add(comp);
+ }
}
}
-
validateDOM(childNode, jsfnonValComponents);
}
}
+
/**
* Checks if Element containt non Externalized strings in value attribute
*/
@@ -183,6 +182,7 @@
}
return notValidNode;
}
+
/**
* Return false if not not valid
*
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2011-04-26 19:08:33 UTC (rev 30849)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2011-04-26 19:14:11 UTC (rev 30850)
@@ -62,7 +62,6 @@
JsfJbide7975Test.TEST_PROJECT_PATH,
JsfJbide7975Test.TEST_PROJECT_NAME));
-
suite.addTest(new ProjectImportTestSetup(new TestSuite(
ELVariableRefactoringTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
new String[] { "projects/JSFKickStartOldFormat" }, //$NON-NLS-1$
@@ -84,10 +83,10 @@
JSF2RefactoringTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
new String[] { "projects/JSF2ComponentsValidator" }, //$NON-NLS-1$
new String[] { "JSF2ComponentsValidator" })); //$NON-NLS-1$
- suite.addTest(new ProjectImportTestSetup(new TestSuite(
- I18nValidatorTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
- new String[] { "projects/i18nTestProject" }, //$NON-NLS-1$
- new String[] { "i18nTestProject" })); //$NON-NLS-1$
+// suite.addTest(new ProjectImportTestSetup(new TestSuite(
+// I18nValidatorTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
+// new String[] { "projects/i18nTestProject" }, //$NON-NLS-1$
+// new String[] { "i18nTestProject" })); //$NON-NLS-1$
suite.addTest(new ProjectImportTestSetup(new TestSuite(ELValidatorTest.class),"org.jboss.tools.jsf.test","projects/JSFKickStartOldFormat","JSFKickStartOldFormat") {
@Override
protected void setUp() throws Exception {
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2011-04-26 19:08:33 UTC (rev 30849)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2011-04-26 19:14:11 UTC (rev 30850)
@@ -71,7 +71,7 @@
}
}
- public void testRevalidationUnresolvedELs() throws CoreException, ValidationException{
+ public void _testRevalidationUnresolvedELs() throws CoreException, ValidationException{
IPreferenceStore store = WebKbPlugin.getDefault().getPreferenceStore();
store.setValue(ELSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, ELSeverityPreferences.DISABLE);
store.setValue(ELSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, ELSeverityPreferences.ERROR);
14 years, 11 months