Author: scabanovich
Date: 2011-10-18 18:57:31 -0400 (Tue, 18 Oct 2011)
New Revision: 35776
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/DefaultFieldProducerBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/IdenticalDefaultBeans.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/DefaultBeanValidationTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java
Log:
JBIDE-9244
https://issues.jboss.org/browse/JBIDE-9244
Implemented validation of default beans (Solder). Tests are added.
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/DefaultFieldProducerBroken.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/DefaultFieldProducerBroken.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/DefaultFieldProducerBroken.java 2011-10-18
22:57:31 UTC (rev 35776)
@@ -0,0 +1,20 @@
+package org.jboss.defaultbean;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Produces;
+import javax.inject.Named;
+
+import org.jboss.solder.bean.defaultbean.DefaultBean;
+
+@SessionScoped
+public class DefaultFieldProducerBroken implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @Produces
+ @DefaultBean(String.class)
+ @Named("defaultbean172817")
+ String s;
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/DefaultFieldProducerBroken.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/IdenticalDefaultBeans.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/IdenticalDefaultBeans.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/IdenticalDefaultBeans.java 2011-10-18
22:57:31 UTC (rev 35776)
@@ -0,0 +1,23 @@
+package org.jboss.defaultbean;
+
+import javax.enterprise.inject.Produces;
+
+import org.jboss.solder.bean.defaultbean.DefaultBean;
+
+(a)DefaultBean(IdenticalDefaultBeans.class)
+@Cozy
+public class IdenticalDefaultBeans {
+
+ @Produces
+ @DefaultBean(IdenticalDefaultBeans.class)
+ @Cozy
+ IdenticalDefaultBeans bean;
+
+ @Produces
+ @DefaultBean(IdenticalDefaultBeans.class)
+ @Cozy
+ IdenticalDefaultBeans createBean() {
+ return null;
+ }
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/defaultbean/IdenticalDefaultBeans.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/CDISeamSolderCoreAllTests.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java 2011-10-18
22:56:52 UTC (rev 35775)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java 2011-10-18
22:57:31 UTC (rev 35776)
@@ -46,6 +46,7 @@
suite31.addTestSuite(MessageLoggerTest.class);
suite31.addTestSuite(ServiceHandlerTest.class);
suite31.addTestSuite(DefaultBeanTest.class);
+ suite31.addTestSuite(DefaultBeanValidationTest.class);
suite31.addTestSuite(UnwrapsTest.class);
suite31.addTestSuite(SeamServletValidationTest.class);
Added:
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
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/DefaultBeanValidationTest.java 2011-10-18
22:57:31 UTC (rev 35776)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.solder.core.test;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.cdi.seam.solder.core.validation.SeamSolderValidationMessages;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class DefaultBeanValidationTest extends SeamSolderTest {
+
+ public DefaultBeanValidationTest() {}
+
+ public void testBrokenGenericBean() throws CoreException {
+ IFile file = getTestProject().getFile(new
Path("src/org/jboss/defaultbean/DefaultFieldProducerBroken.java"));
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
SeamSolderValidationMessages.DEFAULT_PRODUCER_FIELD_ON_NORMAL_SCOPED_BEAN, 16);
+ }
+
+ public void testIdenticalDefaultBeans() throws CoreException {
+ IFile file = getTestProject().getFile(new
Path("src/org/jboss/defaultbean/IdenticalDefaultBeans.java"));
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
SeamSolderValidationMessages.IDENTICAL_DEFAULT_BEANS.substring(0, 50) + ".*", 7,
12, 17);
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/DefaultBeanValidationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain