[weld-commits] Weld SVN: r4785 - in cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests: definition and 1 other directory.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Sun Nov 8 12:22:25 EST 2009
Author: jharting
Date: 2009-11-08 12:22:25 -0500 (Sun, 08 Nov 2009)
New Revision: 4785
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/definition/
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/definition/ClassWithAroundInvokeMethod.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/definition/DefinitionTest.java
Log:
Added test for interceptor method placed on the target class.
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/definition/ClassWithAroundInvokeMethod.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/definition/ClassWithAroundInvokeMethod.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/definition/ClassWithAroundInvokeMethod.java 2009-11-08 17:22:25 UTC (rev 4785)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.interceptors.tests.definition;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+class ClassWithAroundInvokeMethod
+{
+ public String foo()
+ {
+ return "bar";
+ }
+
+ @AroundInvoke
+ public Object intercept(InvocationContext ctx) throws Exception
+ {
+ return ctx.proceed() + "bar";
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/definition/DefinitionTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/definition/DefinitionTest.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/definition/DefinitionTest.java 2009-11-08 17:22:25 UTC (rev 4785)
@@ -0,0 +1,35 @@
+/*
+ * 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.jsr299.tck.interceptors.tests.definition;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+ at Artifact
+ at SpecVersion(spec = "int", version = "3.1.PFD")
+public class DefinitionTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "1", id= "a")
+ // WELD-276
+ public void testInterceptorMethodDefinedOnTargetClass() {
+ assert getInstanceByType(ClassWithAroundInvokeMethod.class).foo().equals("barbar");
+ }
+}
More information about the weld-commits
mailing list