[jbosstools-commits] JBoss Tools SVN: r43847 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal and 6 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Wed Sep 19 20:22:55 EDT 2012
Author: akazakov
Date: 2012-09-19 20:22:54 -0400 (Wed, 19 Sep 2012)
New Revision: 43847
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/weld/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/weld/ParametersExtension.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/WEB-INF/lib/weld-se-1.0.1-Final-min.jar
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/weld/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/weld/WeldBean.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTWeldValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/WeldValidationTest.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-12644 Weld extension: @Parameters
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2012-09-19 23:40:03 UTC (rev 43846)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2012-09-20 00:22:54 UTC (rev 43847)
@@ -190,6 +190,13 @@
</require>
</extension>
+ <extension
+ point="org.jboss.tools.cdi.core.cdiextensions">
+ <cdiextension
+ class="org.jboss.tools.cdi.internal.weld.ParametersExtension"
+ runtime="org.jboss.weld.environment.se.WeldSEBeanRegistrant">
+ </cdiextension>
+ </extension>
<!-- Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=315390 -->
<extension
id="excludeEJBValidation"
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/weld/ParametersExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/weld/ParametersExtension.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/weld/ParametersExtension.java 2012-09-20 00:22:54 UTC (rev 43847)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.internal.weld;
+
+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 ParametersExtension implements ICDIExtension, IInjectionPointValidatorFeature {
+
+ private final static String PARAMETERS_TYPE_NAME = "org.jboss.weld.environment.se.bindings.Parameters";
+
+ /*
+ * (non-Javadoc)
+ * @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(PARAMETERS_TYPE_NAME) != null;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/weld/ParametersExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/WEB-INF/lib/weld-se-1.0.1-Final-min.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/WEB-INF/lib/weld-se-1.0.1-Final-min.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/weld/WeldBean.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/weld/WeldBean.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/weld/WeldBean.java 2012-09-20 00:22:54 UTC (rev 43847)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.weld;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.jboss.weld.environment.se.bindings.Parameters;
+
+public class WeldBean {
+
+ @Inject @Parameters List<String> parametersList;
+ @Inject @Parameters String[] parametersArray;
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/weld/WeldBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-09-19 23:40:03 UTC (rev 43846)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-09-20 00:22:54 UTC (rev 43847)
@@ -60,6 +60,7 @@
import org.jboss.tools.cdi.core.test.tck.validation.AYTDefenitionErrorsValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.AYTDeploymentProblemsValidationTests;
import org.jboss.tools.cdi.core.test.tck.validation.AYTSuppressWarningsTests;
+import org.jboss.tools.cdi.core.test.tck.validation.AYTWeldValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.AnnotationsValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.BeansXmlValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.BuilderOrderValidationTest;
@@ -72,6 +73,7 @@
import org.jboss.tools.cdi.core.test.tck.validation.ELValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.IncrementalValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.SuppressWarningsTests;
+import org.jboss.tools.cdi.core.test.tck.validation.WeldValidationTest;
import org.jboss.tools.common.base.test.validation.ValidationExceptionTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
@@ -136,6 +138,7 @@
suite.addTestSuite(ELValidationTest.class);
suite.addTestSuite(SuppressWarningsTests.class);
suite.addTestSuite(IncrementalValidationTest.class);
+ suite.addTestSuite(WeldValidationTest.class);
// As-you-type model tests
suite.addTestSuite(CDIProjectAsYouTypeTest.class);
@@ -147,6 +150,7 @@
suite.addTestSuite(AYTBeansXmlValidationTest.class);
suite.addTestSuite(AYTAnnotationValidationTest.class);
suite.addTestSuite(AYTSuppressWarningsTests.class);
+ suite.addTestSuite(AYTWeldValidationTest.class);
// Refactoring test
suite.addTestSuite(NamedBeanRefactoringTest.class);
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTWeldValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTWeldValidationTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTWeldValidationTest.java 2012-09-20 00:22:54 UTC (rev 43847)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.test.tck.validation;
+
+import org.jboss.tools.tests.IAnnotationTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class AYTWeldValidationTest extends WeldValidationTest {
+
+ private CDIAnnotationTest annotationTest = new CDIAnnotationTest();
+
+ @Override
+ protected IAnnotationTest getAnnotationTest() {
+ return annotationTest;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTWeldValidationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/WeldValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/WeldValidationTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/WeldValidationTest.java 2012-09-20 00:22:54 UTC (rev 43847)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.test.tck.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class WeldValidationTest extends ValidationTest {
+
+ /**
+ * https://issues.jboss.org/browse/JBIDE-12644
+ * Weld extension: @Inject @Parameters List<String> parameters;
+ * @throws Exception
+ */
+ public void testParameters() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/weld/WeldBean.java");
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 11);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/WeldValidationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
More information about the jbosstools-commits
mailing list