[webbeans-commits] Webbeans SVN: r760 - doc/trunk/reference.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2009-01-04 18:32:39 -0500 (Sun, 04 Jan 2009)
New Revision: 760
Modified:
doc/trunk/reference/Makefile
Log:
Renamed DOCNAME and PRODUCT
Modified: doc/trunk/reference/Makefile
===================================================================
--- doc/trunk/reference/Makefile 2009-01-04 22:44:45 UTC (rev 759)
+++ doc/trunk/reference/Makefile 2009-01-04 23:32:39 UTC (rev 760)
@@ -3,8 +3,8 @@
#Copyright Red Hat Inc. 2006
XML_LANG = en-US
-DOCNAME = master.xml
-PRODUCT = WebBeansReferenceManual
+DOCNAME = WebBeans_Reference_Guide
+PRODUCT = Web_Beans
BRAND = JBoss
TRANSLATIONS = $(XML_LANG)
16 years
[webbeans-commits] Webbeans SVN: r759 - in doc/trunk/reference: en and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2009-01-04 17:44:45 -0500 (Sun, 04 Jan 2009)
New Revision: 759
Added:
doc/trunk/reference/en-US/
doc/trunk/reference/en-US/modules/
Removed:
doc/trunk/reference/en-US/modules/
doc/trunk/reference/en/.cvsignore
doc/trunk/reference/en/images/
doc/trunk/reference/en/master.xml
doc/trunk/reference/en/modules/
Modified:
doc/trunk/reference/Makefile
Log:
Changed folder name from en to en-US
Modified: doc/trunk/reference/Makefile
===================================================================
--- doc/trunk/reference/Makefile 2009-01-04 21:35:21 UTC (rev 758)
+++ doc/trunk/reference/Makefile 2009-01-04 22:44:45 UTC (rev 759)
@@ -2,7 +2,7 @@
#Created by Jeff Fearn <jfearn(a)redhat.com>
#Copyright Red Hat Inc. 2006
-XML_LANG = en
+XML_LANG = en-US
DOCNAME = master.xml
PRODUCT = WebBeansReferenceManual
BRAND = JBoss
Deleted: doc/trunk/reference/en/.cvsignore
===================================================================
--- doc/trunk/reference/en/.cvsignore 2009-01-04 21:35:21 UTC (rev 758)
+++ doc/trunk/reference/en/.cvsignore 2009-01-04 22:44:45 UTC (rev 759)
@@ -1 +0,0 @@
-master.filtered.xml
Deleted: doc/trunk/reference/en/master.xml
===================================================================
--- doc/trunk/reference/en/master.xml 2009-01-04 21:35:21 UTC (rev 758)
+++ doc/trunk/reference/en/master.xml 2009-01-04 22:44:45 UTC (rev 759)
@@ -1,59 +0,0 @@
-<?xml version='1.0' encoding="iso-8859-1"?>
-
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
-
-<book lang="en">
-
- <xi:include href="modules/Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <toc/>
-
- <part>
- <title>Using contextual objects</title>
-
- <xi:include href="modules/part1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/intro.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/example.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/ri.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/injection.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/scopescontexts.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/producermethods.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- </part>
-
- <part>
- <title>Developing loosely-coupled code</title>
-
- <xi:include href="modules/part2.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/interceptors.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/decorators.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/events.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- </part>
-
- <part>
- <title>Making the most of strong typing</title>
-
- <xi:include href="modules/part3.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="modules/stereotypes.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/specialization.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/xml.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- </part>
-
- <part>
- <title>Web Beans and the Java EE ecosystem</title>
-
- <xi:include href="modules/part4.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="modules/ee.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/extend.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- </part>
-
- <xi:include href="modules/next.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/ri-spi.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
-</book>
-
Copied: doc/trunk/reference/en-US (from rev 730, doc/trunk/reference/en)
Property changes on: doc/trunk/reference/en-US
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: doc/trunk/reference/en-US/modules (from rev 744, doc/trunk/reference/en/modules)
16 years
[webbeans-commits] Webbeans SVN: r758 - in ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts: invalid and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-01-04 16:35:21 -0500 (Sun, 04 Jan 2009)
New Revision: 758
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Loviisa.java
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java
Log:
Missing constructor parameter tests
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java 2009-01-04 20:18:46 UTC (rev 757)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java 2009-01-04 21:35:21 UTC (rev 758)
@@ -25,6 +25,7 @@
import org.jboss.webbeans.test.contexts.invalid.CityProducer;
import org.jboss.webbeans.test.contexts.invalid.CityProducer2;
import org.jboss.webbeans.test.contexts.invalid.CityProducer3;
+import org.jboss.webbeans.test.contexts.invalid.Loviisa;
import org.jboss.webbeans.test.contexts.invalid.Peraseinajoki;
import org.jboss.webbeans.test.contexts.invalid.Espoo;
import org.jboss.webbeans.test.contexts.invalid.Forssa;
@@ -340,12 +341,12 @@
* UnserializableDependencyException must be thrown by the Web Bean manager
* at initialization time.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
@SpecAssertion(section = "9.5")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
{
- // TODO: case?
- assert false;
+ registerBeans(new Class<?>[] { Violation.class, Loviisa.class} );
+ manager.validate();
}
/**
@@ -443,11 +444,12 @@
* parameter of a producer method which declares a passivating scope type, an
* IllegalProductException is thrown by the Web Bean manager.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "9.5")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
{
- assert false;
+ registerProducerBean(CityProducer2.class, "create", Violation.class);
+ getInstance(Loviisa.class).ping();
}
/**
@@ -547,12 +549,12 @@
* parameter of a producer method which declares a passivating scope type, an
* IllegalProductException is thrown by the Web Bean manager.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "9.5")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
{
- // TODO: case?
- assert false;
+ registerProducerBean(CityProducer.class, "reference", Violation.class);
+ getInstance(Loviisa.class).ping();
}
/**
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Loviisa.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Loviisa.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Loviisa.java 2009-01-04 21:35:21 UTC (rev 758)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.Initializer;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.valid.City;
+
+@SessionScoped
+public class Loviisa extends City implements Serializable
+{
+ public Loviisa() {
+ }
+
+ @Initializer
+ public Loviisa(@Current Violation reference) {
+
+ }
+}
16 years
[webbeans-commits] Webbeans SVN: r757 - in ri/trunk/webbeans-ri/src: test/java/org/jboss/webbeans/test and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-01-04 15:18:46 -0500 (Sun, 04 Jan 2009)
New Revision: 757
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityBinding.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityDecorator.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityInterceptor.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityInterface.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer2.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer3.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Espoo.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Forssa.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Hamina.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Jamsa.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kaarina.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kotka.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kuopio.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Lieto.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Maarianhamina.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Mikkeli.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Naantali.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Nokia.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Peraseinajoki.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Pietarsaari.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Pori.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Porvoo.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Raisio.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Salo.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Tampere.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Uusikaupunki.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Vantaa.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Violation.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Violation2.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/City.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Helsinki.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Hyvinkaa.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Joensuu.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Jyvaskyla.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Turku.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Vaasa.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java
Log:
Passivating contexts + test
still missing decorator/interceptor/EJB lifecycle dependent ones
WBRI-90
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-01-04 19:15:14 UTC (rev 756)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -21,12 +21,18 @@
import java.lang.reflect.Type;
import java.util.HashSet;
+import javax.webbeans.BindingType;
import javax.webbeans.DefinitionException;
import javax.webbeans.Dependent;
import javax.webbeans.IllegalProductException;
+import javax.webbeans.UnserializableDependencyException;
+import javax.webbeans.manager.Bean;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.MetaDataCache;
+import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.jlr.AbstractAnnotatedMember;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
@@ -170,7 +176,83 @@
return getAnnotatedItem().isStatic() ? null : manager.getInstance(getDeclaringBean());
}
+ protected void checkInjectionPoints()
+ {
+ for (AnnotatedItem<?, ?> injectionPoint : getInjectionPoints())
+ {
+ Annotation[] bindings = injectionPoint.getMetaAnnotationsAsArray(BindingType.class);
+ Bean<?> bean = manager.resolveByType(injectionPoint.getType(), bindings).iterator().next();
+ if (Dependent.class.equals(bean.getScopeType()) && !bean.isSerializable())
+ {
+ throw new UnserializableDependencyException(bean + " is a non-serializable dependent injection for " + injectionPoint + " in " + this);
+ }
+ }
+ }
+
/**
+ * Creates an instance of the bean
+ *
+ * @returns The instance
+ */
+ @Override
+ public T create()
+ {
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ boolean passivating = MetaDataCache.instance().getScopeModel(scopeType).isPassivating();
+ if (passivating)
+ {
+ checkProducedInjectionPoints();
+ }
+ T instance = produceInstance();
+ checkReturnValue(instance);
+ return instance;
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
+ }
+
+ @Override
+ public void destroy(T instance)
+ {
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ // TODO Implement any cleanup needed
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
+ }
+
+ protected void checkProducedInjectionPoints()
+ {
+ for (AnnotatedItem<?, ?> injectionPoint : getInjectionPoints())
+ {
+ if (injectionPoint instanceof AbstractAnnotatedMember)
+ {
+ if (((AbstractAnnotatedMember<?, ?>) injectionPoint).isTransient())
+ {
+ continue;
+ }
+ }
+ Annotation[] bindings = injectionPoint.getMetaAnnotationsAsArray(BindingType.class);
+ Bean<?> bean = manager.resolveByType(injectionPoint.getType(), bindings).iterator().next();
+ boolean producerBean = (bean instanceof ProducerMethodBean || bean instanceof ProducerFieldBean);
+ if (producerBean && Dependent.class.equals(bean.getScopeType()) && !bean.isSerializable())
+ {
+ throw new IllegalProductException("Dependent-scoped producer bean " + producerBean + " produces a non-serializable product for injection for " + injectionPoint + " in " + this);
+ }
+ }
+ }
+
+ protected abstract T produceInstance();
+
+ /**
* Gets a string representation
*
* @return The string representation
@@ -193,4 +275,29 @@
return buffer.toString();
}
+ @Override
+ public boolean isSerializable()
+ {
+ boolean normalScoped = MetaDataCache.instance().getScopeModel(scopeType).isNormal();
+ if (normalScoped)
+ {
+ boolean passivatingScoped = MetaDataCache.instance().getScopeModel(scopeType).isPassivating();
+ if (passivatingScoped)
+ {
+ checkInjectionPoints();
+ return true;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return isProductSerializable();
+ }
+ }
+
+ protected abstract boolean isProductSerializable();
+
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-01-04 19:15:14 UTC (rev 756)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -20,7 +20,6 @@
import java.lang.reflect.Field;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.jlr.AnnotatedFieldImpl;
import org.jboss.webbeans.util.Names;
@@ -64,41 +63,14 @@
init();
}
- /**
- * Creates an instance of the bean
- *
- * @returns The instance
- */
- @Override
- public T create()
- {
- try
- {
- DependentContext.INSTANCE.setActive(true);
- T instance = field.get(getReceiver());
- checkReturnValue(instance);
- return instance;
- }
- finally
- {
- DependentContext.INSTANCE.setActive(false);
- }
- }
@Override
- public void destroy(T instance)
+ public T produceInstance()
{
- try
- {
- DependentContext.INSTANCE.setActive(true);
- // TODO Implement any cleanup needed
- }
- finally
- {
- DependentContext.INSTANCE.setActive(false);
- }
+ return field.get(getReceiver());
}
+
/**
* Gets the annotated item representing the field
*
@@ -144,18 +116,8 @@
return buffer.toString();
}
- public String toDetailedString()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("ProducerFieldBean:\n");
- buffer.append(super.toString() + "\n");
- buffer.append("Declaring bean: " + declaringBean.toString() + "\n");
- buffer.append("Field: " + field.toString() + "\n");
- return buffer.toString();
- }
-
@Override
- public boolean isSerializable()
+ public boolean isProductSerializable()
{
return Reflections.isSerializable(field.getAnnotatedField().getClass());
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-01-04 19:15:14 UTC (rev 756)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -27,7 +27,6 @@
import javax.webbeans.Observes;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.jlr.AnnotatedMethodImpl;
@@ -74,41 +73,11 @@
init();
}
- /**
- * Creates an instance of the bean
- *
- * @returns The instance
- */
- @Override
- public T create()
+ public T produceInstance()
{
- try
- {
- DependentContext.INSTANCE.setActive(true);
- T instance = method.invoke(getReceiver(), manager);
- checkReturnValue(instance);
- return instance;
- }
- finally
- {
- DependentContext.INSTANCE.setActive(false);
- }
+ return method.invoke(getReceiver(), manager);
}
- @Override
- public void destroy(T instance)
- {
- try
- {
- DependentContext.INSTANCE.setActive(true);
- // TODO Implement any cleanup needed
- }
- finally
- {
- DependentContext.INSTANCE.setActive(false);
- }
- }
-
/**
* Initializes the bean and its metadata
*/
@@ -232,19 +201,10 @@
return buffer.toString();
}
- public String toDetailedString()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("ProducerMethodBean:\n");
- buffer.append(super.toString() + "\n");
- buffer.append("Declaring bean: " + declaringBean.toString() + "\n");
- buffer.append("Method: " + method.toString() + "\n");
- return buffer.toString();
- }
-
@Override
- public boolean isSerializable()
+ protected boolean isProductSerializable()
{
return Reflections.isSerializable(method.getAnnotatedMethod().getReturnType());
}
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2009-01-04 19:15:14 UTC (rev 756)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -1,5 +1,10 @@
package org.jboss.webbeans.test;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.util.Arrays;
import javax.webbeans.Production;
@@ -27,6 +32,7 @@
addStandardDeploymentTypesForTests();
}
+ @SuppressWarnings("unchecked")
protected void addStandardDeploymentTypesForTests()
{
manager.setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class, AnotherDeploymentType.class, HornedAnimalDeploymentType.class));
@@ -37,4 +43,16 @@
manager.getEjbDescriptorCache().add(new MockEjbDescriptor<T>(clazz));
}
+ protected byte[] serialize(Object instance) throws IOException {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bytes);
+ out.writeObject(instance);
+ return bytes.toByteArray();
+ }
+
+ protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException {
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
+ return in.readObject();
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2009-01-04 19:15:14 UTC (rev 756)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -1,10 +1,6 @@
package org.jboss.webbeans.test;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import javax.webbeans.DefinitionException;
import javax.webbeans.UnproxyableDependencyException;
@@ -49,19 +45,7 @@
DependentContext.INSTANCE.setActive(false);
}
}
-
- private byte[] serializeBean(Object instance) throws IOException {
- ByteArrayOutputStream bytes = new ByteArrayOutputStream();
- ObjectOutputStream out = new ObjectOutputStream(bytes);
- out.writeObject(instance);
- return bytes.toByteArray();
- }
- private Object deserializeBean(byte[] bytes) throws IOException, ClassNotFoundException {
- ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
- return in.readObject();
- }
-
@Test(groups = "Reflections")
@SpecAssertion(section = "5.4")
public void testSimpleWebBeanClientProxyIsSerializable() throws IOException, ClassNotFoundException
@@ -70,8 +54,8 @@
manager.addBean(tunaBean);
TunedTuna tuna = manager.getInstance(tunaBean);
assert Reflections.isProxy(tuna);
- byte[] bytes = serializeBean(tuna);
- tuna = (TunedTuna) deserializeBean(bytes);
+ byte[] bytes = serialize(tuna);
+ tuna = (TunedTuna) deserialize(bytes);
assert Reflections.isProxy(tuna);
assert tuna.getState().equals("tuned");
}
@@ -82,6 +66,7 @@
{
Bean<FinalTuna> tunaBean = BeanFactory.createSimpleBean(FinalTuna.class, manager);
manager.addBean(tunaBean);
+ @SuppressWarnings("unused")
FinalTuna tuna = manager.getInstanceByType(FinalTuna.class);
assert false;
}
@@ -100,6 +85,7 @@
@Test(groups = "Reflections", expectedExceptions=DefinitionException.class)
public void testGettingUnknownBeanFails() {
Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ @SuppressWarnings("unused")
Tuna tuna = manager.getInstance(tunaBean);
assert false;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java 2009-01-04 19:15:14 UTC (rev 756)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -1,14 +1,54 @@
package org.jboss.webbeans.test.contexts;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.webbeans.ApplicationScoped;
+import javax.webbeans.ConversationScoped;
import javax.webbeans.DefinitionException;
import javax.webbeans.IllegalProductException;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.SessionScoped;
import javax.webbeans.UnserializableDependencyException;
-import javax.webbeans.manager.Context;
+import javax.webbeans.manager.Bean;
-import org.jboss.webbeans.context.RequestContext;
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.MetaDataCache;
+import org.jboss.webbeans.bean.AbstractProducerBean;
+import org.jboss.webbeans.bean.BeanFactory;
+import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.bean.SimpleBean;
import org.jboss.webbeans.test.AbstractTest;
import org.jboss.webbeans.test.SpecAssertion;
import org.jboss.webbeans.test.SpecVersion;
+import org.jboss.webbeans.test.contexts.invalid.CityProducer;
+import org.jboss.webbeans.test.contexts.invalid.CityProducer2;
+import org.jboss.webbeans.test.contexts.invalid.CityProducer3;
+import org.jboss.webbeans.test.contexts.invalid.Peraseinajoki;
+import org.jboss.webbeans.test.contexts.invalid.Espoo;
+import org.jboss.webbeans.test.contexts.invalid.Forssa;
+import org.jboss.webbeans.test.contexts.invalid.Hamina;
+import org.jboss.webbeans.test.contexts.invalid.Jamsa;
+import org.jboss.webbeans.test.contexts.invalid.Kaarina;
+import org.jboss.webbeans.test.contexts.invalid.Kotka;
+import org.jboss.webbeans.test.contexts.invalid.Kuopio;
+import org.jboss.webbeans.test.contexts.invalid.Maarianhamina;
+import org.jboss.webbeans.test.contexts.invalid.Mikkeli;
+import org.jboss.webbeans.test.contexts.invalid.Nokia;
+import org.jboss.webbeans.test.contexts.invalid.Pietarsaari;
+import org.jboss.webbeans.test.contexts.invalid.Porvoo;
+import org.jboss.webbeans.test.contexts.invalid.Raisio;
+import org.jboss.webbeans.test.contexts.invalid.Salo;
+import org.jboss.webbeans.test.contexts.invalid.Uusikaupunki;
+import org.jboss.webbeans.test.contexts.invalid.Vantaa;
+import org.jboss.webbeans.test.contexts.invalid.Violation;
+import org.jboss.webbeans.test.contexts.invalid.Violation2;
+import org.jboss.webbeans.test.contexts.valid.Hyvinkaa;
+import org.jboss.webbeans.test.contexts.valid.Joensuu;
+import org.jboss.webbeans.test.contexts.valid.Jyvaskyla;
+import org.jboss.webbeans.test.contexts.valid.Turku;
+import org.jboss.webbeans.test.contexts.valid.Vaasa;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -18,27 +58,30 @@
*
*/
@SpecVersion("20081206")
+@SuppressWarnings("unused")
public class PassivatingContextTest extends AbstractTest
{
- Context context;
-
@BeforeMethod
public void initContext()
{
- context = new RequestContext()
- {
- };
+ addToEjbCache(Turku.class);
+ addToEjbCache(Kaarina.class);
+ addToEjbCache(Espoo.class);
+ addToEjbCache(Maarianhamina.class);
+ addToEjbCache(Porvoo.class);
+ addToEjbCache(Pietarsaari.class);
}
/**
* EJB local objects are serializable. Therefore, an enterprise Web Bean may
* declare any passivating scope.
*/
- @Test(groups = { "stub", "contexts", "passivation", "enterpriseBean" })
+ @Test(groups = { "contexts", "passivation", "enterpriseBean" })
@SpecAssertion(section = "9.5")
public void testEJBWebBeanCanDeclarePassivatingScope()
{
- assert false;
+ EnterpriseBean<Turku> bean = BeanFactory.createEnterpriseBean(Turku.class, manager);
+ assert true;
}
/**
@@ -47,111 +90,177 @@
* serializable, a DefinitionException is thrown by the Web Bean manager at
* initialization time.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = DefinitionException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "9.5")
public void testSimpleWebBeanWithNonSerializableImplementationClassFails()
{
- assert false;
+ registerBeans(new Class<?>[] { Hamina.class });
+ manager.validate();
}
/**
- * If a producer method or field declares a passivating scope and returns a
- * non-serializable object at runtime, an Illegal- ProductException is thrown
- * by the Web Bean manager.
+ * Simple Web Beans are not required to be serializable. If a simple Web Bean
+ * declares a passivating scope, and the implementation class is not
+ * serializable, a DefinitionException is thrown by the Web Bean manager at
+ * initialization time.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @Test(groups = {"contexts", "passivation" })
@SpecAssertion(section = "9.5")
- public void testProducerMethodDeclaringPassivatingScopeButReturningNonSerializableImplementationClassFails()
+ public void testSimpleWebBeanWithSerializableImplementationClassOK()
{
- assert false;
+ SimpleBean<Jyvaskyla> bean = BeanFactory.createSimpleBean(Jyvaskyla.class, manager);
+ assert true;
}
/**
* The built-in session and conversation scopes are passivating. No other
* built-in scope is passivating.
*/
- @Test(groups = { "stub", "contexts", "passivation" })
+ @Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "9.5")
public void testIsSessionScopePassivating()
{
- assert false;
+ assert MetaDataCache.instance().getScopeModel(SessionScoped.class).isPassivating();
}
/**
* The built-in session and conversation scopes are passivating. No other
* built-in scope is passivating.
*/
- @Test(groups = { "stub", "contexts", "passivation" })
+ @Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "9.5")
public void testIsConversationScopePassivating()
{
- assert false;
+ assert MetaDataCache.instance().getScopeModel(ConversationScoped.class).isPassivating();
}
/**
* The built-in session and conversation scopes are passivating. No other
* built-in scope is passivating.
*/
- @Test(groups = { "stub", "contexts", "passivation" })
+ @Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "9.5")
public void testIsApplicationScopeNonPassivating()
{
- assert false;
+ assert !MetaDataCache.instance().getScopeModel(ApplicationScoped.class).isPassivating();
}
/**
* The built-in session and conversation scopes are passivating. No other
* built-in scope is passivating.
*/
- @Test(groups = { "stub", "contexts", "passivation" })
+ @Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "9.5")
public void testIsRequestScopeNonPassivating()
{
- assert false;
+ assert !MetaDataCache.instance().getScopeModel(RequestScoped.class).isPassivating();
}
/**
* the Web Bean declares a passivating scope type, and context passivation
* occurs, or
+ *
+ * @throws IOException
+ * @throws ClassNotFoundException
*/
- @Test(groups = { "stub", "contexts", "passivation" })
+ @Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "9.5")
- public void testSimpleWebBeanDeclaringPassivatingScopeIsSerializedWhenContextIsPassivated()
+ public void testSimpleWebBeanDeclaringPassivatingScopeIsSerializedWhenContextIsPassivated() throws IOException, ClassNotFoundException
{
- assert false;
+ SimpleBean<Jyvaskyla> bean = BeanFactory.createSimpleBean(Jyvaskyla.class, manager);
+ assert testSerialize(bean);
}
+ @SuppressWarnings("unchecked")
+ private <T> boolean testSerialize(Bean<T> bean) throws IOException, ClassNotFoundException
+ {
+ manager.addBean(bean);
+ T instance = manager.getInstance(bean);
+ byte[] data = serialize(instance);
+ T resurrected = (T) deserialize(data);
+ return resurrected.getClass().equals(instance.getClass());
+ }
+
/**
* the Web Bean is an EJB stateful session bean, and it is passivated by the
* EJB container.
+ *
+ * @throws ClassNotFoundException
+ * @throws IOException
*/
- @Test(groups = { "stub", "contexts", "passivation" })
+ @Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "9.5")
- public void testStatefulEJBIsSerializedWhenPassivatedByEJBContainer()
+ public void testStatefulEJBIsSerializedWhenPassivatedByEJBContainer() throws IOException, ClassNotFoundException
{
- assert false;
+ EnterpriseBean<Turku> bean = BeanFactory.createEnterpriseBean(Turku.class, manager);
+ assert testSerialize(bean);
}
/**
- * Therefore, any reference to a Web Bean which declares a normal scope type
- * is serializable.
+ * On the other hand, dependent objects (including interceptors and
+ * decorators with scope @Dependent) of a stateful session bean or of a Web
+ * Bean with a passivating scope must be serialized and deserialized along
+ * with their owner
*/
- @Test(groups = { "stub", "contexts", "passivation" })
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
@SpecAssertion(section = "9.5")
- public void testReferencesToWebBeansWithNormalScopeAreSerializable()
+ public void testDependentInterceptorsOfStatefulEnterpriseBeanMustBeSerializable()
{
- assert false;
+ EnterpriseBean<Kaarina> bean = BeanFactory.createEnterpriseBean(Kaarina.class, manager);
}
/**
+ * On the other hand, dependent objects (including interceptors and
+ * decorators with scope @Dependent) of a stateful session bean or of a Web
+ * Bean with a passivating scope must be serialized and deserialized along
+ * with their owner
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentDecoratorsOfStatefulEnterpriseBeanMustBeSerializable()
+ {
+ EnterpriseBean<Porvoo> bean = BeanFactory.createEnterpriseBean(Porvoo.class, manager);
+ }
+
+ /**
+ * On the other hand, dependent objects (including interceptors and
+ * decorators with scope @Dependent) of a stateful session bean or of a Web
+ * Bean with a passivating scope must be serialized and deserialized along
+ * with their owner
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentInterceptorsOfWebBeanWithPassivatingScopeMustBeSerializable()
+ {
+ SimpleBean<Kotka> bean = BeanFactory.createSimpleBean(Kotka.class, manager);
+ }
+
+ /**
+ * On the other hand, dependent objects (including interceptors and
+ * decorators with scope @Dependent) of a stateful session bean or of a Web
+ * Bean with a passivating scope must be serialized and deserialized along
+ * with their owner
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentDecoratorsOfWebBeansWithPassivatingScopeMustBeSerializable()
+ {
+ SimpleBean<Raisio> bean = BeanFactory.createSimpleBean(Raisio.class, manager);
+ }
+
+ /**
* EJB local objects are serializable. Therefore, any reference to an
* enterprise Web Bean of scope @Dependent is serializable.
+ *
+ * @throws ClassNotFoundException
+ * @throws IOException
*/
- @Test(groups = { "stub", "contexts", "passivation" })
+ @Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "9.5")
- public void testDependentEJBsAreSerializable()
+ public void testDependentEJBsAreSerializable() throws IOException, ClassNotFoundException
{
- assert false;
+ SimpleBean<Vaasa> bean = BeanFactory.createSimpleBean(Vaasa.class, manager);
+ assert testSerialize(bean);
}
/**
@@ -165,9 +274,11 @@
*/
@Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
@SpecAssertion(section = "9.5")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoStatefulSessionBeanWithPassivatingScopeFails()
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoStatefulSessionBeanFails()
{
- assert false;
+ manager.addBean(BeanFactory.createSimpleBean(Violation.class, manager));
+ EnterpriseBean<Espoo> bean = BeanFactory.createEnterpriseBean(Espoo.class, manager);
+ bean.postConstruct(null);
}
/**
@@ -179,13 +290,31 @@
* UnserializableDependencyException must be thrown by the Web Bean manager
* at initialization time.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
@SpecAssertion(section = "9.5")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
{
- assert false;
+ registerBeans(new Class<?>[] { Violation.class, Vantaa.class });
+ manager.validate();
+ // T12 instance = manager.getInstanceByType(T12.class);
+ // System.out.println(instance.test());
}
+ private void registerBeans(Class<?>[] classes)
+ {
+ for (Class<?> clazz : classes)
+ {
+ if (CurrentManager.rootManager().getEjbDescriptorCache().containsKey(clazz))
+ {
+ CurrentManager.rootManager().addBean(BeanFactory.createEnterpriseBean(clazz, manager));
+ }
+ else
+ {
+ CurrentManager.rootManager().addBean(BeanFactory.createSimpleBean(clazz, manager));
+ }
+ }
+ }
+
/**
* If a simple Web Bean of scope @Dependent and a non-serializable
* implementation class is injected into a stateful session bean, into a
@@ -195,10 +324,27 @@
* UnserializableDependencyException must be thrown by the Web Bean manager
* at initialization time.
*/
+ @Test(groups = { "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoTransientFieldOK()
+ {
+ SimpleBean<Joensuu> bean = BeanFactory.createSimpleBean(Joensuu.class, manager);
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
@Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
@SpecAssertion(section = "9.5")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
{
+ // TODO: case?
assert false;
}
@@ -211,11 +357,12 @@
* UnserializableDependencyException must be thrown by the Web Bean manager
* at initialization time.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
@SpecAssertion(section = "9.5")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
{
- assert false;
+ registerBeans(new Class<?>[] { Violation.class, Forssa.class });
+ manager.validate();
}
/**
@@ -227,11 +374,13 @@
* UnserializableDependencyException must be thrown by the Web Bean manager
* at initialization time.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
@SpecAssertion(section = "9.5")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoProducerMethodParameterWithPassivatingScopeFails()
{
- assert false;
+ manager.addBean(BeanFactory.createSimpleBean(Violation.class, manager));
+ Bean<?> producerBean = registerProducerBean(Peraseinajoki.class, "create", Violation2.class);
+ manager.validate();
}
/**
@@ -241,12 +390,17 @@
* parameter of a Web Bean which declares a passivating scope type, or into a
* parameter of a producer method which declares a passivating scope type, an
* IllegalProductException is thrown by the Web Bean manager.
+ *
+ * @throws NoSuchMethodException
+ * @throws SecurityException
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "9.5")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanWithPassivatingScopeFails()
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoStatefulEnterpriseBeanFails() throws SecurityException, NoSuchMethodException
{
- assert false;
+ registerProducerBean(CityProducer2.class, "create", Violation.class);
+ EnterpriseBean<Maarianhamina> ejb = BeanFactory.createEnterpriseBean(Maarianhamina.class, manager);
+ ejb.postConstruct(null);
}
/**
@@ -257,11 +411,12 @@
* parameter of a producer method which declares a passivating scope type, an
* IllegalProductException is thrown by the Web Bean manager.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "9.5")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
{
- assert false;
+ registerProducerBean(CityProducer2.class, "create", Violation.class);
+ getInstance(Nokia.class).ping();
}
/**
@@ -272,6 +427,22 @@
* parameter of a producer method which declares a passivating scope type, an
* IllegalProductException is thrown by the Web Bean manager.
*/
+ @Test(groups = { "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
+ {
+ SimpleBean<CityProducer2> bean = BeanFactory.createSimpleBean(CityProducer2.class, manager);
+ SimpleBean<Hyvinkaa> ejb = BeanFactory.createSimpleBean(Hyvinkaa.class, manager);
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
@Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "9.5")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
@@ -287,11 +458,12 @@
* parameter of a producer method which declares a passivating scope type, an
* IllegalProductException is thrown by the Web Bean manager.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "9.5")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
{
- assert false;
+ registerProducerBean(CityProducer2.class, "create", Violation.class);
+ getInstance(Kuopio.class).ping();
}
/**
@@ -302,18 +474,193 @@
* parameter of a producer method which declares a passivating scope type, an
* IllegalProductException is thrown by the Web Bean manager.
*/
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "9.5")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
{
+ registerProducerBean(CityProducer3.class, "create", Violation.class);
+ Bean<?> producerBean = registerProducerBean(Jamsa.class, "create", Violation.class);
+ Jamsa producerInstance = (Jamsa)producerBean.create();
+ producerInstance.ping();
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ *
+ * @throws NoSuchFieldException
+ * @throws SecurityException
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanFails() throws SecurityException, NoSuchFieldException
+ {
+ registerProducerBean(CityProducer.class, "reference", Violation.class);
+ EnterpriseBean<Pietarsaari> bean = BeanFactory.createEnterpriseBean(Pietarsaari.class, manager);
+ // TODO: hack
+ bean.postConstruct(null);
+ assert true;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
+ {
+ registerProducerBean(CityProducer.class, "reference", Violation.class);
+ getInstance(Uusikaupunki.class).ping();
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
+ {
+ registerProducerBean(CityProducer.class, "reference", Violation.class);
+ getInstance(Salo.class).ping();
+ assert true;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ // TODO: case?
assert false;
}
/**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ registerProducerBean(CityProducer.class, "reference", Violation.class);
+ getInstance(Mikkeli.class).ping();
+ }
+
+ private <T> T getInstance(Class<T> clazz)
+ {
+ Bean<T> bean = null;
+ if (CurrentManager.rootManager().getEjbDescriptorCache().containsKey(clazz))
+ {
+ bean = BeanFactory.createEnterpriseBean(clazz, manager);
+ }
+ else
+ {
+ bean = BeanFactory.createSimpleBean(clazz, manager);
+ }
+ manager.addBean(bean);
+ return manager.getInstance(bean);
+ }
+
+ private boolean hasField(Class<?> clazz, String name)
+ {
+ try
+ {
+ Field field = clazz.getDeclaredField(name);
+ }
+ catch (NoSuchFieldException e)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ private Method getMethod(Class<?> clazz, String name)
+ {
+ for (Method method : clazz.getDeclaredMethods())
+ {
+ if (method.getName().equals(name))
+ {
+ return method;
+ }
+ }
+ return null;
+ }
+
+ private AbstractProducerBean<?, ?> registerProducerBean(Class<?> producerBeanClass, String fieldOrMethodName, Class<?> productClass)
+ {
+ SimpleBean<?> producerContainerBean = BeanFactory.createSimpleBean(producerBeanClass, manager);
+ manager.addBean(producerContainerBean);
+ AbstractProducerBean<?, ?> producerBean = null;
+ try
+ {
+ if (hasField(producerBeanClass, fieldOrMethodName))
+ {
+ Field producerField = producerBeanClass.getDeclaredField(fieldOrMethodName);
+ producerBean = BeanFactory.createProducerFieldBean(productClass, producerField, producerContainerBean, manager);
+ }
+ else
+ {
+ Method producerMethod = getMethod(producerBeanClass, fieldOrMethodName);
+ producerBean = BeanFactory.createProducerMethodBean(productClass, producerMethod, producerContainerBean, manager);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Could not initialize producer bean", e);
+ }
+ manager.addBean(producerBean);
+ return producerBean;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
+ {
+ registerProducerBean(CityProducer.class, "reference", Violation.class);
+ Bean<?> producerBean = registerProducerBean(Jamsa.class, "create", Violation.class);
+ Jamsa producerInstance = (Jamsa)producerBean.create();
+ producerInstance.ping();
+
+ }
+
+ /**
* The Web Bean manager must guarantee that JMS endpoint proxy objects are
* serializable.
*/
- @Test(groups = { "stub", "contexts", "passivation" })
+ @Test(groups = { "stub", "contexts", "passivation", "jms" })
@SpecAssertion(section = "9.5")
public void testJMSEndpointProxyIsSerializable()
{
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityBinding.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityBinding.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityBinding.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.InterceptorBindingType;
+
+@InterceptorBindingType
+@Dependent
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+public @interface CityBinding
+{
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityDecorator.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityDecorator.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityDecorator.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.webbeans.Decorates;
+import javax.webbeans.Decorator;
+import javax.webbeans.Dependent;
+
+@Decorator
+@Dependent
+public class CityDecorator implements CityInterface
+{
+ @Decorates
+ private Raisio decorates;
+
+ public void foo()
+ {
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityInterceptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityInterceptor.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityInterceptor.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+import javax.webbeans.Interceptor;
+
+@CityBinding
+@Interceptor
+public class CityInterceptor
+{
+ @AroundInvoke
+ public Object manageTransaction(InvocationContext context) {
+ return null;
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityInterface.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityInterface.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityInterface.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+public interface CityInterface
+{
+ public void foo();
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Produces;
+
+public class CityProducer
+{
+ @Produces @Dependent public Violation reference = new Violation();
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer2.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer2.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer2.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Produces;
+
+public class CityProducer2
+{
+ @Produces
+ @Dependent
+ public Violation create()
+ {
+ return new Violation();
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer3.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer3.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/CityProducer3.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.webbeans.Current;
+import javax.webbeans.Dependent;
+import javax.webbeans.Produces;
+
+
+public class CityProducer3
+{
+ @Produces
+ @Dependent
+ public Violation create(@Current Violation reference)
+ {
+ return new Violation();
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Espoo.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Espoo.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Espoo.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+public class Espoo
+{
+ @Current
+ Violation reference;
+
+ @Remove
+ public void bye() {
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Forssa.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Forssa.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Forssa.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.Initializer;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+public class Forssa implements Serializable
+{
+ public Forssa() {
+ }
+
+ @Initializer
+ public Forssa(@Current Violation reference) {
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Hamina.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Hamina.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Hamina.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+public class Hamina
+{
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Jamsa.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Jamsa.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Jamsa.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Produces;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.valid.City;
+
+@SessionScoped
+public class Jamsa extends City implements Serializable
+{
+ public Jamsa()
+ {
+ }
+
+ @Produces
+ @SessionScoped
+ public Violation create()
+ {
+ return new Violation();
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kaarina.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kaarina.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kaarina.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+public class Kaarina
+{
+ @CityBinding
+ public void foo()
+ {
+ }
+
+ @Remove
+ public void bye()
+ {
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kotka.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kotka.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kotka.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+public class Kotka implements Serializable
+{
+ @CityBinding
+ public void foo() {
+
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kuopio.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kuopio.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Kuopio.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.Initializer;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.valid.City;
+
+@SessionScoped
+public class Kuopio extends City implements Serializable
+{
+ public Kuopio() {
+
+ }
+
+ @Initializer
+ public void init(@Current Violation reference) {
+
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Lieto.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Lieto.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Lieto.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.webbeans.Current;
+
+public class Lieto
+{
+ public Lieto(@Current Violation reference) {
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Maarianhamina.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Maarianhamina.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Maarianhamina.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+public class Maarianhamina
+{
+ @Current
+ private Violation reference;
+
+ @Remove
+ public void bye() {
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Mikkeli.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Mikkeli.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Mikkeli.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.Initializer;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.valid.City;
+
+@SessionScoped
+public class Mikkeli extends City implements Serializable
+{
+ public Mikkeli()
+ {
+ }
+
+ @Initializer
+ public Mikkeli(@Current Violation reference)
+ {
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Naantali.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Naantali.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Naantali.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.webbeans.Dependent;
+
+@Dependent
+public class Naantali
+{
+ public Naantali(Hamina reference) {
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Nokia.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Nokia.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Nokia.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.valid.City;
+
+@SessionScoped
+public class Nokia extends City implements Serializable
+{
+ @Current
+ private Violation reference;
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Peraseinajoki.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Peraseinajoki.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Peraseinajoki.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,25 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.Produces;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.valid.City;
+
+@SessionScoped
+public class Peraseinajoki extends City implements Serializable
+{
+
+ public Peraseinajoki()
+ {
+ }
+
+ @Produces @SessionScoped
+ public Violation2 create(@Current Violation reference)
+ {
+ return new Violation2();
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Pietarsaari.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Pietarsaari.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Pietarsaari.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.valid.City;
+
+@Stateful
+@SessionScoped
+public class Pietarsaari extends City implements Serializable
+{
+ @Current
+ private Violation reference;
+
+ @Remove
+ public void bye() {
+
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Pori.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Pori.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Pori.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.Initializer;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+public class Pori implements Serializable
+{
+ public Pori() {
+ }
+
+ @Initializer
+ public Pori(@Current Violation reference) {
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Porvoo.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Porvoo.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Porvoo.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+public class Porvoo implements CityInterface
+{
+ public void foo()
+ {
+ }
+
+ @Remove
+ public void bye()
+ {
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Raisio.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Raisio.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Raisio.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+public class Raisio implements CityInterface, Serializable
+{
+ public void foo()
+ {
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Salo.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Salo.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Salo.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.valid.City;
+
+@SessionScoped
+public class Salo extends City implements Serializable
+{
+ @Current
+ private transient Violation reference;
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Tampere.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Tampere.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Tampere.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.webbeans.Current;
+import javax.webbeans.Dependent;
+import javax.webbeans.Produces;
+
+public class Tampere
+{
+ @Produces
+ @Dependent
+ public Violation create(@Current Violation reference)
+ {
+ return reference;
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Uusikaupunki.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Uusikaupunki.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Uusikaupunki.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.valid.City;
+
+@SessionScoped
+public class Uusikaupunki extends City implements Serializable
+{
+ @Current
+ private Violation reference;
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Vantaa.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Vantaa.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Vantaa.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,28 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+public class Vantaa implements Serializable
+{
+ @Current
+ private Violation reference;
+
+ public Violation getReference()
+ {
+ return reference;
+ }
+
+ public void setReference(Violation reference)
+ {
+ this.reference = reference;
+ }
+
+ public String test() {
+ return reference.toString();
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Violation.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Violation.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Violation.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.webbeans.Dependent;
+
+@Dependent
+public class Violation
+{
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Violation2.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Violation2.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/invalid/Violation2.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.contexts.invalid;
+
+import javax.webbeans.Dependent;
+
+@Dependent
+public class Violation2
+{
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/City.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/City.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/City.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.test.contexts.valid;
+
+public class City
+{
+ public void ping() {
+
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Helsinki.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Helsinki.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Helsinki.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.contexts.valid;
+
+import javax.ejb.Stateful;
+import javax.webbeans.Dependent;
+
+@Dependent
+@Stateful
+public class Helsinki
+{
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Hyvinkaa.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Hyvinkaa.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Hyvinkaa.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.contexts.valid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.invalid.Violation;
+
+@SessionScoped
+public class Hyvinkaa implements Serializable
+{
+ @Current
+ private transient Violation reference;
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Joensuu.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Joensuu.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Joensuu.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.contexts.valid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.test.contexts.invalid.Violation;
+
+@SessionScoped
+public class Joensuu implements Serializable
+{
+ @Current
+ private transient Violation reference;
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Jyvaskyla.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Jyvaskyla.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Jyvaskyla.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.contexts.valid;
+
+import java.io.Serializable;
+
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+public class Jyvaskyla implements Serializable
+{
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Turku.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Turku.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Turku.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.contexts.valid;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+public class Turku
+{
+ @Remove
+ public void bye() {
+
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Vaasa.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Vaasa.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/valid/Vaasa.java 2009-01-04 20:18:46 UTC (rev 757)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.contexts.valid;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+public class Vaasa implements Serializable
+{
+ @Current private Helsinki ejb;
+}
16 years
[webbeans-commits] Webbeans SVN: r756 - in ri/trunk/webbeans-ri/src: test/java/org/jboss/webbeans/test and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-01-04 14:15:14 -0500 (Sun, 04 Jan 2009)
New Revision: 756
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/OrangeCheekedWaxbill.java
Log:
Fixed newly broken event test.
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-01-03 18:59:16 UTC (rev 755)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-01-04 19:15:14 UTC (rev 756)
@@ -205,13 +205,6 @@
beans.add(producerFieldBean);
log.info("Web Bean: " + producerFieldBean);
}
- for (AnnotatedMethod<Object> initializerMethod : bean.getInitializerMethods())
- {
- for (AnnotatedParameter<Object> parameter : initializerMethod.getAnnotatedParameters(Fires.class))
- {
- registerEvent(parameter, beans);
- }
- }
for (AnnotatedItem injectionPoint : bean.getInjectionPoints())
{
if ( injectionPoint.isAnnotationPresent(Fires.class) )
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java 2009-01-03 18:59:16 UTC (rev 755)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java 2009-01-04 19:15:14 UTC (rev 756)
@@ -715,7 +715,7 @@
}
}
- @Test(groups = { "events", "broken" })
+ @Test(groups = { "events" })
@SpecAssertion(section = "8.6")
public void testObservableAnnotationOnParameterOfInitializerMethod()
{
@@ -859,130 +859,130 @@
}
}
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.6")
-// public void testImplicitObserverBeanMatchesAPITypeOfInectionPoint()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.6")
-// public void testImplicitObserverBeanMatchesBindingAnnotationsOfInjectionPoint()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.6")
-// public void testImplicitObserverBeanHasStandardDeploymentType()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.6")
-// public void testImplicitObserverBeanHasDependentScope()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.6")
-// public void testFireMethodCallsManagerFireWithEventObject()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.6")
-// public void testFireMethodCallsManagerFireWithBindingAnnotationsExceptObservable()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.6")
-// public void testFireMethodCallsManagerFireWithAllBindingAnnotationInstances()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.6")
-// public void testObserveMethodCallsManagerAddObserverWithObserverObject()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.6")
-// public void testObserveMethodCallsManagerAddObserverWithAllBindingAnnotationsExceptObservable()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.6")
-// public void testObserveMethodCallsManagerAddObserverWithAllBindingAnnotationInstance()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.7")
-// public void testEventObjectContainsTypeVariablesWhenResolvingFails()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.7")
-// public void testEventObjectContainsWildcardsWhenResolvingFails()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.7")
-// public void testDuplicateBindingTypesWhenResolvingFails()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.7")
-// public void testNonBindingTypeAnnotationWhenResolvingFails()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.7")
-// public void testResolvingChecksEventType()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.7")
-// public void testResolvingChecksTypeParameters()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.7")
-// public void testResolvingChecksBindingTypes()
-// {
-// assert false;
-// }
-//
-// @Test(groups = { "stub", "events" })
-// @SpecAssertion(section = "8.7")
-// public void testResolvingChecksBindingTypeMembers()
-// {
-// assert false;
-// }
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.6")
+ public void testImplicitObserverBeanMatchesAPITypeOfInectionPoint()
+ {
+ assert false;
+ }
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.6")
+ public void testImplicitObserverBeanMatchesBindingAnnotationsOfInjectionPoint()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.6")
+ public void testImplicitObserverBeanHasStandardDeploymentType()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.6")
+ public void testImplicitObserverBeanHasDependentScope()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.6")
+ public void testFireMethodCallsManagerFireWithEventObject()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.6")
+ public void testFireMethodCallsManagerFireWithBindingAnnotationsExceptObservable()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.6")
+ public void testFireMethodCallsManagerFireWithAllBindingAnnotationInstances()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.6")
+ public void testObserveMethodCallsManagerAddObserverWithObserverObject()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.6")
+ public void testObserveMethodCallsManagerAddObserverWithAllBindingAnnotationsExceptObservable()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.6")
+ public void testObserveMethodCallsManagerAddObserverWithAllBindingAnnotationInstance()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.7")
+ public void testEventObjectContainsTypeVariablesWhenResolvingFails()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.7")
+ public void testEventObjectContainsWildcardsWhenResolvingFails()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.7")
+ public void testDuplicateBindingTypesWhenResolvingFails()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.7")
+ public void testNonBindingTypeAnnotationWhenResolvingFails()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.7")
+ public void testResolvingChecksEventType()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.7")
+ public void testResolvingChecksTypeParameters()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.7")
+ public void testResolvingChecksBindingTypes()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "8.7")
+ public void testResolvingChecksBindingTypeMembers()
+ {
+ assert false;
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/OrangeCheekedWaxbill.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/OrangeCheekedWaxbill.java 2009-01-03 18:59:16 UTC (rev 755)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/OrangeCheekedWaxbill.java 2009-01-04 19:15:14 UTC (rev 756)
@@ -3,11 +3,8 @@
import javax.webbeans.Event;
import javax.webbeans.Initializer;
import javax.webbeans.Fires;
-import javax.webbeans.RequestScoped;
-
import org.jboss.webbeans.test.beans.StarFinch.Mess;
-@RequestScoped
public class OrangeCheekedWaxbill
{
16 years
[webbeans-commits] Webbeans SVN: r755 - in ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test: beans and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-01-03 13:59:16 -0500 (Sat, 03 Jan 2009)
New Revision: 755
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BeanWithInjectionPointMetadata.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPoint.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPoint.java
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPointBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java
Log:
Refactoring of injection point metadata tests.
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java 2009-01-03 16:43:35 UTC (rev 754)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java 2009-01-03 18:59:16 UTC (rev 755)
@@ -19,6 +19,8 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.HashSet;
import java.util.Set;
import javax.webbeans.Current;
@@ -28,9 +30,10 @@
import javax.webbeans.manager.Bean;
import org.jboss.webbeans.binding.CurrentBinding;
-import org.jboss.webbeans.test.beans.ConstructorInjectionPoint;
+import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.test.annotations.AnimalStereotype;
+import org.jboss.webbeans.test.beans.BeanWithInjectionPointMetadata;
import org.jboss.webbeans.test.beans.ConstructorInjectionPointBean;
-import org.jboss.webbeans.test.beans.FieldInjectionPoint;
import org.jboss.webbeans.test.beans.FieldInjectionPointBean;
import org.jboss.webbeans.test.mock.MockWebBeanDiscovery;
import org.testng.annotations.Test;
@@ -48,74 +51,114 @@
@SpecAssertion(section = "5.11")
public void testGetInstance()
{
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
webBeansBootstrap.boot();
// Get an instance of the bean which has another bean injected into it
- FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
- FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
- assert beanWithInjectionPoint.injectedMetadata != null;
- assert beanWithInjectionPoint.injectedMetadata.getInstance().equals(beanWithInjectedBean);
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getInstance().equals(beanWithInjectedBean);
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
@Test(groups = { "broken", "injectionPoint" })
@SpecAssertion(section = "5.11")
public void testGetBean()
{
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
webBeansBootstrap.boot();
// Get an instance of the bean which has another bean injected into it
- FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
- FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
- assert beanWithInjectionPoint.injectedMetadata != null;
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
- Set<Bean<FieldInjectionPointBean>> theBean = manager.resolveByType(FieldInjectionPointBean.class);
- assert beanWithInjectionPoint.injectedMetadata.getBean().equals(theBean);
+ Set<Bean<FieldInjectionPointBean>> theBean = manager.resolveByType(FieldInjectionPointBean.class);
+ assert beanWithInjectionPoint.getInjectedMetadata().getBean().equals(theBean);
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
@Test(groups = { "broken", "injectionPoint" })
@SpecAssertion(section = "5.11")
public void testGetType()
{
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
webBeansBootstrap.boot();
// Get an instance of the bean which has another bean injected into it
- FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
- FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
- assert beanWithInjectionPoint.injectedMetadata != null;
- assert beanWithInjectionPoint.injectedMetadata.getType().equals(FieldInjectionPointBean.class);
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getType().equals(FieldInjectionPointBean.class);
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
@Test(groups = { "broken", "injectionPoint" })
@SpecAssertion(section = "5.11")
public void testGetBindingTypes()
{
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
webBeansBootstrap.boot();
// Get an instance of the bean which has another bean injected into it
- FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
- FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
- assert beanWithInjectionPoint.injectedMetadata != null;
- Set<Annotation> bindingTypes = beanWithInjectionPoint.injectedMetadata.getBindingTypes();
- assert bindingTypes.size() == 1;
- assert bindingTypes.iterator().next().equals(Current.class);
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ Set<Annotation> bindingTypes = beanWithInjectionPoint.getInjectedMetadata().getBindingTypes();
+ assert bindingTypes.size() == 1;
+ assert bindingTypes.iterator().next().equals(Current.class);
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
@Test(groups = { "broken", "injectionPoint" })
@SpecAssertion(section = "5.11")
public void testGetMemberField()
{
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
webBeansBootstrap.boot();
// Get an instance of the bean which has another bean injected into it
- FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
- FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
- assert beanWithInjectionPoint.injectedMetadata != null;
- assert Field.class.isAssignableFrom(beanWithInjectionPoint.injectedMetadata.getMember().getClass());
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert Field.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
@Test(groups = { "stub", "injectionPoint" })
@@ -129,83 +172,156 @@
@SpecAssertion(section = "5.11")
public void testGetMemberConstructor()
{
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(ConstructorInjectionPointBean.class, ConstructorInjectionPoint.class));
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(ConstructorInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
webBeansBootstrap.boot();
// Get an instance of the bean which has another bean injected into it
- ConstructorInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(ConstructorInjectionPointBean.class, new CurrentBinding());
- ConstructorInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
- assert beanWithInjectionPoint.injectedMetadata != null;
- assert Constructor.class.isAssignableFrom(beanWithInjectionPoint.injectedMetadata.getMember().getClass());
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ ConstructorInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(ConstructorInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert Constructor.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
- @Test(groups = { "stub", "injectionPoint" })
+ @Test(groups = { "broken", "injectionPoint" })
@SpecAssertion(section = "5.11")
public void testGetAnnotation()
{
- assert false;
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getAnnotation(AnimalStereotype.class) != null;
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
- @Test(groups = { "stub", "injectionPoint" })
+ @Test(groups = { "broken", "injectionPoint" })
@SpecAssertion(section = "5.11")
public void testGetAnnotations()
{
- assert false;
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ Set<Annotation> annotations = new HashSet<Annotation>(Arrays.asList(beanWithInjectionPoint.getInjectedMetadata().getAnnotations()));
+ assert annotations.size() > 0;
+ assert annotations.contains(Current.class);
+ assert annotations.contains(AnimalStereotype.class);
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
@Test(groups = { "broken", "injectionPoint" })
@SpecAssertion(section = "5.11")
public void testStandardDeployment()
{
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
webBeansBootstrap.boot();
// Get an instance of the bean which has another bean injected into it
- FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
- FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
- assert beanWithInjectionPoint.injectedMetadata != null;
- assert beanWithInjectionPoint.injectedMetadata.getBean().getDeploymentType().equals(Standard.class);
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getBean().getDeploymentType().equals(Standard.class);
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
@Test(groups = { "broken", "injectionPoint" })
@SpecAssertion(section = "5.11")
public void testDependentScope()
{
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
webBeansBootstrap.boot();
// Get an instance of the bean which has another bean injected into it
- FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
- FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
- assert beanWithInjectionPoint.injectedMetadata != null;
- assert beanWithInjectionPoint.injectedMetadata.getBean().getScopeType().equals(Dependent.class);
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getBean().getScopeType().equals(Dependent.class);
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
@Test(groups = { "broken", "injectionPoint" })
@SpecAssertion(section = "5.11")
public void testApiTypeInjectionPoint()
{
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
webBeansBootstrap.boot();
// Get an instance of the bean which has another bean injected into it
- FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
- FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
- assert beanWithInjectionPoint.injectedMetadata != null;
- assert beanWithInjectionPoint.injectedMetadata.getBean().getTypes().contains(InjectionPoint.class);
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getBean().getTypes().contains(InjectionPoint.class);
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
@Test(groups = { "broken", "injectionPoint" })
@SpecAssertion(section = "5.11")
public void testCurrentBinding()
{
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, BeanWithInjectionPointMetadata.class));
webBeansBootstrap.boot();
// Get an instance of the bean which has another bean injected into it
- FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
- FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
- assert beanWithInjectionPoint.injectedMetadata != null;
- assert beanWithInjectionPoint.injectedMetadata.getBean().getBindingTypes().contains(Current.class);
+ try
+ {
+ DependentContext.INSTANCE.setActive(true);
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getBean().getBindingTypes().contains(Current.class);
+ }
+ finally
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
}
}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BeanWithInjectionPointMetadata.java (from rev 753, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPoint.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BeanWithInjectionPointMetadata.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BeanWithInjectionPointMetadata.java 2009-01-03 18:59:16 UTC (rev 755)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Current;
+import javax.webbeans.InjectionPoint;
+
+/**
+ * Test bean with injection point on the constructor of the bean
+ *
+ * @author David Allen
+ *
+ */
+public class BeanWithInjectionPointMetadata
+{
+ @Current
+ private InjectionPoint injectedMetadata;
+
+ public InjectionPoint getInjectedMetadata()
+ {
+ return injectedMetadata;
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BeanWithInjectionPointMetadata.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPoint.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPoint.java 2009-01-03 16:43:35 UTC (rev 754)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPoint.java 2009-01-03 18:59:16 UTC (rev 755)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.test.beans;
-
-import javax.webbeans.InjectionPoint;
-
-/**
- * Test bean with injection point on the constructor of the bean
- *
- * @author David Allen
- *
- */
-public class ConstructorInjectionPoint
-{
- public InjectionPoint injectedMetadata;
-
- public ConstructorInjectionPoint(InjectionPoint injectionPoint)
- {
- injectedMetadata = injectionPoint;
- }
-}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPointBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPointBean.java 2009-01-03 16:43:35 UTC (rev 754)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPointBean.java 2009-01-03 18:59:16 UTC (rev 755)
@@ -17,17 +17,24 @@
package org.jboss.webbeans.test.beans;
import javax.webbeans.Current;
-import javax.webbeans.SessionScoped;
/**
- * Test bean to inject another bean which uses injection point metadata on the constructor
+ * Test bean to inject a bean using injection point metadata into a constructor
*
* @author David Allen
- *
+ *
*/
-@SessionScoped
public class ConstructorInjectionPointBean
{
- @Current
- public ConstructorInjectionPoint injectedBean;
+ private BeanWithInjectionPointMetadata injectedBean;
+
+ public ConstructorInjectionPointBean(@Current BeanWithInjectionPointMetadata injectedBean)
+ {
+ this.injectedBean = injectedBean;
+ }
+
+ public BeanWithInjectionPointMetadata getInjectedBean()
+ {
+ return injectedBean;
+ }
}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPoint.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPoint.java 2009-01-03 16:43:35 UTC (rev 754)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPoint.java 2009-01-03 18:59:16 UTC (rev 755)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.test.beans;
-
-import javax.webbeans.Current;
-import javax.webbeans.InjectionPoint;
-
-/**
- * Test bean with injected metadata in a field about where this bean is injected
- * into another bean
- *
- * @author David Allen
- *
- */
-public class FieldInjectionPoint
-{
- @Current
- public InjectionPoint injectedMetadata;
-}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java 2009-01-03 16:43:35 UTC (rev 754)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java 2009-01-03 18:59:16 UTC (rev 755)
@@ -17,11 +17,10 @@
package org.jboss.webbeans.test.beans;
-import java.io.Serializable;
-
import javax.webbeans.Current;
-import javax.webbeans.SessionScoped;
+import org.jboss.webbeans.test.annotations.AnimalStereotype;
+
/**
* Test bean to inject another bean which uses injection point metadata in a
* field
@@ -29,11 +28,13 @@
* @author David Allen
*
*/
-@SessionScoped
-public class FieldInjectionPointBean implements Serializable
+public class FieldInjectionPointBean
{
- private static final long serialVersionUID = 1L;
+ @Current @AnimalStereotype
+ private BeanWithInjectionPointMetadata injectedBean;
- @Current
- public FieldInjectionPoint injectedBean;
+ public BeanWithInjectionPointMetadata getInjectedBean()
+ {
+ return injectedBean;
+ }
}
16 years
[webbeans-commits] Webbeans SVN: r754 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-01-03 11:43:35 -0500 (Sat, 03 Jan 2009)
New Revision: 754
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java
Log:
Fixed test class for the injection point metadata tests.
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java 2009-01-03 14:23:41 UTC (rev 753)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java 2009-01-03 16:43:35 UTC (rev 754)
@@ -17,18 +17,23 @@
package org.jboss.webbeans.test.beans;
+import java.io.Serializable;
+
import javax.webbeans.Current;
import javax.webbeans.SessionScoped;
/**
- * Test bean to inject another bean which uses injection point metadata in a field
+ * Test bean to inject another bean which uses injection point metadata in a
+ * field
*
* @author David Allen
- *
+ *
*/
@SessionScoped
-public class FieldInjectionPointBean
+public class FieldInjectionPointBean implements Serializable
{
+ private static final long serialVersionUID = 1L;
+
@Current
public FieldInjectionPoint injectedBean;
}
16 years
[webbeans-commits] Webbeans SVN: r753 - in ri/trunk/webbeans-ri/src: test/java/org/jboss/webbeans/test and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-01-03 09:23:41 -0500 (Sat, 03 Jan 2009)
New Revision: 753
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPoint.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPointBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPoint.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InjectionPointBean.java
Log:
Test framework for injection points; all tests marked broken till final integration of feature is done.
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InjectionPointBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InjectionPointBean.java 2009-01-02 18:57:22 UTC (rev 752)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InjectionPointBean.java 2009-01-03 14:23:41 UTC (rev 753)
@@ -41,9 +41,10 @@
private final AbstractAnnotatedMember<?, ? extends Member> memberInjectionPoint;
private final Bean<?> bean;
private final Object beanInstance;
-
+
/**
* Creates a new metadata bean for the given injection point information.
+ *
* @param injectedMember The member of the bean being injected
* @param bean The bean being injected
* @param beanInstance The instance of the bean being injected
@@ -55,49 +56,41 @@
this.beanInstance = beanInstance;
}
- //@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
{
return this.memberInjectionPoint.getAnnotation(annotationType);
}
- //@Override
public Annotation[] getAnnotations()
{
return this.memberInjectionPoint.getAnnotations().toArray(new Annotation[0]);
}
- //@Override
public Bean<?> getBean()
{
return this.bean;
}
- //@Override
public Set<Annotation> getBindingTypes()
{
return this.memberInjectionPoint.getBindingTypes();
}
- //@Override
public Object getInstance()
{
return this.beanInstance;
}
- //@Override
public Member getMember()
{
return this.memberInjectionPoint.getDelegate();
}
- //@Override
public Type getType()
{
return this.memberInjectionPoint.getType();
}
- //@Override
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
{
return this.memberInjectionPoint.isAnnotationPresent(annotationType);
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java 2009-01-03 14:23:41 UTC (rev 753)
@@ -0,0 +1,211 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.test;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.util.Set;
+
+import javax.webbeans.Current;
+import javax.webbeans.Dependent;
+import javax.webbeans.InjectionPoint;
+import javax.webbeans.Standard;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.binding.CurrentBinding;
+import org.jboss.webbeans.test.beans.ConstructorInjectionPoint;
+import org.jboss.webbeans.test.beans.ConstructorInjectionPointBean;
+import org.jboss.webbeans.test.beans.FieldInjectionPoint;
+import org.jboss.webbeans.test.beans.FieldInjectionPointBean;
+import org.jboss.webbeans.test.mock.MockWebBeanDiscovery;
+import org.testng.annotations.Test;
+
+/**
+ * Injection point metadata tests
+ *
+ * @author David Allen
+ *
+ */
+@SpecVersion("20081222")
+public class InjectionPointTest extends AbstractTest
+{
+ @Test(groups = { "broken", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testGetInstance()
+ {
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
+ assert beanWithInjectionPoint.injectedMetadata != null;
+ assert beanWithInjectionPoint.injectedMetadata.getInstance().equals(beanWithInjectedBean);
+ }
+
+ @Test(groups = { "broken", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testGetBean()
+ {
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
+ assert beanWithInjectionPoint.injectedMetadata != null;
+
+ Set<Bean<FieldInjectionPointBean>> theBean = manager.resolveByType(FieldInjectionPointBean.class);
+ assert beanWithInjectionPoint.injectedMetadata.getBean().equals(theBean);
+ }
+
+ @Test(groups = { "broken", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testGetType()
+ {
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
+ assert beanWithInjectionPoint.injectedMetadata != null;
+ assert beanWithInjectionPoint.injectedMetadata.getType().equals(FieldInjectionPointBean.class);
+ }
+
+ @Test(groups = { "broken", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testGetBindingTypes()
+ {
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
+ assert beanWithInjectionPoint.injectedMetadata != null;
+ Set<Annotation> bindingTypes = beanWithInjectionPoint.injectedMetadata.getBindingTypes();
+ assert bindingTypes.size() == 1;
+ assert bindingTypes.iterator().next().equals(Current.class);
+ }
+
+ @Test(groups = { "broken", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testGetMemberField()
+ {
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
+ assert beanWithInjectionPoint.injectedMetadata != null;
+ assert Field.class.isAssignableFrom(beanWithInjectionPoint.injectedMetadata.getMember().getClass());
+ }
+
+ @Test(groups = { "stub", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testGetMemberMethod()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "broken", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testGetMemberConstructor()
+ {
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(ConstructorInjectionPointBean.class, ConstructorInjectionPoint.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ ConstructorInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(ConstructorInjectionPointBean.class, new CurrentBinding());
+ ConstructorInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
+ assert beanWithInjectionPoint.injectedMetadata != null;
+ assert Constructor.class.isAssignableFrom(beanWithInjectionPoint.injectedMetadata.getMember().getClass());
+ }
+
+ @Test(groups = { "stub", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testGetAnnotation()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testGetAnnotations()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "broken", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testStandardDeployment()
+ {
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
+ assert beanWithInjectionPoint.injectedMetadata != null;
+ assert beanWithInjectionPoint.injectedMetadata.getBean().getDeploymentType().equals(Standard.class);
+ }
+
+ @Test(groups = { "broken", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testDependentScope()
+ {
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
+ assert beanWithInjectionPoint.injectedMetadata != null;
+ assert beanWithInjectionPoint.injectedMetadata.getBean().getScopeType().equals(Dependent.class);
+ }
+
+ @Test(groups = { "broken", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testApiTypeInjectionPoint()
+ {
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
+ assert beanWithInjectionPoint.injectedMetadata != null;
+ assert beanWithInjectionPoint.injectedMetadata.getBean().getTypes().contains(InjectionPoint.class);
+ }
+
+ @Test(groups = { "broken", "injectionPoint" })
+ @SpecAssertion(section = "5.11")
+ public void testCurrentBinding()
+ {
+ webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FieldInjectionPointBean.class, FieldInjectionPoint.class));
+ webBeansBootstrap.boot();
+
+ // Get an instance of the bean which has another bean injected into it
+ FieldInjectionPointBean beanWithInjectedBean = manager.getInstanceByType(FieldInjectionPointBean.class, new CurrentBinding());
+ FieldInjectionPoint beanWithInjectionPoint = beanWithInjectedBean.injectedBean;
+ assert beanWithInjectionPoint.injectedMetadata != null;
+ assert beanWithInjectionPoint.injectedMetadata.getBean().getBindingTypes().contains(Current.class);
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionPointTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPoint.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPoint.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPoint.java 2009-01-03 14:23:41 UTC (rev 753)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.InjectionPoint;
+
+/**
+ * Test bean with injection point on the constructor of the bean
+ *
+ * @author David Allen
+ *
+ */
+public class ConstructorInjectionPoint
+{
+ public InjectionPoint injectedMetadata;
+
+ public ConstructorInjectionPoint(InjectionPoint injectionPoint)
+ {
+ injectedMetadata = injectionPoint;
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPoint.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPointBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPointBean.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPointBean.java 2009-01-03 14:23:41 UTC (rev 753)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+/**
+ * Test bean to inject another bean which uses injection point metadata on the constructor
+ *
+ * @author David Allen
+ *
+ */
+@SessionScoped
+public class ConstructorInjectionPointBean
+{
+ @Current
+ public ConstructorInjectionPoint injectedBean;
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ConstructorInjectionPointBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPoint.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPoint.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPoint.java 2009-01-03 14:23:41 UTC (rev 753)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Current;
+import javax.webbeans.InjectionPoint;
+
+/**
+ * Test bean with injected metadata in a field about where this bean is injected
+ * into another bean
+ *
+ * @author David Allen
+ *
+ */
+public class FieldInjectionPoint
+{
+ @Current
+ public InjectionPoint injectedMetadata;
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPoint.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java 2009-01-03 14:23:41 UTC (rev 753)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+/**
+ * Test bean to inject another bean which uses injection point metadata in a field
+ *
+ * @author David Allen
+ *
+ */
+@SessionScoped
+public class FieldInjectionPointBean
+{
+ @Current
+ public FieldInjectionPoint injectedBean;
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FieldInjectionPointBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years
[webbeans-commits] Webbeans SVN: r752 - doc/trunk/reference/it-IT/modules.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2009-01-02 13:57:22 -0500 (Fri, 02 Jan 2009)
New Revision: 752
Modified:
doc/trunk/reference/it-IT/modules/interceptors.po
Log:
WBRI-69: Italian translation for Web Beans
Modified: doc/trunk/reference/it-IT/modules/interceptors.po
===================================================================
--- doc/trunk/reference/it-IT/modules/interceptors.po 2009-01-02 11:34:42 UTC (rev 751)
+++ doc/trunk/reference/it-IT/modules/interceptors.po 2009-01-02 18:57:22 UTC (rev 752)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-27 02:48+0100\n"
+"PO-Revision-Date: 2009-01-02 19:56+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -247,7 +247,7 @@
#: interceptors.xml:95
#, no-c-format
msgid "Whoah! Why the angle bracket stew?"
-msgstr ""
+msgstr "Ma perché viene usato ancora XML, quando Web Beans non dovrebbe utilizzarlo?"
#. Tag: para
#: interceptors.xml:97
16 years
[webbeans-commits] Webbeans SVN: r751 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-01-02 06:34:42 -0500 (Fri, 02 Jan 2009)
New Revision: 751
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java
Log:
Oops, marking one event test as broken until I can check with David what happened...
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java 2009-01-02 11:25:07 UTC (rev 750)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java 2009-01-02 11:34:42 UTC (rev 751)
@@ -715,7 +715,7 @@
}
}
- @Test(groups = { "events" })
+ @Test(groups = { "events", "broken" })
@SpecAssertion(section = "8.6")
public void testObservableAnnotationOnParameterOfInitializerMethod()
{
16 years