[webbeans-commits] Webbeans SVN: r3538 - in ri/trunk: tests/src/test/java/org/jboss/webbeans/test/unit and 1 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Mon Aug 17 13:18:21 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-08-17 13:18:21 -0400 (Mon, 17 Aug 2009)
New Revision: 3538
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/Bean.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/ExampleTest.java
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/WBMethodImpl.java
Log:
WBRI-368
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-08-16 21:38:40 UTC (rev 3537)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-08-17 17:18:21 UTC (rev 3538)
@@ -27,7 +27,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
-import java.util.Set;
import javax.enterprise.inject.spi.AnnotatedParameter;
@@ -258,7 +257,7 @@
public List<AnnotatedParameter<T>> getParameters()
{
- return new ArrayList<AnnotatedParameter<T>>((Set) parameters);
+ return Collections.unmodifiableList((List) parameters);
}
}
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-08-16 21:38:40 UTC (rev 3537)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java 2009-08-17 17:18:21 UTC (rev 3538)
@@ -28,7 +28,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
-import java.util.Set;
import javax.enterprise.inject.spi.AnnotatedParameter;
@@ -229,7 +228,7 @@
public List<AnnotatedParameter<X>> getParameters()
{
- return new ArrayList<AnnotatedParameter<X>>((Set) parameters);
+ return Collections.unmodifiableList((List) parameters);
}
}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/Bean.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/Bean.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/Bean.java 2009-08-17 17:18:21 UTC (rev 3538)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.webbeans.test.unit.annotated;
+
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Bean
+{
+ int field;
+
+ public Bean(int i)
+ {
+
+ }
+
+ public void method(int i)
+ {
+
+ }
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/ExampleTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/ExampleTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/ExampleTest.java 2009-08-17 17:18:21 UTC (rev 3538)
@@ -0,0 +1,63 @@
+package org.jboss.webbeans.test.unit.annotated;
+
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Artifact
+public class ExampleTest extends AbstractWebBeansTest
+{
+ @Test
+ public void testAnnotatedCallableGetParameters() throws Exception
+ {
+ AnnotatedType<Bean> type = getCurrentManager().createAnnotatedType(Bean.class);
+
+ assertNoAnnotations(type);
+
+ Assert.assertEquals(1, type.getConstructors().size());
+ for (AnnotatedConstructor<Bean> ctor : type.getConstructors())
+ {
+ assertNoAnnotations(ctor);
+
+ for (AnnotatedParameter<Bean> param : ctor.getParameters())
+ {
+ assertNoAnnotations(param);
+ }
+ }
+
+ Assert.assertEquals(1, type.getMethods().size());
+ for (AnnotatedMethod<? super Bean> method : type.getMethods())
+ {
+ assertNoAnnotations(method);
+
+ for (AnnotatedParameter<? super Bean> param : method.getParameters())
+ {
+ assertNoAnnotations(param);
+ }
+ }
+
+ Assert.assertEquals(1, type.getFields().size());
+ for (AnnotatedField<? super Bean> field : type.getFields())
+ {
+ assertNoAnnotations(field);
+ }
+ }
+
+ private void assertNoAnnotations(Annotated annotated)
+ {
+ Assert.assertEquals(0, annotated.getAnnotations().size());
+ }
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/ExampleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the weld-commits
mailing list