Author: scabanovich
Date: 2011-10-20 20:11:06 -0400 (Thu, 20 Oct 2011)
New Revision: 35878
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/Test1.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/TypeA.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/TypeB.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/ITest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Q.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test1.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.modified
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.original
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test3.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/DefaultBeanValidationTest.java
Log:
JBIDE-9244
https://issues.jboss.org/browse/JBIDE-9244
Tests.
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/Test1.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/Test1.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/Test1.java 2011-10-21
00:11:06 UTC (rev 35878)
@@ -0,0 +1,24 @@
+package org.jboss.defaultbean.producer;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+import org.jboss.solder.bean.defaultbean.DefaultBean;
+
+(a)DefaultBean(Test1.class)
+public class Test1 {
+
+ @Inject
+ TypeB b;
+
+ @Inject
+ TypeA a;
+
+ @Produces
+ TypeA pa;
+
+ @Produces
+ TypeB getType() {
+ return null;
+ }
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/Test1.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/TypeA.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/TypeA.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/TypeA.java 2011-10-21
00:11:06 UTC (rev 35878)
@@ -0,0 +1,5 @@
+package org.jboss.defaultbean.producer;
+
+public class TypeA {
+ TypeA(String s) {}
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/TypeA.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/TypeB.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/TypeB.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/TypeB.java 2011-10-21
00:11:06 UTC (rev 35878)
@@ -0,0 +1,7 @@
+package org.jboss.defaultbean.producer;
+
+public class TypeB extends TypeA {
+ TypeB(String s) {
+ super(s);
+ }
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/producer/TypeB.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/ITest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/ITest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/ITest.java 2011-10-21
00:11:06 UTC (rev 35878)
@@ -0,0 +1,5 @@
+package org.jboss.defaultbean.validation;
+
+public interface ITest {
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/ITest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Q.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Q.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Q.java 2011-10-21
00:11:06 UTC (rev 35878)
@@ -0,0 +1,21 @@
+package org.jboss.defaultbean.validation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Qualifier
+@Target({ TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+public @interface Q {
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Q.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test1.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test1.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test1.java 2011-10-21
00:11:06 UTC (rev 35878)
@@ -0,0 +1,14 @@
+package org.jboss.defaultbean.validation;
+
+import javax.enterprise.inject.Produces;
+
+import org.jboss.solder.bean.defaultbean.DefaultBean;
+
+public class Test1 {
+
+ @Produces
+ @DefaultBean(String.class)
+ @Q
+ String s;
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test1.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.java 2011-10-21
00:11:06 UTC (rev 35878)
@@ -0,0 +1,15 @@
+package org.jboss.defaultbean.validation;
+
+import javax.enterprise.inject.Produces;
+
+import org.jboss.solder.bean.defaultbean.DefaultBean;
+
+public class Test2 {
+ @Produces
+ @DefaultBean(String.class)
+ @Q
+ String getString() {
+ return "";
+ }
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.modified
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.modified
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.modified 2011-10-21
00:11:06 UTC (rev 35878)
@@ -0,0 +1,14 @@
+package org.jboss.defaultbean.validation;
+
+import javax.enterprise.inject.Produces;
+
+import org.jboss.solder.bean.defaultbean.DefaultBean;
+
+public class Test2 {
+ @Produces
+ @DefaultBean(String.class)
+ String getString() {
+ return "";
+ }
+
+}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.original
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.original
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test2.original 2011-10-21
00:11:06 UTC (rev 35878)
@@ -0,0 +1,15 @@
+package org.jboss.defaultbean.validation;
+
+import javax.enterprise.inject.Produces;
+
+import org.jboss.solder.bean.defaultbean.DefaultBean;
+
+public class Test2 {
+ @Produces
+ @DefaultBean(String.class)
+ @Q
+ String getString() {
+ return "";
+ }
+
+}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test3.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test3.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test3.java 2011-10-21
00:11:06 UTC (rev 35878)
@@ -0,0 +1,20 @@
+package org.jboss.defaultbean.validation;
+
+import javax.enterprise.inject.Produces;
+
+import org.jboss.solder.bean.defaultbean.DefaultBean;
+
+(a)DefaultBean(Test3.class)
+@Q
+public class Test3 {
+
+ @Produces
+ @Q
+ Test3 s2;
+
+ @Produces
+ @Q
+ Test3 getTest() {
+ return null;
+ }
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/validation/Test3.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/DefaultBeanValidationTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/DefaultBeanValidationTest.java 2011-10-21
00:10:20 UTC (rev 35877)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/DefaultBeanValidationTest.java 2011-10-21
00:11:06 UTC (rev 35878)
@@ -35,4 +35,26 @@
AbstractResourceMarkerTest.assertMarkerIsCreated(file,
SeamSolderValidationMessages.IDENTICAL_DEFAULT_BEANS.substring(0, 50) + ".*", 7,
12, 17);
}
+ public void testIncrementalValidationForIdenticalDefaultBeans() throws CoreException {
+ String messageMask = SeamSolderValidationMessages.IDENTICAL_DEFAULT_BEANS.substring(0,
50) + ".*";
+
+ String path1 = "src/org/jboss/defaultbean/validation/Test1.java";
+ String path2 = "src/org/jboss/defaultbean/validation/Test2.java";
+ String path2modified =
"src/org/jboss/defaultbean/validation/Test2.modified";
+ String path2original =
"src/org/jboss/defaultbean/validation/Test2.original";
+
+ IFile file1 = getTestProject().getFile(path1);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file1, messageMask, 10);
+ IFile file2 = getTestProject().getFile(path2);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file2, messageMask, 9);
+
+ GenericBeanValidationTest.writeFile(getTestProject(), path2modified, path2);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file1, messageMask);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file2, messageMask);
+
+ GenericBeanValidationTest.writeFile(getTestProject(), path2original, path2);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file1, messageMask, 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file2, messageMask, 9);
+ }
+
}
\ No newline at end of file