From 7d46ecb0add39936f9687942a753ed36f5fd9077 Mon Sep 17 00:00:00 2001 From: Pete Muir Date: Fri, 25 Mar 2011 11:13:02 +0000 Subject: [PATCH] WELD-873 test --- .../weld/tests/resolution/ResolutionTest.java | 10 ++ .../jboss/weld/tests/resolution/Wibble.java | 96 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/Wibble.java diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/ResolutionTest.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/ResolutionTest.java index fc4d7d50be8..e8f19c8379b 100644 --- a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/ResolutionTest.java +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/ResolutionTest.java @@ -19,6 +19,7 @@ import static org.jboss.weld.test.Utils.getReference; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import java.lang.annotation.Annotation; @@ -52,6 +53,8 @@ public static Archive deploy() @Inject private BeanManagerImpl beanManager; + @Inject Wibble wibble; + @Test // WELD-711 public void testResolveWithAnonymousAnnotationLiteral() throws Exception @@ -62,4 +65,11 @@ public void testResolveWithAnonymousAnnotationLiteral() throws Exception assertFalse(resolver.isCached(new ResolvableBuilder().addType(Foo.class).addQualifier(defaultQualifier).create())); } + // WELD-873 + @Test + public void testImplementsParameterizedType() + { + assertNull(wibble.get("bleh")); + } + } diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/Wibble.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/Wibble.java new file mode 100644 index 00000000000..05ffe92ecb5 --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/Wibble.java @@ -0,0 +1,96 @@ +package org.jboss.weld.tests.resolution; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Map; +import java.util.ResourceBundle; +import java.util.Set; + +import javax.enterprise.context.RequestScoped; +import javax.enterprise.inject.spi.BeanManager; +import javax.inject.Inject; +import javax.inject.Named; + +@RequestScoped +@Named +public class Wibble implements Map, Serializable +{ + @Inject + BeanManager beanManager; + + public int size() + { + // TODO Auto-generated method stub + return 0; + } + + public boolean isEmpty() + { + // TODO Auto-generated method stub + return false; + } + + public boolean containsKey(Object key) + { + // TODO Auto-generated method stub + return false; + } + + public boolean containsValue(Object value) + { + // TODO Auto-generated method stub + return false; + } + + public ResourceBundle get(Object key) + { + if (beanManager == null) + { + throw new NullPointerException(); + } + return null; + } + + public ResourceBundle put(String key, ResourceBundle value) + { + // TODO Auto-generated method stub + return null; + } + + public ResourceBundle remove(Object key) + { + // TODO Auto-generated method stub + return null; + } + + public void putAll(Map m) + { + // TODO Auto-generated method stub + + } + + public void clear() + { + // TODO Auto-generated method stub + + } + + public Set keySet() + { + // TODO Auto-generated method stub + return null; + } + + public Collection values() + { + // TODO Auto-generated method stub + return null; + } + + public Set> entrySet() + { + // TODO Auto-generated method stub + return null; + } + +}