[webbeans-commits] Webbeans SVN: r3368 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-30 08:53:39 -0400 (Thu, 30 Jul 2009)
New Revision: 3368
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/InjectionIntoWebServiceEndPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/IsSheepInjected.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/IsSheepInjectedResponse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/ObjectFactory.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/Sheep.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWS.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPoint.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPointService.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/package-info.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/web.xml
Log:
Added test for dependency injection into non-contextual instance of JAX-WS endpoint.
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/InjectionIntoWebServiceEndPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/InjectionIntoWebServiceEndPointTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/InjectionIntoWebServiceEndPointTest.java 2009-07-30 12:53:39 UTC (rev 3368)
@@ -0,0 +1,47 @@
+/*
+ * 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.tests.lookup.injection.non.contextual.ws;
+
+import javax.xml.ws.WebServiceRef;
+
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest(runLocally = true)
+@Resource(destination = WarArtifactDescriptor.WEB_XML_DESTINATION, source = "web.xml")
+@SpecVersion("20090625")
+public class InjectionIntoWebServiceEndPointTest extends AbstractJSR299Test
+{
+ @WebServiceRef(wsdlLocation = "http://localhost:8080/org.jboss.jsr299.tck.tests.lookup.injection.non.con...")
+ SheepWSEndPointService service;
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "5.6", id = "e")
+ public void testInjectionIntoWebServiceEndpoint() throws Exception
+ {
+ service = new SheepWSEndPointService();
+ SheepWS ws = service.getSheepWSPort();
+ assert ws.isSheepInjected();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/IsSheepInjected.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/IsSheepInjected.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/IsSheepInjected.java 2009-07-30 12:53:39 UTC (rev 3368)
@@ -0,0 +1,13 @@
+
+package org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isSheepInjected")
+public class IsSheepInjected {
+
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/IsSheepInjectedResponse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/IsSheepInjectedResponse.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/IsSheepInjectedResponse.java 2009-07-30 12:53:39 UTC (rev 3368)
@@ -0,0 +1,25 @@
+
+package org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isSheepInjectedResponse", propOrder = {
+ "_return"
+})
+public class IsSheepInjectedResponse {
+
+ @XmlElement(name = "return")
+ protected boolean _return;
+
+ public boolean isReturn() {
+ return _return;
+ }
+
+ public void setReturn(boolean value) {
+ this._return = value;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/ObjectFactory.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/ObjectFactory.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/ObjectFactory.java 2009-07-30 12:53:39 UTC (rev 3368)
@@ -0,0 +1,35 @@
+
+package org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _IsSheepInjected_QNAME = new QName("http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/", "isSheepInjected");
+ private final static QName _IsSheepInjectedResponse_QNAME = new QName("http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/", "isSheepInjectedResponse");
+
+ public ObjectFactory() {
+ }
+
+ public IsSheepInjected createIsSheepInjected() {
+ return new IsSheepInjected();
+ }
+
+ public IsSheepInjectedResponse createIsSheepInjectedResponse() {
+ return new IsSheepInjectedResponse();
+ }
+
+ @XmlElementDecl(namespace = "http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/", name = "isSheepInjected")
+ public JAXBElement<IsSheepInjected> createIsSheepInjected(IsSheepInjected value) {
+ return new JAXBElement<IsSheepInjected>(_IsSheepInjected_QNAME, IsSheepInjected.class, null, value);
+ }
+
+ @XmlElementDecl(namespace = "http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/", name = "isSheepInjectedResponse")
+ public JAXBElement<IsSheepInjectedResponse> createIsSheepInjectedResponse(IsSheepInjectedResponse value) {
+ return new JAXBElement<IsSheepInjectedResponse>(_IsSheepInjectedResponse_QNAME, IsSheepInjectedResponse.class, null, value);
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/Sheep.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/Sheep.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/Sheep.java 2009-07-30 12:53:39 UTC (rev 3368)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws;
+
+public class Sheep
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWS.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWS.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWS.java 2009-07-30 12:53:39 UTC (rev 3368)
@@ -0,0 +1,30 @@
+
+package org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws;
+
+import javax.jws.WebMethod;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.6 in JDK 6
+ * Generated source version: 2.1
+ *
+ */
+@WebService(name = "SheepWS", targetNamespace = "http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/")
+@XmlSeeAlso({
+ ObjectFactory.class
+})
+public interface SheepWS {
+
+ @WebMethod
+ @WebResult(targetNamespace = "")
+ @RequestWrapper(localName = "isSheepInjected", targetNamespace = "http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/", className = "org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.IsSheepInjected")
+ @ResponseWrapper(localName = "isSheepInjectedResponse", targetNamespace = "http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/", className = "org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.IsSheepInjectedResponse")
+ public boolean isSheepInjected();
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPoint.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPoint.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPoint.java 2009-07-30 12:53:39 UTC (rev 3368)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws;
+
+import javax.enterprise.inject.Current;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService(name="SheepWS")
+public class SheepWSEndPoint
+{
+ @Current
+ private Sheep sheep;
+
+ @WebMethod
+ public boolean isSheepInjected() {
+ return (sheep != null);
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPointService.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPointService.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPointService.java 2009-07-30 12:53:39 UTC (rev 3368)
@@ -0,0 +1,58 @@
+
+package org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.6 in JDK 6
+ * Generated source version: 2.1
+ *
+ */
+@WebServiceClient(name = "SheepWSEndPointService", targetNamespace = "http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/", wsdlLocation = "http://localhost:8080/org.jboss.jsr299.tck.tests.lookup.injection.non.con...")
+public class SheepWSEndPointService
+ extends Service
+{
+
+ private final static URL SHEEPWSENDPOINTSERVICE_WSDL_LOCATION;
+ private final static Logger logger = Logger.getLogger(org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.SheepWSEndPointService.class.getName());
+
+ static {
+ URL url = null;
+ try {
+ URL baseUrl;
+ baseUrl = org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.SheepWSEndPointService.class.getResource(".");
+ url = new URL(baseUrl, "http://localhost:8080/org.jboss.jsr299.tck.tests.lookup.injection.non.con...");
+ } catch (MalformedURLException e) {
+ logger.warning("Failed to create URL for the wsdl Location: 'http://localhost:8080/org.jboss.jsr299.tck.tests.lookup.injection.non.con...', retrying as a local file");
+ logger.warning(e.getMessage());
+ }
+ SHEEPWSENDPOINTSERVICE_WSDL_LOCATION = url;
+ }
+
+ public SheepWSEndPointService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public SheepWSEndPointService() {
+ super(SHEEPWSENDPOINTSERVICE_WSDL_LOCATION, new QName("http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/", "SheepWSEndPointService"));
+ }
+
+ @WebEndpoint(name = "SheepWSPort")
+ public SheepWS getSheepWSPort() {
+ return super.getPort(new QName("http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/", "SheepWSPort"), SheepWS.class);
+ }
+
+ @WebEndpoint(name = "SheepWSPort")
+ public SheepWS getSheepWSPort(WebServiceFeature... features) {
+ return super.getPort(new QName("http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/", "SheepWSPort"), SheepWS.class, features);
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/package-info.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/package-info.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/package-info.java 2009-07-30 12:53:39 UTC (rev 3368)
@@ -0,0 +1,2 @@
+(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://ws.contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/")
+package org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws;
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/web.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/web.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/web.xml 2009-07-30 12:53:39 UTC (rev 3368)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <display-name>Dependency Injection Test</display-name>
+ <servlet>
+ <servlet-name>TestWebService</servlet-name>
+ <servlet-class>org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.SheepWSEndPoint</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet>
+ <servlet-name>JBoss Test Harness Test Runner</servlet-name>
+ <servlet-class>org.jboss.testharness.impl.runner.servlet.ServletTestRunner</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestWebService</servlet-name>
+ <url-pattern>/TestWebService</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>JBoss Test Harness Test Runner</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+</web-app>
15 years, 3 months
[webbeans-commits] Webbeans SVN: r3367 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/context/passivating/broken19 and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-07-30 07:46:25 -0400 (Thu, 30 Jul 2009)
New Revision: 3367
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Record.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/RecordProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/Broken_Record.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/RecordProducer.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
passivation tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-30 11:14:38 UTC (rev 3366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-30 11:46:25 UTC (rev 3367)
@@ -55,6 +55,14 @@
assert !beans.isEmpty();
}
+ @Test(groups = { "contexts", "passivation" })
+ @SpecAssertion(section = "6.6.1", id = "ca")
+ public void testPassivationCapableProducerMethodIsOK()
+ {
+ Set<Bean<Record>> beans = getBeans(Record.class);
+ assert !beans.isEmpty();
+ }
+
@Test @SpecAssertion(section="6.6.2", id = "c")
public void testInjectionOfDependentPrimitiveProductIntoNormalBean()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Record.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Record.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Record.java 2009-07-30 11:46:25 UTC (rev 3367)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+@SuppressWarnings("serial")
+class Record implements Serializable
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/RecordProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/RecordProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/RecordProducer.java 2009-07-30 11:46:25 UTC (rev 3367)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Produces;
+
+public class RecordProducer
+{
+ public @Produces @SessionScoped Record getRecord()
+ {
+ return new Record();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/Broken_Record.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/Broken_Record.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/Broken_Record.java 2009-07-30 11:46:25 UTC (rev 3367)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken19;
+
+class Broken_Record
+{
+ public Broken_Record(String foo) {}
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java 2009-07-30 11:46:25 UTC (rev 3367)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken19;
+
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Shane Bryzak
+ */
+@Artifact
+(a)Packaging(PackagingType.EAR)
+@SpecVersion("20090625")
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class NonPassivationCapableProducerMethodTest
+{
+ @Test(groups = { "passivation", "ri-broken" })
+ @SpecAssertion(section = "6.6.1", id = "cb")
+ public void testNonPassivationCapableProducerMethodNotOk()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/RecordProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/RecordProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/RecordProducer.java 2009-07-30 11:46:25 UTC (rev 3367)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken19;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Produces;
+
+class RecordProducer
+{
+ public final @Produces @SessionScoped Broken_Record getRecord()
+ {
+ return new Broken_Record(null);
+ }
+}
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-30 11:14:38 UTC (rev 3366)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-30 11:46:25 UTC (rev 3367)
@@ -2708,23 +2708,31 @@
<text>Tests with a serializable decorator.</text>
</assertion>
</group>
-
- <assertion id="ca">
- <text>A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. _A producer method with a return type that implements or extends serializable is passivation capable_. A producer method with a return type that is declared final and does not implement |Serializable| is not passivation capable.</text>
- </assertion>
+
+ <group>
+ <text>A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. A producer method with a return type that implements or extends serializable is passivation capable. A producer method with a return type that is declared final and does not implement |Serializable| is not passivation capable.</text>
+
+ <assertion id="ca">
+ <text>Test that a producer method with a serializable return type is passivation capable.</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>Test that a producer method with a final, non-serializable return type is not passivation capable.</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. A producer field with a type that implements or extends |Serializable| is passivation capable. A producer field with a type that is declared |final| and does not implement |Serializable| is not passivation capable.</text>
- <assertion id="cb">
- <text>A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. A producer method with a return type that implements or extends serializable is passivation capable. _A producer method with a return type that is declared final and does not implement |Serializable| is not passivation capable._</text>
- </assertion>
+ <assertion id="da">
+ <text>Test that a producer field with a serializable type is passivation capable.</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>Test that a producer field with a final, non-serializable type is not passivation capable.</text>
+ </assertion>
+ </group>
- <assertion id="da">
- <text>A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. _A producer field with a type that implements or extends |Serializable| is passivation capable._ A producer field with a type that is declared |final| and does not implement |Serializable| is not passivation capable.</text>
- </assertion>
-
- <assertion id="db">
- <text>A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. A producer field with a type that implements or extends |Serializable| is passivation capable. _A producer field with a type that is declared |final| and does not implement |Serializable| is not passivation capable._</text>
- </assertion>
-
<assertion id="ea">
<text>A custom implementation of Bean is passivation capable if it implements the interface |PassivationCapable|.</text>
</assertion>
15 years, 3 months
[webbeans-commits] Webbeans SVN: r3366 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: injection and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-30 07:14:38 -0400 (Thu, 30 Jul 2009)
New Revision: 3366
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java
Log:
Remove unneeded annotationStore from API
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-07-30 09:57:25 UTC (rev 3365)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-07-30 11:14:38 UTC (rev 3366)
@@ -66,6 +66,6 @@
public static TransactionPhase getTransactionalPhase(WBMethod<?> observer)
{
WBParameter<?> parameter = observer.getAnnotatedParameters(Observes.class).iterator().next();
- return parameter.getAnnotationStore().getAnnotation(Observes.class).during();
+ return parameter.getAnnotation(Observes.class).during();
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-07-30 09:57:25 UTC (rev 3365)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-07-30 11:14:38 UTC (rev 3366)
@@ -68,7 +68,7 @@
public Set<Annotation> getBindings()
{
- return delegate().getAnnotationStore().getBindings();
+ return delegate().getBindings();
}
public void inject(Object declaringInstance, BeanManagerImpl manager, CreationalContext<?> creationalContext)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java 2009-07-30 09:57:25 UTC (rev 3365)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java 2009-07-30 11:14:38 UTC (rev 3366)
@@ -110,11 +110,6 @@
protected abstract WBAnnotated<T, S> delegate();
- public AnnotationStore getAnnotationStore()
- {
- return delegate().getAnnotationStore();
- }
-
public boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationType)
{
return delegate().isDeclaredAnnotationPresent(annotationType);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java 2009-07-30 09:57:25 UTC (rev 3365)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java 2009-07-30 11:14:38 UTC (rev 3366)
@@ -185,8 +185,6 @@
*/
public String getName();
- public AnnotationStore getAnnotationStore();
-
public boolean isParameterizedType();
}
\ No newline at end of file
15 years, 3 months
[webbeans-commits] Webbeans SVN: r3365 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-30 05:57:25 -0400 (Thu, 30 Jul 2009)
New Revision: 3365
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AdvancedPaymentProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousPaymentProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInstanceBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/RemotePaymentProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousPaymentProcessor.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Asynchronous.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ChequePaymentProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Farm.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBindingAnnotation.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInjectionPointBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Sheep.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Synchronous.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousChequePaymentProcessor.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/PaymentProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SimplePaymentProcessor.java
Log:
Rewritten tests for dynamic lookup
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AdvancedPaymentProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AdvancedPaymentProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AdvancedPaymentProcessor.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import org.jboss.jsr299.tck.tests.lookup.dynamic.PayBy.PaymentMethod;
+
+(a)PayBy(PaymentMethod.CHEQUE)
+@ApplicationScoped
+class AdvancedPaymentProcessor implements AsynchronousPaymentProcessor
+{
+ private int value = 0;
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public void setValue(int value)
+ {
+ this.value = value;
+ }
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Asynchronous.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Asynchronous.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Asynchronous.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,19 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.BindingType;
-
-@Target( { TYPE, METHOD, PARAMETER })
-@Retention(RUNTIME)
-@Documented
-@BindingType
-@interface Asynchronous {
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousBinding.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousBinding.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import javax.enterprise.inject.AnnotationLiteral;
-
-class AsynchronousBinding extends AnnotationLiteral<Asynchronous> implements Asynchronous {
-}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousPaymentProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousPaymentProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/AsynchronousPaymentProcessor.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+interface AsynchronousPaymentProcessor extends PaymentProcessor
+{
+ int getValue();
+ void setValue(int value);
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ChequePaymentProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ChequePaymentProcessor.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ChequePaymentProcessor.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import static org.jboss.jsr299.tck.tests.lookup.dynamic.PayBy.PaymentMethod.CHEQUE;
-
-@PayBy(CHEQUE)
-class ChequePaymentProcessor implements PaymentProcessor
-{
- public void process()
- {
-
- }
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -17,7 +17,10 @@
package org.jboss.jsr299.tck.tests.lookup.dynamic;
+import java.util.Iterator;
+
import javax.enterprise.inject.AmbiguousResolutionException;
+import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.UnsatisfiedResolutionException;
@@ -25,6 +28,8 @@
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyLiteral;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -44,30 +49,17 @@
})
public void testObtainsInjectsInstanceOfInstance()
{
- ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
- assert injectionPoint.getPaymentProcessor() instanceof Instance;
+ ObtainsInstanceBean injectionPoint = getInstanceByType(ObtainsInstanceBean.class);
+ assert injectionPoint.getPaymentProcessor() != null;
}
- @Test(groups = {"ri-broken"})
- @SpecAssertions({
- @SpecAssertion(section = "5.7", id ="ba"),
- @SpecAssertion(section = "5.7", id ="ca"),
- @SpecAssertion(section = "5.7.1", id ="ab")
- })
- // WBRI-307
- public void testDynamicLookup()
- {
- ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
- assert injectionPoint.getPaymentProcessor().select(new SynchronousBinding()).get() instanceof SynchronousChequePaymentProcessor;
- }
-
@Test(groups = "ri-broken", expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = "5.7.1", id ="da")
// WBRI-307
public void testDuplicateBindingsThrowsException()
{
- ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
- injectionPoint.getPaymentProcessor().select(new SynchronousBinding(), new SynchronousBinding());
+ ObtainsInstanceBean injectionPoint = getInstanceByType(ObtainsInstanceBean.class);
+ injectionPoint.getAnyPaymentProcessor().select(new CurrentLiteral(), new CurrentLiteral());
}
@Test(groups = "ri-broken", expectedExceptions = IllegalArgumentException.class)
@@ -75,54 +67,108 @@
// WBRI-307
public void testNonBindingThrowsException()
{
- ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
- injectionPoint.getPaymentProcessor().select(new NonBinding());
+ ObtainsInstanceBean injectionPoint = getInstanceByType(ObtainsInstanceBean.class);
+ injectionPoint.getAnyPaymentProcessor().select(new AnnotationLiteral<NonBinding>(){});
}
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "5.7", id="ba"),
+ @SpecAssertion(section = "5.7", id ="ca"),
+ @SpecAssertion(section = "5.7.1", id ="aa"),
+ @SpecAssertion(section = "5.7.1", id ="ab"),
+ @SpecAssertion(section = "5.7.1", id="fa"),
+ @SpecAssertion(section = "5.7.1", id="fc")
+ })
+ public void testGetMethod() {
+ // initial setup of contextual instance
+ getInstanceByType(AdvancedPaymentProcessor.class, new AnyLiteral()).setValue(10);
+
+ Instance<AsynchronousPaymentProcessor> instance = getInstanceByType(ObtainsInstanceBean.class).getPaymentProcessor();
+ assert instance.get() instanceof AdvancedPaymentProcessor;
+ assert instance.get().getValue() == 10;
+ }
+
@Test(groups = "ri-broken", expectedExceptions = UnsatisfiedResolutionException.class)
- @SpecAssertions({
- @SpecAssertion(section = "5.7.1", id = "fb"),
- @SpecAssertion(section = "5.7.1", id = "l")})
+ @SpecAssertion(section = "5.7.1", id = "fba")
// WBRI-307
public void testUnsatisfiedDependencyThrowsException()
{
- ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
- assert !injectionPoint.getPaymentProcessor().isUnsatisfied();
-
- Instance<PaymentProcessor> instance = injectionPoint.getPaymentProcessor().select(new AsynchronousBinding());
- assert instance.isUnsatisfied();
-
- instance.get();
+ getInstanceByType(ObtainsInstanceBean.class).getPaymentProcessor().select(AdvancedPaymentProcessor.class).get();
}
@Test(expectedExceptions = AmbiguousResolutionException.class)
- @SpecAssertion(section = "5.7.1", id = "fb")
+ @SpecAssertion(section = "5.7.1", id = "fbb")
public void testAmbiguousDependencyThrowsException()
{
- ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
- injectionPoint.getPaymentProcessor().get();
+ getInstanceByType(ObtainsInstanceBean.class).getAnyPaymentProcessor().get();
}
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section="5.7.1", id="aa"),
+ @SpecAssertion(section="5.7.1", id="ba"),
+ @SpecAssertion(section="5.7.1", id="ja"),
+ @SpecAssertion(section="5.7.1", id="ka")
+ })
+ // WBRI-307
+ public void testIteratorMethod() {
+ // initial setup of contextual instances
+ getInstanceByType(AdvancedPaymentProcessor.class, new AnyLiteral()).setValue(1);
+ getInstanceByType(RemotePaymentProcessor.class, new AnyLiteral()).setValue(2);
+
+ Instance<PaymentProcessor> instance = getInstanceByType(ObtainsInstanceBean.class).getAnyPaymentProcessor();
+ Iterator<AsynchronousPaymentProcessor> iterator1 = instance.select(AsynchronousPaymentProcessor.class).iterator();
+
+ AdvancedPaymentProcessor advanced = null;
+ RemotePaymentProcessor remote = null;
+ int instances = 0;
+ for (AsynchronousPaymentProcessor processor = iterator1.next(); iterator1.hasNext(); processor = iterator1.next()) {
+ if (processor instanceof AdvancedPaymentProcessor) {
+ advanced = (AdvancedPaymentProcessor) processor;
+ } else if (processor instanceof RemotePaymentProcessor) {
+ remote = (RemotePaymentProcessor) processor;
+ } else {
+ throw new RuntimeException("Unexpected instance returned by iterator.");
+ }
+ instances++;
+ }
+
+ assert instances == 2;
+ assert (advanced != null) && (advanced.getValue() == 1);
+ assert (remote != null) && (remote.getValue() == 2);
+
+ Iterator<RemotePaymentProcessor> iterator2 = instance.select(RemotePaymentProcessor.class, new PayByBinding()
+ {
+ public PaymentMethod value()
+ {
+ return PaymentMethod.CHEQUE;
+ }
+ }).iterator();
+
+ assert iterator2.next().getValue() == 2;
+ assert !iterator2.hasNext();
+ }
+
@Test(groups= "ri-broken")
- @SpecAssertion(section = "5.7.1", id = "m")
+ @SpecAssertion(section = "5.7.1", id = "l")
// WBRI-307
- public void testIsAmbiguous()
- {
- ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
- assert injectionPoint.getPaymentProcessor().isAmbiguous();
- Instance<PaymentProcessor> instance = injectionPoint.getPaymentProcessor().select(new SynchronousBinding());
- assert !instance.isAmbiguous();
+ public void testIsUnsatisfied() {
+ ObtainsInstanceBean injectionPoint = getInstanceByType(ObtainsInstanceBean.class);
+ assert !injectionPoint.getAnyPaymentProcessor().isUnsatisfied();
+ assert injectionPoint.getPaymentProcessor().select(AdvancedPaymentProcessor.class).isUnsatisfied();
}
- @Test
+ @Test(groups= "ri-broken")
@SpecAssertions({
- @SpecAssertion(section="5.7", id="ba"),
- @SpecAssertion(section="5.7", id="da"),
- @SpecAssertion(section="5.7.1", id="fc")})
- public void testGetMethodReturnsContextualReference() {
- Sheep sheep = getInstanceByType(Sheep.class);
- sheep.setAge(10);
- Farm farm = getInstanceByType(Farm.class);
- assert farm.getSheep().get().getAge() == sheep.getAge();
+ @SpecAssertion(section = "5.7", id = "da"),
+ @SpecAssertion(section = "5.7.1", id = "m")
+ })
+ // WBRI-307
+ public void testIsAmbiguous()
+ {
+ ObtainsInstanceBean injectionPoint = getInstanceByType(ObtainsInstanceBean.class);
+ assert injectionPoint.getAnyPaymentProcessor().isAmbiguous();
+ assert !injectionPoint.getPaymentProcessor().isAmbiguous();
}
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Farm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Farm.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Farm.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-
-class Farm
-{
- @Any private Instance<Sheep> sheep;
-
- public Instance<Sheep> getSheep()
- {
- return sheep;
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBinding.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBinding.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import javax.enterprise.inject.AnnotationLiteral;
-
-class NonBinding extends AnnotationLiteral<NonBindingAnnotation> implements NonBindingAnnotation
-{
-
-}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBinding.java (from rev 3345, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBindingAnnotation.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBinding.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@interface NonBinding
+{
+
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBindingAnnotation.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBindingAnnotation.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/NonBindingAnnotation.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,19 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-@Target( { TYPE, METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@interface NonBindingAnnotation
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInjectionPointBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInjectionPointBean.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInjectionPointBean.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,15 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import static org.jboss.jsr299.tck.tests.lookup.dynamic.PayBy.PaymentMethod.CHEQUE;
-
-import javax.enterprise.inject.Instance;
-
-class ObtainsInjectionPointBean
-{
- @PayBy(CHEQUE) Instance<PaymentProcessor> paymentProcessor;
-
- public Instance<PaymentProcessor> getPaymentProcessor()
- {
- return paymentProcessor;
- }
-}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInstanceBean.java (from rev 3345, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInjectionPointBean.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInstanceBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInstanceBean.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+import static org.jboss.jsr299.tck.tests.lookup.dynamic.PayBy.PaymentMethod.CHEQUE;
+
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+
+class ObtainsInstanceBean
+{
+ @PayBy(CHEQUE) Instance<AsynchronousPaymentProcessor> paymentProcessor;
+ @Any Instance<PaymentProcessor> anyPaymentProcessor;
+
+ public Instance<AsynchronousPaymentProcessor> getPaymentProcessor()
+ {
+ return paymentProcessor;
+ }
+
+ public Instance<PaymentProcessor> getAnyPaymentProcessor()
+ {
+ return anyPaymentProcessor;
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/PaymentProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/PaymentProcessor.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/PaymentProcessor.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -2,5 +2,4 @@
interface PaymentProcessor
{
- void process();
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/RemotePaymentProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/RemotePaymentProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/RemotePaymentProcessor.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+class RemotePaymentProcessor implements AsynchronousPaymentProcessor
+{
+ private int value = 0;
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public void setValue(int value)
+ {
+ this.value = value;
+ }
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Sheep.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Sheep.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Sheep.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,19 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import javax.enterprise.context.RequestScoped;
-
-@RequestScoped
-class Sheep
-{
- private int age = 0;
-
- public int getAge()
- {
- return age;
- }
-
- public void setAge(int age)
- {
- this.age = age;
- }
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SimplePaymentProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SimplePaymentProcessor.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SimplePaymentProcessor.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,11 +1,11 @@
package org.jboss.jsr299.tck.tests.lookup.dynamic;
-class SimplePaymentProcessor implements PaymentProcessor
-{
+import javax.enterprise.context.ApplicationScoped;
- public void process()
- {
-
- }
+import org.jboss.jsr299.tck.tests.lookup.dynamic.PayBy.PaymentMethod;
+(a)PayBy(PaymentMethod.CASH)
+@ApplicationScoped
+class SimplePaymentProcessor implements SynchronousPaymentProcessor
+{
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Synchronous.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Synchronous.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/Synchronous.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,19 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.BindingType;
-
-@Target( { TYPE, METHOD, PARAMETER })
-@Retention(RUNTIME)
-@Documented
-@BindingType
-@interface Synchronous {
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousBinding.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousBinding.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,7 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import javax.enterprise.inject.AnnotationLiteral;
-
-public class SynchronousBinding extends AnnotationLiteral<Synchronous> implements Synchronous{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousChequePaymentProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousChequePaymentProcessor.java 2009-07-30 09:24:30 UTC (rev 3364)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousChequePaymentProcessor.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dynamic;
-
-import static org.jboss.jsr299.tck.tests.lookup.dynamic.PayBy.PaymentMethod.CHEQUE;
-
-@PayBy(CHEQUE) @Synchronous
-class SynchronousChequePaymentProcessor implements PaymentProcessor
-{
- public void process()
- {
-
- }
-}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousPaymentProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousPaymentProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/SynchronousPaymentProcessor.java 2009-07-30 09:57:25 UTC (rev 3365)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.lookup.dynamic;
+
+interface SynchronousPaymentProcessor extends PaymentProcessor
+{
+}
15 years, 3 months
[webbeans-commits] Webbeans SVN: r3364 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-30 05:24:30 -0400 (Thu, 30 Jul 2009)
New Revision: 3364
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
Log:
Minor
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-07-30 09:09:00 UTC (rev 3363)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-07-30 09:24:30 UTC (rev 3364)
@@ -33,7 +33,7 @@
{
@Test(groups="ri-broken")
- @SpecAssertion(section="2.5", id="a")
+ @SpecAssertion(section="5.8", id="c")
//WBRI-322
public void testQualifiedNameLookup()
{
15 years, 3 months
[webbeans-commits] Webbeans SVN: r3363 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean: custom and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-30 05:09:00 -0400 (Thu, 30 Jul 2009)
New Revision: 3363
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CustomBeanImplementationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/House.java
Log:
Added tests for a custom implementation of Bean interface
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/Cat.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/Cat.java 2009-07-30 09:09:00 UTC (rev 3363)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.definition.bean.custom;
+
+class Cat
+{
+
+ @SuppressWarnings("unused")
+ private String name;
+
+ public Cat(String name)
+ {
+ this.name = name;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java 2009-07-30 09:09:00 UTC (rev 3363)
@@ -0,0 +1,168 @@
+package org.jboss.jsr299.tck.tests.definition.bean.custom;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
+
+class CatBean implements Bean<Cat>
+{
+ public static final CatBean bean = new CatBean();
+
+ private boolean getBindingsCalled = false;
+ private boolean getInjectionPointsCalled = false;
+ private boolean getNameCalled = false;
+ private boolean getScopeTypeCalled = false;
+ private boolean getTypesCalled = false;
+ private boolean isPolicyCalled = false;
+ private boolean isSerializableCalled = false;
+ private boolean isNullableCalled = false;
+ private boolean isGetBeanClassCalled = false;
+ private boolean getStereotypesCalled = false;
+
+
+ @SuppressWarnings("serial")
+ public Set<Annotation> getBindings()
+ {
+ getBindingsCalled = true;
+ return new HashSet<Annotation>(){{ add(new CurrentLiteral());}};
+ }
+
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return Production.class;
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ getInjectionPointsCalled = true;
+ return new HashSet<InjectionPoint>();
+ }
+
+ public String getName()
+ {
+ getNameCalled = true;
+ return "cat";
+ }
+
+ public Set<Class<? extends Annotation>> getStereotypes() {
+ getStereotypesCalled = true;
+ return new HashSet<Class<? extends Annotation>>();
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ getScopeTypeCalled = true;
+ return Dependent.class;
+ }
+
+ @SuppressWarnings("serial")
+ public Set<Type> getTypes()
+ {
+ getTypesCalled = true;
+ return new HashSet<Type>() {{ add(Cat.class); add(Object.class); }};
+ }
+
+ public boolean isNullable()
+ {
+ isNullableCalled = true;
+ return false;
+ }
+
+ public boolean isSerializable()
+ {
+ isSerializableCalled = true;
+ return false;
+ }
+
+ public Class<?> getBeanClass()
+ {
+ isGetBeanClassCalled = true;
+ return Cat.class;
+ }
+
+ public boolean isPolicy()
+ {
+ isPolicyCalled = true;
+ return false;
+ }
+
+ public Cat create(CreationalContext<Cat> creationalContext)
+ {
+ return new Cat("kitty");
+ }
+
+ public void destroy(Cat instance, CreationalContext<Cat> creationalContext)
+ {
+ creationalContext.release();
+ }
+
+ public boolean isGetBindingsCalled()
+ {
+ return getBindingsCalled;
+ }
+
+ public boolean isGetInjectionPointsCalled()
+ {
+ return getInjectionPointsCalled;
+ }
+
+ public boolean isGetNameCalled()
+ {
+ return getNameCalled;
+ }
+
+ public boolean isGetScopeTypeCalled()
+ {
+ return getScopeTypeCalled;
+ }
+
+ public boolean isGetTypesCalled()
+ {
+ return getTypesCalled;
+ }
+
+ public boolean isPolicyCalled()
+ {
+ return isPolicyCalled;
+ }
+
+ public boolean isSerializableCalled()
+ {
+ return isSerializableCalled;
+ }
+
+ public boolean isNullableCalled()
+ {
+ return isNullableCalled;
+ }
+
+ public static CatBean getBean()
+ {
+ return bean;
+ }
+
+ public boolean isGetBeanClassCalled()
+ {
+ return isGetBeanClassCalled;
+ }
+
+ public boolean isGetStereotypesCalled()
+ {
+ return getStereotypesCalled;
+ }
+
+ public void afterDiscovery(@Observes AfterBeanDiscovery event) {
+ event.addBean(bean);
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CustomBeanImplementationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CustomBeanImplementationTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CustomBeanImplementationTest.java 2009-07-30 09:09:00 UTC (rev 3363)
@@ -0,0 +1,92 @@
+/*
+ * 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.tests.definition.bean.custom;
+
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+@Artifact
+@SpecVersion("20090625")
+// TODO declare injection point on Cat and verify remaining assertions
+public class CustomBeanImplementationTest extends AbstractJSR299Test
+{
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section="5.1", id="b"),
+ @SpecAssertion(section="5.2", id="k")
+ })
+ //WBRI-328
+ public void testGetBeanClassCalled() {
+ assert CatBean.bean.isGetBeanClassCalled();
+ }
+
+ @Test(groups={"ri-broken"})
+ @SpecAssertion(section="5.2", id="k")
+ //WBRI-328
+ public void testGetStereotypesCalled() {
+ assert CatBean.bean.isGetStereotypesCalled();
+ }
+
+ @Test(groups={"ri-broken"})
+ @SpecAssertion(section="5.2", id="k")
+ //WBRI-328
+ public void testIsPolicyCalled() {
+ assert CatBean.bean.isPolicyCalled();
+ }
+
+ @Test
+ @SpecAssertion(section="5.3", id="na")
+ public void testGetTypesCalled() {
+ assert CatBean.bean.isGetTypesCalled();
+ }
+
+ @Test
+ @SpecAssertion(section="5.3", id="nb")
+ public void testGetBindingsCalled() {
+ assert CatBean.bean.isGetBindingsCalled();
+ }
+
+ @Test
+ @SpecAssertion(section="5.3.1", id="b")
+ public void testGetInjectionPointsCalled() {
+ assert CatBean.bean.isGetInjectionPointsCalled();
+ }
+
+ @Test(groups={"ri-broken"})
+ @SpecAssertion(section="5.3.4", id="ba")
+ //WBRI-328
+ public void testIsNullableCalled() {
+ assert CatBean.bean.isNullableCalled();
+ }
+
+ @Test
+ @SpecAssertion(section="5.4", id="e")
+ public void testGetNameCalled() {
+ assert CatBean.bean.isGetNameCalled();
+ }
+
+ @Test
+ @SpecAssertion(section="6.5.2", id="e")
+ public void testGetScopeTypeCalled() {
+ assert CatBean.bean.isGetScopeTypeCalled();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/House.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/House.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/House.java 2009-07-30 09:09:00 UTC (rev 3363)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.bean.custom;
+
+import javax.enterprise.inject.Current;
+
+class House
+{
+ @SuppressWarnings("unused")
+ @Current private Cat cat;
+}
15 years, 3 months
[webbeans-commits] Webbeans SVN: r3362 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-30 04:57:27 -0400 (Thu, 30 Jul 2009)
New Revision: 3362
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/InjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/IntegerProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Mustard.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Other.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Small.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/nonContextual/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/nonContextual/servlet/
Log:
Cleanup
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java 2009-07-30 08:35:45 UTC (rev 3361)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java 2009-07-30 08:57:27 UTC (rev 3362)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-import javax.enterprise.inject.Current;
-
-
-class BrokenInjectedBean
-{
- public @Current Mustard mustard;
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-07-30 08:35:45 UTC (rev 3361)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-07-30 08:57:27 UTC (rev 3362)
@@ -1,179 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.spi.Annotated;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.InjectionPoint;
-
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.ForwardingBean;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
-
-/**
- * Tests for dependency resolution problem detection
- */
-@Artifact
-@SpecVersion("20090625")
-public class DependencyResolutionTest extends AbstractJSR299Test
-{
- class MockInjectionPoint implements InjectionPoint
- {
- private Bean<?> beanWithManager;
- private Type type;
- private Member member;
- private Set<Annotation> bindings;
-
- public MockInjectionPoint(Bean<?> bean, Type type, Member member,
- Set<Annotation> bindings)
- {
- this.beanWithManager = bean;
- this.type = type;
- this.member = member;
- this.bindings = bindings;
- }
-
- public Bean<?> getBean()
- {
- return beanWithManager;
- }
-
- public Set<Annotation> getBindings()
- {
- return bindings;
- }
-
- public Member getMember()
- {
- return member;
- }
-
- public Type getType()
- {
- return type;
- }
-
- public Annotated getAnnotated()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isDelegate()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isTransient()
- {
- // TODO Auto-generated method stub
- return false;
- }
- }
-
- @Test(groups = "rewrite")
- @SpecAssertion(section = "5.3.1", id = "aa")
- public void testUnsatisfiedDependencyDetected() throws Exception
- {
- Bean<Vanilla> vanillaBean = getBeans(Vanilla.class).iterator().next();
-
- Field injectedField = InjectedBean.class.getField("vanilla");
- Set<Annotation> bindings = new HashSet<Annotation>();
- bindings.add(new OtherLiteral());
- MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean, Vanilla.class, injectedField, bindings);
-
- assert getCurrentManager().getInjectableReference(injectionPoint, null) instanceof Vanilla;
- }
-
- @Test(groups = "rewrite")
- @SpecAssertion(section = "5.3.1", id = "aa")
- public void testAmbiguousDependencyDetected() throws Exception
- {
- Bean<Vanilla> vanillaBean = getBeans(Vanilla.class).iterator().next();
-
- Field injectedField = InjectedBean.class.getField("vanilla");
- Set<Annotation> bindings = new HashSet<Annotation>();
- bindings.add(new OtherLiteral());
- MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean, Vanilla.class, injectedField, bindings);
- getCurrentManager().getInjectableReference(injectionPoint, null);
- }
-
- @Test(groups = "rewrite")
- @SpecAssertion(section = "5.5.1", id = "aa")
- public void testUnproxyableDependencyDetected() throws Exception
- {
- final Bean<Mustard> bean = getBeans(Mustard.class).iterator().next();
- final Set<Annotation> bindings = new HashSet<Annotation>();
- bindings.add(new OtherLiteral());
-
- Bean<Mustard> wrappedBean = new ForwardingBean<Mustard>()
- {
-
- @Override
- protected Bean<Mustard> delegate()
- {
- return bean;
- }
-
- @Override
- public Class<? extends Annotation> getScopeType()
- {
- return RequestScoped.class;
- }
-
- @Override
- public Set<Annotation> getBindings()
- {
- return bindings;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- return this == obj;
- }
-
- public Class<?> getBeanClass()
- {
- return Mustard.class;
- }
-
- public boolean isPolicy()
- {
- return false;
- }
-
- public Set<Class<? extends Annotation>> getStereotypes()
- {
- return Collections.emptySet();
- }
-
- };
-
- getCurrentManager().addBean(wrappedBean);
-
- Field injectedField = BrokenInjectedBean.class.getField("mustard");
- MockInjectionPoint injectionPoint = new MockInjectionPoint(bean, Mustard.class, injectedField, bindings);
- getCurrentManager().getInjectableReference(injectionPoint, null);
- }
-
- @Test
- @SpecAssertion(section="5.3.4", id="aa")
- public void testTypeBoxing()
- {
- assert getInstanceByType(Integer.class, new AnnotationLiteral<Small>() {}).equals(IntegerProducer.VALUE);
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/InjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/InjectedBean.java 2009-07-30 08:35:45 UTC (rev 3361)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/InjectedBean.java 2009-07-30 08:57:27 UTC (rev 3362)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-import javax.enterprise.inject.Current;
-
-class InjectedBean
-{
- @Current public Vanilla vanilla;
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/IntegerProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/IntegerProducer.java 2009-07-30 08:35:45 UTC (rev 3361)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/IntegerProducer.java 2009-07-30 08:57:27 UTC (rev 3362)
@@ -1,36 +0,0 @@
-/*
- * 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.tests.lookup.dependency.resolution;
-
-import javax.enterprise.inject.Produces;
-
-/**
- * @author pmuir
- *
- */
-public class IntegerProducer
-{
-
- public static final int VALUE = 5;
-
- @Produces @Small
- public int produce()
- {
- return VALUE;
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Mustard.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Mustard.java 2009-07-30 08:35:45 UTC (rev 3361)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Mustard.java 2009-07-30 08:57:27 UTC (rev 3362)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-
-public class Mustard
-{
-
- private Mustard()
- {
- // TODO Auto-generated constructor stub
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Other.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Other.java 2009-07-30 08:35:45 UTC (rev 3361)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Other.java 2009-07-30 08:57:27 UTC (rev 3362)
@@ -1,22 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.BindingType;
-
-@Target( { TYPE, METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@BindingType
-public @interface Other
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherLiteral.java 2009-07-30 08:35:45 UTC (rev 3361)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherLiteral.java 2009-07-30 08:57:27 UTC (rev 3362)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-import javax.enterprise.inject.AnnotationLiteral;
-
-class OtherLiteral extends AnnotationLiteral<Other> implements Other
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Small.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Small.java 2009-07-30 08:35:45 UTC (rev 3361)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Small.java 2009-07-30 08:57:27 UTC (rev 3362)
@@ -1,22 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.BindingType;
-
-@Target( { TYPE, METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@BindingType
-@interface Small
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java 2009-07-30 08:35:45 UTC (rev 3361)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java 2009-07-30 08:57:27 UTC (rev 3362)
@@ -1,7 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
-
-
-class Vanilla
-{
-
-}
Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/nonContextual/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/nonContextual/beans.xml 2009-07-30 08:35:45 UTC (rev 3361)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/nonContextual/beans.xml 2009-07-30 08:57:27 UTC (rev 3362)
@@ -1,3 +0,0 @@
-<beans>
-
-</beans>
15 years, 3 months
[webbeans-commits] Webbeans SVN: r3361 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/any.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-30 04:35:45 -0400 (Thu, 30 Jul 2009)
New Revision: 3361
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/any/AnyInjectionTest.java
Log:
Matched test with assertion
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/any/AnyInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/any/AnyInjectionTest.java 2009-07-30 00:00:31 UTC (rev 3360)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/any/AnyInjectionTest.java 2009-07-30 08:35:45 UTC (rev 3361)
@@ -1,13 +1,33 @@
+/*
+ * 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.tests.lookup.injection.any;
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;
@Artifact
+@SpecVersion("20090625")
public class AnyInjectionTest extends AbstractJSR299Test
{
@Test
+ @SpecAssertion(section = "2.3.1", id = "a0")
public void testAnyInjectionIfExactlyOneBeanForType()
{
assert getInstanceByType(Customer.class).drink != null;
15 years, 3 months
[webbeans-commits] Webbeans SVN: r3360 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-29 20:00:31 -0400 (Wed, 29 Jul 2009)
New Revision: 3360
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
Log:
WBRI-293
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-07-29 23:15:49 UTC (rev 3359)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-07-30 00:00:31 UTC (rev 3360)
@@ -74,7 +74,7 @@
* context lookup
*
* @param self the proxy instance.
- * @param thisMethod the overridden method declared in the super class or
+ * @param proxiedMethod the overridden method declared in the super class or
* interface.
* @param proceed the forwarder method for invoking the overridden method. It
* is null if the overridden mehtod is abstract or declared in the
@@ -101,6 +101,10 @@
// getting lazy created
return null;
}
+ if (proxiedMethod.getName().equals("equals") && proxiedMethod.getParameterTypes().length == 1 && proxiedMethod.getParameterTypes()[0] == Object.class && args[0] == self)
+ {
+ return true;
+ }
try
{
Object returnValue = Reflections.lookupMethod(proxiedMethod, proxiedInstance).invoke(proxiedInstance, args);
15 years, 3 months