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;
+}