Author: scabanovich
Date: 2012-01-06 14:30:05 -0500 (Fri, 06 Jan 2012)
New Revision: 37693
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded/MyExcludedBean.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/MyExcludedBean2.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/MyIncludedBean.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResourceExclusionTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
Log:
JBIDE-10601
https://issues.joss.org/browse/JBIDE-10601
Method EclipseUtil.getCompilationUnit(IFile) should return existing Java element or null.
Test is added.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/.classpath
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/.classpath 2012-01-06
19:27:44 UTC (rev 37692)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/.classpath 2012-01-06
19:30:05 UTC (rev 37693)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="JavaSource"/>
+ <classpathentry
excluding="**/excluded/**|**/excluded2/MyExcludedBean2.java"
kind="src" path="JavaSource"/>
<classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con"
path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/JBoss
4.2 Runtime">
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded/MyExcludedBean.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded/MyExcludedBean.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded/MyExcludedBean.java 2012-01-06
19:30:05 UTC (rev 37693)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.jbt.excluded;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import javax.inject.Named;
+
+@Named("myExcludedBean")
+class MyExcludedBean {
+ private int value = 0;
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded/MyExcludedBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/MyExcludedBean2.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/MyExcludedBean2.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/MyExcludedBean2.java 2012-01-06
19:30:05 UTC (rev 37693)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.jbt.excluded2;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import javax.inject.Named;
+
+@Named("myExcludedBean2")
+class MyExcludedBean2 {
+ private int value = 0;
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/MyExcludedBean2.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/MyIncludedBean.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/MyIncludedBean.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/MyIncludedBean.java 2012-01-06
19:30:05 UTC (rev 37693)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.jbt.excluded2;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import javax.inject.Named;
+
+@Named("myIncludedBean")
+class MyIncludedBean {
+ private int value = 0;
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/excluded2/MyIncludedBean.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-01-06
19:27:44 UTC (rev 37692)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-01-06
19:30:05 UTC (rev 37693)
@@ -43,6 +43,7 @@
import org.jboss.tools.cdi.core.test.tck.QualifierDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.QualifierWithMembersTest;
import org.jboss.tools.cdi.core.test.tck.ResolvedTypesCacheTest;
+import org.jboss.tools.cdi.core.test.tck.ResourceExclusionTest;
import org.jboss.tools.cdi.core.test.tck.ScopeDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.SelectedAlternativeTest;
import org.jboss.tools.cdi.core.test.tck.StereotypeDefinitionTest;
@@ -118,6 +119,7 @@
suite.addTestSuite(ResolvedTypesCacheTest.class);
suite.addTestSuite(CDIUtilTest.class);
suite.addTestSuite(CoreTest.class);
+ suite.addTestSuite(ResourceExclusionTest.class);
// Validation tests
suite.addTestSuite(DefenitionErrorsValidationTest.class);
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResourceExclusionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResourceExclusionTest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResourceExclusionTest.java 2012-01-06
19:30:05 UTC (rev 37693)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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.test.tck;
+
+import java.util.Set;
+
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.IBean;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class ResourceExclusionTest extends TCKTest {
+
+ public void testExclusion() throws JavaModelException {
+ Set<IBean> beans = cdiProject.getBeans("myExcludedBean", false);
+ assertEquals("Wrong number of beans.", 0, beans.size());
+
+ beans = cdiProject.getBeans("myExcludedBean2", false);
+ assertEquals("Wrong number of beans.", 0, beans.size());
+
+ beans = cdiProject.getBeans("myIncludedBean", false);
+ assertEquals("Wrong number of beans.", 1, beans.size());
+
+ }
+}
\ 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/ResourceExclusionTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain