[weld-commits] Weld SVN: r6755 - core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Thu Jul 22 13:06:40 EDT 2010


Author: marius.bogoevici
Date: 2010-07-22 13:06:40 -0400 (Thu, 22 Jul 2010)
New Revision: 6755

Added:
   core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/SimpleWeldClassTest.java
Modified:
   core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/Attacker.java
   core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/InterceptorsWithHierarchyTest.java
   core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/Player.java
Log:
Fix the TypeSafeResolver so that the equals implementation for Key works correctly. Any Resolvable implementation must now implement their own equals and hashCode.

Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/Attacker.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/Attacker.java	2010-07-22 16:40:17 UTC (rev 6754)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/Attacker.java	2010-07-22 17:06:40 UTC (rev 6755)
@@ -28,6 +28,10 @@
       // do nothing
    }
 
+   public void pass()
+   {
+      
+   }
 
    public Attacker cloneMe()
    {

Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/InterceptorsWithHierarchyTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/InterceptorsWithHierarchyTest.java	2010-07-22 16:40:17 UTC (rev 6754)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/InterceptorsWithHierarchyTest.java	2010-07-22 17:06:40 UTC (rev 6755)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., 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.weld.tests.interceptors.hierarchical;
 
 import org.jboss.testharness.impl.packaging.Artifact;

Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/Player.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/Player.java	2010-07-22 16:40:17 UTC (rev 6754)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/Player.java	2010-07-22 17:06:40 UTC (rev 6755)
@@ -26,6 +26,11 @@
 
    }
 
+   public void receiveInstructions()
+   {
+      
+   }
+
    public Player cloneMe()
    {
       return this;

Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/SimpleWeldClassTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/SimpleWeldClassTest.java	                        (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/hierarchical/SimpleWeldClassTest.java	2010-07-22 17:06:40 UTC (rev 6755)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., 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.weld.tests.interceptors.hierarchical;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.introspector.jlr.WeldClassImpl;
+import org.jboss.weld.metadata.TypeStore;
+import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.jboss.weld.util.Beans;
+import org.testng.annotations.Test;
+
+/**
+ * @author Marius Bogoevici
+ */
+ at Artifact
+public class SimpleWeldClassTest extends AbstractWeldTest
+{
+
+   @Test(groups = "broken")
+   public void testWeldClassForCovariantReturnType()
+   {
+      WeldClass<Attacker> weldClass = WeldClassImpl.of(Attacker.class, new ClassTransformer(new TypeStore()));
+      Collection methods = weldClass.getWeldMethods();
+      assert methods.size() == 4;
+      List<WeldMethod<?,?>> interceptableMethods = Beans.getInterceptableMethods(weldClass);
+      assert methods.size() == 4;
+   }
+
+}



More information about the weld-commits mailing list