Weld SVN: r6094 - in core/trunk/tests/src/test: java/org/jboss/weld/tests/decorators/multidelegate and 2 other directories.
by weld-commits@lists.jboss.org
Author: nickarls
Date: 2010-04-12 08:37:05 -0400 (Mon, 12 Apr 2010)
New Revision: 6094
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account1.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account2.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/AccountDecorator.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/TestMultiDelegate.java
core/trunk/tests/src/test/resources/org/jboss/weld/tests/decorators/multidelegate/
core/trunk/tests/src/test/resources/org/jboss/weld/tests/decorators/multidelegate/beans.xml
Log:
Test for http://seamframework.org/Community/SerializableDecorators validity
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account.java 2010-04-12 12:37:05 UTC (rev 6094)
@@ -0,0 +1,9 @@
+package org.jboss.weld.tests.decorators.multidelegate;
+
+import java.math.BigDecimal;
+
+public interface Account {
+
+ public String withdraw(BigDecimal amount);
+
+}
\ No newline at end of file
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account1.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account1.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account1.java 2010-04-12 12:37:05 UTC (rev 6094)
@@ -0,0 +1,11 @@
+package org.jboss.weld.tests.decorators.multidelegate;
+
+import java.math.BigDecimal;
+
+public class Account1 implements Account {
+
+ public String withdraw(BigDecimal amount) {
+ return "Account1 withdraw";
+ }
+
+}
\ No newline at end of file
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account2.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account2.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/Account2.java 2010-04-12 12:37:05 UTC (rev 6094)
@@ -0,0 +1,11 @@
+package org.jboss.weld.tests.decorators.multidelegate;
+
+import java.math.BigDecimal;
+
+public class Account2 implements Account {
+
+ public String withdraw(BigDecimal amount) {
+ return "Account2 withdraw";
+ }
+
+}
\ No newline at end of file
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/AccountDecorator.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/AccountDecorator.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/AccountDecorator.java 2010-04-12 12:37:05 UTC (rev 6094)
@@ -0,0 +1,20 @@
+package org.jboss.weld.tests.decorators.multidelegate;
+
+import java.math.BigDecimal;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+@Decorator
+public class AccountDecorator implements Account {
+
+ @Inject @Delegate @Any Account account;
+
+ public String withdraw(BigDecimal amount) {
+ System.out.println("AccountDecorator withdraw " + account.toString());
+ return account.withdraw(amount);
+ }
+
+}
\ No newline at end of file
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/TestMultiDelegate.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/TestMultiDelegate.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/multidelegate/TestMultiDelegate.java 2010-04-12 12:37:05 UTC (rev 6094)
@@ -0,0 +1,17 @@
+package org.jboss.weld.tests.decorators.multidelegate;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@BeansXml("beans.xml")
+public class TestMultiDelegate extends AbstractWeldTest
+{
+
+ @Test(description="http://seamframework.org/Community/SerializableDecorators")
+ public void go() {
+ }
+
+}
Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/decorators/multidelegate/beans.xml
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/decorators/multidelegate/beans.xml (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/tests/decorators/multidelegate/beans.xml 2010-04-12 12:37:05 UTC (rev 6094)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.weld.tests.decorators.multidelegate.AccountDecorator</class>
+ </decorators>
+</beans>
\ No newline at end of file
14 years, 8 months
Weld SVN: r6093 - extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-04-12 08:14:02 -0400 (Mon, 12 Apr 2010)
New Revision: 6093
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java
Log:
minor
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java 2010-04-12 10:24:02 UTC (rev 6092)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java 2010-04-12 12:14:02 UTC (rev 6093)
@@ -16,7 +16,7 @@
private static final Logger log = LoggerFactory.getLogger("org.jboss.weld.extensions.resources");
- private ResourceLoaderImpl()
+ protected ResourceLoaderImpl()
{
}
14 years, 8 months
Weld SVN: r6092 - extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-04-12 06:24:02 -0400 (Mon, 12 Apr 2010)
New Revision: 6092
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java
Log:
fix for constructor of inner classes
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java 2010-04-12 07:05:46 UTC (rev 6091)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java 2010-04-12 10:24:02 UTC (rev 6092)
@@ -3,6 +3,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Collections;
+import java.util.HashSet;
import java.util.Set;
import javax.enterprise.inject.spi.Annotated;
@@ -70,7 +71,7 @@
public Set<Type> getTypeClosure()
{
- return Collections.unmodifiableSet(typeClosure);
+ return new HashSet<Type>(typeClosure);
}
public Type getBaseType()
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java 2010-04-12 07:05:46 UTC (rev 6091)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java 2010-04-12 10:24:02 UTC (rev 6092)
@@ -16,7 +16,27 @@
NewAnnotatedConstructor(NewAnnotatedType<X> type, Constructor<?> constructor, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Map<Integer, Type> typeOverrides)
{
- super(type, (Constructor<X>) constructor, constructor.getDeclaringClass(), constructor.getParameterTypes(), constructor.getGenericParameterTypes(), annotations, parameterAnnotations, null, typeOverrides);
+
+ super(type, (Constructor<X>) constructor, constructor.getDeclaringClass(), constructor.getParameterTypes(), getGenericArray(constructor), annotations, parameterAnnotations, null, typeOverrides);
}
+ private static Type[] getGenericArray(Constructor<?> constructor)
+ {
+ Type[] genericTypes = constructor.getGenericParameterTypes();
+ // for inner classes genericTypes and parameterTypes can be different
+ // length, this is a hack to fix this.
+ // TODO: investigate this behaviour further, on different JVM's and
+ // compilers
+ if (genericTypes.length + 1 == constructor.getParameterTypes().length)
+ {
+ genericTypes = new Type[constructor.getGenericParameterTypes().length + 1];
+ genericTypes[0] = constructor.getParameterTypes()[0];
+ for (int i = 0; i < constructor.getGenericParameterTypes().length; ++i)
+ {
+ genericTypes[i + 1] = constructor.getGenericParameterTypes()[i];
+ }
+ }
+ return genericTypes;
+ }
+
}
14 years, 8 months
Weld SVN: r6091 - extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-04-12 03:05:46 -0400 (Mon, 12 Apr 2010)
New Revision: 6091
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java
Log:
minor
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java 2010-04-12 06:45:49 UTC (rev 6090)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java 2010-04-12 07:05:46 UTC (rev 6091)
@@ -18,7 +18,7 @@
NewAnnotatedParameter(AnnotatedCallable<X> declaringCallable, Class<?> type, int position, AnnotationStore annotations, Type genericType, Type typeOverride)
{
- super(type, annotations, null, typeOverride);
+ super(type, annotations, genericType, typeOverride);
this.declaringCallable = declaringCallable;
this.position = position;
}
14 years, 8 months
Weld SVN: r6090 - extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-04-12 02:45:49 -0400 (Mon, 12 Apr 2010)
New Revision: 6090
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java
Log:
updated NewAnnotatedParameter to properly deal with generic types
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java 2010-04-11 12:20:16 UTC (rev 6089)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java 2010-04-12 06:45:49 UTC (rev 6090)
@@ -21,10 +21,10 @@
private final List<AnnotatedParameter<X>> parameters;
- protected AbstractNewAnnotatedCallable(AnnotatedType<X> declaringType, Y member, Class<?> memberType, Class<?>[] parameterTypes, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Type genericType, Map<Integer, Type> parameterTypeOverrides)
+ protected AbstractNewAnnotatedCallable(AnnotatedType<X> declaringType, Y member, Class<?> memberType, Class<?>[] parameterTypes, Type[] genericTypes, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Type genericType, Map<Integer, Type> parameterTypeOverrides)
{
super(declaringType, member, memberType, annotations, genericType, null);
- this.parameters = getAnnotatedParameters(this, parameterTypes, parameterAnnotations, parameterTypeOverrides);
+ this.parameters = getAnnotatedParameters(this, parameterTypes, genericTypes, parameterAnnotations, parameterTypeOverrides);
}
public List<AnnotatedParameter<X>> getParameters()
@@ -38,7 +38,7 @@
}
- private static <X, Y extends Member> List<AnnotatedParameter<X>> getAnnotatedParameters(AbstractNewAnnotatedCallable<X, Y> callable, Class<?>[] parameterTypes, Map<Integer, AnnotationStore> parameterAnnotations, Map<Integer, Type> parameterTypeOverrides)
+ private static <X, Y extends Member> List<AnnotatedParameter<X>> getAnnotatedParameters(AbstractNewAnnotatedCallable<X, Y> callable, Class<?>[] parameterTypes, Type[] genericTypes, Map<Integer, AnnotationStore> parameterAnnotations, Map<Integer, Type> parameterTypeOverrides)
{
List<AnnotatedParameter<X>> parameters = new ArrayList<AnnotatedParameter<X>>();
int len = parameterTypes.length;
@@ -54,7 +54,7 @@
{
over = parameterTypeOverrides.get(i);
}
- NewAnnotatedParameter<X> p = new NewAnnotatedParameter<X>(callable, parameterTypes[i], i, builder.create(), over);
+ NewAnnotatedParameter<X> p = new NewAnnotatedParameter<X>(callable, parameterTypes[i], i, builder.create(), genericTypes[i], over);
parameters.add(p);
}
return parameters;
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java 2010-04-11 12:20:16 UTC (rev 6089)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java 2010-04-12 06:45:49 UTC (rev 6090)
@@ -16,7 +16,7 @@
NewAnnotatedConstructor(NewAnnotatedType<X> type, Constructor<?> constructor, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Map<Integer, Type> typeOverrides)
{
- super(type, (Constructor<X>) constructor, constructor.getDeclaringClass(), constructor.getParameterTypes(), annotations, parameterAnnotations, null, typeOverrides);
+ super(type, (Constructor<X>) constructor, constructor.getDeclaringClass(), constructor.getParameterTypes(), constructor.getGenericParameterTypes(), annotations, parameterAnnotations, null, typeOverrides);
}
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java 2010-04-11 12:20:16 UTC (rev 6089)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java 2010-04-12 06:45:49 UTC (rev 6090)
@@ -16,7 +16,7 @@
{
NewAnnotatedMethod(AnnotatedType<X> type, Method method, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Map<Integer, Type> parameterTypeOverrides)
{
- super(type, method, method.getReturnType(), method.getParameterTypes(), annotations, parameterAnnotations, method.getGenericReturnType(), parameterTypeOverrides);
+ super(type, method, method.getReturnType(), method.getParameterTypes(), method.getGenericParameterTypes(), annotations, parameterAnnotations, method.getGenericReturnType(), parameterTypeOverrides);
}
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java 2010-04-11 12:20:16 UTC (rev 6089)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java 2010-04-12 06:45:49 UTC (rev 6090)
@@ -16,7 +16,7 @@
private final int position;
private final AnnotatedCallable<X> declaringCallable;
- NewAnnotatedParameter(AnnotatedCallable<X> declaringCallable, Class<?> type, int position, AnnotationStore annotations, Type typeOverride)
+ NewAnnotatedParameter(AnnotatedCallable<X> declaringCallable, Class<?> type, int position, AnnotationStore annotations, Type genericType, Type typeOverride)
{
super(type, annotations, null, typeOverride);
this.declaringCallable = declaringCallable;
14 years, 8 months
Weld SVN: r6089 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck.
by weld-commits@lists.jboss.org
Author: dallen6
Date: 2010-04-11 08:20:16 -0400 (Sun, 11 Apr 2010)
New Revision: 6089
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
Log:
Added original exception to DeploymentFailure so that the information can be seen on why a deployment failed
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2010-04-09 22:37:36 UTC (rev 6088)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2010-04-11 12:20:16 UTC (rev 6089)
@@ -192,7 +192,7 @@
}
else
{
- return new DeploymentException(deploymentException, new DeploymentFailure());
+ return new DeploymentException(deploymentException, new DeploymentFailure(deploymentException));
}
}
}
14 years, 8 months
Weld SVN: r6088 - in extensions/trunk/src/main/java/org/jboss/weld/extensions: resources/spi and 1 other directory.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-04-09 18:37:36 -0400 (Fri, 09 Apr 2010)
New Revision: 6088
Removed:
extensions/trunk/src/main/java/org/jboss/weld/extensions/ResourceListener.java
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java
Log:
oops
Deleted: extensions/trunk/src/main/java/org/jboss/weld/extensions/ResourceListener.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/ResourceListener.java 2010-04-09 21:34:16 UTC (rev 6087)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/ResourceListener.java 2010-04-09 22:37:36 UTC (rev 6088)
@@ -1,81 +0,0 @@
-package org.jboss.weld.extensions;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-import org.jboss.weld.extensions.resources.servlet.ServletContextDestroyedEvent;
-import org.jboss.weld.extensions.resources.servlet.ServletContextInitializedEvent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * ServletContextListener that fires a CDI event when the ServletContext is
- * created or destroyed
- *
- * @author Stuart Douglas
- *
- */
-//@WebListener
-public class ResourceListener implements ServletContextListener
-{
- private BeanManager beanManager;
-
- private Logger log = LoggerFactory.getLogger(ResourceListener.class);
- // FIXME: hack to work around invalid binding in JBoss AS 6 M2
- private static final List<String> beanManagerLocations = new ArrayList<String>()
- {
- private static final long serialVersionUID = 1L;
- {
- add("java:comp/BeanManager");
- add("java:app/BeanManager");
- }
- };
-
- public ResourceListener()
- {
- beanManager = lookupBeanManager();
- }
-
- private BeanManager lookupBeanManager()
- {
- for (String location : beanManagerLocations)
- {
- try
- {
- log.trace("Looking for Bean Manager at JNDI location #0", location);
- return (BeanManager) new InitialContext().lookup(location);
- }
- catch (NamingException e)
- {
- // No panic, keep trying
- log.debug("Bean Manager not found at JNDI location #0", location);
- }
- }
- // OK, panic
- throw new IllegalArgumentException("Could not find BeanManager in " + beanManagerLocations);
- }
-
- private void fireEvent(Object payload, Annotation... qualifiers)
- {
- log.trace("Firing event #0 with qualifiers #1", payload, qualifiers);
- beanManager.fireEvent(payload, qualifiers);
- }
-
- public void contextDestroyed(ServletContextEvent sce)
- {
- fireEvent(new ServletContextDestroyedEvent(sce.getServletContext()));
- }
-
- public void contextInitialized(ServletContextEvent sce)
- {
- fireEvent(new ServletContextInitializedEvent(sce.getServletContext()));
- }
-
-}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java 2010-04-09 21:34:16 UTC (rev 6087)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java 2010-04-09 22:37:36 UTC (rev 6088)
@@ -16,6 +16,9 @@
private static final Logger log = LoggerFactory.getLogger("org.jboss.weld.extensions.resources");
+ private ResourceLoaderImpl()
+ {
+ }
public InputStream getResourceAsStream(String name)
{
14 years, 8 months
Weld SVN: r6087 - in extensions/trunk: src/main/java/org/jboss/weld/extensions/resources and 1 other directories.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-04-09 17:34:16 -0400 (Fri, 09 Apr 2010)
New Revision: 6087
Removed:
extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/servlet/
Modified:
extensions/trunk/pom.xml
extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java
Log:
removed servlet stuff
Modified: extensions/trunk/pom.xml
===================================================================
--- extensions/trunk/pom.xml 2010-04-09 20:48:36 UTC (rev 6086)
+++ extensions/trunk/pom.xml 2010-04-09 21:34:16 UTC (rev 6087)
@@ -156,12 +156,6 @@
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <optional>true</optional>
- </dependency>
-
- <dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java 2010-04-09 20:48:36 UTC (rev 6086)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java 2010-04-09 21:34:16 UTC (rev 6087)
@@ -2,32 +2,20 @@
import java.io.IOException;
import java.io.InputStream;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Set;
-import javax.inject.Inject;
-import javax.servlet.ServletContext;
-
import org.jboss.weld.extensions.resources.ResourceProducer;
-import org.jboss.weld.extensions.resources.servlet.ServletResourceExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ResourceLoaderImpl implements ResourceLoader
{
- private final Set<ServletContext> servletContexts;
-
private static final Logger log = LoggerFactory.getLogger("org.jboss.weld.extensions.resources");
- @Inject
- private ResourceLoaderImpl(ServletResourceExtension extension)
- {
- servletContexts = extension.getServletContexts();
- }
public InputStream getResourceAsStream(String name)
{
@@ -53,16 +41,6 @@
return stream;
}
}
- String slashedName = getSlashedName(name);
- for (ServletContext context : servletContexts)
- {
- InputStream stream = context.getResourceAsStream(slashedName);
- if (stream != null)
- {
- log.trace("Loaded resource from ServletContext: " + slashedName);
- return stream;
- }
- }
return null;
}
@@ -90,24 +68,6 @@
return url;
}
}
- String slashedName = getSlashedName(name);
- // Try to load from the ServletContext
- for (ServletContext context : servletContexts)
- {
- try
- {
- URL url = context.getResource(slashedName);
- if (url != null)
- {
- log.trace("Loaded resource from ServletContext: " + slashedName);
- return url;
- }
- }
- catch (MalformedURLException e)
- {
- log.error("Malformed URL loading " + name, e);
- }
- }
return null;
}
@@ -150,22 +110,6 @@
throw new RuntimeException(e);
}
}
- String slashedName = getSlashedName(name);
- for (ServletContext context : servletContexts)
- {
- try
- {
- URL url = context.getResource(slashedName);
- if (url != null)
- {
- urls.add(url);
- }
- }
- catch (MalformedURLException e)
- {
- log.error("Malformed URL loading " + name, e);
- }
- }
return urls;
}
@@ -173,10 +117,4 @@
{
return name.startsWith("/") ? name.substring(1) : name;
}
-
- private static String getSlashedName(String name)
- {
- return name.startsWith("/") ? name : "/" + name;
- }
-
}
14 years, 8 months
Weld SVN: r6086 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation.
by weld-commits@lists.jboss.org
Author: marius.bogoevici
Date: 2010-04-09 16:48:36 -0400 (Fri, 09 Apr 2010)
New Revision: 6086
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java
Log:
minor: remove BarDecorator import
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java 2010-04-09 17:50:10 UTC (rev 6085)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java 2010-04-09 20:48:36 UTC (rev 6086)
@@ -17,7 +17,6 @@
package org.jboss.jsr299.tck.tests.decorators.invocation;
import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.tests.decorators.resolution.BarDecorator;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
14 years, 8 months
Weld SVN: r6085 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-04-09 13:50:10 -0400 (Fri, 09 Apr 2010)
New Revision: 6085
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java
Log:
port 6081 to trunk
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java 2010-04-09 13:07:07 UTC (rev 6084)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java 2010-04-09 17:50:10 UTC (rev 6085)
@@ -17,6 +17,7 @@
package org.jboss.jsr299.tck.tests.decorators.invocation;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.decorators.resolution.BarDecorator;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
@@ -55,7 +56,6 @@
@Test
@SpecAssertions({
- @SpecAssertion(section="8.2", id="b"),
@SpecAssertion(section="8.4", id="d"),
@SpecAssertion(section="8.4", id="e"),
@SpecAssertion(section="8.4", id="f"),
14 years, 8 months