JBoss Tools SVN: r33294 - in trunk/cdi: tests/org.jboss.tools.cdi.seam.core.test and 16 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-07-28 00:41:31 -0400 (Thu, 28 Jul 2011)
New Revision: 33294
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/.project
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/bin/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/cdi-api.jar
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/javax.inject.jar
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/jboss-interceptor-api.jar
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/seam-servlet-api.jar
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/seam-servlet-impl.jar
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/META-INF/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/META-INF/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/MyBean1.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/MyBean2.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/Validation.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTestSetup.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/SeamResourceBundlesTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/servlet/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/servlet/SeamServletValidationTest.java
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/BundleModelTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamResourceBundlesTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.settings/
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/servlet/SeamServletExtension.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/build.properties
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-9389
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/servlet/SeamServletExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/servlet/SeamServletExtension.java 2011-07-28 01:37:59 UTC (rev 33293)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/servlet/SeamServletExtension.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -12,8 +12,10 @@
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointParameter;
import org.jboss.tools.cdi.core.extension.ICDIExtension;
import org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature;
+import org.jboss.tools.common.java.IAnnotated;
/**
* @author Alexey Kazakov
@@ -32,8 +34,14 @@
*/
@Override
public boolean shouldIgnoreInjection(IType typeOfInjectionPoint, IInjectionPoint injection) {
- return injection.getAnnotation(SEAM_SERVLET_COOKIE_PARAM_TYPE_NAME) != null
- || injection.getAnnotation(SEAM_SERVLET_HEADER_PARAM_TYPE_NAME) != null
- || injection.getAnnotation(SEAM_SERVLET_REQUEST_PARAM_TYPE_NAME) != null;
+ IAnnotated annotated = injection;
+ if(injection instanceof IInjectionPointParameter) {
+ IInjectionPointParameter param = (IInjectionPointParameter)injection;
+ annotated = param.getBeanMethod();
+ }
+
+ return annotated.getAnnotation(SEAM_SERVLET_COOKIE_PARAM_TYPE_NAME) != null
+ || annotated.getAnnotation(SEAM_SERVLET_HEADER_PARAM_TYPE_NAME) != null
+ || annotated.getAnnotation(SEAM_SERVLET_REQUEST_PARAM_TYPE_NAME) != null;
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/build.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/build.properties 2011-07-28 01:37:59 UTC (rev 33293)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/build.properties 2011-07-28 04:41:31 UTC (rev 33294)
@@ -2,4 +2,5 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- resources/
+ resources/,\
+ projects/
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/.classpath
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/.classpath (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/.classpath 2011-07-28 04:41:31 UTC (rev 33294)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="lib" path="lib/cdi-api.jar"/>
+ <classpathentry kind="lib" path="lib/javax.inject.jar"/>
+ <classpathentry kind="lib" path="lib/jboss-interceptor-api.jar"/>
+ <classpathentry kind="lib" path="lib/seam-servlet-impl.jar"/>
+ <classpathentry kind="lib" path="lib/seam-servlet-api.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/.project
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/.project (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/.project 2011-07-28 04:41:31 UTC (rev 33294)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>SeamCoreTest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.cdi.core.cdibuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
+ <nature>org.jboss.tools.cdi.core.cdinature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/cdi-api.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/cdi-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/javax.inject.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/javax.inject.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/jboss-interceptor-api.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/jboss-interceptor-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/seam-servlet-api.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/seam-servlet-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/seam-servlet-impl.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/lib/seam-servlet-impl.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/META-INF/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/META-INF/beans.xml (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/META-INF/beans.xml 2011-07-28 04:41:31 UTC (rev 33294)
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<beans>
+</beans>
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/META-INF/beans.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/MyBean1.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/MyBean1.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/MyBean1.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -0,0 +1,5 @@
+package org.jboss.tools.seam.servlet.validation.test;
+
+public class MyBean1 {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/MyBean1.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/MyBean2.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/MyBean2.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/MyBean2.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -0,0 +1,5 @@
+package org.jboss.tools.seam.servlet.validation.test;
+
+public class MyBean2 extends MyBean1 {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/MyBean2.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/Validation.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/Validation.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/Validation.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -0,0 +1,44 @@
+package org.jboss.tools.seam.servlet.validation.test;
+
+import javax.inject.Inject;
+
+import org.jboss.seam.servlet.http.CookieParam;
+import org.jboss.seam.servlet.http.DefaultValue;
+import org.jboss.seam.servlet.http.HeaderParam;
+import org.jboss.seam.servlet.http.RequestParam;
+
+public class Validation {
+
+ @Inject @RequestParam("id") String bookId;
+ @Inject @RequestParam String id;
+ @Inject @RequestParam @DefaultValue("25") String pageSize;
+ @Inject @HeaderParam("User-Agent") String userAgent;
+ @Inject @HeaderParam String userAgent2;
+ @Inject @HeaderParam @DefaultValue("25") String userAgent3;
+ @Inject @CookieParam("User-Agent") String userAgent4;
+ @Inject @CookieParam String userAgent5;
+ @Inject @CookieParam @DefaultValue("25") String userAgent6;
+ @Inject @RequestParam("id") MyBean1 bookId1;
+ @Inject @RequestParam MyBean1 id1;
+ @Inject @RequestParam @DefaultValue("25") MyBean1 pageSize1;
+ @Inject @HeaderParam("User-Agent") MyBean1 userAgent7;
+ @Inject @HeaderParam MyBean1 userAgent8;
+ @Inject @HeaderParam @DefaultValue("25") MyBean1 userAgent9;
+ @Inject @CookieParam("User-Agent") MyBean1 userAgent10;
+ @Inject @CookieParam MyBean1 userAgent11;
+ @Inject @CookieParam @DefaultValue("25") MyBean1 userAgent12;
+ @Inject @RequestParam public void setMyBeanOk(MyBean1 bean, String bean2) {}
+ @Inject @RequestParam("id") public void setMyBeanOk1(MyBean1 bean, String bean2) {}
+ @Inject @RequestParam @DefaultValue("25") public void setMyBeanOk2(MyBean1 bean, String bean2) {}
+ @Inject @HeaderParam public void setMyBeanOk3(MyBean1 bean, String bean2) {}
+ @Inject @HeaderParam("id") public void setMyBeanOk4(MyBean1 bean, String bean2) {}
+ @Inject @HeaderParam @DefaultValue("25") public void setMyBeanOk5(MyBean1 bean, String bean2) {}
+ @Inject @CookieParam public void setMyBeanOk6(MyBean1 bean, String bean2) {}
+ @Inject @CookieParam("id") public void setMyBeanOk7(MyBean1 bean, String bean2) {}
+ @Inject @CookieParam @DefaultValue("25") public void setMyBeanOk8(MyBean1 bean, String bean2) {}
+
+ @Inject MyBean1 beanBroken;
+ @Inject String bean2Broken;
+ @Inject public void setMyBeanBroken(MyBean1 bean) {}
+ @Inject public void setMyBeanBroken(String bean) {}
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/src/org/jboss/tools/seam/servlet/validation/test/Validation.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/BundleModelTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/BundleModelTest.java 2011-07-28 01:37:59 UTC (rev 33293)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/BundleModelTest.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -1,37 +0,0 @@
-package org.jboss.tools.cdi.seam.core.test;
-
-import java.util.Set;
-
-import org.jboss.tools.cdi.core.test.tck.TCKTest;
-import org.jboss.tools.cdi.seam.core.international.BundleModelFactory;
-import org.jboss.tools.cdi.seam.core.international.IBundle;
-import org.jboss.tools.cdi.seam.core.international.IBundleModel;
-import org.jboss.tools.cdi.seam.core.international.ILocalizedValue;
-import org.jboss.tools.cdi.seam.core.international.IProperty;
-
-public class BundleModelTest extends TCKTest {
-
- public void testBundleModel() throws Exception {
- IBundleModel bundleModel = BundleModelFactory.getBundleModel(tckProject);
- assertNotNull(bundleModel);
-
- Set<String> bundles = bundleModel.getAllAvailableBundles();
- assertTrue(bundles.contains("messages"));
-
- IBundle bundle = bundleModel.getBundle("messages");
- assertNotNull(bundle);
-
- IProperty property = bundle.getProperty("home_header1");
- assertNotNull(property);
-
- ILocalizedValue value = property.getValue("de");
- assertNotNull(value);
- assertEquals("Über dieses Beispiel-Anwendung", value.getValue());
-
- value = property.getValue();
- assertNotNull(value);
- assertEquals("About this example application", value.getValue());
-
- }
-
-}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java 2011-07-28 01:37:59 UTC (rev 33293)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -14,20 +14,27 @@
import junit.framework.TestSuite;
import org.eclipse.jdt.internal.core.JavaModelManager;
+import org.jboss.tools.cdi.seam.core.test.international.BundleModelTest;
+import org.jboss.tools.cdi.seam.core.test.international.SeamResourceBundlesTest;
+import org.jboss.tools.cdi.seam.core.test.servlet.SeamServletValidationTest;
/**
* @author Alexey Kazakov
*/
public class CDISeamCoreAllTests {
- protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.core.test";
+ public static String PLUGIN_ID = "org.jboss.tools.cdi.seam.core.test";
public static Test suite() {
JavaModelManager.getIndexManager().disable();
- TestSuite suite = new TestSuite("Seam Core Tests");
+ TestSuite suiteAll = new TestSuite("Seam Core Tests");
- suite.addTestSuite(SeamResourceBundlesTest.class);
- suite.addTestSuite(BundleModelTest.class);
- return suite;
+ suiteAll.addTestSuite(SeamResourceBundlesTest.class);
+ suiteAll.addTestSuite(BundleModelTest.class);
+
+ TestSuite suite = new TestSuite("Seam Core Project Tests");
+ suiteAll.addTest(new SeamCoreTestSetup(suite));
+ suiteAll.addTestSuite(SeamServletValidationTest.class);
+ return suiteAll;
}
}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTestSetup.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTestSetup.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTestSetup.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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.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 Alexey Kazakov
+ */
+public class SeamCoreTestSetup extends TestSetup {
+
+ public static final String PLUGIN_ID = "org.jboss.tools.cdi.seam.core.test";
+ public static final String PROJECT_NAME = "SeamCoreTest";
+ public static final String PROJECT_PATH = "/projects/SeamCoreTest";
+
+ protected IProject project;
+
+ public SeamCoreTestSetup(Test test) {
+ super(test);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
+ if(!project.exists()) {
+ project = ResourcesUtils.importProject(PLUGIN_ID, 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.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamCoreTestSetup.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamResourceBundlesTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamResourceBundlesTest.java 2011-07-28 01:37:59 UTC (rev 33293)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamResourceBundlesTest.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * 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.core.test;
-
-import java.io.File;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.jboss.tools.cdi.core.CDICorePlugin;
-import org.jboss.tools.cdi.core.test.tck.TCKTest;
-import org.jboss.tools.cdi.seam.core.CDISeamCorePlugin;
-import org.jboss.tools.cdi.seam.core.international.el.CDIInternationalMessagesELResolver;
-import org.jboss.tools.common.el.core.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.common.text.ext.util.Utils;
-import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
-import org.jboss.tools.jst.web.kb.PageContextFactory;
-import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
-import org.jboss.tools.test.util.JobUtils;
-import org.osgi.framework.Bundle;
-
-/**
- * @author Alexey Kazakov
- * @author Victor Rubezhny
- */
-public class SeamResourceBundlesTest extends TCKTest {
- protected static final String SEAM_INTERNATIONAL_LIB_SUFFIX = "/seam-international.jar";
- protected static final String SEAM_INTERNATIONAL_PAGE_SUFFIX = "/seam-international.xhtml";
- protected static final String DEFAULT_RESOURCE_BUNDLE_SUFFIX = "/messages.properties";
- protected static final String DE_RESOURCE_BUNDLE_SUFFIX = "/messages_de.properties";
- protected static final String RESOURCES_SUFFIX = "/resources";
-
- protected static String LIB_SUFFIX = "/lib";
-
- private ContentAssistantTestCase caTest = new ContentAssistantTestCase();
- private static final String PAGE_NAME = "WebContent/seam-international.xhtml";
- private String[] resourceBundleNames = new String[] {"bundles.messages"};
- private String[] defaultResourceBundleNameProperties = new String[] {"bundles.messages.home_header", "bundles.messages.home_body", "bundles.messages.home_note"};
- private String[] germanResourceBundleNameProperties = new String[] {"bundles.messages.de_home_header", "bundles.messages.de_home_body", "bundles.messages.de_home_note"};
- private String[] textDefaultResourceBundleNameProperties = new String[] {"home_header", "home_body", "home_note"};
- private String[] textGermanResourceBundleNameProperties = new String[] {"de_home_header", "de_home_body", "de_home_note"};
-
- boolean bReadyForTesting = false;
- String errMessage = null;
-
- public SeamResourceBundlesTest () {
- super();
-
- boolean setupOK = true;
- // Set up seam-international.jar library into the project's WEB-INF/lib folder
- try {
- setupOK = setUpSeamInternationalLibraryAndResourceBundle();
- if (!setupOK)
- errMessage = "Cannot set up SEAM International module and resource bundles into a test project";
- } catch (Exception e) {
- setupOK = false;
- errMessage = "Cannot set up SEAM International module and resource bundles into a test project: "
- + e.getLocalizedMessage();
- }
-
- if (!setupOK)
- return;
-
- // Test that seam-international module is successfully installed on the CDI project
- setupOK = CDICorePlugin.getCDI(tckProject, true).getExtensionManager()
- .isCDIExtensionAvailable(CDISeamCorePlugin.CDI_INTERNATIONAL_RUNTIME_EXTENTION);
- if (!setupOK)
- errMessage = "SEAM International module is not installed or incorrectly installed";
-
- bReadyForTesting = setupOK;
- }
-
-
- /**
- * The method checks if CDIInternationalMessagesELResolver present among the EL Resolvers,
- * then if the required resolver found uses it to retrieve and test proposals for bundle and their properties
- */
- public void testCDIInternationalMessages () {
- assertTrue(errMessage, bReadyForTesting);
-
- IFile page = tckProject.getFile(PAGE_NAME);
- assertTrue("Test page not found: " + PAGE_NAME, (page != null && page.exists()));
- ELContext elContext = PageContextFactory.createPageContext(page);
-
- ELResolver[] elResolvers = elContext.getElResolvers();
- ELResolver cdiInternationalModuleResolver = null;
- if (elResolvers != null) {
- for (ELResolver r : elResolvers) {
- if (r instanceof CDIInternationalMessagesELResolver) {
- cdiInternationalModuleResolver = r;
- break;
- }
- }
- }
- assertNotNull("Seam International module resolver is not set up on the project", cdiInternationalModuleResolver);
-
- List<TextProposal> bundleProposals = cdiInternationalModuleResolver.getProposals(elContext, "value=\"#{", 1);
- assertTrue("Seam International module resolver didn't return proposals for bundles",
- (bundleProposals != null && bundleProposals.size() > 0));
- proposalsExist(bundleProposals, resourceBundleNames);
-
- List<TextProposal> bundlePropertyProposals = cdiInternationalModuleResolver.getProposals(elContext, "value=\"#{bundles.messages.", 1);
- assertTrue("Seam International module resolver didn't return proposals for bundles",
- (bundlePropertyProposals != null && bundlePropertyProposals.size() > 0));
- proposalsExist(bundlePropertyProposals, textDefaultResourceBundleNameProperties);
- proposalsExist(bundlePropertyProposals, textGermanResourceBundleNameProperties);
- }
-
- public void proposalsExist(List<TextProposal> res, String[] proposals) {
- TextProposal[] result = res.toArray(new TextProposal[res.size()]);
- for (int i = 0; i < proposals.length; i++) {
- boolean found = compareTextProposal(proposals[i], result);
- assertTrue("Proposal " + proposals[i] + " not found!", found ); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- public boolean compareTextProposal(String proposal, TextProposal[] proposals){
- for (int i = 0; i < proposals.length; i++) {
- String replacementString = proposals[i].getReplacementString().toLowerCase();
- if (replacementString.equalsIgnoreCase(proposal)) return true;
- // For an attribute value proposal there will be the quote characters
-
- replacementString = Utils.trimQuotes(replacementString);
- if (replacementString.equalsIgnoreCase(proposal)) return true;
-
- }
- return false;
- }
-
- /**
- * The method tests CA on CDI Seam International Module Resource Bundles
- */
- public void testResourceBundles() {
- assertTrue(errMessage, bReadyForTesting);
-
- // Perform CA test
- caTest.checkProposals(PAGE_NAME, "value=\"#{", 9, resourceBundleNames, false);
- caTest.checkProposals(PAGE_NAME, "value=\"#{bundles.messages.", 26, defaultResourceBundleNameProperties, false);
- caTest.checkProposals(PAGE_NAME, "value=\"#{bundles.messages.", 26, germanResourceBundleNameProperties, false);
-
- }
-
- private boolean setUpSeamInternationalLibraryAndResourceBundle() throws Exception {
- Bundle b = Platform.getBundle(CDISeamCoreAllTests.PLUGIN_ID);
- String projectPath = tckProject.getLocation().toOSString();
- String resourcePath = FileLocator.resolve(b.getEntry(RESOURCES_SUFFIX)).getFile();
-
- File seamInternationalLibFrom = new File(resourcePath + SEAM_INTERNATIONAL_LIB_SUFFIX);
- File seamInternationalLibTo = new File(projectPath + WEB_CONTENT_SUFFIX + WEB_INF_SUFFIX
- + LIB_SUFFIX + SEAM_INTERNATIONAL_LIB_SUFFIX);
- if (!FileUtil.copyFile(seamInternationalLibFrom, seamInternationalLibTo))
- return false;
-
- File defaultResourceBundleFrom = new File(resourcePath + DEFAULT_RESOURCE_BUNDLE_SUFFIX);
- File defaultResourceBundleTo = new File(projectPath + JAVA_SOURCE_SUFFIX + DEFAULT_RESOURCE_BUNDLE_SUFFIX);
- if (!FileUtil.copyFile(defaultResourceBundleFrom, defaultResourceBundleTo))
- return false;
-
- File germanResourceBundleFrom = new File(resourcePath + DE_RESOURCE_BUNDLE_SUFFIX);
- File germanResourceBundleTo = new File(projectPath + JAVA_SOURCE_SUFFIX + DE_RESOURCE_BUNDLE_SUFFIX);
- if (!FileUtil.copyFile(germanResourceBundleFrom, germanResourceBundleTo))
- return false;
-
- File seamInternationalPageFrom = new File(resourcePath + SEAM_INTERNATIONAL_PAGE_SUFFIX);
- File seamInternationalPageTo = new File(projectPath + WEB_CONTENT_SUFFIX
- + SEAM_INTERNATIONAL_PAGE_SUFFIX);
- if (!FileUtil.copyFile(seamInternationalPageFrom, seamInternationalPageTo))
- return false;
-
- ValidatorManager.setStatus(ValidatorManager.RUNNING);
- tckProject.refreshLocal(IResource.DEPTH_INFINITE, null);
- JobUtils.waitForIdle();
- tckProject.build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
- JobUtils.waitForIdle();
- tckProject.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
- TestUtil.waitForValidation();
-
- caTest.setProject(tckProject);
- return true;
- }
-}
\ No newline at end of file
Copied: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java (from rev 33276, trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/BundleModelTest.java)
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -0,0 +1,37 @@
+package org.jboss.tools.cdi.seam.core.test.international;
+
+import java.util.Set;
+
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
+import org.jboss.tools.cdi.seam.core.international.BundleModelFactory;
+import org.jboss.tools.cdi.seam.core.international.IBundle;
+import org.jboss.tools.cdi.seam.core.international.IBundleModel;
+import org.jboss.tools.cdi.seam.core.international.ILocalizedValue;
+import org.jboss.tools.cdi.seam.core.international.IProperty;
+
+public class BundleModelTest extends TCKTest {
+
+ public void testBundleModel() throws Exception {
+ IBundleModel bundleModel = BundleModelFactory.getBundleModel(tckProject);
+ assertNotNull(bundleModel);
+
+ Set<String> bundles = bundleModel.getAllAvailableBundles();
+ assertTrue(bundles.contains("messages"));
+
+ IBundle bundle = bundleModel.getBundle("messages");
+ assertNotNull(bundle);
+
+ IProperty property = bundle.getProperty("home_header1");
+ assertNotNull(property);
+
+ ILocalizedValue value = property.getValue("de");
+ assertNotNull(value);
+ assertEquals("Über dieses Beispiel-Anwendung", value.getValue());
+
+ value = property.getValue();
+ assertNotNull(value);
+ assertEquals("About this example application", value.getValue());
+
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/SeamResourceBundlesTest.java (from rev 33276, trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamResourceBundlesTest.java)
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/SeamResourceBundlesTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/SeamResourceBundlesTest.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * 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.core.test.international;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
+import org.jboss.tools.cdi.seam.core.CDISeamCorePlugin;
+import org.jboss.tools.cdi.seam.core.international.el.CDIInternationalMessagesELResolver;
+import org.jboss.tools.cdi.seam.core.test.CDISeamCoreAllTests;
+import org.jboss.tools.common.el.core.resolver.ELContext;
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
+import org.jboss.tools.jst.web.kb.PageContextFactory;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.test.util.JobUtils;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author Victor Rubezhny
+ */
+public class SeamResourceBundlesTest extends TCKTest {
+ protected static final String SEAM_INTERNATIONAL_LIB_SUFFIX = "/seam-international.jar";
+ protected static final String SEAM_INTERNATIONAL_PAGE_SUFFIX = "/seam-international.xhtml";
+ protected static final String DEFAULT_RESOURCE_BUNDLE_SUFFIX = "/messages.properties";
+ protected static final String DE_RESOURCE_BUNDLE_SUFFIX = "/messages_de.properties";
+ protected static final String RESOURCES_SUFFIX = "/resources";
+
+ protected static String LIB_SUFFIX = "/lib";
+
+ private ContentAssistantTestCase caTest = new ContentAssistantTestCase();
+ private static final String PAGE_NAME = "WebContent/seam-international.xhtml";
+ private String[] resourceBundleNames = new String[] {"bundles.messages"};
+ private String[] defaultResourceBundleNameProperties = new String[] {"bundles.messages.home_header", "bundles.messages.home_body", "bundles.messages.home_note"};
+ private String[] germanResourceBundleNameProperties = new String[] {"bundles.messages.de_home_header", "bundles.messages.de_home_body", "bundles.messages.de_home_note"};
+ private String[] textDefaultResourceBundleNameProperties = new String[] {"home_header", "home_body", "home_note"};
+ private String[] textGermanResourceBundleNameProperties = new String[] {"de_home_header", "de_home_body", "de_home_note"};
+
+ boolean bReadyForTesting = false;
+ String errMessage = null;
+
+ public SeamResourceBundlesTest () {
+ super();
+
+ boolean setupOK = true;
+ // Set up seam-international.jar library into the project's WEB-INF/lib folder
+ try {
+ setupOK = setUpSeamInternationalLibraryAndResourceBundle();
+ if (!setupOK)
+ errMessage = "Cannot set up SEAM International module and resource bundles into a test project";
+ } catch (Exception e) {
+ setupOK = false;
+ errMessage = "Cannot set up SEAM International module and resource bundles into a test project: "
+ + e.getLocalizedMessage();
+ }
+
+ if (!setupOK)
+ return;
+
+ // Test that seam-international module is successfully installed on the CDI project
+ setupOK = CDICorePlugin.getCDI(tckProject, true).getExtensionManager()
+ .isCDIExtensionAvailable(CDISeamCorePlugin.CDI_INTERNATIONAL_RUNTIME_EXTENTION);
+ if (!setupOK)
+ errMessage = "SEAM International module is not installed or incorrectly installed";
+
+ bReadyForTesting = setupOK;
+ }
+
+
+ /**
+ * The method checks if CDIInternationalMessagesELResolver present among the EL Resolvers,
+ * then if the required resolver found uses it to retrieve and test proposals for bundle and their properties
+ */
+ public void testCDIInternationalMessages () {
+ assertTrue(errMessage, bReadyForTesting);
+
+ IFile page = tckProject.getFile(PAGE_NAME);
+ assertTrue("Test page not found: " + PAGE_NAME, (page != null && page.exists()));
+ ELContext elContext = PageContextFactory.createPageContext(page);
+
+ ELResolver[] elResolvers = elContext.getElResolvers();
+ ELResolver cdiInternationalModuleResolver = null;
+ if (elResolvers != null) {
+ for (ELResolver r : elResolvers) {
+ if (r instanceof CDIInternationalMessagesELResolver) {
+ cdiInternationalModuleResolver = r;
+ break;
+ }
+ }
+ }
+ assertNotNull("Seam International module resolver is not set up on the project", cdiInternationalModuleResolver);
+
+ List<TextProposal> bundleProposals = cdiInternationalModuleResolver.getProposals(elContext, "value=\"#{", 1);
+ assertTrue("Seam International module resolver didn't return proposals for bundles",
+ (bundleProposals != null && bundleProposals.size() > 0));
+ proposalsExist(bundleProposals, resourceBundleNames);
+
+ List<TextProposal> bundlePropertyProposals = cdiInternationalModuleResolver.getProposals(elContext, "value=\"#{bundles.messages.", 1);
+ assertTrue("Seam International module resolver didn't return proposals for bundles",
+ (bundlePropertyProposals != null && bundlePropertyProposals.size() > 0));
+ proposalsExist(bundlePropertyProposals, textDefaultResourceBundleNameProperties);
+ proposalsExist(bundlePropertyProposals, textGermanResourceBundleNameProperties);
+ }
+
+ public void proposalsExist(List<TextProposal> res, String[] proposals) {
+ TextProposal[] result = res.toArray(new TextProposal[res.size()]);
+ for (int i = 0; i < proposals.length; i++) {
+ boolean found = compareTextProposal(proposals[i], result);
+ assertTrue("Proposal " + proposals[i] + " not found!", found ); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ public boolean compareTextProposal(String proposal, TextProposal[] proposals){
+ for (int i = 0; i < proposals.length; i++) {
+ String replacementString = proposals[i].getReplacementString().toLowerCase();
+ if (replacementString.equalsIgnoreCase(proposal)) return true;
+ // For an attribute value proposal there will be the quote characters
+
+ replacementString = Utils.trimQuotes(replacementString);
+ if (replacementString.equalsIgnoreCase(proposal)) return true;
+
+ }
+ return false;
+ }
+
+ /**
+ * The method tests CA on CDI Seam International Module Resource Bundles
+ */
+ public void testResourceBundles() {
+ assertTrue(errMessage, bReadyForTesting);
+
+ // Perform CA test
+ caTest.checkProposals(PAGE_NAME, "value=\"#{", 9, resourceBundleNames, false);
+ caTest.checkProposals(PAGE_NAME, "value=\"#{bundles.messages.", 26, defaultResourceBundleNameProperties, false);
+ caTest.checkProposals(PAGE_NAME, "value=\"#{bundles.messages.", 26, germanResourceBundleNameProperties, false);
+
+ }
+
+ private boolean setUpSeamInternationalLibraryAndResourceBundle() throws Exception {
+ Bundle b = Platform.getBundle(CDISeamCoreAllTests.PLUGIN_ID);
+ String projectPath = tckProject.getLocation().toOSString();
+ String resourcePath = FileLocator.resolve(b.getEntry(RESOURCES_SUFFIX)).getFile();
+
+ File seamInternationalLibFrom = new File(resourcePath + SEAM_INTERNATIONAL_LIB_SUFFIX);
+ File seamInternationalLibTo = new File(projectPath + WEB_CONTENT_SUFFIX + WEB_INF_SUFFIX
+ + LIB_SUFFIX + SEAM_INTERNATIONAL_LIB_SUFFIX);
+ if (!FileUtil.copyFile(seamInternationalLibFrom, seamInternationalLibTo))
+ return false;
+
+ File defaultResourceBundleFrom = new File(resourcePath + DEFAULT_RESOURCE_BUNDLE_SUFFIX);
+ File defaultResourceBundleTo = new File(projectPath + JAVA_SOURCE_SUFFIX + DEFAULT_RESOURCE_BUNDLE_SUFFIX);
+ if (!FileUtil.copyFile(defaultResourceBundleFrom, defaultResourceBundleTo))
+ return false;
+
+ File germanResourceBundleFrom = new File(resourcePath + DE_RESOURCE_BUNDLE_SUFFIX);
+ File germanResourceBundleTo = new File(projectPath + JAVA_SOURCE_SUFFIX + DE_RESOURCE_BUNDLE_SUFFIX);
+ if (!FileUtil.copyFile(germanResourceBundleFrom, germanResourceBundleTo))
+ return false;
+
+ File seamInternationalPageFrom = new File(resourcePath + SEAM_INTERNATIONAL_PAGE_SUFFIX);
+ File seamInternationalPageTo = new File(projectPath + WEB_CONTENT_SUFFIX
+ + SEAM_INTERNATIONAL_PAGE_SUFFIX);
+ if (!FileUtil.copyFile(seamInternationalPageFrom, seamInternationalPageTo))
+ return false;
+
+ ValidatorManager.setStatus(ValidatorManager.RUNNING);
+ tckProject.refreshLocal(IResource.DEPTH_INFINITE, null);
+ JobUtils.waitForIdle();
+ tckProject.build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
+ JobUtils.waitForIdle();
+ tckProject.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ TestUtil.waitForValidation();
+
+ caTest.setProject(tckProject);
+ return true;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/SeamResourceBundlesTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/servlet/SeamServletValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/servlet/SeamServletValidationTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/servlet/SeamServletValidationTest.java 2011-07-28 04:41:31 UTC (rev 33294)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * 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.core.test.servlet;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+import org.jboss.tools.cdi.seam.core.test.SeamCoreTestSetup;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamServletValidationTest extends TestCase {
+
+ protected IProject project;
+
+ public IProject getTestProject() throws IOException, CoreException, InvocationTargetException, InterruptedException {
+ if(project==null) {
+ ValidatorManager.setStatus("INIT");
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(SeamCoreTestSetup.PROJECT_NAME);
+ if(!project.exists()) {
+ project = ResourcesUtils.importProject(SeamCoreTestSetup.PLUGIN_ID, SeamCoreTestSetup.PROJECT_PATH);
+ }
+ TestUtil.waitForValidation();
+ }
+ return project;
+ }
+
+ /**
+ * CDI validator should ignore injection points annotated @RequestParam/@HeaderParam/@CookieParam
+ * See https://issues.jboss.org/browse/JBIDE-9389
+ * @throws Exception
+ */
+ public void testInjectionValidationForField() throws Exception {
+ IFile file = getTestProject().getFile("src/org/jboss/tools/seam/servlet/validation/test/Validation.java");
+ for (int i = 12; i < 30; i++) {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, i);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, i);
+ }
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 40, 42);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 41, 43);
+ }
+
+ /**
+ * CDI validator should ignore injection points annotated @RequestParam/@HeaderParam/@CookieParam
+ * See https://issues.jboss.org/browse/JBIDE-9389
+ * @throws Exception
+ */
+ public void testInjectionValidationForParam() throws Exception {
+ IFile file = getTestProject().getFile("src/org/jboss/tools/seam/servlet/validation/test/Validation.java");
+ for (int i = 30; i < 39; i++) {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, i);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, i);
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/servlet/SeamServletValidationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 9 months
JBoss Tools SVN: r33293 - trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-07-27 21:37:59 -0400 (Wed, 27 Jul 2011)
New Revision: 33293
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/OpenOnsTest.java
Log:
removed all JobUtils.waitForIdle() from tests to check if it is fine for hudson. it works locally and saves about 15 seconds of tests execution time, which is about 20% of execution time for whole plugin.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/OpenOnsTest.java 2011-07-28 01:35:04 UTC (rev 33292)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/OpenOnsTest.java 2011-07-28 01:37:59 UTC (rev 33293)
@@ -36,7 +36,6 @@
project = ResourcesPlugin.getWorkspace().getRoot().getProject(
OPENON_TEST_PROJECT);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
- JobUtils.waitForIdle();
IWorkbench workbench = PlatformUI.getWorkbench();
}
@@ -53,7 +52,6 @@
public void testFilterNameOpenOn() throws PartInitException, BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(WEB_XML_FILE_PATH);
editor = ((EditorPartWrapper)editor).getEditor();
- JobUtils.waitForIdle();
DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
xmlMultyPageEditor.selectPageByName("Source");
ISourceViewer viewer = xmlMultyPageEditor.getSourceEditor().getTextViewer();
@@ -77,7 +75,6 @@
public void testRoleNameOpenOn() throws PartInitException, BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(WEB_XML_FILE_PATH);
editor = ((EditorPartWrapper)editor).getEditor();
- JobUtils.waitForIdle();
DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
xmlMultyPageEditor.selectPageByName("Source");
ISourceViewer viewer = xmlMultyPageEditor.getSourceEditor().getTextViewer();
@@ -99,7 +96,6 @@
public void testServletNameOpenOn() throws PartInitException, BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(WEB_XML_FILE_PATH);
editor = ((EditorPartWrapper)editor).getEditor();
- JobUtils.waitForIdle();
DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
xmlMultyPageEditor.selectPageByName("Source");
ISourceViewer viewer = xmlMultyPageEditor.getSourceEditor().getTextViewer();
@@ -129,7 +125,6 @@
public void testTaglibUriFromJarOpenOn() throws BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(TAGLIB_URI_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
@@ -141,7 +136,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -153,7 +147,6 @@
public void testTaglibUriFromJarinJspRootOpenOn() throws BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(TAGLIB_URI_JSP_ROOT_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
@@ -165,8 +158,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
-
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -181,7 +172,6 @@
public void testStylesheetOpenOn() throws BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(STYLE_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
@@ -193,7 +183,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -203,7 +192,6 @@
public void testStyleClassOpenOns() throws CoreException, BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(STYLE_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
@@ -215,7 +203,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle(DELAY_FOR_LINK_OPEN);
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -229,7 +216,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle(DELAY_FOR_LINK_OPEN);
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
fileName = editor.getEditorInput().getName();
@@ -243,7 +229,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle(DELAY_FOR_LINK_OPEN);
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
fileName = editor.getEditorInput().getName();
@@ -267,7 +252,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -289,7 +273,6 @@
assertNotNull(links[0].toString());
System.out.println(links[0].getClass().getName());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -314,7 +297,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
assertEquals("<jsp:useBean id=\"b1\" class=\"org.jboss.tools.test.TestBean1\">", selection.getText());
@@ -327,7 +309,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
assertTrue("TestBean1.java".equals(fileName));
@@ -347,7 +328,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -368,7 +348,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -392,7 +371,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -406,7 +384,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
fileName = editor.getEditorInput().getName();
@@ -430,7 +407,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -444,7 +420,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
fileName = editor.getEditorInput().getName();
assertTrue("includeHiperlinkPage1Tests.jsp".equals(fileName));
@@ -468,7 +443,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -492,7 +466,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -516,7 +489,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
@@ -528,7 +500,6 @@
public void testFaceletTaglibTypeOpenOn() throws CoreException, BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(FACELET_TAGLIB_TEST_FILE);
editor = ((EditorPartWrapper)editor).getEditor();
- JobUtils.waitForIdle();
DefaultMultipageEditor faceletEditor = (DefaultMultipageEditor) editor;
faceletEditor.selectPageByName("Source");
ISourceViewer viewer = faceletEditor.getSourceEditor().getTextViewer();
@@ -542,7 +513,6 @@
assertTrue(links.length != 0);
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String title = editor.getTitle();
assertTrue("java.lang.String declaration should be opened, but \'" + title + "\' is actially openned in active editor",
@@ -566,7 +536,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -578,7 +547,6 @@
public void testTaglibAttributeFromJarOpenOn() throws BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(TAGLIB_TAGS_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
@@ -590,7 +558,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
@@ -603,7 +570,6 @@
public void testTaglibTagsFromJarOpenOn() throws BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(TAGLIB_TAGS_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
@@ -615,7 +581,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
@@ -632,7 +597,6 @@
public void testTaglibTagsInWebInfOpenOn() throws BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(TAGLIB_TAGS_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
@@ -644,7 +608,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
@@ -657,7 +620,6 @@
public void testTaglibAttributeInWebInfOpenOn() throws BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(TAGLIB_TAGS_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
- JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
@@ -669,7 +631,6 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
12 years, 9 months
JBoss Tools SVN: r33292 - trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-07-27 21:35:04 -0400 (Wed, 27 Jul 2011)
New Revision: 33292
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSFHyperlinkTestUtil.java
Log:
added additional constructor for TestRegion for convenience
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSFHyperlinkTestUtil.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSFHyperlinkTestUtil.java 2011-07-28 01:32:05 UTC (rev 33291)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSFHyperlinkTestUtil.java 2011-07-28 01:35:04 UTC (rev 33292)
@@ -70,9 +70,11 @@
assertNotNull("The document for the file \"" + fileName + "\" is not loaded", document);
int expected = 0;
- for(TestRegion testRegion : regionList)
+
+ for(TestRegion testRegion : regionList) {
expected += testRegion.region.getLength()+1;
-
+ }
+
IEditorPart part = openFileInEditor(file);
ISourceViewer viewer = null;
if(part instanceof JavaEditor){
@@ -310,6 +312,13 @@
hyperlinks.add(testHyperlink);
}
}
+
+ public TestRegion(Region region, TestHyperlink[] testHyperlinks){
+ region = new Region(region.getOffset(),region.getLength());
+ for(TestHyperlink testHyperlink : testHyperlinks){
+ hyperlinks.add(testHyperlink);
+ }
+ }
}
public static class TestHyperlink{
12 years, 9 months
JBoss Tools SVN: r33291 - trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-07-27 21:32:05 -0400 (Wed, 27 Jul 2011)
New Revision: 33291
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java
Log:
Test optimization: all tests are moved in the same setup to avoid importing the same test project many times for none conflicting tests.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java 2011-07-28 00:49:44 UTC (rev 33290)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java 2011-07-28 01:32:05 UTC (rev 33291)
@@ -25,26 +25,14 @@
new String[]{"HiperlinksTestProject"}));
suite.addTest(new ProjectImportTestSetup(new TestSuite(
JSF2CompositeOpenOnTest.class,
- JSF2CompositeLibOpenOnTest.class),
+ JSF2CompositeLibOpenOnTest.class,
+ JSF2MessagesOpenOnTest.class,
+ JSF2CSSStylesheetOpenOnTest.class,
+ JSF2CCAttrsOpenOnTest.class,
+ JSF2XMLOpenOnTest.class),
"org.jboss.tools.jsf.text.ext.test",
new String[]{"projects/JSF2CompositeOpenOn"},
new String[]{"JSF2CompositeOpenOn"}));
- suite.addTest(new ProjectImportTestSetup(new TestSuite(JSF2MessagesOpenOnTest.class),
- "org.jboss.tools.jsf.text.ext.test",
- new String[]{"projects/JSF2CompositeOpenOn"},
- new String[]{"JSF2CompositeOpenOn"}));
- suite.addTest(new ProjectImportTestSetup(new TestSuite(JSF2CSSStylesheetOpenOnTest.class),
- "org.jboss.tools.jsf.text.ext.test",
- new String[]{"projects/JSF2CompositeOpenOn"},
- new String[]{"JSF2CompositeOpenOn"}));
- suite.addTest(new ProjectImportTestSetup(new TestSuite(JSF2CCAttrsOpenOnTest.class),
- "org.jboss.tools.jsf.text.ext.test",
- new String[]{"projects/JSF2CompositeOpenOn"},
- new String[]{"JSF2CompositeOpenOn"}));
- suite.addTest(new ProjectImportTestSetup(new TestSuite(JSF2XMLOpenOnTest.class),
- "org.jboss.tools.jsf.text.ext.test",
- new String[]{"projects/JSF2CompositeOpenOn"},
- new String[]{"JSF2CompositeOpenOn"}));
return suite;
}
}
\ No newline at end of file
12 years, 9 months
JBoss Tools SVN: r33290 - in trunk/jsf/docs/userguide/en-US/images: palette and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-07-27 20:49:44 -0400 (Wed, 27 Jul 2011)
New Revision: 33290
Modified:
trunk/jsf/docs/userguide/en-US/images/editors_features/editors_features_31.png
trunk/jsf/docs/userguide/en-US/images/palette/palette_2.png
Log:
updated for TOOLSDOC-182
Modified: trunk/jsf/docs/userguide/en-US/images/editors_features/editors_features_31.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/palette/palette_2.png
===================================================================
(Binary files differ)
12 years, 9 months
JBoss Tools SVN: r33289 - in branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images: palette and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-07-27 20:49:27 -0400 (Wed, 27 Jul 2011)
New Revision: 33289
Modified:
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/editors_features/editors_features_31.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/palette/palette_2.png
Log:
updated for TOOLSDOC-182
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/editors_features/editors_features_31.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/palette/palette_2.png
===================================================================
(Binary files differ)
12 years, 9 months
JBoss Tools SVN: r33288 - trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-07-27 20:35:52 -0400 (Wed, 27 Jul 2011)
New Revision: 33288
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/build.properties
Log:
Added resource folder to build
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/build.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/build.properties 2011-07-28 00:32:45 UTC (rev 33287)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/build.properties 2011-07-28 00:35:52 UTC (rev 33288)
@@ -1,4 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ resources/
12 years, 9 months
JBoss Tools SVN: r33287 - trunk/jsf/docs/userguide/en-US/images/visual_page.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-07-27 20:32:45 -0400 (Wed, 27 Jul 2011)
New Revision: 33287
Modified:
trunk/jsf/docs/userguide/en-US/images/visual_page/customFacelets1.png
trunk/jsf/docs/userguide/en-US/images/visual_page/customFacelets2.png
trunk/jsf/docs/userguide/en-US/images/visual_page/customFacelets3.png
trunk/jsf/docs/userguide/en-US/images/visual_page/customFacelets4.png
trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_12.png
trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_14.png
trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_15.png
trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_23b.png
trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_3.png
trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_4.png
trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_4d.png
trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_4e.png
trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_5.png
Log:
updated images for TOOLSDOC-182
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/customFacelets1.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/customFacelets2.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/customFacelets3.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/customFacelets4.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_12.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_14.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_15.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_23b.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_3.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_4.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_4d.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_4e.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en-US/images/visual_page/visual_page_5.png
===================================================================
(Binary files differ)
12 years, 9 months
JBoss Tools SVN: r33286 - branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-07-27 20:32:25 -0400 (Wed, 27 Jul 2011)
New Revision: 33286
Modified:
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/customFacelets1.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/customFacelets2.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/customFacelets3.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/customFacelets4.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_12.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_14.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_15.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_23b.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_3.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_4d.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_4e.png
branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_5.png
Log:
updated images for TOOLSDOC-182
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/customFacelets1.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/customFacelets2.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/customFacelets3.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/customFacelets4.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_12.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_14.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_15.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_23b.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_3.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_4d.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_4e.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/jsf/docs/userguide/en-US/images/visual_page/visual_page_5.png
===================================================================
(Binary files differ)
12 years, 9 months
JBoss Tools SVN: r33285 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension and 12 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-07-27 20:27:03 -0400 (Wed, 27 Jul 2011)
New Revision: 33285
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IInjectionPointValidatorFeature.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/servlet/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/servlet/SeamServletExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/src/org/jboss/tools/cdi/seam/faces/core/SeamFacesExtension.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/plugin.xml
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/SeamConfigTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/CDISeamFacesCoreAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-9389
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -98,9 +98,6 @@
public String WELD_BEAN_MANAGER_TYPE_NAME = "org.jboss.weld.manager.BeanManagerImpl";
- public String SEAM_FACES_INPUT_FIELD_TYPE_NAME = "org.jboss.seam.faces.validation.InputField";
- public String SEAM_FACES_INPUT_ELEMENT_TYPE_NAME = "org.jboss.seam.faces.validation.InputElement";
-
public String ELEMENT_TYPE_TYPE_NAME = "java.lang.annotation.ElementType.TYPE";
public String ELEMENT_TYPE_METHOD_NAME = "java.lang.annotation.ElementType.METHOD";
public String ELEMENT_TYPE_FIELD_NAME = "java.lang.annotation.ElementType.FIELD";
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -161,7 +161,7 @@
}
if(isClassPathUpdated || buildParticipants == null) {
//3. Install extensions. That should be done before constructing working copy of context.
- buildParticipants = n.getExtensionManager().getBuildParticipantFeature();
+ buildParticipants = n.getExtensionManager().getBuildParticipantFeatures();
buildParticipants2 = new HashSet<IBuildParticipant2Feature>();
Set<IDefinitionContextExtension> es = new HashSet<IDefinitionContextExtension>();
for (IBuildParticipantFeature p: buildParticipants) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.cdi.core.extension;
-
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -138,30 +137,30 @@
return featureToExtensions.containsKey(feature) ? featureToExtensions.get(feature) : EMPTY;
}
- public Set<IProcessAnnotatedMemberFeature> getProcessAnnotatedMemberFeature() {
- return getFeature(IProcessAnnotatedMemberFeature.class);
+ public Set<IProcessAnnotatedMemberFeature> getProcessAnnotatedMemberFeatures() {
+ return getFeatures(IProcessAnnotatedMemberFeature.class);
}
- public Set<IProcessAnnotatedTypeFeature> getProcessAnnotatedTypeFeature() {
- return getFeature(IProcessAnnotatedTypeFeature.class);
+ public Set<IProcessAnnotatedTypeFeature> getProcessAnnotatedTypeFeatures() {
+ return getFeatures(IProcessAnnotatedTypeFeature.class);
}
- public Set<IBuildParticipantFeature> getBuildParticipantFeature() {
+ public Set<IBuildParticipantFeature> getBuildParticipantFeatures() {
if(!featureStorage.containsKey(IBuildParticipantFeature.class)) {
- Set<IBuildParticipantFeature> result = getFeature(IBuildParticipantFeature.class);
+ Set<IBuildParticipantFeature> result = getFeatures(IBuildParticipantFeature.class);
for (IBuildParticipantFeature f: result) {
f.setProject(n);
}
}
- return getFeature(IBuildParticipantFeature.class);
+ return getFeatures(IBuildParticipantFeature.class);
}
- public Set<IAmbiguousBeanResolverFeature> getAmbiguousBeanResolverFeature() {
- return getFeature(IAmbiguousBeanResolverFeature.class);
+ public Set<IAmbiguousBeanResolverFeature> getAmbiguousBeanResolverFeatures() {
+ return getFeatures(IAmbiguousBeanResolverFeature.class);
}
- public Set<IValidatorFeature> getValidatorFeature() {
- return getFeature(IValidatorFeature.class);
+ public Set<IValidatorFeature> getValidatorFeatures() {
+ return getFeatures(IValidatorFeature.class);
}
/**
@@ -170,7 +169,8 @@
* @param cls
* @return set of feature implementation objects by feature class
*/
- public <F extends ICDIFeature> Set<F> getFeature(Class<F> cls) {
+ public <F extends ICDIFeature> Set<F> getFeatures(Class<F> cls) {
+ @SuppressWarnings("unchecked")
Set<F> result = (Set<F>)featureStorage.get(cls);
if(result == null) {
result = new HashSet<F>();
@@ -187,5 +187,4 @@
}
return result;
}
-
-}
+}
\ No newline at end of file
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IInjectionPointValidatorFeature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IInjectionPointValidatorFeature.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IInjectionPointValidatorFeature.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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.core.extension.feature;
+
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IInjectionPointValidatorFeature extends ICDIFeature {
+
+ /**
+ * Returns true if CDI Validator should ignore the injection point during lookup validation.
+ * @param typeOfInjectionPoint
+ * @param injection
+ * @return
+ */
+ boolean shouldIgnoreInjection(IType typeOfInjectionPoint, IInjectionPoint injection);
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IInjectionPointValidatorFeature.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -257,7 +257,7 @@
}
if(result.size() > 1) {
- Set<IAmbiguousBeanResolverFeature> extensions = getExtensionManager().getAmbiguousBeanResolverFeature();
+ Set<IAmbiguousBeanResolverFeature> extensions = getExtensionManager().getAmbiguousBeanResolverFeatures();
for (IAmbiguousBeanResolverFeature e: extensions) {
result = e.getResolvedBeans(result);
if(result.size() < 2) return result;
@@ -1034,7 +1034,7 @@
rebuildAnnotationTypes();
rebuildBeans();
- Set<IBuildParticipantFeature> buildParticipants = n.getExtensionManager().getBuildParticipantFeature();
+ Set<IBuildParticipantFeature> buildParticipants = n.getExtensionManager().getBuildParticipantFeatures();
for (IBuildParticipantFeature p: buildParticipants) p.buildBeans();
CDICoreNature[] ps = n.getDependentProjects().toArray(new CDICoreNature[0]);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -363,7 +363,7 @@
packageDefinitions = workingCopy.packageDefinitions;
beanXMLs = workingCopy.beanXMLs;
- Set<IProcessAnnotatedTypeFeature> fs = project.getExtensionManager().getProcessAnnotatedTypeFeature();
+ Set<IProcessAnnotatedTypeFeature> fs = project.getExtensionManager().getProcessAnnotatedTypeFeatures();
if(fs != null && !fs.isEmpty()) {
for (TypeDefinition nd: newTypeDefinitions) {
for (IProcessAnnotatedTypeFeature f: fs) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -49,7 +49,7 @@
//provide initialization
context.getAnnotationKind(a.getType());
}
- Set<IProcessAnnotatedMemberFeature> extensions = context.getProject().getExtensionManager().getProcessAnnotatedMemberFeature();
+ Set<IProcessAnnotatedMemberFeature> extensions = context.getProject().getExtensionManager().getProcessAnnotatedMemberFeatures();
IField[] fs = getType().getFields();
for (int i = 0; i < fs.length; i++) {
FieldDefinition f = newFieldDefinition();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -80,6 +80,7 @@
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.IStereotyped;
+import org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature;
import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
import org.jboss.tools.cdi.core.preferences.CDIPreferences;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
@@ -111,8 +112,10 @@
String projectName;
IValidatingProjectTree projectTree;
IValidatingProjectSet projectSet;
- Set<IFolder> sourceFolders = null;
+ Set<IFolder> sourceFolders;
+ private Set<IInjectionPointValidatorFeature> injectionValidationFeatures;
+
private BeansXmlValidationDelegate beansXmlValidator = new BeansXmlValidationDelegate(this);
private AnnotationValidationDelegate annotationValidator = new AnnotationValidationDelegate(this);
@@ -199,12 +202,14 @@
setMessageIdQuickFixAttributeName(MESSAGE_ID_ATTRIBUTE_NAME);
projectTree = validationHelper.getValidationContextManager().getValidatingProjectTree(this);
projectSet = projectTree.getBrunches().get(rootProject);
+ cdiProject = null;
CDICoreNature nature = CDICorePlugin.getCDI(projectSet.getRootProject(), false);
if(nature!=null) {
cdiProject = nature.getDelegate();
if(cdiProject==null) {
CDICorePlugin.getDefault().logError("Trying to validate " + rootProject + " but CDI Tools model for the project is not buit.");
}
+ injectionValidationFeatures = nature.getExtensionManager().getFeatures(IInjectionPointValidatorFeature.class);
}
projectName = projectSet.getRootProject().getName();
sourceFolders = null;
@@ -445,7 +450,7 @@
IInterceptorBinding binding = cdiProject.getInterceptorBinding(file.getFullPath());
validateInterceptorBinding(binding);
}
- Set<IValidatorFeature> extensions = cdiProject.getNature().getExtensionManager().getValidatorFeature();
+ Set<IValidatorFeature> extensions = cdiProject.getNature().getExtensionManager().getValidatorFeatures();
for (IValidatorFeature v: extensions) {
setSeverityPreferences(v.getSeverityPreferences());
v.validateResource(file, this);
@@ -1429,6 +1434,21 @@
}
}
+ /**
+ * Checks if the injection point injects some bean from a CDI extension and should be ignored by the validator during lookup validation.
+ * @param typeOfInjectionPoint
+ * @param injection
+ * @return
+ */
+ private boolean shouldIgnoreInjection(IType typeOfInjectionPoint, IInjectionPoint injection) {
+ for (IInjectionPointValidatorFeature feature : injectionValidationFeatures) {
+ if(feature.shouldIgnoreInjection(typeOfInjectionPoint, injection)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private void validateInjectionPoint(IInjectionPoint injection) {
/*
* 3.11. The qualifier @Named at injection points
@@ -1491,127 +1511,117 @@
* - If an unsatisfied or unresolvable ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem.
*/
IType type = getTypeOfInjection(injection);
- // If the injection point annotated @InputField then don't try to resolve it. Also ignore @Inject InputElement field.
- // Despite this annotation is from Seam Faces module and is not part of JSR-299 it's much easy to check this annotation here instead of moving this check to Seam Faces plug-in.
- // See https://issues.jboss.org/browse/JBIDE-8576
- if(type==null || !CDIConstants.SEAM_FACES_INPUT_ELEMENT_TYPE_NAME.equals(type.getFullyQualifiedName())) {
- IAnnotationDeclaration faces = injection.getAnnotation(CDIConstants.SEAM_FACES_INPUT_FIELD_TYPE_NAME);
- if(faces==null && injection instanceof IInjectionPointParameter) {
- IInjectionPointParameter param = (IInjectionPointParameter)injection;
- faces = param.getBeanMethod().getAnnotation(CDIConstants.SEAM_FACES_INPUT_FIELD_TYPE_NAME);
+ if(!shouldIgnoreInjection(type, injection)) {
+ boolean instance = type!=null && CDIConstants.INSTANCE_TYPE_NAME.equals(type.getFullyQualifiedName());
+ Set<IBean> allBeans = cdiProject.getBeans(false, injection);
+ for (IBean bean : allBeans) {
+ if(!bean.getBeanClass().isReadOnly()) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, injection.getSourcePath().toOSString(), bean.getResource().getFullPath(), false);
+ }
}
- if(faces==null) {
- boolean instance = type!=null && CDIConstants.INSTANCE_TYPE_NAME.equals(type.getFullyQualifiedName());
- Set<IBean> allBeans = cdiProject.getBeans(false, injection);
- for (IBean bean : allBeans) {
- if(!bean.getBeanClass().isReadOnly()) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, injection.getSourcePath().toOSString(), bean.getResource().getFullPath(), false);
+ if(type!=null && beans.isEmpty() && !instance) {
+ addError(CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, CDIPreferences.UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), UNSATISFIED_INJECTION_POINTS_ID);
+ } else if(beans.size()>1 && !instance) {
+ addError(CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), AMBIGUOUS_INJECTION_POINTS_ID);
+ } else if(beans.size()==1) {
+ IBean bean = beans.iterator().next();
+ if(!bean.getBeanClass().isReadOnly()) {
+ /*
+ * 5.2.4. Primitive types and null values
+ * - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
+ */
+ if(bean.isNullable() && injection.getType()!=null && injection.getType().isPrimitive()) {
+ addError(CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, reference, injection.getResource());
}
- }
- if(type!=null && beans.isEmpty() && !instance) {
- addError(CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, CDIPreferences.UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), UNSATISFIED_INJECTION_POINTS_ID);
- } else if(beans.size()>1 && !instance) {
- addError(CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), AMBIGUOUS_INJECTION_POINTS_ID);
- } else if(beans.size()==1) {
- IBean bean = beans.iterator().next();
- if(!bean.getBeanClass().isReadOnly()) {
- /*
- * 5.2.4. Primitive types and null values
- * - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
- */
- if(bean.isNullable() && injection.getType()!=null && injection.getType().isPrimitive()) {
- addError(CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, reference, injection.getResource());
- }
- /*
- * 5.1.4. Inter-module injection
- * - a decorator can not be injected
- * - an interceptor can not be injected
- * It is not an error - container just never attempts to inject them.
- */
+ /*
+ * 5.1.4. Inter-module injection
+ * - a decorator can not be injected
+ * - an interceptor can not be injected
+ * It is not an error - container just never attempts to inject them.
+ */
- /*
- * 5.4.1. Unproxyable bean types
- * - If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope,
- * the container automatically detects the problem and treats it as a deployment problem.
- */
- if(bean.getScope()!=null && bean.getScope().isNorlmalScope() && injection.getType()!=null) {
- // - Array types cannot be proxied by the container.
- String typeSignature = injection.getType().getSignature();
- int kind = Signature.getTypeSignatureKind(typeSignature);
- if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else if(injection.getType().isPrimitive()) {
- // - Primitive types cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else if(bean instanceof IClassBean) {
- try {
- if(Flags.isFinal(bean.getBeanClass().getFlags())) {
- // - Classes which are declared final cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else {
- IMethod[] methods = bean.getBeanClass().getMethods();
- boolean hasDefaultConstructor = false;
- boolean hasConstructor = false;
- for (IMethod method : methods) {
- hasConstructor = hasConstructor || method.isConstructor();
- hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor() && !Flags.isPrivate(method.getFlags()) && method.getParameterNames().length==0);
- if(Flags.isFinal(method.getFlags())) {
- // - Classes which have final methods cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- hasDefaultConstructor = true;
- break;
- }
+ /*
+ * 5.4.1. Unproxyable bean types
+ * - If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ if(bean.getScope()!=null && bean.getScope().isNorlmalScope() && injection.getType()!=null) {
+ // - Array types cannot be proxied by the container.
+ String typeSignature = injection.getType().getSignature();
+ int kind = Signature.getTypeSignatureKind(typeSignature);
+ if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else if(injection.getType().isPrimitive()) {
+ // - Primitive types cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else if(bean instanceof IClassBean) {
+ try {
+ if(Flags.isFinal(bean.getBeanClass().getFlags())) {
+ // - Classes which are declared final cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else {
+ IMethod[] methods = bean.getBeanClass().getMethods();
+ boolean hasDefaultConstructor = false;
+ boolean hasConstructor = false;
+ for (IMethod method : methods) {
+ hasConstructor = hasConstructor || method.isConstructor();
+ hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor() && !Flags.isPrivate(method.getFlags()) && method.getParameterNames().length==0);
+ if(Flags.isFinal(method.getFlags())) {
+ // - Classes which have final methods cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ hasDefaultConstructor = true;
+ break;
}
- if(!hasDefaultConstructor && hasConstructor) {
- // - Classes which don't have a non-private constructor with no parameters cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- }
}
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
+ if(!hasDefaultConstructor && hasConstructor) {
+ // - Classes which don't have a non-private constructor with no parameters cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ }
}
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
}
- if(injection.getClassBean() instanceof IDecorator && injection.isDelegate() && bean instanceof IClassBean) {
- try {
- IType beanClass = bean.getBeanClass();
- if(Flags.isFinal(beanClass.getFlags())) {
- // 8.3. Decorator resolution
- // - If a decorator matches a managed bean, and the managed bean class is declared final, the container automatically detects
- // the problem and treats it as a deployment problem.
- addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, bean.getSimpleJavaName()), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
- } else {
- // 8.3. Decorator resolution
- // - If a decorator matches a managed bean with a non-static, non-private, final method, and the decorator also implements that method,
- // the container automatically detects the problem and treats it as a deployment problem.
- IType decoratorClass = injection.getClassBean().getBeanClass();
- IMethod[] methods = decoratorClass.getMethods();
- boolean reported = false;
- if(methods!=null) {
- for (IMethod method : methods) {
- if(!Flags.isPrivate(method.getFlags()) && !Flags.isStatic(method.getFlags())) {
- IMethod[] beanMethods = beanClass.findMethods(method);
- if(beanMethods!=null) {
- for (IMethod beanMethod : beanMethods) {
- int flags = beanMethod.getFlags();
- if(!Flags.isPrivate(flags) && !Flags.isStatic(flags) && Flags.isFinal(flags)) {
- String methodName = Signature.toString(beanMethod.getSignature(), beanMethod.getElementName(), beanMethod.getParameterNames(), false, false);
- addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, bean.getSimpleJavaName(), methodName), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
- reported = true;
- break;
- }
- }
- if(reported) {
+ }
+ if(injection.getClassBean() instanceof IDecorator && injection.isDelegate() && bean instanceof IClassBean) {
+ try {
+ IType beanClass = bean.getBeanClass();
+ if(Flags.isFinal(beanClass.getFlags())) {
+ // 8.3. Decorator resolution
+ // - If a decorator matches a managed bean, and the managed bean class is declared final, the container automatically detects
+ // the problem and treats it as a deployment problem.
+ addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, bean.getSimpleJavaName()), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
+ } else {
+ // 8.3. Decorator resolution
+ // - If a decorator matches a managed bean with a non-static, non-private, final method, and the decorator also implements that method,
+ // the container automatically detects the problem and treats it as a deployment problem.
+ IType decoratorClass = injection.getClassBean().getBeanClass();
+ IMethod[] methods = decoratorClass.getMethods();
+ boolean reported = false;
+ if(methods!=null) {
+ for (IMethod method : methods) {
+ if(!Flags.isPrivate(method.getFlags()) && !Flags.isStatic(method.getFlags())) {
+ IMethod[] beanMethods = beanClass.findMethods(method);
+ if(beanMethods!=null) {
+ for (IMethod beanMethod : beanMethods) {
+ int flags = beanMethod.getFlags();
+ if(!Flags.isPrivate(flags) && !Flags.isStatic(flags) && Flags.isFinal(flags)) {
+ String methodName = Signature.toString(beanMethod.getSignature(), beanMethod.getElementName(), beanMethod.getParameterNames(), false, false);
+ addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, bean.getSimpleJavaName(), methodName), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
+ reported = true;
break;
}
}
+ if(reported) {
+ break;
+ }
}
}
}
}
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
}
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml 2011-07-28 00:27:03 UTC (rev 33285)
@@ -17,4 +17,12 @@
runtime="org.jboss.seam.international.status.TypedStatusMessageBundleExtension">
</cdiextension>
</extension>
-</plugin>
+
+ <extension
+ point="org.jboss.tools.cdi.core.cdiextensions">
+ <cdiextension
+ class="org.jboss.tools.cdi.seam.core.servlet.SeamServletExtension"
+ runtime="org.jboss.seam.servlet.ServletExtension">
+ </cdiextension>
+ </extension>
+</plugin>
\ No newline at end of file
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/servlet/SeamServletExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/servlet/SeamServletExtension.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/servlet/SeamServletExtension.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.core.servlet;
+
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamServletExtension implements ICDIExtension, IInjectionPointValidatorFeature {
+
+ private final static String SEAM_SERVLET_REQUEST_PARAM_TYPE_NAME = "org.jboss.seam.servlet.http.RequestParam";
+ private final static String SEAM_SERVLET_HEADER_PARAM_TYPE_NAME = "org.jboss.seam.servlet.http.HeaderParam";
+ private final static String SEAM_SERVLET_COOKIE_PARAM_TYPE_NAME = "org.jboss.seam.servlet.http.CookieParam";
+
+ /**
+ * If the injection point annotated @RequestParam, @HeaderParam or @CookieParam then don't try to resolve it.
+ * See https://issues.jboss.org/browse/JBIDE-9389
+ *
+ * @see org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature#shouldIgnoreInjection(org.eclipse.jdt.core.IType, org.jboss.tools.cdi.core.IInjectionPoint)
+ */
+ @Override
+ public boolean shouldIgnoreInjection(IType typeOfInjectionPoint, IInjectionPoint injection) {
+ return injection.getAnnotation(SEAM_SERVLET_COOKIE_PARAM_TYPE_NAME) != null
+ || injection.getAnnotation(SEAM_SERVLET_HEADER_PARAM_TYPE_NAME) != null
+ || injection.getAnnotation(SEAM_SERVLET_REQUEST_PARAM_TYPE_NAME) != null;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/servlet/SeamServletExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/META-INF/MANIFEST.MF 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/META-INF/MANIFEST.MF 2011-07-28 00:27:03 UTC (rev 33285)
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Core
+Bundle-Name: Seam Faces Core
Bundle-SymbolicName: org.jboss.tools.cdi.seam.faces.core;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.tools.cdi.seam.faces.core.SeamFacesCorePlugin
@@ -8,7 +8,9 @@
Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.core.runtime;bundle-version="3.7.0",
org.jboss.tools.common,
- org.jboss.tools.jst.web.kb
+ org.jboss.tools.jst.web.kb,
+ org.jboss.tools.cdi.core,
+ org.eclipse.jdt.core;bundle-version="3.7.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.jboss.tools.cdi.seam.faces.core
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/plugin.xml 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/plugin.xml 2011-07-28 00:27:03 UTC (rev 33285)
@@ -1,11 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
- <extension
+ <extension
point="org.jboss.tools.jst.web.kb.tagLib">
- <tag-lib
+ <tag-lib
location="platform:/plugin/org.jboss.tools.cdi.seam.faces.core/taglibs/JBossSeamFaces.xml"
name="JBoss Seam Faces"
uri="http://jboss.org/seam/faces"/>
- </extension>
+ </extension>
+ <extension
+ point="org.jboss.tools.cdi.core.cdiextensions">
+ <cdiextension
+ class="org.jboss.tools.cdi.seam.faces.core.SeamFacesExtension"
+ runtime="org.jboss.seam.faces.component.FormValidationTypeOverrideExtension">
+ </cdiextension>
+ </extension>
</plugin>
\ No newline at end of file
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/src/org/jboss/tools/cdi/seam/faces/core/SeamFacesExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/src/org/jboss/tools/cdi/seam/faces/core/SeamFacesExtension.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/src/org/jboss/tools/cdi/seam/faces/core/SeamFacesExtension.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -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.faces.core;
+
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointParameter;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamFacesExtension implements ICDIExtension, IInjectionPointValidatorFeature {
+
+ private final static String SEAM_FACES_INPUT_FIELD_TYPE_NAME = "org.jboss.seam.faces.validation.InputField";
+ private final static String SEAM_FACES_INPUT_ELEMENT_TYPE_NAME = "org.jboss.seam.faces.validation.InputElement";
+
+ /**
+ * If the injection point annotated @InputField then don't try to resolve it. Also ignore @Inject InputElement field.
+ * See https://issues.jboss.org/browse/JBIDE-8576
+ *
+ * @see org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature#shouldIgnoreInjection(org.eclipse.jdt.core.IType, org.jboss.tools.cdi.core.IInjectionPoint)
+ */
+ @Override
+ public boolean shouldIgnoreInjection(IType typeOfInjectionPoint, IInjectionPoint injection) {
+ if(typeOfInjectionPoint!=null) {
+ if(SEAM_FACES_INPUT_ELEMENT_TYPE_NAME.equals(typeOfInjectionPoint.getFullyQualifiedName()) || injection.getAnnotation(SEAM_FACES_INPUT_FIELD_TYPE_NAME)!=null) {
+ return true;
+ }
+ if(injection instanceof IInjectionPointParameter) {
+ IInjectionPointParameter param = (IInjectionPointParameter)injection;
+ if(param.getBeanMethod().getAnnotation(SEAM_FACES_INPUT_FIELD_TYPE_NAME)!=null) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/src/org/jboss/tools/cdi/seam/faces/core/SeamFacesExtension.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/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-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/ExtensionTest.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -29,7 +29,7 @@
public void testExtension() throws CoreException, IOException {
ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
- Set<IBuildParticipantFeature> bp = cdi.getNature().getExtensionManager().getBuildParticipantFeature();
+ Set<IBuildParticipantFeature> bp = cdi.getNature().getExtensionManager().getBuildParticipantFeatures();
System.out.println(bp.size());
}
Modified: 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 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigTest.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -72,7 +72,7 @@
}
protected CDISeamConfigExtension getConfigExtension(ICDIProject cdi) {
- Set<IBuildParticipantFeature> bp = cdi.getNature().getExtensionManager().getBuildParticipantFeature();
+ Set<IBuildParticipantFeature> bp = cdi.getNature().getExtensionManager().getBuildParticipantFeatures();
for (IBuildParticipantFeature p: bp) {
if(p instanceof CDISeamConfigExtension) {
return (CDISeamConfigExtension)p;
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/CDISeamFacesCoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/CDISeamFacesCoreAllTests.java 2011-07-28 00:19:59 UTC (rev 33284)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/CDISeamFacesCoreAllTests.java 2011-07-28 00:27:03 UTC (rev 33285)
@@ -29,6 +29,6 @@
suite.addTestSuite(SeamFacesValidationTest.class);
suiteAll.addTest(new SeamFacesTestSetup(suite));
suiteAll.addTestSuite(SeamFacesTagLibTest.class);
- return suite;
+ return suiteAll;
}
}
\ No newline at end of file
12 years, 9 months