[webbeans-commits] Webbeans SVN: r3824 - ri/trunk/impl/src/main/java/org/jboss/webbeans and 15 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-09-30 19:39:55 -0400 (Wed, 30 Sep 2009)
New Revision: 3824
Modified:
ri/trunk/api/pom.xml
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Strings.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/ParameterizedTypeImpl.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java
ri/trunk/version-matrix/pom.xml
tck/trunk/impl/pom.xml
Log:
Update to a newer javax.inject api and tck, various small cleanups
Modified: ri/trunk/api/pom.xml
===================================================================
--- ri/trunk/api/pom.xml 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/api/pom.xml 2009-09-30 23:39:55 UTC (rev 3824)
@@ -28,7 +28,7 @@
<dependency>
<groupId>javax.inject</groupId>
- <artifactId>inject-api</artifactId>
+ <artifactId>javax.inject</artifactId>
</dependency>
</dependencies>
</project>
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -877,7 +877,7 @@
}
if (getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal())
{
- if (creationalContext != null || (creationalContext == null && getContext(bean.getScope()).get(bean) != null))
+ if (creationalContext != null || getContext(bean.getScope()).get(bean) != null)
{
return clientProxyProvider.getClientProxy(this, bean);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -96,10 +96,7 @@
for (ObserverMethodImpl<?, ?> observer : getEnvironment().getObservers())
{
log.debug("Observer : " + observer);
- if (observer instanceof ObserverMethodImpl<?, ?>)
- {
- observer.initialize();
- }
+ observer.initialize();
manager.addObserver(observer);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -92,7 +92,7 @@
boolean needCreationLock = isCreationLockRequired();
try
{
- if(needCreationLock)
+ if (needCreationLock)
{
creationLock.lock();
beanInstance = getBeanStore().get(id);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -56,6 +56,7 @@
this.beanStore.set(beanStore);
}
+ @Override
protected boolean isCreationLockRequired()
{
return true;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -40,7 +40,7 @@
public class ContextLifecycle implements Lifecycle, Service
{
- public static LogProvider log = Logging.getLogProvider(ContextLifecycle.class);
+ public static final LogProvider log = Logging.getLogProvider(ContextLifecycle.class);
private final AbstractApplicationContext applicationContext;
private final AbstractApplicationContext singletonContext;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -40,7 +40,7 @@
private static LogProvider log = Logging.getLogProvider(JavaSEConversationTerminator.class);
- private ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
+ private transient ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
public Future<?> scheduleForTermination(Runnable terminationTask, long timeoutInMilliseconds)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -19,6 +19,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -259,7 +260,7 @@
public Type[] getActualTypeArguments()
{
- return actualTypeArguments;
+ return Arrays.copyOf(actualTypeArguments, actualTypeArguments.length);
}
public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -19,12 +19,13 @@
import java.util.Arrays;
import org.jboss.webbeans.introspector.ConstructorSignature;
-import org.jboss.webbeans.introspector.MethodSignature;
import org.jboss.webbeans.introspector.WBConstructor;
public class ConstructorSignatureImpl implements ConstructorSignature
{
+ private static final long serialVersionUID = -9111642596078876778L;
+
private final String[] parameterTypes;
public ConstructorSignatureImpl(WBConstructor<?> method)
@@ -40,9 +41,9 @@
@Override
public boolean equals(Object obj)
{
- if (obj instanceof ConstructorSignatureImpl)
+ if (obj instanceof ConstructorSignature)
{
- MethodSignature that = (MethodSignature) obj;
+ ConstructorSignature that = (ConstructorSignature) obj;
return Arrays.equals(this.getParameterTypes(), that.getParameterTypes());
}
else
@@ -59,7 +60,7 @@
public String[] getParameterTypes()
{
- return parameterTypes;
+ return Arrays.copyOf(parameterTypes, parameterTypes.length);
}
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -81,7 +81,7 @@
public String[] getParameterTypes()
{
- return parameterTypes;
+ return Arrays.copyOf(parameterTypes, parameterTypes.length);
}
@Override
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -30,6 +30,7 @@
import org.jboss.webbeans.introspector.WBClass;
import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.resources.ClassTransformer;
+import org.jboss.webbeans.util.Names;
import com.google.common.base.Supplier;
import com.google.common.collect.Multimaps;
@@ -57,7 +58,7 @@
private final Map<String, WBMethod<?, ?>> namedMembers;
// Cached string representation
- private String toString;
+ private final String toString;
public static <A extends Annotation> WBAnnotation<A> of(Class<A> annotationType, ClassTransformer classTransformer)
{
@@ -75,6 +76,7 @@
{
super(annotationType, annotationType, null, AnnotationStore.of(annotationType, classTransformer.getTypeStore().get(annotationType), classTransformer.getTypeStore().get(annotationType), classTransformer.getTypeStore()), classTransformer);
this.clazz = annotationType;
+ this.toString = "class " + Names.classToString(getDelegate());
members = new HashSet<WBMethod<?, ?>>();
annotatedMembers = Multimaps.newSetMultimap(new HashMap<Class<? extends Annotation>, Collection<WBMethod<?, ?>>>(), new Supplier<Set<WBMethod<?, ?>>>()
{
@@ -141,13 +143,10 @@
@Override
public String toString()
{
- if (toString != null)
- {
- return toString;
- }
return toString;
}
+ @Override
public Class<T> getDelegate()
{
return clazz;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -118,7 +118,7 @@
private final SetMultimap<Class<? extends Annotation>, WBConstructor<?>> constructorsByAnnotatedParameters;
// Cached string representation
- private String toString;
+ private final String toString;
private final boolean _nonStaticMemberClass;
private final boolean _abstract;
@@ -139,6 +139,7 @@
protected WBClassImpl(Class<T> rawType, Type type, AnnotatedType<T> annotatedType, AnnotationStore annotationStore, ClassTransformer classTransformer)
{
super(annotationStore, rawType, type);
+ this.toString = "class " + Names.classToString(rawType);
this.name = rawType.getName();
this._simpleName = rawType.getSimpleName();
if (rawType.getSuperclass() != null)
@@ -448,6 +449,7 @@
*
* @return The class
*/
+ @Override
public Class<T> getDelegate()
{
return getJavaClass();
@@ -650,11 +652,6 @@
@Override
public String toString()
{
- if (toString != null)
- {
- return toString;
- }
- toString = "Annotated class " + Names.classToString(getDelegate());
return toString;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -387,7 +387,7 @@
}
catch (Exception e)
{
- throw new RuntimeException("Error accessing constructor (with parameters " + parameterTypes + ") of " + clazz, e);
+ throw new RuntimeException("Error accessing constructor (with parameters " + Arrays.toString(parameterTypes) + ") of " + clazz, e);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Strings.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Strings.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Strings.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -20,7 +20,9 @@
import java.util.Collection;
import java.util.Map;
import java.util.StringTokenizer;
+import java.util.Map.Entry;
+
/**
* String utilities
*
@@ -79,26 +81,26 @@
StringBuilder buffer = new StringBuilder();
if (map == null)
{
- buffer.append(header + "null\n");
+ buffer.append(header).append("null\n");
return buffer.toString();
}
- buffer.append(header + "[" + map.size() + " entries]\n");
+ buffer.append(header).append("[").append(map.size()).append(" entries]\n");
int i = 0;
- for (Object key : map.keySet())
+ for (Entry<?, ?> entry: map.entrySet())
{
- Object value = map.get(key);
- buffer.append(" #" + ++i + ": " + key.toString() + " -> ");
- if (value instanceof Iterable)
+ Object value = entry.getValue();
+ buffer.append(" #").append(++i).append(": ").append(entry.getKey()).append(" -> ");
+ if (value instanceof Iterable<?>)
{
buffer.append("\n");
for (Object subValue : (Iterable<?>) value)
{
- buffer.append(" " + subValue.toString() + "\n");
+ buffer.append(" ").append(subValue.toString()).append("\n");
}
}
else
{
- buffer.append(value.toString() + "\n");
+ buffer.append(value.toString()).append("\n");
}
}
return buffer.toString();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/ParameterizedTypeImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/ParameterizedTypeImpl.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/ParameterizedTypeImpl.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -28,14 +28,14 @@
public ParameterizedTypeImpl(Type rawType, Type[] actualTypeArguments, Type ownerType)
{
- this.actualTypeArguments = actualTypeArguments;
+ this.actualTypeArguments = Arrays.copyOf(actualTypeArguments, actualTypeArguments.length);
this.rawType = rawType;
this.ownerType = ownerType;
}
public Type[] getActualTypeArguments()
{
- return actualTypeArguments;
+ return Arrays.copyOf(actualTypeArguments, actualTypeArguments.length);
}
public Type getOwnerType()
@@ -75,6 +75,7 @@
}
+ @Override
public String toString()
{
StringBuilder sb = new StringBuilder();
Modified: ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -10,8 +10,8 @@
import org.atinject.tck.Tck;
import org.atinject.tck.auto.Car;
import org.atinject.tck.auto.Convertible;
-import org.atinject.tck.auto.DriversSeat;
import org.atinject.tck.auto.FuelTank;
+import org.atinject.tck.auto.Seat;
import org.atinject.tck.auto.V8Engine;
import org.atinject.tck.auto.accessories.Cupholder;
import org.atinject.tck.auto.accessories.SpareTire;
@@ -21,7 +21,7 @@
public class AtInjectTCK
{
- private static final List<Class<?>> classes = Arrays.<Class<?>>asList(Convertible.class, DriversSeat.class, DriversSeatProducer.class, V8Engine.class, Cupholder.class, FuelTank.class, SpareTireProducer.class, SpareTire.class);
+ private static final List<Class<?>> classes = Arrays.<Class<?>>asList(Convertible.class, Seat.class, DriversSeatProducer.class, V8Engine.class, Cupholder.class, FuelTank.class, SpareTireProducer.class, SpareTire.class);
public static Test suite()
{
Modified: ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -1,6 +1,9 @@
package org.jboss.webbeans.atinject.tck;
import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.inject.Inject;
import org.atinject.tck.auto.Drivers;
import org.atinject.tck.auto.DriversSeat;
@@ -8,11 +11,21 @@
public class DriversSeatProducer
{
+
+ private final InjectionTarget<DriversSeat> injectionTarget;
+ private final BeanManager beanManager;
+
+ @Inject
+ public DriversSeatProducer(BeanManager beanManager)
+ {
+ this.injectionTarget = beanManager.createInjectionTarget(beanManager.createAnnotatedType(DriversSeat.class));
+ this.beanManager = beanManager;
+ }
@Produces @Drivers
- public Seat produceDriversSeat(DriversSeat seat)
+ public Seat produceDriversSeat()
{
- return seat;
+ return injectionTarget.produce(beanManager.<DriversSeat>createCreationalContext(null));
}
}
Modified: ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -1,6 +1,9 @@
package org.jboss.webbeans.atinject.tck;
import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.inject.Inject;
import javax.inject.Named;
import org.atinject.tck.auto.Tire;
@@ -8,11 +11,21 @@
public class SpareTireProducer
{
+
+ private final InjectionTarget<SpareTire> injectionTarget;
+ private final BeanManager beanManager;
+
+ @Inject
+ public SpareTireProducer(BeanManager beanManager)
+ {
+ this.injectionTarget = beanManager.createInjectionTarget(beanManager.createAnnotatedType(SpareTire.class));
+ this.beanManager = beanManager;
+ }
@Produces @Named("spare")
- public Tire produceSpareTire(SpareTire spareTire)
+ public Tire produceSpareTire()
{
- return spareTire;
+ return injectionTarget.produce(beanManager.<SpareTire>createCreationalContext(null));
}
}
Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -14,15 +14,7 @@
public class ManagersImpl implements Managers
{
- public static ThreadLocal<ServletContext> SERVLET_CONTEXT = new ThreadLocal<ServletContext>()
- {
-
- protected ServletContext initialValue()
- {
- return new MockServletContext("");
- }
-
- };
+ private static final ServletContext SERVLET_CONTEXT = new MockServletContext("");
public BeanManager getManager()
{
@@ -32,7 +24,7 @@
}
else
{
- return ServletHelper.getModuleBeanManager(SERVLET_CONTEXT.get());
+ return ServletHelper.getModuleBeanManager(SERVLET_CONTEXT);
}
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -99,7 +99,14 @@
@Override
public boolean equals(Object obj)
{
- return services.equals(obj);
+ if (obj instanceof Map<?, ?>)
+ {
+ return services.equals(obj);
+ }
+ else
+ {
+ return false;
+ }
}
public Iterator<Service> iterator()
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -42,8 +42,8 @@
{
- private Set<Class<?>> beanClasses;
- private Collection<URL> webBeansXmlFiles;
+ private Collection<Class<?>> beanClasses;
+ private Collection<URL> beansXmlFiles;
private List<EjbDescriptor<?>> ejbs;
private final ServiceRegistry services;
@@ -51,7 +51,7 @@
{
this.services = new SimpleServiceRegistry();
this.beanClasses = new HashSet<Class<?>>();
- this.webBeansXmlFiles = new HashSet<URL>();
+ this.beansXmlFiles = new HashSet<URL>();
}
public Collection<Class<?>> getBeanClasses()
@@ -59,13 +59,9 @@
return beanClasses;
}
- public void setBeanClasses(Iterable<Class<?>> beanClasses)
+ public void setBeanClasses(Collection<Class<?>> beanClasses)
{
- this.beanClasses.clear();
- for (Class<?> clazz : beanClasses)
- {
- this.beanClasses.add(clazz);
- }
+ this.beanClasses = beanClasses;
ejbs = new ArrayList<EjbDescriptor<?>>();
for (Class<?> ejbClass : discoverEjbs(getBeanClasses()))
{
@@ -75,16 +71,12 @@
public Collection<URL> getBeansXml()
{
- return webBeansXmlFiles;
+ return beansXmlFiles;
}
- public void setWebBeansXmlFiles(Iterable<URL> webBeansXmlFiles)
+ public void setBeansXmlFiles(Collection<URL> beansXmlFiles)
{
- this.webBeansXmlFiles.clear();
- for (URL url : webBeansXmlFiles)
- {
- this.webBeansXmlFiles.add(url);
- }
+ this.beansXmlFiles = beansXmlFiles;
}
public List<BeanDeploymentArchive> getBeanDeploymentArchives()
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.mock;
import java.net.URL;
+import java.util.Collection;
import org.jboss.webbeans.BeanManagerImpl;
@@ -36,8 +37,8 @@
}
private final MockServletLifecycle lifecycle;
- private final Iterable<Class<?>> classes;
- private final Iterable<URL> beansXml;
+ private final Collection<Class<?>> classes;
+ private final Collection<URL> beansXml;
/**
* Create a container, specifying the classes and beans.xml to deploy
@@ -46,7 +47,7 @@
* @param classes
* @param beansXml
*/
- public TestContainer(MockServletLifecycle lifecycle, Iterable<Class<?>> classes, Iterable<URL> beansXml)
+ public TestContainer(MockServletLifecycle lifecycle, Collection<Class<?>> classes, Collection<URL> beansXml)
{
this.lifecycle = lifecycle;
this.classes = classes;
@@ -77,7 +78,7 @@
archive.setBeanClasses(classes);
if (beansXml != null)
{
- archive.setWebBeansXmlFiles(beansXml);
+ archive.setBeansXmlFiles(beansXml);
}
lifecycle.initialize();
lifecycle.beginApplication();
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -5,6 +5,7 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.util.Collection;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.api.SingletonProvider;
@@ -31,7 +32,7 @@
SingletonProvider.reset();
}
- protected TestContainer bootstrapContainer(int id, Iterable<Class<?>> classes)
+ protected TestContainer bootstrapContainer(int id, Collection<Class<?>> classes)
{
// Bootstrap container
SwitchableSingletonProvider.use(id);
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.test.harness;
import java.net.URL;
+import java.util.Collection;
import org.jboss.testharness.api.DeploymentException;
import org.jboss.testharness.spi.StandaloneContainers;
@@ -15,7 +16,7 @@
private TestContainer testContainer;
- public boolean deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml)
+ public boolean deploy(Collection<Class<?>> classes, Collection<URL> beansXml)
{
this.testContainer = new TestContainer(newLifecycle(), classes, beansXml);
@@ -35,7 +36,7 @@
protected abstract MockServletLifecycle newLifecycle();
- public void deploy(Iterable<Class<?>> classes) throws DeploymentException
+ public void deploy(Collection<Class<?>> classes) throws DeploymentException
{
deploy(classes, null);
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java 2009-09-30 23:39:55 UTC (rev 3824)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.test.unit.cluster;
import java.util.Arrays;
+import java.util.Collection;
import javax.enterprise.inject.spi.Bean;
@@ -39,7 +40,7 @@
@Test
public void testMultipleDependentObjectsSessionReplication() throws Exception
{
- Iterable<Class<?>> classes = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class);
+ Collection<Class<?>> classes = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class);
TestContainer container1 = bootstrapContainer(1, classes);
BeanManagerImpl beanManager1 = container1.getBeanManager();
Bean<?> stableBean1 = beanManager1.resolve(beanManager1.getBeans(Stable.class));
@@ -81,8 +82,8 @@
public void testVariableBeanDeploymentStructure() throws Exception
{
// NB This is not a valid deployment scenario for a cluster, but it does allow us to test bean ids neatly!
- Iterable<Class<?>> classes1 = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class);
- Iterable<Class<?>> classes2 = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class, Foo.class);
+ Collection<Class<?>> classes1 = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class);
+ Collection<Class<?>> classes2 = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class, Foo.class);
TestContainer container1 = bootstrapContainer(1, classes1);
BeanManagerImpl beanManager1 = container1.getBeanManager();
Bean<?> stableBean1 = beanManager1.resolve(beanManager1.getBeans(Stable.class));
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/version-matrix/pom.xml 2009-09-30 23:39:55 UTC (rev 3824)
@@ -87,7 +87,7 @@
<dependency>
<groupId>org.atinject</groupId>
<artifactId>inject-tck</artifactId>
- <version>1.0.0-PRD</version>
+ <version>1.0.0-PFD-2</version>
</dependency>
@@ -137,8 +137,8 @@
<dependency>
<groupId>javax.inject</groupId>
- <artifactId>inject-api</artifactId>
- <version>1.0.0-PRD</version>
+ <artifactId>javax.inject</artifactId>
+ <version>1.0-PFD-1</version>
</dependency>
<dependency>
Modified: tck/trunk/impl/pom.xml
===================================================================
--- tck/trunk/impl/pom.xml 2009-09-30 14:39:18 UTC (rev 3823)
+++ tck/trunk/impl/pom.xml 2009-09-30 23:39:55 UTC (rev 3824)
@@ -104,7 +104,7 @@
<dependency>
<groupId>javax.inject</groupId>
- <artifactId>inject-api</artifactId>
+ <artifactId>javax.inject</artifactId>
</dependency>
<dependency>
15 years, 1 month
[webbeans-commits] Webbeans SVN: r3823 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-09-30 10:39:18 -0400 (Wed, 30 Sep 2009)
New Revision: 3823
Modified:
tck/trunk/doc/reference/en-US/reporting.xml
Log:
change variance requirement
Modified: tck/trunk/doc/reference/en-US/reporting.xml
===================================================================
--- tck/trunk/doc/reference/en-US/reporting.xml 2009-09-30 13:38:57 UTC (rev 3822)
+++ tck/trunk/doc/reference/en-US/reporting.xml 2009-09-30 14:39:18 UTC (rev 3823)
@@ -31,8 +31,8 @@
<emphasis role="bold">Assertion Breadth Coverage Variance</emphasis>
</para>
<para>
- The coverage of specification sub-sections shows at least a
- normal distribution (centered around 75%).
+ The coverage of specification sub-sections shows at 75% of sections
+ with greater than 75% coverage.
</para>
</listitem>
<listitem>
@@ -48,14 +48,6 @@
</listitem>
<listitem>
<para>
- <emphasis role="bold">Method Coverage</emphasis>
- </para>
- <para>
- TODO
- </para>
- </listitem>
- <listitem>
- <para>
<emphasis role="bold">API Signature Coverage</emphasis>
</para>
<para>
15 years, 1 month
[webbeans-commits] Webbeans SVN: r3822 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: bean/proxy and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-09-30 09:38:57 -0400 (Wed, 30 Sep 2009)
New Revision: 3822
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SessionBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
Log:
tidy up
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-09-30 13:21:36 UTC (rev 3821)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-09-30 13:38:57 UTC (rev 3822)
@@ -21,7 +21,6 @@
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
@@ -90,7 +89,6 @@
if (getType().isArray() || getType().isPrimitive())
{
Set<Type> types = new HashSet<Type>();
- types = new HashSet<Type>();
types.add(getType());
types.add(Object.class);
super.types = types;
@@ -119,30 +117,12 @@
}
catch (ClassCastException e)
{
- throw new RuntimeException(" Cannot cast producer type " + getAnnotatedItem().getJavaClass() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
+ Type type = Beans.getDeclaredBeanType(getClass());
+ throw new RuntimeException(" Cannot cast producer type " + getAnnotatedItem().getJavaClass() + " to bean type " + (type == null ? " unknown " : type), e);
}
}
/**
- * Gets the declared bean type
- *
- * @return The bean type
- */
- protected Type getDeclaredBeanType()
- {
- Type type = getClass();
- if (type instanceof ParameterizedType)
- {
- ParameterizedType parameterizedType = (ParameterizedType) type;
- if (parameterizedType.getActualTypeArguments().length == 1)
- {
- return parameterizedType.getActualTypeArguments()[0];
- }
- }
- return null;
- }
-
- /**
* Validates the producer method
*/
protected void checkProducerReturnType()
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorImpl.java 2009-09-30 13:21:36 UTC (rev 3821)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorImpl.java 2009-09-30 13:38:57 UTC (rev 3822)
@@ -164,7 +164,10 @@
{
throw new DefinitionException("The decorated type is parameterized, but the delegate type isn't. Delegate type " + delegateType + "." + this);
}
- if (!Arrays.equals(delegateInjectionPoint.getActualTypeArguments(), parameterizedType.getActualTypeArguments()));
+ if (!Arrays.equals(delegateInjectionPoint.getActualTypeArguments(), parameterizedType.getActualTypeArguments()))
+ {
+ throw new DefinitionException("The delegate type must have exactly the same type parameters as the decorated type. Decorated type " + decoratedType + "." + this );
+ }
Type rawType = ((ParameterizedType) decoratedType).getRawType();
if (rawType instanceof Class && !((Class<?>) rawType).isAssignableFrom(delegateInjectionPoint.getJavaClass()))
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethod.java 2009-09-30 13:21:36 UTC (rev 3821)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethod.java 2009-09-30 13:38:57 UTC (rev 3822)
@@ -92,7 +92,6 @@
protected void initTypes()
{
Set<Type> types = new HashSet<Type>();
- types = new HashSet<Type>();
types.addAll(disposalMethodInjectionPoint.getAnnotatedParameters(Disposes.class).get(0).getTypeClosure());
types.add(Object.class);
super.types = types;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SessionBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SessionBean.java 2009-09-30 13:21:36 UTC (rev 3821)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SessionBean.java 2009-09-30 13:38:57 UTC (rev 3822)
@@ -22,7 +22,6 @@
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collections;
-import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -122,8 +121,7 @@
@Override
protected void initTypes()
{
- Set<Type> types = new HashSet<Type>();
- types = new LinkedHashSet<Type>();
+ Set<Type> types = new LinkedHashSet<Type>();
types.add(Object.class);
for (BusinessInterfaceDescriptor<?> businessInterfaceDescriptor : ejbDescriptor.getLocalBusinessInterfaces())
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-09-30 13:21:36 UTC (rev 3821)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-09-30 13:38:57 UTC (rev 3822)
@@ -19,6 +19,7 @@
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.Arrays;
import javassist.util.proxy.MethodHandler;
@@ -108,7 +109,7 @@
try
{
Object returnValue = Reflections.lookupMethod(proxiedMethod, proxiedInstance).invoke(proxiedInstance, args);
- log.trace("Executed method " + proxiedMethod + " on " + proxiedInstance + " with parameters " + args + " and got return value " + returnValue);
+ log.trace("Executed method " + proxiedMethod + " on " + proxiedInstance + " with parameters " + Arrays.toString(args) + " and got return value " + returnValue);
return returnValue;
}
catch (InvocationTargetException e)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2009-09-30 13:21:36 UTC (rev 3821)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2009-09-30 13:38:57 UTC (rev 3822)
@@ -18,6 +18,7 @@
import java.io.Serializable;
import java.lang.reflect.Method;
+import java.util.Arrays;
import java.util.Collection;
import javassist.util.proxy.MethodHandler;
@@ -115,7 +116,7 @@
Object proxiedInstance = reference.getBusinessObject(businessInterface);
Method proxiedMethod = Reflections.lookupMethod(method, proxiedInstance);
Object returnValue = Reflections.invokeAndWrap(proxiedMethod, proxiedInstance, args);
- log.trace("Executed " + method + " on " + proxiedInstance + " with parameters " + args + " and got return value " + returnValue);
+ log.trace("Executed " + method + " on " + proxiedInstance + " with parameters " + Arrays.toString(args) + " and got return value " + returnValue);
return returnValue;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-09-30 13:21:36 UTC (rev 3821)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-09-30 13:38:57 UTC (rev 3822)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.util;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -524,6 +525,25 @@
/**
+ * Gets the declared bean type
+ *
+ * @return The bean type
+ */
+ public static Type getDeclaredBeanType(Class<? extends Bean> clazz)
+ {
+ Type[] actualTypeArguments = Reflections.getActualTypeArguments(clazz);
+ if (actualTypeArguments.length == 1)
+ {
+ return actualTypeArguments[0];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+
+ /**
* Injects bound fields
*
* @param instance The instance to inject into
15 years, 1 month
[webbeans-commits] Webbeans SVN: r3821 - in ri/trunk: tests and 8 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-09-30 09:21:36 -0400 (Wed, 30 Sep 2009)
New Revision: 3821
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/AbstractHtmlUnitTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/Foo.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/TxEventTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/Updated.java
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/faces-config.xml
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/home.xhtml
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/web.xml
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java
ri/trunk/tests/pom.xml
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/tests/unit-tests.xml
ri/trunk/version-matrix/pom.xml
Log:
WBRI-401
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java 2009-09-30 12:03:10 UTC (rev 3820)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java 2009-09-30 13:21:36 UTC (rev 3821)
@@ -34,9 +34,9 @@
private static Log log = Logging.getLog(DeferredEventNotification.class);
// The observer
- protected ObserverMethodImpl<?, T> observer;
+ protected final ObserverMethodImpl<?, T> observer;
// The event object
- protected T event;
+ protected final T event;
/**
* Creates a new deferred event notifier.
@@ -52,22 +52,25 @@
public void run()
{
- Lifecycle lifecycle = Container.instance().deploymentServices().get(ContextLifecycle.class);
- BeanStore requestBeanStore = new ConcurrentHashMapBeanStore();
- lifecycle.beginRequest("async invocation", requestBeanStore);
try
{
log.debug("Sending event [" + event + "] directly to observer " + observer);
- observer.sendEvent(event);
+ new RunInRequest()
+ {
+
+ @Override
+ protected void execute()
+ {
+ observer.sendEvent(event);
+ }
+
+ }.run();
+
}
catch (Exception e)
{
log.error("Failure while notifying an observer of event [" + event + "]", e);
}
- finally
- {
- lifecycle.endRequest("async invocation", requestBeanStore);
- }
}
@Override
@@ -76,4 +79,33 @@
return "Deferred event [" + event + "] for [" + observer + "]";
}
+ private abstract static class RunInRequest
+ {
+
+ protected abstract void execute();
+
+ public void run()
+ {
+ Lifecycle lifecycle = Container.instance().deploymentServices().get(ContextLifecycle.class);
+ boolean requestActive = lifecycle.isRequestActive();
+ BeanStore requestBeanStore = new ConcurrentHashMapBeanStore();
+ try
+ {
+ if (!requestActive)
+ {
+ lifecycle.beginRequest("async invocation", requestBeanStore);
+ }
+ execute();
+ }
+ finally
+ {
+ if (!requestActive)
+ {
+ lifecycle.endRequest("async invocation", requestBeanStore);
+ }
+ }
+ }
+
+ }
+
}
Modified: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml 2009-09-30 12:03:10 UTC (rev 3820)
+++ ri/trunk/tests/pom.xml 2009-09-30 13:21:36 UTC (rev 3821)
@@ -104,6 +104,11 @@
<artifactId>jsf-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ </dependency>
+
</dependencies>
<build>
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-09-30 12:03:10 UTC (rev 3820)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-09-30 13:21:36 UTC (rev 3821)
@@ -24,7 +24,6 @@
import org.jboss.webbeans.mock.MockServletContext;
import org.jboss.webbeans.mock.el.EL;
import org.jboss.webbeans.servlet.ServletHelper;
-import org.jboss.webbeans.test.harness.AbstractStandaloneContainersImpl;
import org.jboss.webbeans.util.collections.EnumerationList;
import org.testng.ITestContext;
import org.testng.annotations.AfterClass;
@@ -196,5 +195,10 @@
ELContext elContext = EL.createELContext(getCurrentManager().getCurrent());
return (T) EL.EXPRESSION_FACTORY.createValueExpression(elContext, expression, expectedType).getValue(elContext);
}
+
+ protected String getPath(String viewId)
+ {
+ return getContextPath() + viewId;
+ }
}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/AbstractHtmlUnitTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/AbstractHtmlUnitTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/AbstractHtmlUnitTest.java 2009-09-30 13:21:36 UTC (rev 3821)
@@ -0,0 +1,50 @@
+package org.jboss.webbeans.test.unit.implementation.event.tx;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public abstract class AbstractHtmlUnitTest extends AbstractWebBeansTest
+{
+
+ public AbstractHtmlUnitTest()
+ {
+ super();
+ }
+
+ protected <T extends HtmlElement> T getFirstMatchingElement(HtmlPage page, Class<T> elementClass, String id)
+ {
+
+ Set<T> inputs = getElements(page.getBody(), elementClass);
+ for (T input : inputs)
+ {
+ if (input.getId().contains(id))
+ {
+ return input;
+ }
+ }
+ return null;
+ }
+
+ protected <T> Set<T> getElements(HtmlElement rootElement, Class<T> elementClass)
+ {
+ Set<T> result = new HashSet<T>();
+
+ for (HtmlElement element : rootElement.getAllHtmlChildElements())
+ {
+ result.addAll(getElements(element, elementClass));
+ }
+
+ if (elementClass.isInstance(rootElement))
+ {
+ result.add(elementClass.cast(rootElement));
+ }
+ return result;
+
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/AbstractHtmlUnitTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/Foo.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/Foo.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/Foo.java 2009-09-30 13:21:36 UTC (rev 3821)
@@ -0,0 +1,49 @@
+package org.jboss.webbeans.test.unit.implementation.event.tx;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Event;
+import javax.enterprise.event.Observes;
+import javax.enterprise.event.TransactionPhase;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.transaction.UserTransaction;
+
+@Named
+@ApplicationScoped
+public class Foo implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ @Inject
+ private UserTransaction utx;
+
+ @Inject @Updated
+ private Event<String> event1;
+
+ public Foo()
+ {
+ }
+
+ public String save()
+ {
+ try
+ {
+ utx.begin();
+ event1.fire("Fired using Event Interface with AnnotationLiteral.");
+ utx.commit();
+ }
+ catch (Exception e)
+ {
+ }
+ return null;
+ }
+
+ public void eventObserver(@Observes(during = TransactionPhase.AFTER_COMPLETION) @Updated String s)
+ {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("AfterCompletion Event Recieved!"));
+ }
+}
\ No newline at end of file
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/TxEventTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/TxEventTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/TxEventTest.java 2009-09-30 13:21:36 UTC (rev 3821)
@@ -0,0 +1,39 @@
+package org.jboss.webbeans.test.unit.implementation.event.tx;
+
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
+import org.testng.annotations.Test;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+
+@Artifact(addCurrentPackage=false)
+@IntegrationTest(runLocally=true)
+@Resources({
+ @Resource(source="faces-config.xml", destination="WEB-INF/faces-config.xml"),
+ @Resource(source="web.xml", destination=WarArtifactDescriptor.WEB_XML_DESTINATION),
+ @Resource(source="home.xhtml", destination="home.xhtml")
+})
+@Classes({
+ Foo.class,
+ Updated.class
+})
+public class TxEventTest extends AbstractHtmlUnitTest
+{
+
+ @Test(description="WBRI-401")
+ public void testRequestContextLifecycle() throws Exception
+ {
+ WebClient webClient = new WebClient();
+ HtmlPage home = webClient.getPage(getPath("/home.jsf"));
+ HtmlSubmitInput beginConversationButton = getFirstMatchingElement(home, HtmlSubmitInput.class, "SaveButton");
+ beginConversationButton.click();
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/TxEventTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/Updated.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/Updated.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/Updated.java 2009-09-30 13:21:36 UTC (rev 3821)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.implementation.event.tx;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target( { TYPE, METHOD, FIELD, PARAMETER })
+@Documented
+@interface Updated
+{
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/tx/Updated.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/faces-config.xml
===================================================================
--- ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/faces-config.xml (rev 0)
+++ ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/faces-config.xml 2009-09-30 13:21:36 UTC (rev 3821)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<faces-config version="2.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2.0.xsd">
+
+</faces-config>
\ No newline at end of file
Property changes on: ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/home.xhtml
===================================================================
--- ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/home.xhtml (rev 0)
+++ ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/home.xhtml 2009-09-30 13:21:36 UTC (rev 3821)
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <h:head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>JSF 2.0 Web Beans Example</title>
+ </h:head>
+
+ <h:body>
+ <h:form id="NumberGuessMain">
+ <h:panelGrid styleClass="title-panel">
+ <h:outputText value="Guess Number" styleClass="title-panel-text"/>
+ <h:outputText value="Powered By JavaServer Faces 2.0 and Web Beans" styleClass="title-panel-subtext"/>
+ </h:panelGrid>
+
+ <div style="color: black; font-size: 20px;">
+ Transactional Services
+ </div>
+
+ <h:panelGrid border="1" columns="5" style="font-size: 18px;">
+ <h:commandButton id="SaveButton" value="Save" action="#{foo.save}" />
+ </h:panelGrid>
+
+ <div style="color: red; font-size: 14px;">
+ <h:messages id="messages" globalOnly="false"/>
+ </div>l
+ </h:form>
+ </h:body>
+
+</html>
Property changes on: ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/home.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/web.xml
===================================================================
--- ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/web.xml (rev 0)
+++ ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/web.xml 2009-09-30 13:21:36 UTC (rev 3821)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name>Web Beans Test</display-name>
+
+
+ <!-- JSF -->
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Property changes on: ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/implementation/event/tx/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/tests/unit-tests.xml
===================================================================
--- ri/trunk/tests/unit-tests.xml 2009-09-30 12:03:10 UTC (rev 3820)
+++ ri/trunk/tests/unit-tests.xml 2009-09-30 13:21:36 UTC (rev 3821)
@@ -45,6 +45,7 @@
<package name="org.jboss.webbeans.test.unit.implementation.enterpise.lifecycle" />
<package name="org.jboss.webbeans.test.unit.implementation.enterprise.sbi" />
<package name="org.jboss.webbeans.test.unit.implementation.event" />
+ <package name="org.jboss.webbeans.test.unit.implementation.event.tx" />
<package name="org.jboss.webbeans.test.unit.implementation.exceptions" />
<package name="org.jboss.webbeans.test.unit.implementation.named" />
<package name="org.jboss.webbeans.test.unit.implementation.newsimple" />
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-09-30 12:03:10 UTC (rev 3820)
+++ ri/trunk/version-matrix/pom.xml 2009-09-30 13:21:36 UTC (rev 3821)
@@ -425,6 +425,12 @@
<version>4.7</version>
</dependency>
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.4</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
15 years, 1 month
[webbeans-commits] Webbeans SVN: r3820 - ri/trunk/jboss-as.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-09-30 08:03:10 -0400 (Wed, 30 Sep 2009)
New Revision: 3820
Modified:
ri/trunk/jboss-as/build.properties
Log:
bad path
Modified: ri/trunk/jboss-as/build.properties
===================================================================
--- ri/trunk/jboss-as/build.properties 2009-09-30 11:51:38 UTC (rev 3819)
+++ ri/trunk/jboss-as/build.properties 2009-09-30 12:03:10 UTC (rev 3820)
@@ -1,5 +1,5 @@
# Container a number of properties associated with installing Web Beans into JBoss AS and running the TCK in JBoss AS
-jboss.home=/home/shane/apps/jboss
+jboss.home=/Applications/jboss-5.2.0.Beta
org.jboss.testharness.container.javaOpts=-Xms128m -Xmx384m -XX:MaxPermSize=128m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
# time to allow before attempting to restart JBoss AS
15 years, 1 month
[webbeans-commits] Webbeans SVN: r3819 - ri/trunk/inject-tck-runner.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-09-30 07:51:38 -0400 (Wed, 30 Sep 2009)
New Revision: 3819
Modified:
ri/trunk/inject-tck-runner/
Log:
ignores
Property changes on: ri/trunk/inject-tck-runner
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.project
test-output
.classpath
15 years, 1 month
[webbeans-commits] Webbeans SVN: r3818 - in ri/trunk: impl/src/main/java/org/jboss/webbeans and 24 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-09-30 07:43:24 -0400 (Wed, 30 Sep 2009)
New Revision: 3818
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractApplicationContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/SingletonContext.java
ri/trunk/inject-tck-runner/
ri/trunk/inject-tck-runner/pom.xml
ri/trunk/inject-tck-runner/src/
ri/trunk/inject-tck-runner/src/main/
ri/trunk/inject-tck-runner/src/main/java/
ri/trunk/inject-tck-runner/src/main/resources/
ri/trunk/inject-tck-runner/src/test/
ri/trunk/inject-tck-runner/src/test/java/
ri/trunk/inject-tck-runner/src/test/java/org/
ri/trunk/inject-tck-runner/src/test/java/org/jboss/
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java
ri/trunk/inject-tck-runner/src/test/resources/
ri/trunk/inject-tck-runner/src/test/resources/log4j.xml
ri/trunk/inject-tck-runner/tests.xml
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ManagedBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ApplicationContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanStore.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanStore.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
ri/trunk/jboss-tck-runner/src/test/resources/log4j.xml
ri/trunk/pom.xml
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Lifecycle.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingLifecycle.java
ri/trunk/tests/pom.xml
ri/trunk/version-matrix/pom.xml
Log:
add SingletonContext, remove a couple of uneeded checks, add atinject tck runner module
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -18,10 +18,10 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
@@ -43,8 +43,8 @@
import org.jboss.webbeans.bean.AbstractProducerBean;
import org.jboss.webbeans.bean.DecoratorImpl;
import org.jboss.webbeans.bean.DisposalMethod;
-import org.jboss.webbeans.bean.NewSessionBean;
import org.jboss.webbeans.bean.NewManagedBean;
+import org.jboss.webbeans.bean.NewSessionBean;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.bootstrap.api.Service;
@@ -52,7 +52,6 @@
import org.jboss.webbeans.metadata.cache.MetaAnnotationStore;
import org.jboss.webbeans.resolution.ResolvableWBClass;
import org.jboss.webbeans.util.Beans;
-import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.Reflections;
@@ -153,21 +152,6 @@
{
throw new DefinitionException("Cannot declare an injection point with a type variable " + ij);
}
- if (ij.getType() instanceof ParameterizedType)
- {
- ParameterizedType parameterizedType = (ParameterizedType) ij.getType();
- for (Type type : parameterizedType.getActualTypeArguments())
- {
-// if (type instanceof TypeVariable<?>)
-// {
-// throw new DefinitionException("Injection point cannot have a type variable type parameter " + ij);
-// }
-// if (type instanceof WildcardType)
-// {
-// throw new DefinitionException("Injection point cannot have a wildcard type parameter " + ij);
-// }
- }
- }
checkFacadeInjectionPoint(ij, Instance.class);
checkFacadeInjectionPoint(ij, Event.class);
Annotation[] bindings = ij.getQualifiers().toArray(new Annotation[0]);
@@ -175,11 +159,11 @@
Set<?> resolvedBeans = beanManager.getBeanResolver().resolve(beanManager.getInjectableBeans(ij));
if (resolvedBeans.isEmpty())
{
- throw new DeploymentException("The injection point " + ij + " with binding types " + Names.annotationsToString(ij.getQualifiers()) + " in " + ij.getBean() + " has unsatisfied dependencies with binding types ");
+ throw new DeploymentException("Injection point has unstatisfied dependencies. Injection point: " + ij.toString() + "; Qualifiers: " + Arrays.toString(bindings));
}
if (resolvedBeans.size() > 1)
{
- throw new DeploymentException("The injection point " + ij + " with binding types " + Names.annotationsToString(ij.getQualifiers()) + " in " + ij.getBean() + " has ambiguous dependencies " + resolvedBeans);
+ throw new DeploymentException("Injection point has ambiguous dependencies. Injection point: " + ij.toString() + "; Qualifiers: " + Arrays.toString(bindings) +"; Possible dependencies: " + resolvedBeans);
}
Bean<?> resolvedBean = (Bean<?>) resolvedBeans.iterator().next();
if (beanManager.getServices().get(MetaAnnotationStore.class).getScopeModel(resolvedBean.getScope()).isNormal() && !Proxies.isTypeProxyable(ij.getType()))
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -31,6 +31,7 @@
import javax.inject.Qualifier;
import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.Container;
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.WBInjectionPoint;
@@ -468,6 +469,11 @@
return Dependent.class.equals(getScope());
}
+ public boolean isNormalScoped()
+ {
+ return Container.instance().deploymentServices().get(MetaAnnotationStore.class).getScopeModel(getScope()).isNormal();
+ }
+
public boolean isAlternative()
{
return policy;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ManagedBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ManagedBean.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ManagedBean.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -250,7 +250,7 @@
protected void checkBeanImplementation()
{
super.checkBeanImplementation();
- if (!isDependent())
+ if (isNormalScoped())
{
for (WBField<?, ?> field : getAnnotatedItem().getWBFields())
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -25,6 +25,7 @@
import javax.enterprise.inject.Any;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.TypeLiteral;
+import javax.inject.Provider;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.literal.AnyLiteral;
@@ -34,11 +35,13 @@
public class InstanceBean extends AbstractFacadeBean<Instance<?>>
{
- private static final Class<Instance<?>> TYPE = new TypeLiteral<Instance<?>>() {}.getRawType();
- private static final Set<Type> DEFAULT_TYPES = Arrays2.<Type>asSet(TYPE, Object.class);
+ private static final Class<Instance<?>> INSTANCE_TYPE = new TypeLiteral<Instance<?>>() {}.getRawType();
+ private static final Class<Provider<?>> PROVIDER_TYPE = new TypeLiteral<Provider<?>>() {}.getRawType();
+ private static final Set<Type> DEFAULT_TYPES = Arrays2.<Type>asSet(INSTANCE_TYPE, PROVIDER_TYPE, Object.class);
private static final Any ANY = new AnyLiteral();
private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
- public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE);
+ public static final ResolvableTransformer INSTANCE_TRANSFORMER = new FacadeBeanResolvableTransformer(INSTANCE_TYPE);
+ public static final ResolvableTransformer PROVIDER_TRANSFORMER = new FacadeBeanResolvableTransformer(PROVIDER_TYPE);
public InstanceBean(BeanManagerImpl manager)
{
@@ -48,7 +51,7 @@
@Override
public Class<Instance<?>> getType()
{
- return TYPE;
+ return INSTANCE_TYPE;
}
@Override
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -42,12 +42,14 @@
import org.jboss.webbeans.bootstrap.api.helpers.SimpleServiceRegistry;
import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.webbeans.bootstrap.spi.Deployment;
+import org.jboss.webbeans.context.AbstractApplicationContext;
import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.ContextLifecycle;
import org.jboss.webbeans.context.ConversationContext;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.context.RequestContext;
import org.jboss.webbeans.context.SessionContext;
+import org.jboss.webbeans.context.SingletonContext;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.ejb.EJBApiAbstraction;
import org.jboss.webbeans.jsf.JsfApiAbstraction;
@@ -380,17 +382,19 @@
deploymentManager.addContext(lifecycle.getConversationContext());
deploymentManager.addContext(lifecycle.getSessionContext());
deploymentManager.addContext(lifecycle.getApplicationContext());
+ deploymentManager.addContext(lifecycle.getSingletonContext());
}
protected void createContexts()
{
- ApplicationContext applicationContext = new ApplicationContext();
+ AbstractApplicationContext applicationContext = new ApplicationContext();
+ AbstractApplicationContext singletonContext = new SingletonContext();
SessionContext sessionContext = new SessionContext();
ConversationContext conversationContext = new ConversationContext();
RequestContext requestContext = new RequestContext();
DependentContext dependentContext = new DependentContext();
- deployment.getServices().add(ContextLifecycle.class, new ContextLifecycle(applicationContext, sessionContext, conversationContext, requestContext, dependentContext));
+ deployment.getServices().add(ContextLifecycle.class, new ContextLifecycle(applicationContext, singletonContext, sessionContext, conversationContext, requestContext, dependentContext));
}
public void shutdown()
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractApplicationContext.java (from rev 3811, ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ApplicationContext.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractApplicationContext.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractApplicationContext.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -0,0 +1,111 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * 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.context;
+
+import java.lang.annotation.Annotation;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.jboss.webbeans.context.api.BeanStore;
+
+/**
+ * The Application context
+ *
+ * @author Nicklas Karlsson
+ *
+ * @see org.jboss.webbeans.context.AbstractApplicationContext
+ */
+public abstract class AbstractApplicationContext extends AbstractMapContext
+{
+
+ // The beans
+ private BeanStore beanStore;
+ // Is the context active?
+ private final AtomicBoolean active;
+
+ /**
+ * Constructor
+ */
+ public AbstractApplicationContext(Class<? extends Annotation> scope)
+ {
+ super(scope);
+ this.active = new AtomicBoolean(false);
+ }
+
+ /**
+ * Gets the bean store
+ *
+ * @return The bean store
+ */
+ @Override
+ public BeanStore getBeanStore()
+ {
+ return this.beanStore;
+ }
+
+ /**
+ * Sets the bean store
+ *
+ * @param applicationBeanStore The bean store
+ */
+ public void setBeanStore(BeanStore applicationBeanStore)
+ {
+ this.beanStore = applicationBeanStore;
+ }
+
+ /**
+ * Indicates if the context is active
+ *
+ * @return True if active, false otherwise
+ */
+ @Override
+ public boolean isActive()
+ {
+ return active.get();
+ }
+
+ /**
+ * Sets the active state of the context
+ *
+ * @param active The new state
+ */
+ @Override
+ public void setActive(boolean active)
+ {
+ this.active.set(active);
+ }
+
+ @Override
+ public String toString()
+ {
+ String active = isActive() ? "Active " : "Inactive ";
+ String beanStoreInfo = getBeanStore() == null ? "" : getBeanStore().toString();
+ return active + "application context " + beanStoreInfo;
+ }
+
+ @Override
+ protected boolean isCreationLockRequired()
+ {
+ return true;
+ }
+
+}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ApplicationContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ApplicationContext.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ApplicationContext.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -1,112 +1,13 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- *
- * Use is subject to license terms.
- *
- * 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.context;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.enterprise.context.ApplicationScoped;
-
-import org.jboss.webbeans.context.api.BeanStore;
-
-/**
- * The Application context
- *
- * @author Nicklas Karlsson
- *
- * @see org.jboss.webbeans.context.ApplicationContext
- */
-public class ApplicationContext extends AbstractMapContext
-{
-
- // The beans
- private BeanStore beanStore;
- // Is the context active?
- private final AtomicBoolean active;
-
- /**
- * Constructor
- */
- public ApplicationContext()
- {
- super(ApplicationScoped.class);
- this.active = new AtomicBoolean(false);
- }
-
- /**
- * Gets the bean store
- *
- * @return The bean store
- */
- @Override
- public BeanStore getBeanStore()
- {
- return this.beanStore;
- }
-
- /**
- * Sets the bean store
- *
- * @param applicationBeanStore The bean store
- */
- public void setBeanStore(BeanStore applicationBeanStore)
- {
- this.beanStore = applicationBeanStore;
- }
-
- /**
- * Indicates if the context is active
- *
- * @return True if active, false otherwise
- */
- @Override
- public boolean isActive()
- {
- return active.get();
- }
-
- /**
- * Sets the active state of the context
- *
- * @param active The new state
- */
- @Override
- public void setActive(boolean active)
- {
- this.active.set(active);
- }
-
- @Override
- public String toString()
- {
- String active = isActive() ? "Active " : "Inactive ";
- String beanStoreInfo = getBeanStore() == null ? "" : getBeanStore().toString();
- return active + "application context " + beanStoreInfo;
- }
-
- @Override
- protected boolean isCreationLockRequired()
- {
- return true;
- }
-
-}
+package org.jboss.webbeans.context;
+
+import javax.enterprise.context.ApplicationScoped;
+
+public class ApplicationContext extends AbstractApplicationContext
+{
+
+ public ApplicationContext()
+ {
+ super(ApplicationScoped.class);
+ }
+
+}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -26,6 +26,7 @@
import org.jboss.webbeans.bootstrap.api.Lifecycle;
import org.jboss.webbeans.bootstrap.api.Service;
import org.jboss.webbeans.context.api.BeanStore;
+import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -41,15 +42,17 @@
public static LogProvider log = Logging.getLogProvider(ContextLifecycle.class);
- private final ApplicationContext applicationContext;
+ private final AbstractApplicationContext applicationContext;
+ private final AbstractApplicationContext singletonContext;
private final SessionContext sessionContext;
private final ConversationContext conversationContext;
private final RequestContext requestContext;
private final DependentContext dependentContext;
- public ContextLifecycle(ApplicationContext applicationContext, SessionContext sessionContext, ConversationContext conversationContext, RequestContext requestContext, DependentContext dependentContext)
+ public ContextLifecycle(AbstractApplicationContext applicationContext, AbstractApplicationContext singletonContext, SessionContext sessionContext, ConversationContext conversationContext, RequestContext requestContext, DependentContext dependentContext)
{
this.applicationContext = applicationContext;
+ this.singletonContext = singletonContext;
this.sessionContext = sessionContext;
this.conversationContext = conversationContext;
this.requestContext = requestContext;
@@ -92,22 +95,22 @@
public boolean isRequestActive()
{
- return applicationContext.isActive() && requestContext.isActive() && dependentContext.isActive();
+ return singletonContext.isActive() && applicationContext.isActive() && requestContext.isActive() && dependentContext.isActive();
}
public boolean isApplicationActive()
{
- return applicationContext.isActive() && dependentContext.isActive();
+ return singletonContext.isActive() && applicationContext.isActive() && dependentContext.isActive();
}
public boolean isConversationActive()
{
- return applicationContext.isActive() && sessionContext.isActive() && conversationContext.isActive() && dependentContext.isActive();
+ return singletonContext.isActive() && applicationContext.isActive() && sessionContext.isActive() && conversationContext.isActive() && dependentContext.isActive();
}
public boolean isSessionActive()
{
- return applicationContext.isActive() && sessionContext.isActive() && dependentContext.isActive();
+ return singletonContext.isActive() && applicationContext.isActive() && sessionContext.isActive() && dependentContext.isActive();
}
@@ -116,7 +119,8 @@
log.trace("Starting application");
applicationContext.setBeanStore(applicationBeanStore);
applicationContext.setActive(true);
-
+ singletonContext.setBeanStore(new ConcurrentHashMapBeanStore());
+ singletonContext.setActive(true);
}
public void endApplication()
@@ -125,7 +129,9 @@
applicationContext.destroy();
applicationContext.setActive(false);
applicationContext.setBeanStore(null);
-
+ singletonContext.destroy();
+ singletonContext.setActive(false);
+ singletonContext.setBeanStore(null);
Container.instance().cleanup();
}
@@ -135,14 +141,20 @@
requestContext.cleanup();
conversationContext.cleanup();
sessionContext.cleanup();
+ singletonContext.cleanup();
applicationContext.cleanup();
}
- public ApplicationContext getApplicationContext()
+ public AbstractApplicationContext getApplicationContext()
{
return applicationContext;
}
+ public AbstractApplicationContext getSingletonContext()
+ {
+ return singletonContext;
+ }
+
public SessionContext getSessionContext()
{
return sessionContext;
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/SingletonContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/SingletonContext.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/SingletonContext.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.context;
+
+import javax.inject.Singleton;
+
+public class SingletonContext extends AbstractApplicationContext
+{
+
+ public SingletonContext()
+ {
+ super(Singleton.class);
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/SingletonContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -39,7 +39,6 @@
import org.jboss.webbeans.introspector.WBConstructor;
import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.util.Names;
import com.google.common.base.Supplier;
import com.google.common.collect.ListMultimap;
@@ -68,7 +67,7 @@
private final ConstructorSignature signature;
// Cached string representation
- private String toString;
+ private final String toString;
public static <T> WBConstructor<T> of(Constructor<T> constructor, WBClass<T> declaringClass, ClassTransformer classTransformer)
{
@@ -93,6 +92,7 @@
private WBConstructorImpl(Constructor<T> constructor, AnnotatedConstructor<T> annotatedConstructor, AnnotationStore annotationStore, WBClass<T> declaringClass, ClassTransformer classTransformer)
{
super(annotationStore, constructor, constructor.getDeclaringClass(), constructor.getDeclaringClass(), declaringClass);
+ this.toString = new StringBuilder().append("constructor ").append(constructor.toString()).toString();
this.constructor = constructor;
this.parameters = new ArrayList<WBParameter<?, ?>>();
@@ -271,11 +271,6 @@
@Override
public String toString()
{
- if (toString != null)
- {
- return toString;
- }
- toString = "Annotated constructor " + Names.constructorToString(constructor);
return toString;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -26,7 +26,6 @@
import org.jboss.webbeans.introspector.WBClass;
import org.jboss.webbeans.introspector.WBField;
import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
/**
@@ -45,7 +44,7 @@
private final Field field;
// Cached string representation
- private String toString;
+ private final String toString;
public static <T, X> WBFieldImpl<T, X> of(Field field, WBClass<X> declaringClass, ClassTransformer classTransformer)
{
@@ -72,6 +71,7 @@
{
super(annotationStore, field, (Class<T>) field.getType(), field.getGenericType(), declaringClass);
this.field = field;
+ this.toString = new StringBuilder().append("field ").append(declaringClass.getName()).append(".").append(field.getName()).toString();
}
/**
@@ -84,6 +84,7 @@
return field;
}
+ @Override
public Field getDelegate()
{
return field;
@@ -125,12 +126,7 @@
@Override
public String toString()
{
- if (toString != null)
- {
- return toString;
- }
- toString = Names.fieldToString(field) + " on " + getDeclaringType();
- return toString;
+ return this.toString;
}
@Override
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -39,7 +39,6 @@
import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
import com.google.common.base.Supplier;
@@ -71,7 +70,7 @@
private final String propertyName;
// Cached string representation
- private String toString;
+ private final String toString;
private final MethodSignature signature;
@@ -101,6 +100,7 @@
{
super(annotationStore, method, (Class<T>) method.getReturnType(), method.getGenericReturnType(), declaringClass);
this.method = method;
+ this.toString = new StringBuilder().append("method ").append(method.toString()).toString();
this.parameters = new ArrayList<WBParameter<?, ?>>();
this.annotatedParameters = Multimaps.newListMultimap(new HashMap<Class<? extends Annotation>, Collection<WBParameter<?, ?>>>(), new Supplier< List<WBParameter<?, ?>>>()
{
@@ -166,6 +166,7 @@
this.propertyName = propertyName;
}
this.signature = new MethodSignatureImpl(this);
+
}
public Method getAnnotatedMethod()
@@ -173,6 +174,7 @@
return method;
}
+ @Override
public Method getDelegate()
{
return method;
@@ -241,12 +243,7 @@
@Override
public String toString()
{
- if (toString != null)
- {
- return toString;
- }
- toString = "Annotated method on class " + getDeclaringType().getName() + Names.methodToString(method);
- return toString;
+ return this.toString;
}
public MethodSignature getSignature()
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -49,10 +49,9 @@
private final boolean _private = false;
private final int position;
private final WBCallable<?, X, ?> declaringMember;
-
- // Cached string representation
- private String toString;
+ private final String toString;
+
public static <T, X> WBParameter<T, X> of(Annotation[] annotations, Class<T> rawType, Type type, WBCallable<?, X, ?> declaringMember, int position, ClassTransformer classTransformer)
{
return new WBParameterImpl<T, X>(annotations, rawType, type, declaringMember, position, classTransformer);
@@ -74,6 +73,7 @@
super(AnnotationStore.of(annotations, annotations, classTransformer.getTypeStore()), rawType, type);
this.declaringMember = declaringMember;
this.position = position;
+ this.toString = new StringBuilder().append("parameter ").append(position + 1).append(" of ").append(declaringMember.toString()).toString();
}
/**
@@ -130,19 +130,6 @@
@Override
public String toString()
{
- if (toString == null)
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("Annotated parameter ");
- if (_static)
- buffer.append("static ");
- if (_final)
- buffer.append("final ");
- buffer.append(getJavaClass().getName());
- buffer.append(" for operation ");
- buffer.append(getDeclaringCallable().toString());
- toString = buffer.toString();
- }
return toString;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -46,7 +46,8 @@
{
TRANSFORMERS = new HashSet<ResolvableTransformer>();
TRANSFORMERS.add(EventBean.TRANSFORMER);
- TRANSFORMERS.add(InstanceBean.TRANSFORMER);
+ TRANSFORMERS.add(InstanceBean.INSTANCE_TRANSFORMER);
+ TRANSFORMERS.add(InstanceBean.PROVIDER_TRANSFORMER);
TRANSFORMERS.add(new NewResolvableTransformer());
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanStore.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanStore.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanStore.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -21,7 +21,7 @@
import javax.servlet.ServletContext;
-import org.jboss.webbeans.context.ApplicationContext;
+import org.jboss.webbeans.context.AbstractApplicationContext;
import org.jboss.webbeans.context.beanstore.AbstractAttributeBackedBeanStore;
import org.jboss.webbeans.context.beanstore.NamingScheme;
@@ -30,12 +30,12 @@
*
* @author Nicklas Karlsson
*
- * @see org.jboss.webbeans.context.ApplicationContext
+ * @see org.jboss.webbeans.context.AbstractApplicationContext
*/
public class ApplicationBeanStore extends AbstractAttributeBackedBeanStore
{
- private static final NamingScheme NAMING_SCHEME = new NamingScheme(ApplicationContext.class.getName(), "#");
+ private static final NamingScheme NAMING_SCHEME = new NamingScheme(AbstractApplicationContext.class.getName(), "#");
// The servlet context to use as backing map
private ServletContext context;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanStore.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanStore.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanStore.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -29,7 +29,7 @@
*
* @author Nicklas Karlsson
*
- * @see org.jboss.webbeans.context.ApplicationContext
+ * @see org.jboss.webbeans.context.AbstractApplicationContext
*/
public class HttpSessionBeanStore extends AbstractAttributeBackedBeanStore
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -38,8 +38,8 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.bean.AbstractProducerBean;
-import org.jboss.webbeans.bean.SessionBean;
import org.jboss.webbeans.bean.RIBean;
+import org.jboss.webbeans.bean.SessionBean;
import org.jboss.webbeans.ejb.EJBApiAbstraction;
import org.jboss.webbeans.injection.ConstructorInjectionPoint;
import org.jboss.webbeans.injection.FieldInjectionPoint;
@@ -265,12 +265,8 @@
Set<MethodInjectionPoint<?, ?>> initializerMethods = new HashSet<MethodInjectionPoint<?, ?>>();
for (WBMethod<?, ?> method : type.getAnnotatedWBMethods(Inject.class))
{
- if (method.isStatic())
+ if (method.getAnnotation(Produces.class) != null)
{
- throw new DefinitionException("Initializer method " + method.toString() + " cannot be static on " + type);
- }
- else if (method.getAnnotation(Produces.class) != null)
- {
throw new DefinitionException("Initializer method " + method.toString() + " cannot be annotated @Produces on " + type);
}
else if (method.getAnnotatedWBParameters(Disposes.class).size() > 0)
@@ -317,10 +313,6 @@
{
if (!annotatedField.isAnnotationPresent(Produces.class))
{
- if (annotatedField.isStatic())
- {
- throw new DefinitionException("Don't place binding annotations on static fields " + annotatedField);
- }
if (annotatedField.isFinal())
{
throw new DefinitionException("Don't place binding annotations on final fields " + annotatedField);
Added: ri/trunk/inject-tck-runner/pom.xml
===================================================================
--- ri/trunk/inject-tck-runner/pom.xml (rev 0)
+++ ri/trunk/inject-tck-runner/pom.xml 2009-09-30 11:43:24 UTC (rev 3818)
@@ -0,0 +1,53 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>webbeans-parent</artifactId>
+ <groupId>org.jboss.webbeans</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-inject-tck-runner</artifactId>
+ <name>javax.inject TCK runner for Web Beans</name>
+ <description>Aggregates dependencies and run's the javax.inject TCK for Web Beans</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-porting-package</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.atinject</groupId>
+ <artifactId>inject-tck</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <testFailureIgnore>true</testFailureIgnore>
+ <suiteXmlFiles>
+ <suiteXmlFile>tests.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java (rev 0)
+++ ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -0,0 +1,35 @@
+package org.jboss.webbeans.atinject.tck;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import junit.framework.Test;
+
+import org.atinject.tck.Tck;
+import org.atinject.tck.auto.Car;
+import org.atinject.tck.auto.Convertible;
+import org.atinject.tck.auto.DriversSeat;
+import org.atinject.tck.auto.FuelTank;
+import org.atinject.tck.auto.V8Engine;
+import org.atinject.tck.auto.accessories.Cupholder;
+import org.atinject.tck.auto.accessories.SpareTire;
+import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.TestContainer;
+
+public class AtInjectTCK
+{
+
+ private static final List<Class<?>> classes = Arrays.<Class<?>>asList(Convertible.class, DriversSeat.class, DriversSeatProducer.class, V8Engine.class, Cupholder.class, FuelTank.class, SpareTireProducer.class, SpareTire.class);
+
+ public static Test suite()
+ {
+ TestContainer container = new TestContainer(new MockEELifecycle(), classes, null);
+ container.startContainer();
+ BeanManager beanManager = container.getBeanManager();
+ Bean<?> bean = beanManager.resolve(beanManager.getBeans(Car.class));
+ Car instance = (Car) beanManager.getReference(bean, Car.class, beanManager.createCreationalContext(bean));
+ return Tck.testsFor(instance, false /* supportsStatic */, false /* supportsPrivate */);
+ }
+}
\ No newline at end of file
Added: ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java (rev 0)
+++ ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.atinject.tck;
+
+import javax.enterprise.inject.Produces;
+
+import org.atinject.tck.auto.Drivers;
+import org.atinject.tck.auto.DriversSeat;
+import org.atinject.tck.auto.Seat;
+
+public class DriversSeatProducer
+{
+
+ @Produces @Drivers
+ public Seat produceDriversSeat(DriversSeat seat)
+ {
+ return seat;
+ }
+
+}
Added: ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java (rev 0)
+++ ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.atinject.tck;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Named;
+
+import org.atinject.tck.auto.Tire;
+import org.atinject.tck.auto.accessories.SpareTire;
+
+public class SpareTireProducer
+{
+
+ @Produces @Named("spare")
+ public Tire produceSpareTire(SpareTire spareTire)
+ {
+ return spareTire;
+ }
+
+}
Added: ri/trunk/inject-tck-runner/src/test/resources/log4j.xml
===================================================================
--- ri/trunk/inject-tck-runner/src/test/resources/log4j.xml (rev 0)
+++ ri/trunk/inject-tck-runner/src/test/resources/log4j.xml 2009-09-30 11:43:24 UTC (rev 3818)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{2}] %m%n"/>
+ </layout>
+ <filter class="org.apache.log4j.varia.StringMatchFilter">
+ <param name="AcceptOnMatch" value="false" />
+ <param name="StringToMatch" value="Failure while notifying an observer of event [a]" />
+ </filter>
+ <filter class="org.apache.log4j.varia.StringMatchFilter">
+ <param name="AcceptOnMatch" value="false" />
+ <param name="StringToMatch" value="Error destroying org.jboss.webbeans.bean-test-ManagedBean-org.jboss.jsr299.tck.tests.implementation.simple.lifecycle.Cod" />
+ </filter>
+ </appender>
+
+ <!-- ############### Embedded EJB3 ################# -->
+ <category name="org.jboss">
+ <priority value="ERROR"/>
+ </category>
+
+ <category name="org.jboss.test">
+ <priority value="ERROR"/>
+ </category>
+
+ <category name="com.arjuna">
+ <priority value="ERROR"/>
+ </category>
+
+ <!-- ############### Hibernate logging ################# -->
+
+ <category name="org.hibernate">
+ <priority value="ERROR"/>
+ </category>
+
+ <!--
+ <category name="org.hibernate.SQL">
+ <priority value="TRACE"/>
+ </category>
+
+ <category name="org.hibernate.type">
+ <priority value="TRACE"/>
+ </category>
+
+ <category name="org.hibernate.loader">
+ <priority value="TRACE"/>
+ </category>
+ <category name="org.hibernate.cache">
+ <priority value="TRACE"/>
+ </category>
+ -->
+
+ <!-- ############### Web Beans logging ################### -->
+
+ <category name="org.jboss.webbeans">
+ <priority value="WARN"/>
+ </category>
+
+ <category name="org.jboss.webbeans.tck">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.jboss.testharness">
+ <priority value="INFO"/>
+ </category>
+
+ <root>
+ <priority value="INFO"/>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Added: ri/trunk/inject-tck-runner/tests.xml
===================================================================
--- ri/trunk/inject-tck-runner/tests.xml (rev 0)
+++ ri/trunk/inject-tck-runner/tests.xml 2009-09-30 11:43:24 UTC (rev 3818)
@@ -0,0 +1,11 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="Web Beans AtInject TCK" verbose="2" >
+
+ <test name="Web Beans RI" junit="true">
+ <classes>
+ <class name="org.jboss.webbeans.atinject.tck.AtInjectTCK"></class>
+ </classes>
+ </test>
+
+</suite>
\ No newline at end of file
Modified: ri/trunk/jboss-tck-runner/src/test/resources/log4j.xml
===================================================================
--- ri/trunk/jboss-tck-runner/src/test/resources/log4j.xml 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/jboss-tck-runner/src/test/resources/log4j.xml 2009-09-30 11:43:24 UTC (rev 3818)
@@ -14,7 +14,7 @@
</filter>
<filter class="org.apache.log4j.varia.StringMatchFilter">
<param name="AcceptOnMatch" value="false" />
- <param name="StringToMatch" value="Error destroying Request scoped unnamed simple bean org.jboss.jsr299.tck.tests.implementation.simple.lifecycle.Cod" />
+ <param name="StringToMatch" value="Error destroying org.jboss.webbeans.bean-test-ManagedBean-org.jboss.jsr299.tck.tests.implementation.simple.lifecycle.Cod" />
</filter>
</appender>
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/pom.xml 2009-09-30 11:43:24 UTC (rev 3818)
@@ -58,6 +58,7 @@
<module>impl</module>
<module>tests</module>
<module>porting-package</module>
+ <module>inject-tck-runner</module>
<module>jboss-tck-runner</module>
<module>osgi-bundle</module>
</modules>
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Lifecycle.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Lifecycle.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Lifecycle.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -36,6 +36,8 @@
public void endApplication();
public Context getApplicationContext();
+
+ public Context getSingletonContext();
public Context getSessionContext();
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingLifecycle.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingLifecycle.java 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingLifecycle.java 2009-09-30 11:43:24 UTC (rev 3818)
@@ -79,6 +79,11 @@
{
return delegate().getSessionContext();
}
+
+ public Context getSingletonContext()
+ {
+ return delegate().getSingletonContext();
+ }
public boolean isRequestActive()
{
Modified: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/tests/pom.xml 2009-09-30 11:43:24 UTC (rev 3818)
@@ -63,7 +63,6 @@
<dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-api</artifactId>
- <optional>true</optional>
<exclusions>
<exclusion>
<artifactId>jboss-jaxrpc</artifactId>
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-09-30 11:34:49 UTC (rev 3817)
+++ ri/trunk/version-matrix/pom.xml 2009-09-30 11:43:24 UTC (rev 3818)
@@ -83,6 +83,14 @@
<artifactId>jsp-2.1-jetty</artifactId>
<version>${jetty.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.atinject</groupId>
+ <artifactId>inject-tck</artifactId>
+ <version>1.0.0-PRD</version>
+ </dependency>
+
+
<dependency>
<groupId>org.testng</groupId>
@@ -409,8 +417,14 @@
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.7</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
15 years, 1 month
[webbeans-commits] Webbeans SVN: r3817 - in ri/branches/kabir-builder: impl/src/main/java/org/jboss/webbeans and 23 other directories.
by webbeans-commits@lists.jboss.org
Author: kabir.khan(a)jboss.com
Date: 2009-09-30 07:34:49 -0400 (Wed, 30 Sep 2009)
New Revision: 3817
Added:
ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/ContextualInstance.java
ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java
ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/Foo.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableContainerTest.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableSingletonProvider.java
Removed:
ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/ContexutalInstance.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/Foo.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableContainerTest.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableSingletonProvider.java
Modified:
ri/branches/kabir-builder/
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/SimpleInjectionTarget.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/DependentInstancesStore.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/beanstore/HashMapBeanStore.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/AbstractWebBeansELResolver.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java
ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
ri/branches/kabir-builder/jboss-as/build.properties
ri/branches/kabir-builder/jboss-tck-runner/pom.xml
ri/branches/kabir-builder/osgi-bundle/pom.xml
ri/branches/kabir-builder/parent/pom.xml
ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Lifecycle.java
ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingLifecycle.java
ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java
ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java
ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ConcurrentHashMapBeanStore.java
ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java
ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InjectionServicesTest.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/WBStartupTest.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/SorterTest.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/decorator/simple/SimpleDecorator1.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/decorator/simple/SimpleDecorator2.java
ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java
ri/branches/kabir-builder/tests/unit-tests.xml
ri/branches/kabir-builder/version-matrix/pom.xml
Log:
Merged revisions 3757-3758,3763,3768-3769,3771-3772,3776,3784-3785,3791-3793,3796,3800-3801 via svnmerge from
https://svn.jboss.org/repos/webbeans/ri/trunk
.......
r3757 | pete.muir(a)jboss.org | 2009-09-23 12:11:51 +0100 (Wed, 23 Sep 2009) | 1 line
add some versions for tomcat
.......
r3758 | pete.muir(a)jboss.org | 2009-09-23 12:12:01 +0100 (Wed, 23 Sep 2009) | 1 line
fix cleanup order
.......
r3763 | pete.muir(a)jboss.org | 2009-09-23 16:10:17 +0100 (Wed, 23 Sep 2009) | 1 line
move versions to version matrix
.......
r3768 | pete.muir(a)jboss.org | 2009-09-23 19:22:11 +0100 (Wed, 23 Sep 2009) | 1 line
support the situation where the ELContextListener isn't registered
.......
r3769 | pete.muir(a)jboss.org | 2009-09-23 20:53:54 +0100 (Wed, 23 Sep 2009) | 1 line
fix some security access problem
.......
r3771 | pete.muir(a)jboss.org | 2009-09-23 22:45:05 +0100 (Wed, 23 Sep 2009) | 1 line
add various jettys deps
.......
r3772 | pete.muir(a)jboss.org | 2009-09-23 22:45:19 +0100 (Wed, 23 Sep 2009) | 1 line
allow default package
.......
r3776 | pete.muir(a)jboss.org | 2009-09-23 23:08:02 +0100 (Wed, 23 Sep 2009) | 1 line
WBRI-390
.......
r3784 | pete.muir(a)jboss.org | 2009-09-25 17:25:33 +0100 (Fri, 25 Sep 2009) | 1 line
Add isXXXActive methods
.......
r3785 | pete.muir(a)jboss.org | 2009-09-25 17:27:20 +0100 (Fri, 25 Sep 2009) | 1 line
Extract test bootstrap code to TestContainer, use it, and start on a naive cluster test
.......
r3791 | cpopetz | 2009-09-28 15:19:21 +0100 (Mon, 28 Sep 2009) | 2 lines
allow creation of InjectionTarget<T> where T is non-Producible by deferring exception until produce() is invoked
.......
r3792 | rogerk | 2009-09-28 15:37:27 +0100 (Mon, 28 Sep 2009) | 1 line
synch with 1.0.0.PREVIEW4.SP1
.......
r3793 | cpopetz | 2009-09-28 22:33:41 +0100 (Mon, 28 Sep 2009) | 2 lines
No longer need our own build of wicket; move to 1.4.1
.......
r3796 | shane.bryzak(a)jboss.com | 2009-09-29 05:29:31 +0100 (Tue, 29 Sep 2009) | 2 lines
how did this typo get past unnoticed
.......
r3800 | pete.muir(a)jboss.org | 2009-09-29 14:11:46 +0100 (Tue, 29 Sep 2009) | 1 line
Allow running standalone
.......
r3801 | pete.muir(a)jboss.org | 2009-09-29 14:57:56 +0100 (Tue, 29 Sep 2009) | 1 line
Allow running standalone TCK
.......
Property changes on: ri/branches/kabir-builder
___________________________________________________________________
Name: svnmerge-integrated
- /ri/trunk:1-3741
+ /ri/trunk:1-3804
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/SimpleInjectionTarget.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/SimpleInjectionTarget.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/SimpleInjectionTarget.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -57,8 +57,18 @@
this.beanManager = beanManager;
this.type = type;
this.injectionPoints = new HashSet<InjectionPoint>();
- this.constructor = Beans.getBeanConstructor(null, type);
- this.injectionPoints.addAll(Beans.getParameterInjectionPoints(null, constructor));
+ ConstructorInjectionPoint<T> constructor = null;
+ try
+ {
+ constructor = Beans.getBeanConstructor(null, type);
+ this.injectionPoints.addAll(Beans.getParameterInjectionPoints(null, constructor));
+ }
+ catch (Exception e)
+ {
+ // this means the bean of a type that cannot be produce()d, but that is non-fatal
+ // unless someone calls produce()
+ }
+ this.constructor = constructor;
this.injectableFields = new HashSet<FieldInjectionPoint<?,?>>();
this.injectableFields.addAll(Beans.getFieldInjectionPoints(null, type));
this.injectionPoints.addAll(injectableFields);
@@ -75,6 +85,16 @@
public T produce(CreationalContext<T> ctx)
{
+ if (constructor == null)
+ {
+ // this means we couldn't find a constructor on instantiation, which
+ // means there isn't one that's spec-compliant
+ // try again so the correct DefinitionException is thrown
+ Beans.getBeanConstructor(null, type);
+ // should not be reached
+ throw new IllegalStateException(
+ "We were not previously able to find the bean constructor, but now are?");
+ }
return constructor.newInstance(beanManager, ctx);
}
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -80,7 +80,7 @@
return this;
}
- private <X> ProcessAnnotatedTypeImpl<X> createProcessAnnotatedTypeEvent(Class<X> clazz, ClassTransformer classTransformer)
+ private static <X> ProcessAnnotatedTypeImpl<X> createProcessAnnotatedTypeEvent(Class<X> clazz, ClassTransformer classTransformer)
{
WBClass<X> annotatedType = classTransformer.loadClass(clazz);
return new ProcessAnnotatedTypeImpl<X>(annotatedType) {};
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -24,7 +24,7 @@
import javax.enterprise.context.spi.CreationalContext;
import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.api.ContexutalInstance;
+import org.jboss.webbeans.context.api.ContextualInstance;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -75,7 +75,7 @@
{
throw new IllegalStateException("No bean store available for " + toString());
}
- ContexutalInstance<T> beanInstance = getBeanStore().get(contextual);
+ ContextualInstance<T> beanInstance = getBeanStore().get(contextual);
if (beanInstance != null)
{
return beanInstance.getInstance();
@@ -128,7 +128,7 @@
{
throw new IllegalStateException("No bean store available for " + toString());
}
- ContexutalInstance<T> beanInstance = getBeanStore().get(contextual);
+ ContextualInstance<T> beanInstance = getBeanStore().get(contextual);
contextual.destroy(beanInstance.getInstance(), beanInstance.getCreationalContext());
}
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -19,9 +19,9 @@
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
-import org.jboss.webbeans.context.api.ContexutalInstance;
+import org.jboss.webbeans.context.api.ContextualInstance;
-public class BeanInstanceImpl<T> implements ContexutalInstance<T>
+public class BeanInstanceImpl<T> implements ContextualInstance<T>
{
private final Contextual<T> contextual;
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -41,11 +41,11 @@
public static LogProvider log = Logging.getLogProvider(ContextLifecycle.class);
- public final ApplicationContext applicationContext;
- public final SessionContext sessionContext;
- public final ConversationContext conversationContext;
- public final RequestContext requestContext;
- public final DependentContext dependentContext;
+ private final ApplicationContext applicationContext;
+ private final SessionContext sessionContext;
+ private final ConversationContext conversationContext;
+ private final RequestContext requestContext;
+ private final DependentContext dependentContext;
public ContextLifecycle(ApplicationContext applicationContext, SessionContext sessionContext, ConversationContext conversationContext, RequestContext requestContext, DependentContext dependentContext)
{
@@ -92,9 +92,24 @@
public boolean isRequestActive()
{
- return requestContext.isActive() && dependentContext.isActive();
+ return applicationContext.isActive() && requestContext.isActive() && dependentContext.isActive();
}
+ public boolean isApplicationActive()
+ {
+ return applicationContext.isActive() && dependentContext.isActive();
+ }
+
+ public boolean isConversationActive()
+ {
+ return applicationContext.isActive() && sessionContext.isActive() && conversationContext.isActive() && dependentContext.isActive();
+ }
+
+ public boolean isSessionActive()
+ {
+ return applicationContext.isActive() && sessionContext.isActive() && dependentContext.isActive();
+ }
+
public void beginApplication(BeanStore applicationBeanStore)
{
@@ -116,11 +131,11 @@
public void cleanup()
{
+ dependentContext.cleanup();
+ requestContext.cleanup();
+ conversationContext.cleanup();
+ sessionContext.cleanup();
applicationContext.cleanup();
- sessionContext.cleanup();
- conversationContext.cleanup();
- requestContext.cleanup();
- dependentContext.cleanup();
}
public ApplicationContext getApplicationContext()
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -27,7 +27,7 @@
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
-import org.jboss.webbeans.context.api.ContexutalInstance;
+import org.jboss.webbeans.context.api.ContextualInstance;
/**
* The dependent context
@@ -63,7 +63,7 @@
if (creationalContext instanceof WBCreationalContext<?>)
{
WBCreationalContext<T> creationalContextImpl = (WBCreationalContext<T>) creationalContext;
- ContexutalInstance<T> beanInstance = new BeanInstanceImpl<T>(contextual, instance, creationalContext);
+ ContextualInstance<T> beanInstance = new BeanInstanceImpl<T>(contextual, instance, creationalContext);
creationalContextImpl.getParentDependentInstancesStore().addDependentInstance(beanInstance);
}
return instance;
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/DependentInstancesStore.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/DependentInstancesStore.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/DependentInstancesStore.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -20,7 +20,7 @@
import java.util.Collections;
import java.util.List;
-import org.jboss.webbeans.context.api.ContexutalInstance;
+import org.jboss.webbeans.context.api.ContextualInstance;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
@@ -34,14 +34,14 @@
private static Log log = Logging.getLog(DependentInstancesStore.class);
// A object -> List of contextual instances mapping
- private List<ContexutalInstance<?>> dependentInstances;
+ private List<ContextualInstance<?>> dependentInstances;
/**
* Creates a new DependentInstancesStore
*/
public DependentInstancesStore()
{
- dependentInstances = Collections.synchronizedList(new ArrayList<ContexutalInstance<?>>());
+ dependentInstances = Collections.synchronizedList(new ArrayList<ContextualInstance<?>>());
}
/**
@@ -50,7 +50,7 @@
* @param key The key to store the instance under
* @param contextualInstance The instance to store
*/
- public <T> void addDependentInstance(ContexutalInstance<T> contextualInstance)
+ public <T> void addDependentInstance(ContextualInstance<T> contextualInstance)
{
log.trace("Registered dependent instance #0", contextualInstance);
dependentInstances.add(contextualInstance);
@@ -64,13 +64,13 @@
public void destroyDependentInstances()
{
log.trace("Destroying dependent instances");
- for (ContexutalInstance<?> injectedInstance : dependentInstances)
+ for (ContextualInstance<?> injectedInstance : dependentInstances)
{
destroy(injectedInstance);
}
}
- private static <T> void destroy(ContexutalInstance<T> beanInstance)
+ private static <T> void destroy(ContextualInstance<T> beanInstance)
{
beanInstance.getContextual().destroy(beanInstance.getInstance(), beanInstance.getCreationalContext());
}
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -26,7 +26,7 @@
import org.jboss.webbeans.Container;
import org.jboss.webbeans.ContextualIdStore;
import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.api.ContexutalInstance;
+import org.jboss.webbeans.context.api.ContextualInstance;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.util.Names;
@@ -50,11 +50,11 @@
* @return The instance
*/
@SuppressWarnings("unchecked")
- public <T> ContexutalInstance<T> get(Contextual<? extends T> contextual)
+ public <T> ContextualInstance<T> get(Contextual<? extends T> contextual)
{
Integer contextualId = Container.instance().deploymentServices().get(ContextualIdStore.class).getId(contextual);
String key = getNamingScheme().getKeyFromId(contextualId);
- ContexutalInstance<T> instance = (ContexutalInstance<T>) getAttribute(key);
+ ContextualInstance<T> instance = (ContextualInstance<T>) getAttribute(key);
log.trace("Looked for " + key + " and got " + instance);
return instance;
}
@@ -131,7 +131,7 @@
* @param instance The instance
* @return The instance added
*/
- public <T> void put(ContexutalInstance<T> beanInstance)
+ public <T> void put(ContextualInstance<T> beanInstance)
{
Integer contextualId = Container.instance().deploymentServices().get(ContextualIdStore.class).getId(beanInstance.getContextual());
String key = getNamingScheme().getKeyFromId(contextualId);
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/beanstore/HashMapBeanStore.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/beanstore/HashMapBeanStore.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/context/beanstore/HashMapBeanStore.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -23,7 +23,7 @@
import javax.enterprise.context.spi.Contextual;
-import org.jboss.webbeans.context.api.ContexutalInstance;
+import org.jboss.webbeans.context.api.ContextualInstance;
import org.jboss.webbeans.context.api.helpers.AbstractMapBackedBeanStore;
/**
@@ -37,14 +37,14 @@
private static final long serialVersionUID = 4770689245633688471L;
// The backing map
- protected Map<Contextual<? extends Object>, ContexutalInstance<? extends Object>> delegate;
+ protected Map<Contextual<? extends Object>, ContextualInstance<? extends Object>> delegate;
/**
* Constructor
*/
public HashMapBeanStore()
{
- delegate = new HashMap<Contextual<? extends Object>, ContexutalInstance<? extends Object>>();
+ delegate = new HashMap<Contextual<? extends Object>, ContextualInstance<? extends Object>>();
}
/**
@@ -53,7 +53,7 @@
* @return The delegate
*/
@Override
- public Map<Contextual<? extends Object>, ContexutalInstance<? extends Object>> delegate()
+ public Map<Contextual<? extends Object>, ContextualInstance<? extends Object>> delegate()
{
return delegate;
}
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/AbstractWebBeansELResolver.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/AbstractWebBeansELResolver.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/AbstractWebBeansELResolver.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -16,18 +16,17 @@
*/
package org.jboss.webbeans.el;
+import static org.jboss.webbeans.el.ELCreationalContextStack.getCreationalContextStore;
+
import java.beans.FeatureDescriptor;
import java.util.Iterator;
import java.util.concurrent.Callable;
import javax.el.ELContext;
import javax.el.ELResolver;
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.Container;
/**
* An EL-resolver against the named beans
@@ -37,18 +36,6 @@
public abstract class AbstractWebBeansELResolver extends ELResolver
{
- private static final Contextual<?> CONTEXTUAL = new Contextual<Object>()
- {
-
- public Object create(CreationalContext<Object> creationalContext)
- {
- return null;
- }
-
- public void destroy(Object instance, CreationalContext<Object> creationalContext) {}
-
- };
-
protected abstract BeanManagerImpl getManager(ELContext context);
@Override
@@ -151,25 +138,6 @@
public void setValue(ELContext context, Object base, Object property, Object value)
{
}
-
- private static ELCreationalContextStack getCreationalContextStore(ELContext context)
- {
- Object o = context.getContext(ELCreationalContextStack.class);
-
- if (!(o instanceof ELCreationalContextStack))
- {
- ELCreationalContextStack store = ELCreationalContextStack.addToContext(context);
- o = store;
- }
- ELCreationalContextStack store = (ELCreationalContextStack) o;
- if (store.isEmpty())
- {
- // TODO need to use correct manager for module
- ELCreationalContext<?> creationalContext = ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
- store.push(creationalContext);
- }
- return (ELCreationalContextStack) o;
- }
}
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -3,10 +3,27 @@
import java.util.Stack;
import javax.el.ELContext;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import org.jboss.webbeans.Container;
+
class ELCreationalContextStack extends Stack<ELCreationalContext<?>>
{
+
+ private static final Contextual<?> CONTEXTUAL = new Contextual<Object>()
+ {
+
+ public Object create(CreationalContext<Object> creationalContext)
+ {
+ return null;
+ }
+
+ public void destroy(Object instance, CreationalContext<Object> creationalContext) {}
+
+ };
+
private static final long serialVersionUID = -57142365866995726L;
public static ELCreationalContextStack addToContext(ELContext context)
@@ -16,4 +33,24 @@
return store;
}
+
+ public static ELCreationalContextStack getCreationalContextStore(ELContext context)
+ {
+ Object o = context.getContext(ELCreationalContextStack.class);
+
+ if (!(o instanceof ELCreationalContextStack))
+ {
+ ELCreationalContextStack store = ELCreationalContextStack.addToContext(context);
+ o = store;
+ }
+ ELCreationalContextStack store = (ELCreationalContextStack) o;
+ if (store.isEmpty())
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext = ELCreationalContext.of(Container.instance().deploymentManager().createCreationalContext(CONTEXTUAL));
+ store.push(creationalContext);
+ }
+ return (ELCreationalContextStack) o;
+ }
+
}
\ No newline at end of file
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -16,6 +16,8 @@
*/
package org.jboss.webbeans.el;
+import static org.jboss.webbeans.el.ELCreationalContextStack.getCreationalContextStore;
+
import javax.el.ELContext;
import javax.el.MethodExpression;
import javax.el.MethodInfo;
@@ -92,15 +94,5 @@
creationalContext.release();
}
}
-
- private ELCreationalContextStack getCreationalContextStore(ELContext context)
- {
- Object o = context.getContext(ELCreationalContextStack.class);
- if (!(o instanceof ELCreationalContextStack))
- {
- throw new IllegalStateException("Something went wrong with the ELContext, expecting a CreationalContextStore to be present, but instead got " + o);
- }
- return (ELCreationalContextStack) o;
- }
}
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -16,6 +16,8 @@
*/
package org.jboss.webbeans.el;
+import static org.jboss.webbeans.el.ELCreationalContextStack.getCreationalContextStore;
+
import javax.el.ELContext;
import javax.el.ValueExpression;
import javax.enterprise.context.spi.Contextual;
@@ -109,15 +111,5 @@
creationalContext.release();
}
}
-
- private ELCreationalContextStack getCreationalContextStore(ELContext context)
- {
- Object o = context.getContext(ELCreationalContextStack.class);
- if (!(o instanceof ELCreationalContextStack))
- {
- throw new IllegalStateException("Something went wrong with the ELContext, expecting a CreationalContextStore to be present, but instead got " + o);
- }
- return (ELCreationalContextStack) o;
- }
}
Modified: ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -31,12 +31,15 @@
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
+import java.security.AccessControlException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import javax.inject.Qualifier;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.util.reflection.ParameterizedTypeImpl;
/**
@@ -48,6 +51,8 @@
public class Reflections
{
+ private static final Log log = Logging.getLog(Reflections.class);
+
private static final Type[] EMPTY_TYPES = {};
public static class HierarchyDiscovery
@@ -129,11 +134,19 @@
@SuppressWarnings("unchecked")
private void discoverFromClass(Class<?> clazz)
{
- discoverTypes(resolveType(type, clazz.getGenericSuperclass()));
- for (Type c : clazz.getGenericInterfaces())
+ try
{
- discoverTypes(resolveType(type, c));
+ discoverTypes(resolveType(type, clazz.getGenericSuperclass()));
+ for (Type c : clazz.getGenericInterfaces())
+ {
+ discoverTypes(resolveType(type, c));
+ }
}
+ catch (AccessControlException e)
+ {
+ // TODO Hmm, is this a hack?
+ log.trace("Security exception scanning " + clazz.getName(), e);
+ }
}
/**
@@ -836,7 +849,7 @@
public static Field ensureAccessible(Field field)
{
- if (!field.isAccessible() && !field.getDeclaringClass().getPackage().getName().startsWith("java.util"))
+ if (!field.isAccessible() && !isIgnorePackage(field.getDeclaringClass().getPackage()))
{
field.setAccessible(true);
}
@@ -845,7 +858,7 @@
public static Method ensureAccessible(Method method)
{
- if (!method.isAccessible() && !method.getDeclaringClass().getPackage().getName().startsWith("java.util"))
+ if (!method.isAccessible() && !isIgnorePackage(method.getDeclaringClass().getPackage()))
{
method.setAccessible(true);
}
@@ -854,11 +867,25 @@
public static <T> Constructor<T> ensureAccessible(Constructor<T> constructor)
{
- if (!constructor.isAccessible() && !constructor.getDeclaringClass().getPackage().getName().startsWith("java.util"))
+ Class<?> c = constructor.getDeclaringClass();
+ Package p = c.getPackage();
+ if (!constructor.isAccessible() && !isIgnorePackage(p))
{
constructor.setAccessible(true);
}
return constructor;
}
+
+ private static boolean isIgnorePackage(Package pkg)
+ {
+ if (pkg != null)
+ {
+ return pkg.getName().startsWith("java.lang");
+ }
+ else
+ {
+ return false;
+ }
+ }
}
Modified: ri/branches/kabir-builder/jboss-as/build.properties
===================================================================
--- ri/branches/kabir-builder/jboss-as/build.properties 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/jboss-as/build.properties 2009-09-30 11:34:49 UTC (rev 3817)
@@ -1,5 +1,5 @@
# Container a number of properties associated with installing Web Beans into JBoss AS and running the TCK in JBoss AS
-#jboss.home=/Applications/jboss-5.2.0.Beta1
+jboss.home=/home/shane/apps/jboss
org.jboss.testharness.container.javaOpts=-Xms128m -Xmx384m -XX:MaxPermSize=128m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
# time to allow before attempting to restart JBoss AS
Modified: ri/branches/kabir-builder/jboss-tck-runner/pom.xml
===================================================================
--- ri/branches/kabir-builder/jboss-tck-runner/pom.xml 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/jboss-tck-runner/pom.xml 2009-09-30 11:34:49 UTC (rev 3817)
@@ -3,6 +3,7 @@
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
<version>1.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
Modified: ri/branches/kabir-builder/osgi-bundle/pom.xml
===================================================================
--- ri/branches/kabir-builder/osgi-bundle/pom.xml 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/osgi-bundle/pom.xml 2009-09-30 11:34:49 UTC (rev 3817)
@@ -21,7 +21,7 @@
<parent>
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0.PREVIEW4.SP1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -60,8 +60,8 @@
<Embed-Dependency>*; scope=compile; inline=true</Embed-Dependency>
<_exportcontents>javax.event; javax.context; javax.webbeans; javax.decorator; javax.inject; javax.enterprise.*; version=${osgi.version},
- org.jboss.webbeans.ejb; org.jboss.webbeans.bean.proxy; org.jboss.webbeans.*.api.*; org.jboss.webbeans.*.spi.*; org.jboss.webbeans.conversation; org.jboss.webbeans; org.jboss.webbeans.bootstrap; org.jboss.webbeans.introspector; org.jboss.webbeans.servlet; version=${osgi.version},
- org.jboss.webbeans.el; include:="WebBeansELResolver"; version=${osgi.version},
+ org.jboss.webbeans.context; org.jboss.webbeans.ejb; org.jboss.webbeans.bean; org.jboss.webbeans.bean.proxy; org.jboss.webbeans.*.api.*; org.jboss.webbeans.*.spi.*; org.jboss.webbeans.conversation; org.jboss.webbeans; org.jboss.webbeans.bootstrap; org.jboss.webbeans.introspector; org.jboss.webbeans.servlet; version=${osgi.version},
+ org.jboss.webbeans.el; version=${osgi.version},
org.jboss.webbeans.jsf; include:="WebBeansPhaseListener"; version=${osgi.version},
javassist.util.proxy;version="3.8.1.GA"
</_exportcontents>
@@ -129,7 +129,13 @@
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>inject-api</artifactId>
+ <version>1.0.0-PRD</version>
+ </dependency>
+
</dependencies>
</project>
Modified: ri/branches/kabir-builder/parent/pom.xml
===================================================================
--- ri/branches/kabir-builder/parent/pom.xml 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/parent/pom.xml 2009-09-30 11:34:49 UTC (rev 3817)
@@ -9,6 +9,7 @@
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-version-matrix</artifactId>
<version>1.0.0-SNAPSHOT</version>
+ <relativePath>../version-matrix</relativePath>
</parent>
<name>Web Beans, the reference implementation of JSR-299</name>
Modified: ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Lifecycle.java
===================================================================
--- ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Lifecycle.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Lifecycle.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -24,6 +24,12 @@
public void endRequest(String id, BeanStore requestBeanStore);
public boolean isRequestActive();
+
+ public boolean isSessionActive();
+
+ public boolean isApplicationActive();
+
+ public boolean isConversationActive();
public void beginApplication(BeanStore applicationBeanStore);
Modified: ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingLifecycle.java
===================================================================
--- ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingLifecycle.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingLifecycle.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -84,6 +84,21 @@
{
return delegate().isRequestActive();
}
+
+ public boolean isApplicationActive()
+ {
+ return delegate().isApplicationActive();
+ }
+
+ public boolean isConversationActive()
+ {
+ return delegate().isConversationActive();
+ }
+
+ public boolean isSessionActive()
+ {
+ return delegate().isSessionActive();
+ }
public void restoreSession(String id, BeanStore sessionBeanStore)
{
Modified: ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java
===================================================================
--- ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -36,7 +36,7 @@
* @param contextual The contextual whose instance is to be return
* @return The instance. Null if not found
*/
- public abstract <T> ContexutalInstance<T> get(Contextual<? extends T> contextual);
+ public abstract <T> ContextualInstance<T> get(Contextual<? extends T> contextual);
/**
* Clears the store of contextual instances
@@ -56,5 +56,5 @@
* @param contextualInstance the contextual instance
* @return The instance added
*/
- public abstract <T> void put(ContexutalInstance<T> contextualInstance);
+ public abstract <T> void put(ContextualInstance<T> contextualInstance);
}
\ No newline at end of file
Copied: ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/ContextualInstance.java (from rev 3801, ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/ContextualInstance.java)
===================================================================
--- ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/ContextualInstance.java (rev 0)
+++ ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/ContextualInstance.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.context.api;
+
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+public interface ContextualInstance<T>
+{
+
+ public T getInstance();
+
+ public CreationalContext<T> getCreationalContext();
+
+ public Contextual<T> getContextual();
+}
Deleted: ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/ContexutalInstance.java
===================================================================
--- ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/ContexutalInstance.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/ContexutalInstance.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -1,15 +0,0 @@
-package org.jboss.webbeans.context.api;
-
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
-
-public interface ContexutalInstance<T>
-{
-
- public T getInstance();
-
- public CreationalContext<T> getCreationalContext();
-
- public Contextual<T> getContextual();
-
-}
Modified: ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java
===================================================================
--- ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -5,7 +5,7 @@
import javax.enterprise.context.spi.Contextual;
-import org.jboss.webbeans.context.api.ContexutalInstance;
+import org.jboss.webbeans.context.api.ContextualInstance;
import org.jboss.webbeans.context.api.BeanStore;
public abstract class AbstractMapBackedBeanStore implements BeanStore
@@ -16,7 +16,7 @@
super();
}
- public abstract Map<Contextual<? extends Object>, ContexutalInstance<? extends Object>> delegate();
+ public abstract Map<Contextual<? extends Object>, ContextualInstance<? extends Object>> delegate();
/**
* Gets an instance from the store
@@ -26,10 +26,10 @@
*
* @see org.jboss.webbeans.context.api.BeanStore#get(BaseBean)
*/
- public <T extends Object> ContexutalInstance<T> get(Contextual<? extends T> bean)
+ public <T extends Object> ContextualInstance<T> get(Contextual<? extends T> bean)
{
@SuppressWarnings("unchecked")
- ContexutalInstance<T> instance = (ContexutalInstance<T>) delegate().get(bean);
+ ContextualInstance<T> instance = (ContextualInstance<T>) delegate().get(bean);
return instance;
}
@@ -63,7 +63,7 @@
*
* @see org.jboss.webbeans.context.api.BeanStore#put(Contextual, Object)
*/
- public <T> void put(ContexutalInstance<T> beanInstance)
+ public <T> void put(ContextualInstance<T> beanInstance)
{
delegate().put(beanInstance.getContextual(), beanInstance);
}
Modified: ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ConcurrentHashMapBeanStore.java
===================================================================
--- ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ConcurrentHashMapBeanStore.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ConcurrentHashMapBeanStore.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -23,7 +23,7 @@
import javax.enterprise.context.spi.Contextual;
-import org.jboss.webbeans.context.api.ContexutalInstance;
+import org.jboss.webbeans.context.api.ContextualInstance;
/**
* A BeanStore that uses a HashMap as backing storage
@@ -36,14 +36,14 @@
private static final long serialVersionUID = 4770689245633688471L;
// The backing map
- protected Map<Contextual<? extends Object>, ContexutalInstance<? extends Object>> delegate;
+ protected Map<Contextual<? extends Object>, ContextualInstance<? extends Object>> delegate;
/**
* Constructor
*/
public ConcurrentHashMapBeanStore()
{
- delegate = new ConcurrentHashMap<Contextual<? extends Object>, ContexutalInstance<? extends Object>>();
+ delegate = new ConcurrentHashMap<Contextual<? extends Object>, ContextualInstance<? extends Object>>();
}
/**
@@ -52,7 +52,7 @@
* @return The delegate
*/
@Override
- public Map<Contextual<? extends Object>, ContexutalInstance<? extends Object>> delegate()
+ public Map<Contextual<? extends Object>, ContextualInstance<? extends Object>> delegate()
{
return delegate;
}
Modified: ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java
===================================================================
--- ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -5,7 +5,7 @@
import javax.enterprise.context.spi.Contextual;
import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.api.ContexutalInstance;
+import org.jboss.webbeans.context.api.ContextualInstance;
public abstract class ForwardingBeanStore implements BeanStore
{
@@ -17,7 +17,7 @@
delegate().clear();
}
- public <T> ContexutalInstance<T> get(Contextual<? extends T> bean)
+ public <T> ContextualInstance<T> get(Contextual<? extends T> bean)
{
return delegate().get(bean);
}
@@ -27,7 +27,7 @@
return delegate().getContextuals();
}
- public <T> void put(ContexutalInstance<T> beanInstance)
+ public <T> void put(ContextualInstance<T> beanInstance)
{
delegate().put(beanInstance);
}
Copied: ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java (from rev 3801, ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java)
===================================================================
--- ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java (rev 0)
+++ ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.mock;
+
+import org.jboss.webbeans.bootstrap.api.Lifecycle;
+
+public interface MockLifecycle extends Lifecycle
+{
+
+ public abstract void initialize();
+
+ public abstract void beginApplication();
+
+ public abstract void endApplication();
+
+ public abstract void resetContexts();
+
+ public abstract void beginRequest();
+
+ public abstract void endRequest();
+
+ public abstract void beginSession();
+
+ public abstract void endSession();
+
+}
\ No newline at end of file
Modified: ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
===================================================================
--- ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -11,7 +11,7 @@
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.servlet.api.ServletServices;
-public class MockServletLifecycle extends ForwardingLifecycle
+public class MockServletLifecycle extends ForwardingLifecycle implements MockLifecycle
{
private static final ResourceLoader MOCK_RESOURCE_LOADER = new MockResourceLoader();
@@ -35,6 +35,9 @@
deployment.getServices().add(ServletServices.class, new MockServletServices(deployment.getArchive()));
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.mock.MockLifecycle#initialize()
+ */
public void initialize()
{
try
@@ -53,21 +56,28 @@
return lifecycle;
}
- public MockDeployment getDeployment()
+ protected MockDeployment getDeployment()
{
return deployment;
}
- public WebBeansBootstrap getBootstrap()
+ protected WebBeansBootstrap getBootstrap()
{
return bootstrap;
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.mock.MockLifecycle#beginApplication()
+ */
public void beginApplication()
{
bootstrap.startInitialization().deployBeans().validateBeans().endInitialization();
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.mock.MockLifecycle#endApplication()
+ */
+ @Override
public void endApplication()
{
bootstrap.shutdown();
@@ -78,33 +88,48 @@
return applicationBeanStore;
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.mock.MockLifecycle#resetContexts()
+ */
public void resetContexts()
{
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.mock.MockLifecycle#beginRequest()
+ */
public void beginRequest()
{
super.beginRequest("Mock", requestBeanStore);
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.mock.MockLifecycle#endRequest()
+ */
public void endRequest()
{
super.endRequest("Mock", requestBeanStore);
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.mock.MockLifecycle#beginSession()
+ */
public void beginSession()
{
super.restoreSession("Mock", sessionBeanStore);
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.mock.MockLifecycle#endSession()
+ */
public void endSession()
{
// TODO Conversation handling breaks this :-(
//super.endSession("Mock", sessionBeanStore);
}
- public Environment getEnvironment()
+ protected Environment getEnvironment()
{
return Environments.SERVLET;
}
Copied: ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java (from rev 3801, ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java)
===================================================================
--- ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java (rev 0)
+++ ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -0,0 +1,142 @@
+package org.jboss.webbeans.mock;
+
+import java.net.URL;
+
+import org.jboss.webbeans.BeanManagerImpl;
+
+/**
+ * Control of the container, used for tests. Wraps up common operations.
+ *
+ * @author pmuir
+ *
+ */
+public class TestContainer
+{
+
+ public static class Status
+ {
+
+ private final Exception deploymentException;
+
+ public Status(Exception deploymentException)
+ {
+ this.deploymentException = deploymentException;
+ }
+
+ public Exception getDeploymentException()
+ {
+ return deploymentException;
+ }
+
+ public boolean isSuccess()
+ {
+ return deploymentException == null;
+ }
+
+ }
+
+ private final MockServletLifecycle lifecycle;
+ private final Iterable<Class<?>> classes;
+ private final Iterable<URL> beansXml;
+
+ /**
+ * Create a container, specifying the classes and beans.xml to deploy
+ *
+ * @param lifecycle
+ * @param classes
+ * @param beansXml
+ */
+ public TestContainer(MockServletLifecycle lifecycle, Iterable<Class<?>> classes, Iterable<URL> beansXml)
+ {
+ this.lifecycle = lifecycle;
+ this.classes = classes;
+ this.beansXml = beansXml;
+ }
+
+ /**
+ * Start the container, returning the container state
+ *
+ * @return
+ */
+ public Status startContainerAndReturnStatus()
+ {
+ try
+ {
+ startContainer();
+ }
+ catch (Exception e)
+ {
+ return new Status(e);
+ }
+ return new Status(null);
+ }
+
+ public void startContainer()
+ {
+ MockBeanDeploymentArchive archive = lifecycle.getDeployment().getArchive();
+ archive.setBeanClasses(classes);
+ if (beansXml != null)
+ {
+ archive.setWebBeansXmlFiles(beansXml);
+ }
+ lifecycle.initialize();
+ lifecycle.beginApplication();
+ }
+
+ /**
+ * Get the context lifecycle, allowing fine control over the contexts' state
+ *
+ * @return
+ */
+ public MockLifecycle getLifecycle()
+ {
+ return lifecycle;
+ }
+
+ public BeanManagerImpl getBeanManager()
+ {
+ return lifecycle.getBootstrap().getManager(getDeployment().getArchive());
+ }
+
+ public MockDeployment getDeployment()
+ {
+ return lifecycle.getDeployment();
+ }
+
+ /**
+ * Utility method which ensures a request is active and available for use
+ *
+ */
+ public void ensureRequestActive()
+ {
+ if (!lifecycle.isSessionActive())
+ {
+ lifecycle.beginSession();
+ }
+ if (!lifecycle.isRequestActive())
+ {
+ lifecycle.beginRequest();
+ }
+ }
+
+ /**
+ * Clean up the container, ending any active contexts
+ *
+ */
+ public void stopContainer()
+ {
+ if (lifecycle.isRequestActive())
+ {
+ lifecycle.endRequest();
+ }
+ if (lifecycle.isSessionActive())
+ {
+ lifecycle.endSession();
+ }
+ if (lifecycle.isApplicationActive())
+ {
+ lifecycle.endApplication();
+ }
+ }
+
+}
\ No newline at end of file
Modified: ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java
===================================================================
--- ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -4,39 +4,33 @@
import org.jboss.testharness.api.DeploymentException;
import org.jboss.testharness.spi.StandaloneContainers;
-import org.jboss.webbeans.mock.MockBeanDeploymentArchive;
import org.jboss.webbeans.mock.MockServletLifecycle;
+import org.jboss.webbeans.mock.TestContainer;
+import org.jboss.webbeans.mock.TestContainer.Status;
public abstract class AbstractStandaloneContainersImpl implements StandaloneContainers
{
private DeploymentException deploymentException;
+
+ private TestContainer testContainer;
- private MockServletLifecycle lifecycle;
-
public boolean deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml)
{
- this.lifecycle = newLifecycle();
+ this.testContainer = new TestContainer(newLifecycle(), classes, beansXml);
- try
+ Status status = testContainer.startContainerAndReturnStatus();
+ if (!status.isSuccess())
{
- MockBeanDeploymentArchive archive = lifecycle.getDeployment().getArchive();
- archive.setBeanClasses(classes);
- if (beansXml != null)
- {
- archive.setWebBeansXmlFiles(beansXml);
- }
- lifecycle.initialize();
- lifecycle.beginApplication();
+ this.deploymentException = new DeploymentException("Error deploying beans", status.getDeploymentException());
+ return false;
}
- catch (Exception e)
+ else
{
- this.deploymentException = new DeploymentException("Error deploying beans", e);
- return false;
+ testContainer.getLifecycle().beginSession();
+ testContainer.getLifecycle().beginRequest();
+ return true;
}
- lifecycle.beginSession();
- lifecycle.beginRequest();
- return true;
}
protected abstract MockServletLifecycle newLifecycle();
@@ -64,10 +58,8 @@
public void undeploy()
{
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
- lifecycle = null;
+ testContainer.stopContainer();
+ testContainer = null;
deploymentException = null;
}
Modified: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -1,6 +1,9 @@
package org.jboss.webbeans.test.unit.bootstrap;
-import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
+import org.jboss.webbeans.bootstrap.api.Bootstrap;
+import org.jboss.webbeans.bootstrap.api.Environments;
+import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
import org.testng.annotations.Test;
public class DiscoverFailsBootstrapTest
@@ -9,10 +12,8 @@
@Test(groups="bootstrap", expectedExceptions=IllegalArgumentException.class)
public void testDiscoverFails()
{
- MockEELifecycle lifecycle = new MockEELifecycle();
- lifecycle.getBootstrap().startContainer(lifecycle.getEnvironment(), null, lifecycle.getApplicationBeanStore());
- lifecycle.initialize();
- lifecycle.beginApplication();
+ Bootstrap bootstrap = new WebBeansBootstrap();
+ bootstrap.startContainer(Environments.SE, null, new ConcurrentHashMapBeanStore());
}
}
Modified: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InjectionServicesTest.java
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InjectionServicesTest.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InjectionServicesTest.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -7,24 +7,22 @@
import org.jboss.webbeans.injection.spi.InjectionServices;
import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.TestContainer;
import org.testng.annotations.Test;
public class InjectionServicesTest
{
@Test
- public void testDiscoverFails()
+ public void testInjectionOfTarget()
{
- MockEELifecycle lifecycle = new MockEELifecycle();
- lifecycle.getDeployment().getArchive().setBeanClasses(Arrays.asList(Foo.class, Bar.class));
+ TestContainer container = new TestContainer(new MockEELifecycle(), Arrays.asList(Foo.class, Bar.class), null);
CheckableInjectionServices ijs = new CheckableInjectionServices();
- lifecycle.getDeployment().getArchive().getServices().add(InjectionServices.class, ijs);
- lifecycle.initialize();
- lifecycle.beginApplication();
- lifecycle.beginSession();
- lifecycle.beginRequest();
+ container.getDeployment().getArchive().getServices().add(InjectionServices.class, ijs);
+ container.startContainer();
+ container.ensureRequestActive();
- BeanManager manager = lifecycle.getBootstrap().getManager(lifecycle.getDeployment().getArchive());
+ BeanManager manager = container.getBeanManager();
Bean<? extends Object> bean = manager.resolve(manager.getBeans(Foo.class));
ijs.reset();
@@ -39,9 +37,7 @@
assert foo.getMessage().equals("hi!");
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
+ container.stopContainer();
}
}
Modified: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/WBStartupTest.java
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/WBStartupTest.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/WBStartupTest.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -22,6 +22,7 @@
import javax.enterprise.inject.spi.BeanManager;
import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.TestContainer;
import org.testng.annotations.Test;
/**
@@ -34,14 +35,11 @@
@Test
public void test()
{
- MockEELifecycle lifecycle = new MockEELifecycle();
- lifecycle.getDeployment().getArchive().setBeanClasses(Arrays.asList(Foo.class, Bar.class));
- lifecycle.initialize();
- lifecycle.beginApplication();
- lifecycle.beginSession();
- lifecycle.beginRequest();
+ TestContainer container = new TestContainer(new MockEELifecycle(), Arrays.asList(Foo.class, Bar.class), null);
+ container.startContainer();
+ container.ensureRequestActive();
- BeanManager manager = lifecycle.getBootstrap().getManager(lifecycle.getDeployment().getArchive());
+ BeanManager manager = container.getBeanManager();
Bean<? extends Object> bean = manager.resolve(manager.getBeans(Foo.class));
Foo foo = (Foo) manager.getReference(bean, Foo.class, manager.createCreationalContext(bean));
@@ -49,10 +47,7 @@
assert foo != null;
assert foo.getBar() != null;
-
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
+ container.stopContainer();
}
}
Modified: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/SorterTest.java
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/SorterTest.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/builder/sorter/SorterTest.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -27,6 +27,8 @@
import java.util.List;
import java.util.Set;
+import javax.enterprise.inject.spi.BeanManager;
+
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.builder.sorter.DeploymentItem;
@@ -35,7 +37,10 @@
import org.jboss.webbeans.introspector.jlr.WBClassImpl;
import org.jboss.webbeans.mock.MockEELifecycle;
import org.jboss.webbeans.mock.MockEjbDescriptor;
+import org.jboss.webbeans.mock.TestContainer;
import org.jboss.webbeans.resources.ClassTransformer;
+import org.jboss.webbeans.test.unit.bootstrap.Bar;
+import org.jboss.webbeans.test.unit.bootstrap.Foo;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
@@ -48,7 +53,7 @@
*/
public class SorterTest
{
- MockEELifecycle lifecycle;
+ TestContainer container;
BeanManagerImpl manager;
final int ITERATIONS = 100;
@@ -56,21 +61,16 @@
@BeforeClass
public void beforeMethod() throws Exception
{
- lifecycle = new MockEELifecycle();
- lifecycle.getDeployment().getArchive().setBeanClasses(new ArrayList<Class<?>>());
- lifecycle.initialize();
- lifecycle.beginApplication();
- lifecycle.beginSession();
- lifecycle.beginRequest();
- manager = lifecycle.getBootstrap().getManager(lifecycle.getDeployment().getArchive());
+ container = new TestContainer(new MockEELifecycle(), Arrays.asList(Foo.class, Bar.class), null);
+ container.startContainer();
+ container.ensureRequestActive();
+ manager = container.getBeanManager();
}
@AfterClass
public void afterClass()
{
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
+ container.stopContainer();
}
@Test
Copied: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster (from rev 3801, ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster)
Deleted: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/Foo.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/Foo.java 2009-09-29 13:57:56 UTC (rev 3801)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/Foo.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -1,23 +0,0 @@
-package org.jboss.webbeans.test.unit.cluster;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-
-@SessionScoped
-public class Foo implements Serializable
-{
-
- private String name;
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
-}
Copied: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/Foo.java (from rev 3801, ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/Foo.java)
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/Foo.java (rev 0)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/Foo.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.test.unit.cluster;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+
+@SessionScoped
+public class Foo implements Serializable
+{
+
+ private String name;
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+}
Deleted: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java 2009-09-29 13:57:56 UTC (rev 3801)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -1,82 +0,0 @@
-package org.jboss.webbeans.test.unit.cluster;
-
-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.enterprise.inject.spi.Bean;
-
-import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.bootstrap.api.SingletonProvider;
-import org.jboss.webbeans.context.ContextLifecycle;
-import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.mock.MockEELifecycle;
-import org.jboss.webbeans.mock.TestContainer;
-import org.testng.annotations.Test;
-
-public class NaiveClusterTest
-{
-
- @Test
- public void testSessionReplication() throws Exception
- {
- SingletonProvider.initialize(new SwitchableSingletonProvider());
-
- // Bootstrap container 1
- SwitchableSingletonProvider.use(1);
-
- TestContainer container1 = new TestContainer(new MockEELifecycle(), Arrays.<Class<?>>asList(Foo.class), null);
- container1.startContainer();
- container1.ensureRequestActive();
-
- BeanManagerImpl beanManager1 = container1.getBeanManager();
- Bean<?> fooBean1 = beanManager1.resolve(beanManager1.getBeans(Foo.class));
-
- // Bootstrap container 2
- SwitchableSingletonProvider.use(2);
-
- TestContainer container2 = new TestContainer(new MockEELifecycle(), Arrays.<Class<?>>asList(Foo.class), null);
- container2.startContainer();
- container2.ensureRequestActive();
-
- BeanManagerImpl beanManager2 = container2.getBeanManager();
- Bean<?> fooBean2 = beanManager2.resolve(beanManager2.getBeans(Foo.class));
-
- SwitchableSingletonProvider.use(1);
- // Set a value into Foo1
- Foo foo1 = (Foo) beanManager1.getReference(fooBean1, Foo.class, beanManager1.createCreationalContext(fooBean1));
- foo1.setName("container 1");
-
- replicateSession(beanManager1, beanManager2);
-
- SwitchableSingletonProvider.use(2);
- Foo foo2 = (Foo) beanManager2.getReference(fooBean2, Foo.class, beanManager2.createCreationalContext(fooBean2));
- assert foo2.getName().equals("container 1");
- }
-
- private void replicateSession(BeanManagerImpl beanManager1, BeanManagerImpl beanManager2) throws Exception
- {
- // Mimic replicating the session
- BeanStore sessionBeanStore = beanManager1.getServices().get(ContextLifecycle.class).getSessionContext().getBeanStore();
- BeanStore replicatedSessionBeanStore = (BeanStore) deserialize(serialize(sessionBeanStore));
- beanManager2.getServices().get(ContextLifecycle.class).getSessionContext().setBeanStore(replicatedSessionBeanStore);
- }
-
- 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();
- }
-
-}
Copied: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java (from rev 3801, ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java)
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java (rev 0)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -0,0 +1,82 @@
+package org.jboss.webbeans.test.unit.cluster;
+
+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.enterprise.inject.spi.Bean;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.bootstrap.api.SingletonProvider;
+import org.jboss.webbeans.context.ContextLifecycle;
+import org.jboss.webbeans.context.api.BeanStore;
+import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.TestContainer;
+import org.testng.annotations.Test;
+
+public class NaiveClusterTest
+{
+
+ @Test
+ public void testSessionReplication() throws Exception
+ {
+ SingletonProvider.initialize(new SwitchableSingletonProvider());
+
+ // Bootstrap container 1
+ SwitchableSingletonProvider.use(1);
+
+ TestContainer container1 = new TestContainer(new MockEELifecycle(), Arrays.<Class<?>>asList(Foo.class), null);
+ container1.startContainer();
+ container1.ensureRequestActive();
+
+ BeanManagerImpl beanManager1 = container1.getBeanManager();
+ Bean<?> fooBean1 = beanManager1.resolve(beanManager1.getBeans(Foo.class));
+
+ // Bootstrap container 2
+ SwitchableSingletonProvider.use(2);
+
+ TestContainer container2 = new TestContainer(new MockEELifecycle(), Arrays.<Class<?>>asList(Foo.class), null);
+ container2.startContainer();
+ container2.ensureRequestActive();
+
+ BeanManagerImpl beanManager2 = container2.getBeanManager();
+ Bean<?> fooBean2 = beanManager2.resolve(beanManager2.getBeans(Foo.class));
+
+ SwitchableSingletonProvider.use(1);
+ // Set a value into Foo1
+ Foo foo1 = (Foo) beanManager1.getReference(fooBean1, Foo.class, beanManager1.createCreationalContext(fooBean1));
+ foo1.setName("container 1");
+
+ replicateSession(beanManager1, beanManager2);
+
+ SwitchableSingletonProvider.use(2);
+ Foo foo2 = (Foo) beanManager2.getReference(fooBean2, Foo.class, beanManager2.createCreationalContext(fooBean2));
+ assert foo2.getName().equals("container 1");
+ }
+
+ private void replicateSession(BeanManagerImpl beanManager1, BeanManagerImpl beanManager2) throws Exception
+ {
+ // Mimic replicating the session
+ BeanStore sessionBeanStore = beanManager1.getServices().get(ContextLifecycle.class).getSessionContext().getBeanStore();
+ BeanStore replicatedSessionBeanStore = (BeanStore) deserialize(serialize(sessionBeanStore));
+ beanManager2.getServices().get(ContextLifecycle.class).getSessionContext().setBeanStore(replicatedSessionBeanStore);
+ }
+
+ 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();
+ }
+
+}
Deleted: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableContainerTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableContainerTest.java 2009-09-29 13:57:56 UTC (rev 3801)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableContainerTest.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -1,56 +0,0 @@
-package org.jboss.webbeans.test.unit.cluster;
-
-import java.util.Arrays;
-
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.webbeans.bootstrap.api.SingletonProvider;
-import org.jboss.webbeans.mock.MockEELifecycle;
-import org.jboss.webbeans.mock.TestContainer;
-import org.testng.annotations.Test;
-
-public class SwitchableContainerTest
-{
-
- @Test
- public void test()
- {
- SingletonProvider.initialize(new SwitchableSingletonProvider());
-
- // Bootstrap container 1
- SwitchableSingletonProvider.use(1);
-
- TestContainer container1 = new TestContainer(new MockEELifecycle(), Arrays.<Class<?>>asList(Foo.class), null);
- container1.startContainer();
- container1.ensureRequestActive();
-
- BeanManager beanManager1 = container1.getBeanManager();
- Bean<?> fooBean1 = beanManager1.resolve(beanManager1.getBeans(Foo.class));
- Foo foo1 = (Foo) beanManager1.getReference(fooBean1, Foo.class, beanManager1.createCreationalContext(fooBean1));
- foo1.setName("container 1");
-
- // Bootstrap container 2
- SwitchableSingletonProvider.use(2);
-
- TestContainer container2 = new TestContainer(new MockEELifecycle(), Arrays.<Class<?>>asList(Foo.class), null);
- container2.startContainer();
- container2.ensureRequestActive();
-
- BeanManager beanManager2 = container2.getBeanManager();
- Bean<?> fooBean2 = beanManager2.resolve(beanManager2.getBeans(Foo.class));
- Foo foo2 = (Foo) beanManager2.getReference(fooBean2, Foo.class, beanManager2.createCreationalContext(fooBean2));
- foo2.setName("container 2");
-
- // Switch to container 1 and check value
- SwitchableSingletonProvider.use(1);
- foo1 = (Foo) beanManager1.getReference(fooBean1, Foo.class, beanManager1.createCreationalContext(fooBean1));
- assert foo1.getName().equals("container 1");
-
- // Switch to container 2 and check value
- SwitchableSingletonProvider.use(2);
- foo2 = (Foo) beanManager2.getReference(fooBean2, Foo.class, beanManager2.createCreationalContext(fooBean2));
- assert foo2.getName().equals("container 2");
- }
-
-}
Copied: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableContainerTest.java (from rev 3801, ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableContainerTest.java)
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableContainerTest.java (rev 0)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableContainerTest.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -0,0 +1,56 @@
+package org.jboss.webbeans.test.unit.cluster;
+
+import java.util.Arrays;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.webbeans.bootstrap.api.SingletonProvider;
+import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.TestContainer;
+import org.testng.annotations.Test;
+
+public class SwitchableContainerTest
+{
+
+ @Test
+ public void test()
+ {
+ SingletonProvider.initialize(new SwitchableSingletonProvider());
+
+ // Bootstrap container 1
+ SwitchableSingletonProvider.use(1);
+
+ TestContainer container1 = new TestContainer(new MockEELifecycle(), Arrays.<Class<?>>asList(Foo.class), null);
+ container1.startContainer();
+ container1.ensureRequestActive();
+
+ BeanManager beanManager1 = container1.getBeanManager();
+ Bean<?> fooBean1 = beanManager1.resolve(beanManager1.getBeans(Foo.class));
+ Foo foo1 = (Foo) beanManager1.getReference(fooBean1, Foo.class, beanManager1.createCreationalContext(fooBean1));
+ foo1.setName("container 1");
+
+ // Bootstrap container 2
+ SwitchableSingletonProvider.use(2);
+
+ TestContainer container2 = new TestContainer(new MockEELifecycle(), Arrays.<Class<?>>asList(Foo.class), null);
+ container2.startContainer();
+ container2.ensureRequestActive();
+
+ BeanManager beanManager2 = container2.getBeanManager();
+ Bean<?> fooBean2 = beanManager2.resolve(beanManager2.getBeans(Foo.class));
+ Foo foo2 = (Foo) beanManager2.getReference(fooBean2, Foo.class, beanManager2.createCreationalContext(fooBean2));
+ foo2.setName("container 2");
+
+ // Switch to container 1 and check value
+ SwitchableSingletonProvider.use(1);
+ foo1 = (Foo) beanManager1.getReference(fooBean1, Foo.class, beanManager1.createCreationalContext(fooBean1));
+ assert foo1.getName().equals("container 1");
+
+ // Switch to container 2 and check value
+ SwitchableSingletonProvider.use(2);
+ foo2 = (Foo) beanManager2.getReference(fooBean2, Foo.class, beanManager2.createCreationalContext(fooBean2));
+ assert foo2.getName().equals("container 2");
+ }
+
+}
Deleted: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableSingletonProvider.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableSingletonProvider.java 2009-09-29 13:57:56 UTC (rev 3801)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableSingletonProvider.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -1,61 +0,0 @@
-package org.jboss.webbeans.test.unit.cluster;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.jboss.webbeans.bootstrap.api.Singleton;
-import org.jboss.webbeans.bootstrap.api.SingletonProvider;
-
-public class SwitchableSingletonProvider extends SingletonProvider
-{
-
- public static void use(Integer id)
- {
- if (id == null)
- {
- throw new IllegalArgumentException("id cannot be null");
- }
- SwitchableSingleton.id = id;
- }
-
- private static class SwitchableSingleton<T> implements Singleton<T>
- {
-
- private static Integer id = 0;
-
- private final Map<Integer, T> store;
-
- public SwitchableSingleton()
- {
- this.store = new Hashtable<Integer, T>();
- }
-
- public void clear()
- {
- store.remove(id);
- }
-
- public T get()
- {
- return store.get(id);
- }
-
- public boolean isSet()
- {
- return store.containsKey(id);
- }
-
- public void set(T object)
- {
- store.put(id, object);
- }
-
- }
-
- @Override
- public <T> Singleton<T> create(Class<? extends T> expectedType)
- {
- return new SwitchableSingleton<T>();
- }
-
-}
Copied: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableSingletonProvider.java (from rev 3801, ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableSingletonProvider.java)
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableSingletonProvider.java (rev 0)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/SwitchableSingletonProvider.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -0,0 +1,61 @@
+package org.jboss.webbeans.test.unit.cluster;
+
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.jboss.webbeans.bootstrap.api.Singleton;
+import org.jboss.webbeans.bootstrap.api.SingletonProvider;
+
+public class SwitchableSingletonProvider extends SingletonProvider
+{
+
+ public static void use(Integer id)
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException("id cannot be null");
+ }
+ SwitchableSingleton.id = id;
+ }
+
+ private static class SwitchableSingleton<T> implements Singleton<T>
+ {
+
+ private static Integer id = 0;
+
+ private final Map<Integer, T> store;
+
+ public SwitchableSingleton()
+ {
+ this.store = new Hashtable<Integer, T>();
+ }
+
+ public void clear()
+ {
+ store.remove(id);
+ }
+
+ public T get()
+ {
+ return store.get(id);
+ }
+
+ public boolean isSet()
+ {
+ return store.containsKey(id);
+ }
+
+ public void set(T object)
+ {
+ store.put(id, object);
+ }
+
+ }
+
+ @Override
+ public <T> Singleton<T> create(Class<? extends T> expectedType)
+ {
+ return new SwitchableSingleton<T>();
+ }
+
+}
Modified: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/decorator/simple/SimpleDecorator1.java
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/decorator/simple/SimpleDecorator1.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/decorator/simple/SimpleDecorator1.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -53,6 +53,6 @@
public int echo3(int i)
{
echo3 = true;
- return delegate.echo1(i);
+ return delegate.echo3(i);
}
}
Modified: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/decorator/simple/SimpleDecorator2.java
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/decorator/simple/SimpleDecorator2.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/decorator/simple/SimpleDecorator2.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -47,12 +47,12 @@
public int echo2(int i)
{
echo2 = true;
- return delegate.echo1(i);
+ return delegate.echo2(i);
}
public int echo3(int i)
{
echo3 = true;
- return delegate.echo1(i);
+ return delegate.echo3(i);
}
}
Modified: ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java
===================================================================
--- ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java 2009-09-30 11:34:49 UTC (rev 3817)
@@ -9,42 +9,38 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.Container;
-import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bean.ManagedBean;
-import org.jboss.webbeans.mock.MockBeanDeploymentArchive;
+import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.mock.MockServletLifecycle;
+import org.jboss.webbeans.mock.TestContainer;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
public class ServletEnvironmentTest
{
- private MockServletLifecycle lifecycle;
+ private TestContainer container;
private BeanManagerImpl manager;
@BeforeClass
public void beforeClass() throws Throwable
{
- lifecycle = new MockServletLifecycle();
- lifecycle.initialize();
- MockBeanDeploymentArchive archive = lifecycle.getDeployment().getArchive();
- archive.setBeanClasses(Arrays.asList(Animal.class, DeadlyAnimal.class, DeadlySpider.class, DeadlyAnimal.class, Hound.class, HoundLocal.class, Salmon.class, ScottishFish.class, SeaBass.class, Sole.class, Spider.class, Tarantula.class, TarantulaProducer.class, Tuna.class));
- lifecycle.beginApplication();
- lifecycle.beginSession();
- lifecycle.beginRequest();
- manager = Container.instance().deploymentManager();
+ container = new TestContainer(new MockServletLifecycle(), Arrays.asList(Animal.class, DeadlyAnimal.class, DeadlySpider.class, DeadlyAnimal.class, Hound.class, HoundLocal.class, Salmon.class, ScottishFish.class, SeaBass.class, Sole.class, Spider.class, Tarantula.class, TarantulaProducer.class, Tuna.class), null);
+ container.startContainer();
+ container.ensureRequestActive();
+ manager = container.getBeanManager();
}
@AfterClass(alwaysRun=true)
public void afterClass() throws Exception
{
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
- lifecycle = null;
+ container.stopContainer();
+ container = null;
+ manager = null;
}
+ @Test
public void testSimpleBeans()
{
Map<Class<?>, Bean<?>> beans = new HashMap<Class<?>, Bean<?>>();
@@ -67,6 +63,7 @@
manager.getInstanceByType(Sole.class, new AnnotationLiteral<Whitefish>() {}).ping();
}
+ @Test
public void testProducerMethodBean()
{
Map<Class<?>, Bean<?>> beans = new HashMap<Class<?>, Bean<?>>();
Modified: ri/branches/kabir-builder/tests/unit-tests.xml
===================================================================
--- ri/branches/kabir-builder/tests/unit-tests.xml 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/tests/unit-tests.xml 2009-09-30 11:34:49 UTC (rev 3817)
@@ -56,6 +56,7 @@
<package name="org.jboss.webbeans.test.unit.manager" />
<package name="org.jboss.webbeans.test.unit.noncontextual" />
<package name="org.jboss.webbeans.test.unit.security" />
+ <package name="org.jboss.webbeans.test.unit.decorator.simple" />
</packages>
</test>
Modified: ri/branches/kabir-builder/version-matrix/pom.xml
===================================================================
--- ri/branches/kabir-builder/version-matrix/pom.xml 2009-09-30 10:56:56 UTC (rev 3816)
+++ ri/branches/kabir-builder/version-matrix/pom.xml 2009-09-30 11:34:49 UTC (rev 3817)
@@ -51,11 +51,38 @@
<webbeans.version>1.0.0-SNAPSHOT</webbeans.version>
<webbeans.servlet.version>1.0.0-SNAPSHOT</webbeans.servlet.version>
<webbeans.se.version>1.0.0-SNAPSHOT</webbeans.se.version>
+ <webbeans.wicket.version>1.0.0-SNAPSHOT</webbeans.wicket.version>
<jboss.test.harness.version>1.0.0-SNAPSHOT</jboss.test.harness.version>
+ <jetty.version>6.1.21</jetty.version>
+ <wicket.version>1.4.1</wicket.version>
</properties>
<dependencyManagement>
<dependencies>
+
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket</artifactId>
+ <version>${wicket.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jsp-2.1-jetty</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
<dependency>
<groupId>org.testng</groupId>
@@ -129,6 +156,12 @@
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
<dependency>
<groupId>javax.transaction</groupId>
@@ -141,6 +174,12 @@
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.4.2</version>
+ </dependency>
<dependency>
<groupId>jaxen</groupId>
@@ -169,13 +208,13 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_12</version>
+ <version>1.2_13</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_12</version>
+ <version>1.2_13</version>
</dependency>
<dependency>
@@ -287,13 +326,6 @@
<artifactId>webbeans-se</artifactId>
<version>${webbeans.se.version}</version>
</dependency>
-
- <!-- Deprecated -->
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>se-module</artifactId>
- <version>${webbeans.se.version}</version>
- </dependency>
<dependency>
<groupId>org.jboss.webbeans.servlet</groupId>
@@ -306,6 +338,12 @@
<artifactId>webbeans-servlet</artifactId>
<version>${webbeans.servlet.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-wicket</artifactId>
+ <version>${webbeans.wicket.version}</version>
+ </dependency>
<dependency>
<groupId>org.jboss.jsr299.tck</groupId>
@@ -356,6 +394,12 @@
</dependency>
<dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>jasper</artifactId>
+ <version>6.0.20</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.1</version>
@@ -382,6 +426,11 @@
<pluginManagement>
<plugins>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.4</version>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
@@ -493,7 +542,7 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.16</version>
+ <version>${jetty.version}</version>
</plugin>
<plugin>
<groupId>org.twdata.maven</groupId>
@@ -506,6 +555,11 @@
<version>1.0-beta-3</version>
</plugin>
<plugin>
+ <groupId>com.pyx4j</groupId>
+ <artifactId>maven-junction-plugin</artifactId>
+ <version>1.0.3</version>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-beta-1</version>
15 years, 1 month
[webbeans-commits] Webbeans SVN: r3815 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: implementation/initializer/broken/methodAnnotatedProduces and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-09-29 19:28:59 -0400 (Tue, 29 Sep 2009)
New Revision: 3815
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereoTypeWithBindingTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/InitializerMethodAnnotatedProducesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/BindingAnnotationWithMemberTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/BindingAnnotationWithMemberTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java
Log:
matched remaining unmatched tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereoTypeWithBindingTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereoTypeWithBindingTypesTest.java 2009-09-29 19:57:01 UTC (rev 3814)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereoTypeWithBindingTypesTest.java 2009-09-29 23:28:59 UTC (rev 3815)
@@ -10,13 +10,13 @@
import org.testng.annotations.Test;
@Artifact
-(a)ExpectedDeploymentException(DefinitionError.class)
+//(a)ExpectedDeploymentException(DefinitionError.class)
@SpecVersion(spec="cdi", version="PFD2")
public class StereoTypeWithBindingTypesTest extends AbstractJSR299Test
{
- @Test
- @SpecAssertion(section = "2.7.1", id = "da")
+ // @Test
+ //@SpecAssertion(section = "2.7.1.3", id = "b") now untestable
public void testStereotypeWithBindingTypes()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/InitializerMethodAnnotatedProducesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/InitializerMethodAnnotatedProducesTest.java 2009-09-29 19:57:01 UTC (rev 3814)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/InitializerMethodAnnotatedProducesTest.java 2009-09-29 23:28:59 UTC (rev 3815)
@@ -17,7 +17,7 @@
{
@Test(groups = "initializerMethod")
- @SpecAssertions( { @SpecAssertion(section = "3.8.1", id = "ba"),
+ @SpecAssertions( { @SpecAssertion(section = "3.9.1", id = "ba"),
@SpecAssertion(section = "3.3.2", id = "ca") })
public void testInitializerMethodAnnotatedProduces()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-09-29 19:57:01 UTC (rev 3814)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-09-29 23:28:59 UTC (rev 3815)
@@ -165,7 +165,7 @@
@Test(groups = "injection")
@SpecAssertions({
@SpecAssertion(section = "7.3.1", id = "aa"),
- @SpecAssertion(section = "3.8.1", id = "a"),
+ @SpecAssertion(section = "3.8.1", id = "aa"),
@SpecAssertion(section="2.3.4", id="a"),
@SpecAssertion(section="3.8", id="aa"),
@SpecAssertion(section="3.8", id="ab"),
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-09-29 19:57:01 UTC (rev 3814)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-09-29 23:28:59 UTC (rev 3815)
@@ -55,7 +55,7 @@
@Test
@SpecAssertions( {
- @SpecAssertion(section = "4.3.2", id = "ab"),
+ // @SpecAssertion(section = "4.3.2", id = "ab"), removed from spec
@SpecAssertion(section="4.3", id="cb")
})
public void testProducerMethodOnSpecializedBeanCalledOnSpecializingBean()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java 2009-09-29 19:57:01 UTC (rev 3814)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java 2009-09-29 23:28:59 UTC (rev 3815)
@@ -183,7 +183,7 @@
}
@Test
- @SpecAssertion(section = "7.2", id = "hb")
+ @SpecAssertion(section = "7.2", id = "a1")
public void testInitializerMethodsNotIntercepted()
{
MissileInterceptor.intercepted = false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/BindingAnnotationWithMemberTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/BindingAnnotationWithMemberTest.java 2009-09-29 19:57:01 UTC (rev 3814)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/BindingAnnotationWithMemberTest.java 2009-09-29 23:28:59 UTC (rev 3815)
@@ -31,7 +31,7 @@
{
@Test
- @SpecAssertion(section = "5.3.5", id = "cb")
+ @SpecAssertion(section = "5.3.5", id = "b")
public void testAnnotationMemberWithoutNonBinding()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/BindingAnnotationWithMemberTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/BindingAnnotationWithMemberTest.java 2009-09-29 19:57:01 UTC (rev 3814)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/BindingAnnotationWithMemberTest.java 2009-09-29 23:28:59 UTC (rev 3815)
@@ -31,7 +31,7 @@
{
@Test
- @SpecAssertion(section = "5.3.5", id = "ca")
+ @SpecAssertion(section = "5.3.5", id = "b")
public void testArrayMemberWithoutNonBinding()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java 2009-09-29 19:57:01 UTC (rev 3814)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java 2009-09-29 23:28:59 UTC (rev 3815)
@@ -36,7 +36,7 @@
@Test(groups = { "resolution"})
@SpecAssertions({
- @SpecAssertion(section = "5.4.1", id = "c"),
+ @SpecAssertion(section = "5.4.1", id = "ca"),
@SpecAssertion(section = "11.3.5", id = "aa"),
@SpecAssertion(section = "11.3.5", id = "b")
})
15 years, 1 month